Home > Mobile > Android7.1 not full screen in setting interface
Android7.1 not full screen in setting interface
Time:10-02
We need to modify a function: through radio for dynamic show/hide status bar and the function of the navigation bar, now found hiding in the setting interface when the status bar at the top with a piece of black can't hide, I use the eclipse view layout is found to be the android: id/statusBarBackground the id, the package name is com. Android Settings, the class name is android. View. The view, the in the Settings and SystemUI class is not found, could you tell me how to modify? Now found in the alarm clock interface also has this problem, it should not be in a Setting or SystemUI modification, excuse me, what is the solution?
The static final String TAG_SHOW="1"; The static final String TAG_HIDE="0"; Private static final String INTENT_BAR_ACTION_SHOW="BCD. Intent. Action. BAR_SHOW"; Private static final String INTENT_BAR_ACTION_HIDE="BCD. Intent. Action. BAR_HIDE";
,,,
Private void removeNavigationBar () { If (DEBUG) Log. I (" wangp ", "=========removeNavigationBar=====" + mNavigationBarView); If (mNavigationBarView==null) return; If (mNavigationBarView!=null) { MWindowManager. RemoveViewImmediate (mNavigationBarView); MNavigationBarView=null; } } Private BroadcastReceiver mShowOrHideStatusBarReceiver=new BroadcastReceiver () { Public void onReceive (Context Context, Intent Intent) { If (DEBUG) The v (TAG, "onReceive:" + intent); The String action=intent. GetAction (); If (INTENT_BAR_ACTION_SHOW equals (action)) { //flagShow=true; Settings. System. PutInt (mContext getContentResolver (), "Show_statusbar", 1); //show MStatusBarWindow. SetVisibility (the VISIBLE); MStatusBarView. SetVisibility (the VISIBLE); InflateNavigationBarView (context); AddNavigationBar (); } else if (INTENT_BAR_ACTION_HIDE equals (action)) { //flagShow=false; Settings. System. PutInt (mContext getContentResolver (), "Show_statusbar", 0); //hide MStatusBarWindow. SetVisibility (View. GONE); MStatusBarView. SetVisibility (View. GONE); RemoveNavigationBar (); } } };
,,,
CodePudding user response:
Above Android5.0 messing around, don't need to code the following oneself choose
Full screen, the status bar and navigation translucent (api> 19)
Full screen, status bar, and the navigation bar completely transparent (api> 21) GetWindow (). GetDecorView (.) setSystemUiVisibility (the SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | the SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | the SYSTEM_UI_FLAG_LAYOUT_STABLE);