Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

multiple recyclerview not scrolling bottom sheet

// https://stackoverflow.com/a/61890073/11292068

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.LinearLayout;

public class DisallowInterceptView extends LinearLayout {
    public DisallowInterceptView(Context context) {
        super(context);
        requestDisallowInterceptTouchEvent(true);
    }

    public DisallowInterceptView(Context context, AttributeSet attrs) {
        super(context, attrs);
        requestDisallowInterceptTouchEvent(true);
    }

    public DisallowInterceptView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        requestDisallowInterceptTouchEvent(true);
    }


    public boolean dispatchTouchEvent(MotionEvent ev) {
        getParent().requestDisallowInterceptTouchEvent(true);
        return super.dispatchTouchEvent(ev);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        switch (event.getAction()) {
            case MotionEvent.ACTION_MOVE:
                requestDisallowInterceptTouchEvent(true);
                break;
            case MotionEvent.ACTION_UP:
            case MotionEvent.ACTION_CANCEL:
                requestDisallowInterceptTouchEvent(false);
                break;
        }
        return super.onTouchEvent(event);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: how to use set ForceDarkAllowed(false); in android studio 
Java :: java boolean zen 
Java :: java csvformat example semi colon 
Java :: custom class level annotation in spring 
Java :: detecting battery charging android 
Java :: ein wort in buchstaben zerlegen java 
Java :: java active displays 
Java :: javafx change application title 
Java :: editable column 
Java :: disarium number in java 
Java :: try catch not working java 
Java :: method reference java 
Java :: how to check if a value is integer or not in java 
Java :: simple text formatter as in textbook 
Java :: check if combobox has specified value 
Java :: java mockito subclass mocken method 
Java :: stop countdown timer when exiting an activity 
Java :: class BuildConfig is public, should be declared in a file named BuildConfig.java 
Java :: get all colors in string spigot 
Java :: code converter from java to python 
Java :: class java 
Java :: Java program to find largest of three numbers using nested if 
Java :: Java Creating LinkedHashMap from Other Maps 
Java :: what is minecraft default render distance 
Java :: pgzint install windows 10 
Java :: fibonancci using dynamic programming in java 
Java :: Java Arraylist bestimmtes element ausgeben 
Java :: bukkit detect block that nowbal hit 
Java :: Java Get float, double and String Input 
Java :: how to get map with string as key and Arraylist as value in java 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =