Merge "Post updateClockViews when called within onLayout" into tm-dev am: 94c91a89cf

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18738508

Change-Id: Id52acbd509683de94186405b4a906fe201c0a6ca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-06-08 16:13:45 +00:00
committed by Automerger Merge Worker
3 changed files with 1 additions and 31 deletions

View File

@@ -23,7 +23,6 @@ import android.content.IntentFilter;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Color; import android.graphics.Color;
import android.icu.text.NumberFormat; import android.icu.text.NumberFormat;
import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting;
@@ -144,7 +143,6 @@ public class AnimatableClockController extends ViewController<AnimatableClockVie
@Override @Override
protected void onViewAttached() { protected void onViewAttached() {
Log.d(TAG, "onViewAttached mView=" + mView);
updateLocale(); updateLocale();
mBroadcastDispatcher.registerReceiver(mLocaleBroadcastReceiver, mBroadcastDispatcher.registerReceiver(mLocaleBroadcastReceiver,
new IntentFilter(Intent.ACTION_LOCALE_CHANGED)); new IntentFilter(Intent.ACTION_LOCALE_CHANGED));
@@ -162,7 +160,6 @@ public class AnimatableClockController extends ViewController<AnimatableClockVie
@Override @Override
protected void onViewDetached() { protected void onViewDetached() {
Log.d(TAG, "onViewDetached mView=" + mView);
mBroadcastDispatcher.unregisterReceiver(mLocaleBroadcastReceiver); mBroadcastDispatcher.unregisterReceiver(mLocaleBroadcastReceiver);
mKeyguardUpdateMonitor.removeCallback(mKeyguardUpdateMonitorCallback); mKeyguardUpdateMonitor.removeCallback(mKeyguardUpdateMonitorCallback);
mBatteryController.removeCallback(mBatteryCallback); mBatteryController.removeCallback(mBatteryCallback);

View File

@@ -25,7 +25,6 @@ import android.graphics.Canvas
import android.text.TextUtils import android.text.TextUtils
import android.text.format.DateFormat import android.text.format.DateFormat
import android.util.AttributeSet import android.util.AttributeSet
import android.util.Log
import android.widget.TextView import android.widget.TextView
import com.android.systemui.R import com.android.systemui.R
import com.android.systemui.animation.Interpolators import com.android.systemui.animation.Interpolators
@@ -133,22 +132,6 @@ class AnimatableClockView @JvmOverloads constructor(
// relayout if the text didn't actually change. // relayout if the text didn't actually change.
if (!TextUtils.equals(text, formattedText)) { if (!TextUtils.equals(text, formattedText)) {
text = formattedText text = formattedText
Log.d(
tag, "refreshTime this=$this" +
" currTimeContextDesc=$contentDescription" +
" measuredHeight=$measuredHeight" +
" lastMeasureCall=$lastMeasureCall" +
" isSingleLineInternal=$isSingleLineInternal"
)
} else {
Log.d(
tag, "refreshTime (skipped due to unchanged text)" +
" this=$this" +
" currTimeContextDesc=$contentDescription" +
" measuredHeight=$measuredHeight" +
" lastMeasureCall=$lastMeasureCall" +
" isSingleLineInternal=$isSingleLineInternal"
)
} }
} }
@@ -169,20 +152,10 @@ class AnimatableClockView @JvmOverloads constructor(
} else { } else {
animator.updateLayout(layout) animator.updateLayout(layout)
} }
Log.v(tag, "onMeasure this=$this" +
" currTimeContextDesc=$contentDescription" +
" heightMeasureSpecMode=${MeasureSpec.getMode(heightMeasureSpec)}" +
" heightMeasureSpecSize=${MeasureSpec.getSize(heightMeasureSpec)}" +
" measuredWidth=$measuredWidth" +
" measuredHeight=$measuredHeight" +
" isSingleLineInternal=$isSingleLineInternal")
} }
override fun onDraw(canvas: Canvas) { override fun onDraw(canvas: Canvas) {
// intentionally doesn't call super.onDraw here or else the text will be rendered twice // intentionally doesn't call super.onDraw here or else the text will be rendered twice
Log.d(tag, "onDraw this=$this" +
" currTimeContextDesc=$contentDescription" +
" isSingleLineInternal=$isSingleLineInternal")
textAnimator?.draw(canvas) textAnimator?.draw(canvas)
} }

View File

@@ -304,7 +304,7 @@ public class KeyguardClockSwitch extends RelativeLayout {
super.onLayout(changed, l, t, r, b); super.onLayout(changed, l, t, r, b);
if (mDisplayedClockSize != null && !mChildrenAreLaidOut) { if (mDisplayedClockSize != null && !mChildrenAreLaidOut) {
updateClockViews(mDisplayedClockSize == LARGE, /* animate */ true); post(() -> updateClockViews(mDisplayedClockSize == LARGE, /* animate */ true));
} }
mChildrenAreLaidOut = true; mChildrenAreLaidOut = true;