0

thank you for reading my question. I make a floating view and it has an image inside. It is translucent.

I want this floating view just shows its translucent image and doesn't bother me at all.

Pass touches to the view under

I've seen this article and I've done it. OnTouchListener -> OnTouch -> return false. clickable = false, focusable = false.

But the touch event doesn't pass through my floating view. Would it be possible to solve my problem? Thank you. I'm going to really appreciate it if you could give me just one hint.

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:focusable="false"
    android:clickable="false">

...

        @TargetApi(Build.VERSION_CODES.FROYO)
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            if(!activate){
                return false;
            }
        }
zenyatta
  • 97
  • 2
  • 9
  • 1
    What you are implementing is called a tapjacking attack, used by malware to silently intercept touch events while still having them take normal effect. This has been blocked by Android for five or six years, for security reasons. The Stack Overflow question and answer that you link to refer to passing touch events to lower-layer views within the same app, not between apps. – CommonsWare Aug 26 '19 at 16:10

1 Answers1

1

That's not possible. Communication between apps is limited and there is no touch events communication.

eleven
  • 6,779
  • 2
  • 32
  • 52