安卓SystemUI定制

  

         OS:安卓5.1

1.左上角添加home键:

在这个文件SystemUI/res/layout/status_bar.xml 添加内容如下:
	
2.状态栏中间添加文字
--- a/frameworks/base/packages/SystemUI/res/layout/status_bar.xml
+++ b/frameworks/base/packages/SystemUI/res/layout/status_bar.xml
@@ -29,6 +29,14 @@
     android:descendantFocusability="afterDescendants"
     >
 
+    
+
     
 
 
+       xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+           "家庭智能网关"
3.禁止状态栏下拉。
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@@ -94,9 +94,10 @@ public class PhoneStatusBarView extends PanelBar {
     @Override
     public PanelView selectPanelForTouch(MotionEvent touch) {
         // No double swiping. If either panel is open, nothing else can be pulled down.
-        return mNotificationPanel.getExpandedHeight() > 0
-                ? null
-                : mNotificationPanel;
+        //return mNotificationPanel.getExpandedHeight() > 0
+          //      ? null
+            //    : mNotificationPanel;
+        return null;
     }
 
4.状态栏删除信号图标。
修改文件:frameworks/base/packages/SystemUI/res/layout/system_icons.xml
    
	android:visibility="invisible"


 
   
5.修改状态栏的宽度,遮挡了时间
修改宽度为15dip:
+++ b/frameworks/base/core/res/res/values/dimens.xml
-    25dip
+    15dip
frameworks/base/packages/SystemUI/res/layout/status_bar.xml
            
6.安卓5.1去除电池显示图标
--- a/frameworks/base/packages/SystemUI/res/layout/system_icons.xml
+++ b/frameworks/base/packages/SystemUI/res/layout/system_icons.xml
@@ -36,7 +36,8 @@
     
+       android:layout_marginBottom="@dimen/battery_margin_bottom"
+       android:visibility="gone"/>
 
     
+       android:layout_marginStart="7dp"
+       android:visibility="gone"/>
 



待续……




你可能感兴趣的:(安卓SystemUI定制)