Fix Mediacontroller in Scrollview

I have a media controller in my Android activity that uses setAnchorView to set the starting position. From what I read, if the media controller is in a scroll, the media controller window simply follows the scroll, which is clearly not what I want.

Is there any method for programmatically fixing the position of the media controller so that it does not correspond to scrolling?

Many thanks.

+5
source share
1 answer

You can hide the media control in the scroll event. This is not a problem with the position of vision, but at least it is not visible.

scrollView.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() { @Override public void onScrollChanged() { mediaController.hide(); } }); 
+5
source

Source: https://habr.com/ru/post/1210035/


All Articles