Loading packages/SystemUI/res-keyguard/layout/type_clock.xml→packages/SystemUI/res-keyguard/layout/type_aod_clock.xml +1 −9 Original line number Diff line number Diff line Loading @@ -19,13 +19,5 @@ android:layout_width="match_parent" android:layout_height="match_parent" > <com.android.keyguard.clock.TypographicClock android:id="@+id/type_clock" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="50dp" android:textAlignment="viewStart" style="@style/widget_big" android:textSize="40dp" /> <include layout="@layout/typographic_clock" /> </com.android.keyguard.clock.ClockLayout> packages/SystemUI/res-keyguard/layout/typographic_clock.xml 0 → 100644 +26 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2019 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <com.android.keyguard.clock.TypographicClock xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/type_clock" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="50dp" android:textAlignment="viewStart" style="@style/widget_big" android:textSize="40dp" /> packages/SystemUI/src/com/android/keyguard/clock/TypeClockController.java +19 −9 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public class TypeClockController implements ClockPlugin { /** * Small clock shown on lock screen above stack scroller. */ private View mLockClockContainer; private TypographicClock mLockClock; /** * Controller for transition into dark state. Loading @@ -69,13 +69,15 @@ public class TypeClockController implements ClockPlugin { } private void createViews() { mView = mLayoutInflater.inflate(R.layout.type_clock, null); mView = mLayoutInflater.inflate(R.layout.type_aod_clock, null); mTypeClock = mView.findViewById(R.id.type_clock); // For now, this view is used to hide the default digital clock. // Need better transition to lock screen. mLockClockContainer = mLayoutInflater.inflate(R.layout.digital_clock, null); mLockClockContainer.setVisibility(View.GONE); mLockClock = (TypographicClock) mLayoutInflater.inflate(R.layout.typographic_clock, null); mLockClock.setVisibility(View.GONE); mDarkController = new CrossFadeDarkController(mView, mLockClock); } @Override Loading @@ -95,10 +97,10 @@ public class TypeClockController implements ClockPlugin { @Override public View getView() { if (mLockClockContainer == null) { if (mLockClock == null) { createViews(); } return mLockClockContainer; return mLockClock; } @Override Loading @@ -115,6 +117,7 @@ public class TypeClockController implements ClockPlugin { @Override public void setTextColor(int color) { mTypeClock.setTextColor(color); mLockClock.setTextColor(color); } @Override Loading @@ -122,21 +125,28 @@ public class TypeClockController implements ClockPlugin { if (colorPalette == null || colorPalette.length == 0) { return; } final int length = colorPalette.length; mTypeClock.setClockColor(colorPalette[Math.max(0, length - 5)]); final int color = colorPalette[Math.max(0, colorPalette.length - 5)]; mTypeClock.setClockColor(color); mLockClock.setClockColor(color); } @Override public void onTimeTick() { mTypeClock.onTimeChanged(); mLockClock.onTimeChanged(); } @Override public void setDarkAmount(float darkAmount) {} public void setDarkAmount(float darkAmount) { if (mDarkController != null) { mDarkController.setDarkAmount(darkAmount); } } @Override public void onTimeZoneChanged(TimeZone timeZone) { mTypeClock.onTimeZoneChanged(timeZone); mLockClock.onTimeZoneChanged(timeZone); } @Override Loading packages/SystemUI/src/com/android/keyguard/clock/TypographicClock.java +8 −0 Original line number Diff line number Diff line Loading @@ -119,4 +119,12 @@ public class TypographicClock extends TextView { mTime.setTimeZone(mTimeZone != null ? mTimeZone : TimeZone.getDefault()); onTimeChanged(); } /** * Overriding hasOverlappingRendering as false to improve performance of crossfading. */ @Override public boolean hasOverlappingRendering() { return false; } } Loading
packages/SystemUI/res-keyguard/layout/type_clock.xml→packages/SystemUI/res-keyguard/layout/type_aod_clock.xml +1 −9 Original line number Diff line number Diff line Loading @@ -19,13 +19,5 @@ android:layout_width="match_parent" android:layout_height="match_parent" > <com.android.keyguard.clock.TypographicClock android:id="@+id/type_clock" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="50dp" android:textAlignment="viewStart" style="@style/widget_big" android:textSize="40dp" /> <include layout="@layout/typographic_clock" /> </com.android.keyguard.clock.ClockLayout>
packages/SystemUI/res-keyguard/layout/typographic_clock.xml 0 → 100644 +26 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2019 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <com.android.keyguard.clock.TypographicClock xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/type_clock" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="50dp" android:textAlignment="viewStart" style="@style/widget_big" android:textSize="40dp" />
packages/SystemUI/src/com/android/keyguard/clock/TypeClockController.java +19 −9 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public class TypeClockController implements ClockPlugin { /** * Small clock shown on lock screen above stack scroller. */ private View mLockClockContainer; private TypographicClock mLockClock; /** * Controller for transition into dark state. Loading @@ -69,13 +69,15 @@ public class TypeClockController implements ClockPlugin { } private void createViews() { mView = mLayoutInflater.inflate(R.layout.type_clock, null); mView = mLayoutInflater.inflate(R.layout.type_aod_clock, null); mTypeClock = mView.findViewById(R.id.type_clock); // For now, this view is used to hide the default digital clock. // Need better transition to lock screen. mLockClockContainer = mLayoutInflater.inflate(R.layout.digital_clock, null); mLockClockContainer.setVisibility(View.GONE); mLockClock = (TypographicClock) mLayoutInflater.inflate(R.layout.typographic_clock, null); mLockClock.setVisibility(View.GONE); mDarkController = new CrossFadeDarkController(mView, mLockClock); } @Override Loading @@ -95,10 +97,10 @@ public class TypeClockController implements ClockPlugin { @Override public View getView() { if (mLockClockContainer == null) { if (mLockClock == null) { createViews(); } return mLockClockContainer; return mLockClock; } @Override Loading @@ -115,6 +117,7 @@ public class TypeClockController implements ClockPlugin { @Override public void setTextColor(int color) { mTypeClock.setTextColor(color); mLockClock.setTextColor(color); } @Override Loading @@ -122,21 +125,28 @@ public class TypeClockController implements ClockPlugin { if (colorPalette == null || colorPalette.length == 0) { return; } final int length = colorPalette.length; mTypeClock.setClockColor(colorPalette[Math.max(0, length - 5)]); final int color = colorPalette[Math.max(0, colorPalette.length - 5)]; mTypeClock.setClockColor(color); mLockClock.setClockColor(color); } @Override public void onTimeTick() { mTypeClock.onTimeChanged(); mLockClock.onTimeChanged(); } @Override public void setDarkAmount(float darkAmount) {} public void setDarkAmount(float darkAmount) { if (mDarkController != null) { mDarkController.setDarkAmount(darkAmount); } } @Override public void onTimeZoneChanged(TimeZone timeZone) { mTypeClock.onTimeZoneChanged(timeZone); mLockClock.onTimeZoneChanged(timeZone); } @Override Loading
packages/SystemUI/src/com/android/keyguard/clock/TypographicClock.java +8 −0 Original line number Diff line number Diff line Loading @@ -119,4 +119,12 @@ public class TypographicClock extends TextView { mTime.setTimeZone(mTimeZone != null ? mTimeZone : TimeZone.getDefault()); onTimeChanged(); } /** * Overriding hasOverlappingRendering as false to improve performance of crossfading. */ @Override public boolean hasOverlappingRendering() { return false; } }