安卓SystemUI定制
来源:互联网 发布:js获取自定义属性 编辑:程序博客网 时间:2024/06/06 07:44
OS:安卓5.1
1.左上角添加home键:
在这个文件SystemUI/res/layout/status_bar.xml 添加内容如下:
<com.android.systemui.statusbar.policy.KeyButtonView android:layout_gravity="left" android:orientation="vertical" android:id="@id/home" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_home" android:layout_toRightOf="@id/recent_apps" android:contentDescription="@string/accessibility_home" systemui:keyCode="3" systemui:glowBackground="@drawable/ic_sysbar_highlight"/>
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" > + <TextView android:textSize="18.0dip" + android:gravity="left" + android:layout_gravity="center" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/zidingyi_text"+ />+ <ImageView android:id="@+id/notification_lights_out" android:layout_width="@dimen/status_bar_icon_size"diff --git a/frameworks/base/packages/SystemUI/res/values-zh-rCN/strings.xml b/frameworks/base/packages/SystemUI/res/values-zh-rCN/strings.xmlindex a4be004..6d1fdd9 100755--- a/frameworks/base/packages/SystemUI/res/values-zh-rCN/strings.xml+++ b/frameworks/base/packages/SystemUI/res/values-zh-rCN/strings.xml@@ -18,7 +18,9 @@ --> <resources xmlns:android="http://schemas.android.com/apk/res/android"- xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">++ <string name="zidingyi_text" msgid="71649373448500044888">"家庭智能网关"</string>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
<include layout="@layout/signal_cluster_view" android:id="@+id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="2.5dp"/>android:visibility="invisible"
5.修改状态栏的宽度,遮挡了时间
修改宽度为15dip:
+++ b/frameworks/base/core/res/res/values/dimens.xml- <dimen name="status_bar_height">25dip</dimen>+ <dimen name="status_bar_height">15dip</dimen>frameworks/base/packages/SystemUI/res/layout/status_bar.xml <com.android.systemui.statusbar.policy.Clock android:id="@+id/clock" android:textAppearance="@style/TextAppearance.StatusBar.Clock"+ android:layout_height="wrap_content" android:layout_width="wrap_content"- android:layout_height="match_parent"+ android:layout_marginTop="-5dp" android:singleLine="true" android:paddingLeft="6dip" android:gravity="center_vertical|left"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 @@ <com.android.systemui.BatteryMeterView android:id="@+id/battery" android:layout_height="14.5dp" android:layout_width="9.5dp"- android:layout_marginBottom="@dimen/battery_margin_bottom"/>+ android:layout_marginBottom="@dimen/battery_margin_bottom"+ android:visibility="gone"/> <com.android.systemui.BatteryLevelTextView android:id="@+id/battery_level_text" android:layout_height="match_parent"@@ -45,5 +46,6 @@ android:layout_gravity="center_vertical" android:textColor="#ffffff" android:textSize="@dimen/battery_level_text_size"- android:layout_marginStart="7dp"/>+ android:layout_marginStart="7dp"+ android:visibility="gone"/> </LinearLayout>
阅读全文
0 0
- 安卓SystemUI定制
- 安卓系统定制
- 安卓6.0 SystemUI 通知栏源码分析
- SystemUI Battery电池图标定制修改
- 安卓系统定制最常见问题解决
- 安卓系统定制常见问题解决
- 安卓8.0 SystemUI 中的quick setting加入屏幕截图功能
- SystemUI
- SystemUI
- Android_5.0定制--------keyCode实现SystemUI导航栏音量+ - 按钮
- 安卓运营商定制手机锁卡方式研究
- 分享一个安卓软件定制化测试工具
- 【教程】安卓定制ROM(一)搭建开…
- 【教程】安卓定制ROM(一)搭建开…
- 【教程】安卓定制ROM(一)搭建开…
- 【教程】安卓定制ROM(一)搭建开…
- 【教程】安卓定制ROM(一)搭建开…
- 【教程】安卓定制ROM(一)搭建开…
- 算法的时间复杂度和空间复杂度-总结
- zcmu-1411
- zabbix的在线安装
- HTTP深入浅出 http请求
- python实现-合并表记录
- 安卓SystemUI定制
- CentOS7.2搭建Go语言开发环境
- ubuntu16.04+gtx1080ti+caffe安装记录
- Java值传递和引用传递
- 刷题——hdu 6180 Schedule
- 微信小程序修改数组的值
- winform与静态页面中交互总结
- 51nod1073 约瑟夫环
- HDU4587 [TWO NODES] tarjan求无向图割顶