Add a scroll bar for the notification bar in Android

Source: Internet
Author: User

Upgrade the system to 4.1, and the scroll bar in the notification bar in the lower right corner is missing. If there are few columns in it, it is acceptable, but now there are more columns, adding Bluetooth, GPS, etc., so that the title above is directly directed to the top of the interface. This is unacceptable.

In the past, 4.0 had a scroll bar. I'm not sure if it was removed from 4.1, or a problem occurred while synchronizing the code. In short, add the scroll bar.

For the upper layer, especially the interface, it has always been very guilty. This time, it is also very hard on the scalp. After searching online, you only need to modify an xml resource file and set <ScrollView> to the outmost. However, you must first find the xml file.

First, the status notification bar belongs to the System bar and does not belong to Settings. Therefore, the Code is under frameworks/base/packages/SystemUI.

The xml organization and naming in 4.1 are somewhat different from those in the past. Cannot be found by the same file name. There are many topics in the notification bar, such as "Wi-Fi", "auto rotate screen", and "notification. Search for these strings. The resource file is found to be

Packages/SystemUI/res/layout/system_bar_settings_view.xml
When it is opened, it is found that there is no <ScrollView>. Therefore, set the header in 4.0 to it. The specific changes are as follows:

Diff -- git a/packages/SystemUI/res/layout/system_bar_settings_view.xml B/packages/SystemUI/res/layout/system_bar_settings_view.xml
Index c03dd99 .. 181c026 100644
--- A/packages/SystemUI/res/layout/system_bar_settings_view.xml
++ B/packages/SystemUI/res/layout/system_bar_settings_view.xml
-15,6 + 15,11 @@
* Limitations under the License.
-->
 
+ <ScrollView
+ Xmlns: android = "http://schemas.android.com/apk/res/android"
+ Android: layout_height = "pixel PX"
+ Android: layout_width = "match_parent">
+
<Com. android. systemui. statusbar. tablet. SettingsView
Xmlns: android = "http://schemas.android.com/apk/res/android"
Xmlns: systemui = "http://schemas.android.com/apk/res/com.android.systemui"
@-178,3 + 183,4 @@
 
</Com. android. systemui. statusbar. tablet. SettingsView>
 
+ </ScrollView>
Recompile the package as an upgrade package (it does not work if SystemUI is compiled as apk separately.

Author: laojing123

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.