How to Disable Behind View Click Event Framelayout

How to disable behind view click event Framelayout

 imageView.setSingleTapListener(new OnImageViewTouchSingleTapListener() {
@Override
public void onSingleTapConfirmed() {
Log.d("TAG", "setSingleTapListener");

sCounter++;
if (sCounter % 2 == 0) {
mRlTopOverlayBar.setVisibility(View.GONE);
mRlBottomOverlayBar.setVisibility(View.GONE);
pager.requestFocus();
} else {
mRlTopOverlayBar.setVisibility(View.VISIBLE);
mRlBottomOverlayBar.setVisibility(View.VISIBLE);
mRlTopOverlayBar.requestFocus();
mRlBottomOverlayBar.requestFocus();
mRlBottomOverlayBar.setClickable(true);
mRlTopOverlayBar.setClickable(true);
}
}
});

How to disable background touch in FrameLayout?

Enabling click listener or clickable on any view prevents the touch from passing to its parent views/Underlying Views

In XML add below code to your textview

android:clickable=true

this should prevent all the touches from passing to underlying videoview.

Prevent Click-through of Android ImageVIew?

Simply call rlTest.setClickable(false). This will prevent the click to be propagate to the children

How to disable all click events of a layout?

I would create a ViewGroup with all the views that you want to enable/disable at the same time and call setClickable(true/false) to enable/disable clicking.

disable all clicks in layout

in your onClickListener , check if the slidingPanelLayout is opened or not,

if (opened){
return ;
}

you may assume it is opened/ closed , when the offset of the slidingPanelLayout is 0 or equal to the screen width.



Related Topics



Leave a reply



Submit