Skip to content

Item not dragging properly left & right enabled #5

Description

@omkar-tenkale

Strange behavior
Item not dragging properly

I've enabled both left and right swipe
But when item is swiped left,right swipe becomes too hard (After 4-5 attempts i can swipe right otherwise the draggable view just stays fixed at its position) and when swiped right left swipe becomes too hard

        <com.zerobranch.layout.SwipeLayout
            android:id="@+id/swipeLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:draggedItem="@id/coverHolder"
            app:rightItem="@id/next"
            android:layout_margin="16dp"
            app:leftItem="@id/previous"
            app:swipeDirection="left|right">


                <androidx.appcompat.widget.AppCompatImageButton
                    android:id="@+id/next"
                    android:layout_gravity="end"
                    android:paddingEnd="24dp"
                    android:paddingStart="24dp"
                    android:background="?android:attr/selectableItemBackgroundBorderless"
                    android:scaleType="center"
                    android:focusable="true"
                    app:srcCompat="@drawable/ic_next"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"/>

                <androidx.appcompat.widget.AppCompatImageButton
                    android:id="@+id/previous"
                    android:layout_gravity="start"
                    android:paddingEnd="24dp"
                    android:paddingStart="24dp"
                    android:background="?android:attr/selectableItemBackgroundBorderless"
                    android:scaleType="center"
                    android:focusable="true"
                    app:srcCompat="@drawable/ic_prev"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"/>

            <com.google.android.material.card.MaterialCardView
                android:id="@+id/coverHolder"
                app:cardElevation="0dp"
                android:clickable="true"
                android:focusable="true"
                android:layout_gravity="center"
                app:cardCornerRadius="5dp"
                app:cardBackgroundColor="#33000000"
                android:layout_width="match_parent"
                android:layout_height="match_parent">


                <androidx.appcompat.widget.AppCompatImageView
                    tools:background="#33000000"
                    android:id="@+id/cover"
                    android:scaleType="fitCenter"
                    android:adjustViewBounds="true"
                    app:srcCompat="@drawable/sample_cover"
                    android:layout_width="wrap_content"
                    android:layout_height="match_parent"/>


            </com.google.android.material.card.MaterialCardView>
        </com.zerobranch.layout.SwipeLayout>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions