question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SwipeLayout is not working properly on AllView devices..

See original GitHub issue

Hi, I had made an application and I am having a bug and also tested your demo with:

Device: ALLVIEW X2_Soul Android version: 4.4.2

Device: ALLVIEW V1_VIPER_I Android version: 4.4.2

And the problem is when I tap or swipe the item row, the items that are in the background (comes from the right side of the screen) and the items that are in the foreground(they go to the left side of the screen) are not staying there, they go back instantly, like its remaking the whole row, or listview…

A part of my code how is used in the getView()

LayoutInflater inflater = LayoutInflater.from(parent.getContext()); if (convertView == null) { convertView = inflater.inflate(R.layout.list_item_command, parent, false); }

    final SwipeLayout swipeLayout = ViewHolder.get(convertView, R.id.list_item_command_swipe);
    swipeLayout.setShowMode(SwipeLayout.ShowMode.PullOut);
    swipeLayout.setClickable(true);
    swipeLayout.setClickToClose(true);

    LinearLayout fgLinear = ViewHolder.get(convertView, R.id.list_item_command_fg_linear);

    ImageView addProduct = ViewHolder.get(convertView, R.id.list_item_order_add_img);
    ImageView removeProduct = ViewHolder.get(convertView, R.id.list_item_order_remove_img);
    ImageView eraseProduct = ViewHolder.get(convertView, R.id.list_item_order_erase_img);

    fgLinear.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            swipeLayout.open(true);
        }
    });

How it is in the list item xml:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/command_list_item_container" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="@dimen/list_item_rest_container_padding">

<com.daimajia.swipe.SwipeLayout
    android:id="@+id/list_item_command_swipe"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <!--BACKGROUND LAYOUT-->
    <LinearLayout
        android:id="@+id/bottom_wrapper"
        android:layout_width="wrap_content"
        android:layout_height="match_parent">

        <ImageView
            android:id="@+id/list_item_order_add_img"
            android:layout_width="wrap_content"
            android:layout_height="40dp"
            android:layout_marginLeft="@dimen/list_item_command_count_margin_right"
            android:layout_marginRight="@dimen/list_item_command_general_margin_right"
            android:adjustViewBounds="true"
            android:contentDescription="@string/content_description"
            android:src="@drawable/selector_add_more_product_btn" />

        <ImageView
            android:id="@+id/list_item_order_remove_img"
            android:layout_width="wrap_content"
            android:layout_height="40dp"
            android:layout_marginRight="@dimen/list_item_command_general_margin_right"
            android:adjustViewBounds="true"
            android:contentDescription="@string/content_description"
            android:src="@drawable/selector_less_product_btn" />

        <ImageView
            android:id="@+id/list_item_order_erase_img"
            android:layout_width="wrap_content"
            android:layout_height="40dp"
            android:layout_marginRight="@dimen/list_item_command_general_margin_right"
            android:adjustViewBounds="true"
            android:contentDescription="@string/content_description"
            android:src="@drawable/selector_remove_product_btn" />
    </LinearLayout>

    <!--FOREGROUND LAYOUT-->
    <LinearLayout
        android:id="@+id/list_item_command_fg_linear"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:weightSum="10">

        <TextView
            android:id="@+id/list_item_order_product_name_tv"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginRight="@dimen/list_item_command_general_margin_right"
            android:layout_weight="5"
            android:ellipsize="end"
            android:singleLine="false"
            android:textColor="@color/white"
            android:textSize="@dimen/list_item_command_product_price_tv_size" />

        <TextView
            android:id="@+id/list_item_order_product_qunatity_et"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:ellipsize="end"
            android:gravity="left"
            android:textColor="@color/white"
            android:textSize="@dimen/list_item_command_product_price_tv_size" />


        <TextView
            android:id="@+id/list_item_order_price_tv"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="3"
            android:gravity="right"
            android:textColor="@color/white"
            android:textSize="@dimen/list_item_command_product_price_tv_size"
            android:textStyle="bold" />

        <ImageView
            android:id="@+id/list_item_order_dot_menu_IV"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:src="@drawable/ic_three_dots_menu_white"
            android:visibility="gone" />
    </LinearLayout>
</com.daimajia.swipe.SwipeLayout>
</RelativeLayout>

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:14

github_iconTop GitHub Comments

2reactions
smhmhcommented, May 20, 2016

@haoshili Yes, The suggested line should be commented just on KitKat android like this: if (Build.VERSION.SDK_INT != Build.VERSION_CODES.KITKAT) safeBottomView(); This solve my problem!

0reactions
NoNewscommented, Nov 7, 2016

@smhmh work like a clockwork)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android swipelayout not working on all devices - Stack Overflow
I have tested and works fine, but it doesn't swipe at all on some devices. Any one met similar problem and solution for...
Read more >
Appium simulations - ADM Help Centers
This poses a problem if the device you are testing is not physically available. Using simulations, you can test these aspects of your...
Read more >
Making Swipeable ListView in Android
In this tutorial post, I will present AndroidSwipeLayout, it is powerful library by making swipe view, not only ListView like another.
Read more >
Grasshopper_v5.14.0_apkpure.com.apk - Hybrid Analysis
Not all malicious and suspicious indicators are displayed. Get your own cloud service or the full version to view all details.
Read more >
830孔面包板使用方法 - CSDN
FAB-Loading☆474 - 浮动加载动画 ... AdhesiveLoadingView☆259 - 具有粘性的滑动小球Loading ... 滑动布局accordion-swipe-layout☆69 - Android手风琴滑动布局.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found