[RK3566][Android13] Android->屏蔽锁屏界面的时钟和日期显示
测试平台
Platform: RK3566
OS: Android13
需求:
客户要求:选择 设置->安全->屏幕锁定方式,休眠唤醒进入锁屏界面,屏蔽该界面中央位置的时钟和左上角日期显示。
解决方法:
代码路径:frameworks/base/packages/SystemUI/
--- a/packages/SystemUI/res-keyguard/layout/digital_clock.xml
+++ b/packages/SystemUI/res-keyguard/layout/digital_clock.xml
@@ -16,8 +16,8 @@
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_alignParentTop="true">
<TextClock
--- a/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml
+++ b/packages/SystemUI/res-keyguard/layout/keyguard_clock_switch.xml
@@ -21,8 +21,8 @@
<com.android.keyguard.KeyguardClockSwitch
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/keyguard_clock_container"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
android:clipChildren="false"
android:layout_gravity="center_horizontal|top">
<FrameLayout
@@ -32,7 +32,7 @@
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:paddingStart="@dimen/clock_padding_start"
- android:visibility="invisible" />
+ android:visibility="gone" />
<FrameLayout
android:id="@+id/lockscreen_clock_view_large"
android:layout_width="match_parent"
--- a/packages/SystemUI/res-keyguard/layout/keyguard_status_view.xml
+++ b/packages/SystemUI/res-keyguard/layout/keyguard_status_view.xml
@@ -29,7 +29,7 @@
android:layout_marginHorizontal="@dimen/status_view_margin_horizontal"
android:clipChildren="false"
android:layout_width="0dp"
- android:layout_height="wrap_content">
+ android:layout_height="0dp">
<LinearLayout
android:id="@+id/status_view_container"
android:layout_width="match_parent"
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java
@@ -209,8 +209,8 @@ public class KeyguardClockSwitch extends RelativeLayout {
if (!animate) {
out.setAlpha(0f);
- in.setAlpha(1f);
- in.setVisibility(VISIBLE);
+ in.setAlpha(0f);
+ in.setVisibility(View.GONE);
mStatusArea.setTranslationY(statusAreaYTranslation);
return;
}
@@ -229,7 +229,7 @@ public class KeyguardClockSwitch extends RelativeLayout {
});
in.setAlpha(0);
- in.setVisibility(View.VISIBLE);
+ in.setVisibility(View.GONE);
mClockInAnim = new AnimatorSet();
mClockInAnim.setDuration(CLOCK_IN_MILLIS);
mClockInAnim.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);