Android programming realizes the method of switching the full screen and hiding the status bar when playing video

This paper describes the method of switching the full screen and hiding the status bar when playing video by Android programming. Share with you for your reference, as follows:

one

Demo example:

set up:

explain:

The view class provides setsystemuivisibility and getsystemuivisibility methods, which can dynamically display or hide the status bar and obtain the current visibility of the status bar.

Setsystemuivisibility (int visibility) method can pass in the following arguments:

①. View.SYstem_ UI_ FLAG_ Visible: the status bar is displayed, and the activity is not displayed in full screen (restored to the normal condition with status). ② . view.invisible: hide the status bar, and the activity will be displayed in full screen. ③. View.SYstem_ UI_ FLAG_ Fullscreen: the activity is displayed in full screen, and the status bar is hidden and overwritten. ④. View.SYstem_ UI_ FLAG_ LAYOUT_ Fullscreen: the activity is displayed in full screen, but the status bar will not be hidden or overwritten. The status bar is still visible, and the top layout of the activity will be covered by the status. ⑤. View.SYstem_ UI_ FLAG_ LAYOUT_ HIDE_ Navigation: the effect is the same as that of view.system_ UI_ FLAG_ LAYOUT_ FULLSCREEN ⑥. View.SYstem_ UI_ LAYOUT_ Flags: the effect is the same as that of view.system_ UI_ FLAG_ LAYOUT_ FULLSCREEN ⑦. View.SYstem_ UI_ FLAG_ HIDE_ Navigation: hide virtual keys (navigation bar). Some phones use virtual keys instead of physical keys. ⑧. View.SYstem_ UI_ FLAG_ LOW_ Profile: the status bar is in low-energy display state (low profile mode), and some icons on the status bar will be hidden.

two

More readers interested in Android related content can view the special topics of this site: summary of Android multimedia operation skills (audio, video, recording, etc.), introduction and advanced tutorial of Android development, summary of Android view skills, summary of activity operation skills of Android programming, summary of Android database operation skills Summary of Android file operation skills, summary of Android resource operation skills and summary of Android control usage

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>