Can't Bring View to Top

I’m making an extension (Device Manager 2) if you’ve seen on the Kodular community at all. Now I’m creating a block and it does something to this view, creates a ripple. However my main issue here is that I can’t move the LinearLayouts forward like they did to their Cardview component. What’s supposed to happen is whatever you click on that’s in the parent, it will ignore the child click and click the parent instead, but I can’t seem to make the parent view be the clickable one instead of the child views even after enabling Clickable. The ripple works, the color and everything.

Layout.setOnTouchListener(new View.OnTouchListener() {
  @Override
  public boolean onTouch(View v, MotionEvent event) {
     return true;
  }
});

along with Layout.bringToFront();

Any solutions?

1 Like

this is a question about creating an extension, therefore you have to use the category #open-source-development
I moved this thread to there now

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

Have you tried the below on the Child Views?

view.setOnTouchListener(new View.OnTouchListener() {
  @Override
  public boolean onTouch(View v, MotionEvent event) {
    View parent = (View) v.getParent();
    parent.performClick();
    return true;
   }
   });

Would this intercept the child view and make it act as the parent view was clicked?

OOH I see now, I’m stupid :man_facepalming:

1 Like

Or you could intercept the child views click:

1 Like

Can you give me an example for this? How would I make the View into ViewGroup or ViewParent?

Does not work.

For this example you don't want to do this but you could just do:
ViewParent parent = (View) v.getParent();

I updated my previous post.

Nothing seems to be working at all for this. I don’t know how they made their Cardview fully clickable.