Modify the status bar at the bottom of the desktop in Android 4.0

Source: Internet
Author: User

 

 

The status bar at the bottom of the Android 4.0 desktop consists of three navigation keys on the left: The Return key, the Home key, and the RecentApplication key, which are used to view all recently opened applications, multi-task switching is here. The three keys are called NavigationArea, that is, the navigation area. The rightmost is icationicationarea, that is, the prompt area, which displays power, wireless signals, Bluetooth, and other information. This StatusBar is shown at the bottom of the screen no matter which program is opened.

 

The customer's requirements need to hide the status bar at the bottom. You can simply press the physical button to perform operations. These virtual buttons and status navigation on the right are all hidden. I initially thought it was implemented in the Launcher. After reading the code for more than half an hour, I couldn't find any icon for a return button. If you want to open any program, the system UI should be shown below, and I will try (frameworks/base/packages/SystemUI/res) the drawable below finds the "Return key" icon and finds it. The java class to which the icon belongs is TabletStatusBar. java (frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/tablet). You can find the makeStatusBarView () method under this class.

// The navigation buttons

MBackButton = (ImageView) sb. findViewById (R. id. back );

MNavigationArea = (ViewGroup) sb. findViewById (R. id. navigationArea );

MHomeButton = mNavigationArea. findViewById (R. id. home );

MMenuButton = mNavigationArea. findViewById (R. id. menu );

MRecentButton = mNavigationArea. findViewById (R. id. recent_apps );

MRecentButton. setOnClickListener (mOnClickListener); here you will know what the system has done. I continued to look up the View object sb which was originally referenced here.

Final TabletStatusBarView sb = (TabletStatusBarView) View. inflate (context, R. layout. status_bar, null); TabletStatusBarView. the java class inherits FrameLayout. You can set its hidden or display attributes here. The underlying event transfer principle of virtual buttons will be presented later.

Author: LuoXianXion
 

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.