Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How can I have Fullscreen and Intercept all touch events

TPlayTPlay USMember

Ok let me try to keep this as short and sweet as possible.

Here's my issue. I want to display a VideoView in FullScreen mode. I can successfully do this by adding

newUiOptions |= (int)SystemUiFlags.LayoutStable; newUiOptions |= (int)SystemUiFlags.HideNavigation; newUiOptions |= (int)SystemUiFlags.Fullscreen;

Now, I know that Android obviously has a listener set up so that a user can bring back navigation when they touch the view again. And I can detect this by listening to UiVisibilityChangeListener. This, however, does not give me

1) The requested flags to be set, only the currently set flags.
2) in Xamarin it receives a StatusBarVisibility Enum. In Java however you receive a bitmask packed inside an int.

1st Question:
Why does Xamarin decide to give an Enum containing only 0 and 1 as values? (visible/hidden). I have also received a 0x06. What the hell this means I do not know. (I understand how I can use this to extract flags but in the documentation there is no 0x06 representation.)

2nd Question:
What is the point of having UiVisibilityChangeListener. What can I do with this if I cannot get the updated flags? If I could get the updated flags then on the next touch event I can have an updated status to work off.

3rd Question:
Is there a way to make Fullscreen mode without Android dealing with touch events itself. If I could intercept touches whilst in Fullscreen then I could toggle the SystemBars/VideoControls myself. The reason why I have to handle the touches myself is that in ImersiveSticky it does not include the ActionBar in the remove/show of SystemBar visibility.

So far I have just gone round in circles trying to find a decent solution and nothing works. Please someone help.


Confused Programmer.

P.S. I have tried to add OnTouchListener to Window.DecorView without success.

Sign In or Register to comment.