[RK3588 Android12]系统桌面添加时钟日期部件

查看packages/apps/Launcher3/res/xml/device_profiles.xml
launcher:deviceCategory为平板的配置项使用的布局文件为default_workspace_6x5.xml

    <grid-option
        launcher:name="6_by_5"
        launcher:numRows="5"
        launcher:numColumns="6"
        launcher:numFolderRows="3"
        launcher:numFolderColumns="3"
        launcher:numHotseatIcons="6"
        launcher:numAllAppsColumns="6"
        launcher:dbFile="launcher_6_by_5.db"
        launcher:defaultLayoutId="@xml/default_workspace_6x5"
        launcher:deviceCategory="tablet" >

修改packages/apps/Launcher3/res/xml/default_workspace_6x5.xml
添加时钟部件

diff --git a/packages/apps/Launcher3/res/xml/default_workspace_6x5.xml b/packages/apps/Launcher3/res/xml/default_workspace_6x5.xml
index b078cfd7f8..7b3d02a228 100644
--- a/packages/apps/Launcher3/res/xml/default_workspace_6x5.xml
+++ b/packages/apps/Launcher3/res/xml/default_workspace_6x5.xml
@@ -72,5 +72,14 @@
         <favorite launcher:uri="#Intent;action=android.media.action.STILL_IMAGE_CAMERA;end" />
         <favorite launcher:uri="#Intent;action=android.intent.action.CAMERA_BUTTON;end" />
     </resolve>
+    
+    <appwidget
+        launcher:screen="0"
+        launcher:x="1"
+        launcher:y="2"
+        launcher:spanX="4"
+        launcher:spanY="2"      
+        launcher:className="com.android.alarmclock.DigitalAppWidgetProvider"
+        launcher:packageName="com.android.deskclock"/>
 
 </favorites>

时钟24小时制显示
修改packages/apps/DeskClock/res/layout/digital_widget.xml将
android:format12Hour=“@string/lock_screen_12_hour_format”
改为
android:format12Hour=“@string/lock_screen_24_hour_format”

diff --git a/packages/apps/DeskClock/res/layout/digital_widget.xml b/packages/apps/DeskClock/res/layout/digital_widget.xml
index c5b4837a6f..c2d1d48183 100644
--- a/packages/apps/DeskClock/res/layout/digital_widget.xml
+++ b/packages/apps/DeskClock/res/layout/digital_widget.xml
@@ -29,7 +29,7 @@
         android:layout_height="wrap_content"
         android:layout_gravity="center_horizontal|top"
         android:ellipsize="none"
-        android:format12Hour="@string/lock_screen_12_hour_format"
+        android:format12Hour="@string/lock_screen_24_hour_format"
         android:format24Hour="@string/lock_screen_24_hour_format"
         android:includeFontPadding="false"
         android:singleLine="true"
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值