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

I want to use LongClick #31

Open
ryu884 opened this issue Sep 27, 2019 · 1 comment
Open

I want to use LongClick #31

ryu884 opened this issue Sep 27, 2019 · 1 comment

Comments

@ryu884
Copy link

ryu884 commented Sep 27, 2019

I want to use OnLongClickListener.

I put an imageview inside the cardview and applied a blurview.

I applied longclick to Cardview. But when I clicked on the imageview, longclick didn't work.

I want to make longclick work when I hit the area of ​​Cardview. However, imageview has blurview, so it does not work in imageview area.

So I tried applying OnLongClickListener to the imageview to solve this.

But when I use OnLongClickListener for imageview, blurview doesn't work.

Please tell me the solution.

@ryu884
Copy link
Author

ryu884 commented Sep 27, 2019

`<androidx.cardview.widget.CardView
android:id="@+id/cardview1"
android:foreground="?android:attr/selectableItemBackground"
android:layout_width="match_parent"
android:layout_height="180dp"
xmlns:cardview="http://schemas.android.com/apk/res-auto"
android:layout_margin="6dp"
cardview:cardCornerRadius="15dp"
android:weightSum="10"
>

<LinearLayout
        android:id="@+id/linear1"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="5"
    >

    <com.daimajia.androidviewhover.BlurLayout
        android:layout_height="wrap_content"
        android:id="@+id/blur_layout"
        android:layout_width="wrap_content"
        >

        <ImageView
            android:id="@+id/book_img_id"
            android:layout_width="match_parent"
            android:layout_height="130dp"
            android:scaleType="centerCrop"
            android:src="@drawable/bird"
            />
    </com.daimajia.androidviewhover.BlurLayout>


        <TextView
            android:id="@+id/book_title_id"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:textSize="13dp"
            android:text="Web Hacking"
            android:textColor="#FF000000"
            android:layout_marginRight="7dp"
            android:layout_marginLeft="7dp"
            android:gravity="center_vertical"
            android:maxLines="2"
            android:ellipsize="end"/>


    </LinearLayout>

</androidx.cardview.widget.CardView>
`

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

1 participant