Remove Dependency.get from KeyguardSliceTextView.
Moved the related code into the containing class's controller. Bug: 179775696 Test: atest SystemUITests Change-Id: I4c76d99f988233dd4fd51b7a6ff7606c77e73087
This commit is contained in:
@@ -49,10 +49,8 @@ import androidx.slice.widget.SliceContent;
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.internal.graphics.ColorUtils;
|
||||
import com.android.settingslib.Utils;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.Interpolators;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||
import com.android.systemui.util.wakelock.KeepAwakeAnimationListener;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
@@ -317,6 +315,22 @@ public class KeyguardSliceView extends LinearLayout {
|
||||
R.dimen.widget_label_font_size);
|
||||
mRowWithHeaderTextSize = mContext.getResources().getDimensionPixelSize(
|
||||
R.dimen.header_row_font_size);
|
||||
|
||||
for (int i = 0; i < mRow.getChildCount(); i++) {
|
||||
View child = mRow.getChildAt(i);
|
||||
if (child instanceof KeyguardSliceTextView) {
|
||||
((KeyguardSliceTextView) child).onDensityOrFontScaleChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void onOverlayChanged() {
|
||||
for (int i = 0; i < mRow.getChildCount(); i++) {
|
||||
View child = mRow.getChildAt(i);
|
||||
if (child instanceof KeyguardSliceTextView) {
|
||||
((KeyguardSliceTextView) child).onOverlayChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
||||
@@ -479,8 +493,7 @@ public class KeyguardSliceView extends LinearLayout {
|
||||
* Representation of an item that appears under the clock on main keyguard message.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
static class KeyguardSliceTextView extends TextView implements
|
||||
ConfigurationController.ConfigurationListener {
|
||||
static class KeyguardSliceTextView extends TextView {
|
||||
private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL;
|
||||
|
||||
@StyleRes
|
||||
@@ -492,24 +505,10 @@ public class KeyguardSliceView extends LinearLayout {
|
||||
setEllipsize(TruncateAt.END);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
Dependency.get(ConfigurationController.class).addCallback(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
Dependency.get(ConfigurationController.class).removeCallback(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDensityOrFontScaleChanged() {
|
||||
updatePadding();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
setTextAppearance(sStyleId);
|
||||
}
|
||||
|
||||
@@ -83,6 +83,10 @@ public class KeyguardSliceViewController extends ViewController<KeyguardSliceVie
|
||||
public void onDensityOrFontScaleChanged() {
|
||||
mView.onDensityOrFontScaleChanged();
|
||||
}
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
mView.onOverlayChanged();
|
||||
}
|
||||
};
|
||||
|
||||
Observer<Slice> mObserver = new Observer<Slice>() {
|
||||
|
||||
Reference in New Issue
Block a user