Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click events is not triggering untill double tap in some Samsung Devices above Android 10 #29

Open
JagadishaIncture opened this issue Jun 24, 2021 · 6 comments

Comments

@JagadishaIncture
Copy link

Hi SwipeActionView is not allowing child views to trigger Click Event untill thy tap it for twice.. this issue is not in all devices it only occur in Samsung Android 10 + devices (Samsung S20)

@JagadishaIncture
Copy link
Author

`

<me.thanel.swipeactionview.SwipeActionView
    android:id="@+id/swipeView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <androidx.cardview.widget.CardView
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="end"
        android:backgroundTint="?themeColorPrimary">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="horizontal">

            <com.chootdev.typefaced.TypeFacedTextView
                android:id="@+id/tvAction1"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:gravity="center"
                android:padding="@dimen/material_margin_medium"
                android:text="@string/hold"
                android:textColor="@color/white_common"
                app:textView_font="@string/font_semi_bold" />

            <com.chootdev.typefaced.TypeFacedTextView
                android:id="@+id/tvAction2"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:gravity="center"
                android:padding="@dimen/material_margin_medium"
                android:text="@string/complete"
                android:textColor="@color/white_common"
                app:textView_font="@string/font_semi_bold" />

            <com.chootdev.typefaced.TypeFacedTextView
                android:id="@+id/tvAction3"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:background="?themeColorPrimary"
                android:gravity="center"
                android:padding="@dimen/material_margin_medium"
                android:text="@string/chat"
                android:textColor="@color/white_common"
                android:visibility="gone"
                app:textView_font="@string/font_semi_bold" />

        </LinearLayout>
    </androidx.cardview.widget.CardView>

    <androidx.cardview.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:cardBackgroundColor="@color/white"
        app:cardCornerRadius="3dp">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/white"
            android:id="@+id/outer_ll"
            android:orientation="horizontal">


            <CheckBox
                android:id="@+id/check_box"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:gravity="center"
                android:visibility="gone" />

            <include layout="@layout/rv_inbox_item" />

        </LinearLayout>


    </androidx.cardview.widget.CardView>


</me.thanel.swipeactionview.SwipeActionView>

`

@JagadishaIncture
Copy link
Author

<androidx.constraintlayout.widget.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <ImageView
        android:id="@+id/ivStatus"
        android:layout_width="16dp"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/material_margin_small"
        android:contentDescription="@string/image_content"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/ic_circle" />

    <com.chootdev.typefaced.TypeFacedTextView
        android:id="@+id/tvTitle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="@dimen/material_margin_small"
        android:ellipsize="end"
        android:maxEms="13"
        android:maxLines="1"
        android:paddingEnd="5dp"
        android:text="Purchase Order Approval"
        android:textColor="@color/black"
        android:textSize="@dimen/ts_small"
        android:textStyle="bold"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintLeft_toRightOf="@id/ivStatus"
        app:layout_constraintRight_toLeftOf="@id/tvCreatedOn"
        app:layout_constraintTop_toTopOf="@id/ivStatus"
        app:textView_font="@string/font_semi_bold" />

    <com.chootdev.typefaced.TypeFacedTextView
        android:id="@+id/tvCreatedOn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="5dp"
        android:layout_marginEnd="@dimen/material_margin_medium"
        android:text="1 min ago"
        android:textColor="@color/material_medium_gray"
        android:textSize="@dimen/ts_xs"
        app:layout_constraintBottom_toBottomOf="@id/tvTitle"
        app:layout_constraintRight_toRightOf="parent"
        app:textView_font="@string/font_semi_bold" />

    <ImageView
        android:id="@+id/next"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:contentDescription="@string/image_content"
        android:visibility="visible"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintRight_toRightOf="@id/tvCreatedOn"
        app:layout_constraintTop_toTopOf="parent"
        app:srcCompat="@drawable/ic_right"
        app:tint="@color/ote_disabled" />

    <com.chootdev.typefaced.TypeFacedTextView
        android:id="@+id/tvIncidentID"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingTop="2dp"
        android:text="Request Id: P000035"
        android:textColor="@color/ote_blue"
        android:textSize="@dimen/ts_xs"
        android:visibility="gone"
        app:layout_constraintLeft_toLeftOf="@id/tvTitle"
        app:layout_constraintTop_toBottomOf="@id/tvTitle"
        app:textView_font="@string/font_regular" />

    <com.chootdev.typefaced.TypeFacedTextView
        android:id="@+id/tvSubject"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:paddingTop="2dp"
        android:paddingEnd="5dp"
        android:text="POA for P000002"
        android:textSize="13sp"
        app:layout_constraintLeft_toLeftOf="@id/tvTitle"
        app:layout_constraintRight_toRightOf="@id/next"
        app:layout_constraintTop_toBottomOf="@id/tvIncidentID"
        app:textView_font="@string/font_semi_bold" />

    <com.chootdev.typefaced.TypeFacedTextView
        android:id="@+id/tvDescription"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/material_margin_medium"
        android:text="Approval of PO No. P000002 from Vendor No. 234511 for a value of $14,000."
        android:textColor="@color/ote_disabled"
        android:textSize="@dimen/ts_xs"
        app:layout_constraintLeft_toLeftOf="@id/tvTitle"
        app:layout_constraintRight_toRightOf="@id/next"
        app:layout_constraintTop_toBottomOf="@id/tvSubject"
        app:textView_font="@string/font_semi_bold" />


    <ImageView
        android:id="@+id/option"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginRight="8dp"
        android:contentDescription="@string/image_content"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="@id/tvDescription"
        app:layout_constraintLeft_toRightOf="@id/tvDescription"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="@id/tvDescription"
        app:srcCompat="@drawable/icon_options"
        app:tint="@color/ote_disabled" />

    <com.chootdev.typefaced.TypeFacedTextView
        android:id="@+id/tvSLA"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/placeholder_short"
        android:textColor="@color/material_red"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="@id/tvTitle"
        app:layout_constraintTop_toBottomOf="@id/tvDescription"
        app:textView_font="@string/font_regular" />

    <TextView
        android:id="@+id/tvDiv"
        android:layout_width="0dp"
        android:layout_height="0.5dp"
        android:layout_marginTop="5dp"
        android:background="@color/material_medium_gray"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@id/tvSLA" />

</androidx.constraintlayout.widget.ConstraintLayout>

@JagadishaIncture
Copy link
Author

Case 1 : If i give click even for parent view of SwipeView Event itself is not Trigger

Case 2: if i give click event for SwipeActionView . event is trigger for both childview and childactions

` holder.swipeView.setOnClickListener(view -> {

        Log.d("ResponseClick", "Clicked");
    
    });

`

Case 3: if i give click event for Outer_ll which is click of SwipeActionView . then event is not trigger in Samsung device (Works on all other devices).

` holder.outer_ll.setOnClickListener(view -> {

        Log.d("ResponseClick", "Clicked");
    
    });`

@Tunous
Copy link
Owner

Tunous commented Jun 24, 2021

I'm not sure how to reproduce this since I do not own any Samsung devices but perhaps the change in #23 fixes it?

You can test it by changing dependency in build.gradle to

implementation 'com.github.Tunous:SwipeActionView:th~22-horizontally-scrolling-child-SNAPSHOT'

@JagadishaIncture
Copy link
Author

JagadishaIncture commented Jun 25, 2021 via email

@Tunous
Copy link
Owner

Tunous commented Jun 25, 2021

No, that is internal change only. But again, this might not fix the issue and is just my blind guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants