Original: Android Project Combat (41): Game and video type apply status bar immersive effect Demand:Mobile app, when playing a game or full screen watching video will find that this time the top of the mobile phone status bar is not displayed, when we swipe down from the to
This article describes the Android programming implementation of the hidden status bar and testing activity is the method. Share to everyone for your reference, specific as follows:
First, hide the status bar
The method is as follows: In the program add//remove title of th
1. PrefaceThe Android KitKat has a new feature that can set the background of the phone status bar, allowing the phone to wind the entire interface pane to be consistent, it looks very cool in this year's Google I/O up to Android L style. Come to see how we add this cool black crazy drag the function of the slag day ho
This example is Icons only and Icons and marquee are not particularly well illustrated.
The use Remote views in balloon describes the layout,extended status bar that can be customized to display notification in Extended status bar
bar belongs to Systemui, observe Systemui's file directory; open Androidmanifest.xml seeandroid:name= "Systemuiservice" android:exported= "true" />Next find and open the Systemuiservice.java ; in OnCreate () mention the SystemuiapplicationSystemuiapplication.java launched a series of services, includingCom.android.systemui.statusbar.SystemBars.classOpen Systembars.java frameworks/base/packages/systemui/src/com/a
Android obtains the screen width and height, Status Bar Height, and string width and height of a mobile phone.
Android obtains the screen width and height, Status Bar Height, and string width and height of a mobile phone.
This art
This article describes the implementation of the Android status bar customization and modification methods. Share to everyone for your reference. Specifically as follows:
We all know the importance of customization in Android development, because by customizing, you can create differentiated products to meet the needs
Retrieve the Status Bar Height
1. Traditional Method: Sometimes the value is 0. solution 2:
CodeRect frame = new Rect ();GetWindow (). getDecorView (). getWindowVisibleDisplayFrame (frame );Int statusBarHeight = frame. top;
II. The value may be 0 after 4.0.3.
Public int getBarHeight (){Class Object obj = null;Field field = null;Int x = 0, sbar = 38; // The default value is 38. It seems that most of them are
The immersive status bar in Android is implemented in the following wayThe relevant API methods for calculating the height of the status bar and calling the immersive status bar1 PackageCom.example.status;2 ImportAndroid.annotati
Android immersive status bar Implementation Details
Introduce immersive compatible libraries in studioCompile 'com. readystatesoftware. systembartint: 1.0.3'Eclipse, You can import the corresponding class.
Class 1, compatible with actionbarStep 1: Set the activity topic android: theme = "@ style/action1_eme"
Step 2: S
Android transparent Status Bar
The Android transparent status bar is available only after 4.4.
You can set two methods:
1.
If (Build. VERSION. SDK_INT> = Build. VERSION_CODES.KITKAT) {// transparent
1. DemoOn Android 4.4 There is a new feature that sets the background of the phone's status bar, keeping the style of the phone's entire interface consistent, which is the default for Android L on Google I/O this year. Check out the demo first:Figure one: Transparent status
Android4.4 new features, System status bar integration.The steps to be implemented include the following:1.android4.4 or later2. Set the app fullscreen:Method: Set Android:theme= "@android: Style/theme.translucent.notitlebar" in Androidmanifest.xml3. Load Nineoldandroids-2.4.0.jar4. Implementation class: Set the status
Android gets mobile screen width, status bar height and string width information method
This article mainly introduces Android to get the phone screen width, status bar height and string width high information method, involving
Studio, introducing an immersive compatibility libraryCompile ' com.readystatesoftware.systembartint:systembartint:1.0.3 'Eclipse, you can import the corresponding class.First class, compatible with ActionbarFirst step: Set activity Theme Android:theme= "@style/actionbartheme"style name= "actionbartheme" parent="Android: Theme.Holo.Light.DarkActionBar ">-- API theme customizations can go to here. -->item name= "an
The main use of Https://github.com/jgilfelt/SystemBarTint this open source Library1, import Systembartintmanager class2, Basefragmentactivity's oncreate add the following code: // Modify the status bar color, 4.4+ effective if (Build.VERSION.SDK_INT >= Build.version_codes. KITKAT) {settranslucentstatus (); } systembartintmanager Tintmanager = new Systembartintmanager (this ); Tintmanager.setsta
The previous Android immersive status bar implementation did not take into account the impact of the soft keyboard, the next content will be to solve the problem, first look atThis is a message board:That is, when the soft keyboard is ejected, it does not cause the entire layout to move up.How to do it in detail? Follow the steps below to set it up:1, the layout
First look at the general way to hide the status bar:
Method One:
@Override
protected void onCreate (Bundle savedinstancestate) {
super.oncreate (savedinstancestate);
Remove TITLE
requestwindowfeature (window.feature_no_title);
Remove the status bar
GetWindow (). SetFlags (WindowManager.LayoutParams.FLAG_FULLS
To implement the immersive status bar above Android 4.4 use open source project Systembartint (Https://github.com/hexiaochun/SystemBarTint) Public classMainactivityextendsActivity {@Overrideprotected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Setcontentview (R.layout.activity_main); if(Build.VERSION.SDK_INT >=Build.v
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.