Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTile.java +18 −3 Original line number Diff line number Diff line Loading @@ -264,15 +264,18 @@ public interface QSTile { } } @ProvidesInterface(version = BooleanState.VERSION) public static class BooleanState extends State { /** * Distinguished from [BooleanState] for use-case purposes such as allowing null secondary label */ @ProvidesInterface(version = AdapterState.VERSION) class AdapterState extends State { public static final int VERSION = 1; public boolean value; public boolean forceExpandIcon; @Override public boolean copyTo(State other) { final BooleanState o = (BooleanState) other; final AdapterState o = (AdapterState) other; final boolean changed = super.copyTo(other) || o.value != value || o.forceExpandIcon != forceExpandIcon; Loading @@ -289,6 +292,18 @@ public interface QSTile { return rt; } @Override public State copy() { AdapterState state = new AdapterState(); copyTo(state); return state; } } @ProvidesInterface(version = BooleanState.VERSION) class BooleanState extends AdapterState { public static final int VERSION = 1; @Override public State copy() { BooleanState state = new BooleanState(); Loading packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt +3 −4 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ import com.android.systemui.animation.LaunchableView import com.android.systemui.animation.LaunchableViewDelegate import com.android.systemui.plugins.qs.QSIconView import com.android.systemui.plugins.qs.QSTile import com.android.systemui.plugins.qs.QSTile.BooleanState import com.android.systemui.plugins.qs.QSTile.AdapterState import com.android.systemui.plugins.qs.QSTileView import com.android.systemui.qs.logging.QSLogger import com.android.systemui.qs.tileimpl.QSIconViewImpl.QS_ANIM_LENGTH Loading Loading @@ -506,13 +506,12 @@ open class QSTileViewImpl @JvmOverloads constructor( state.expandedAccessibilityClassName } if (state is BooleanState) { if (state is AdapterState) { val newState = state.value if (tileState != newState) { tileState = newState } } // // Labels if (!Objects.equals(label.text, state.label)) { Loading Loading @@ -625,7 +624,7 @@ open class QSTileViewImpl @JvmOverloads constructor( customDrawableView.setImageDrawable(state.sideViewCustomDrawable) customDrawableView.visibility = VISIBLE chevronView.visibility = GONE } else if (state !is BooleanState || state.forceExpandIcon) { } else if (state !is AdapterState || state.forceExpandIcon) { customDrawableView.setImageDrawable(null) customDrawableView.visibility = GONE chevronView.visibility = VISIBLE Loading packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModelAdapter.kt +1 −1 Original line number Diff line number Diff line Loading @@ -227,7 +227,7 @@ constructor( ): QSTile.State = // we have to use QSTile.BooleanState to support different side icons // which are bound to instanceof QSTile.BooleanState in QSTileView. QSTile.BooleanState().apply { QSTile.AdapterState().apply { spec = config.tileSpec.spec label = viewModelState.label // This value is synthetic and doesn't have any meaning. It's only needed to satisfy Loading Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QSTile.java +18 −3 Original line number Diff line number Diff line Loading @@ -264,15 +264,18 @@ public interface QSTile { } } @ProvidesInterface(version = BooleanState.VERSION) public static class BooleanState extends State { /** * Distinguished from [BooleanState] for use-case purposes such as allowing null secondary label */ @ProvidesInterface(version = AdapterState.VERSION) class AdapterState extends State { public static final int VERSION = 1; public boolean value; public boolean forceExpandIcon; @Override public boolean copyTo(State other) { final BooleanState o = (BooleanState) other; final AdapterState o = (AdapterState) other; final boolean changed = super.copyTo(other) || o.value != value || o.forceExpandIcon != forceExpandIcon; Loading @@ -289,6 +292,18 @@ public interface QSTile { return rt; } @Override public State copy() { AdapterState state = new AdapterState(); copyTo(state); return state; } } @ProvidesInterface(version = BooleanState.VERSION) class BooleanState extends AdapterState { public static final int VERSION = 1; @Override public State copy() { BooleanState state = new BooleanState(); Loading
packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt +3 −4 Original line number Diff line number Diff line Loading @@ -52,7 +52,7 @@ import com.android.systemui.animation.LaunchableView import com.android.systemui.animation.LaunchableViewDelegate import com.android.systemui.plugins.qs.QSIconView import com.android.systemui.plugins.qs.QSTile import com.android.systemui.plugins.qs.QSTile.BooleanState import com.android.systemui.plugins.qs.QSTile.AdapterState import com.android.systemui.plugins.qs.QSTileView import com.android.systemui.qs.logging.QSLogger import com.android.systemui.qs.tileimpl.QSIconViewImpl.QS_ANIM_LENGTH Loading Loading @@ -506,13 +506,12 @@ open class QSTileViewImpl @JvmOverloads constructor( state.expandedAccessibilityClassName } if (state is BooleanState) { if (state is AdapterState) { val newState = state.value if (tileState != newState) { tileState = newState } } // // Labels if (!Objects.equals(label.text, state.label)) { Loading Loading @@ -625,7 +624,7 @@ open class QSTileViewImpl @JvmOverloads constructor( customDrawableView.setImageDrawable(state.sideViewCustomDrawable) customDrawableView.visibility = VISIBLE chevronView.visibility = GONE } else if (state !is BooleanState || state.forceExpandIcon) { } else if (state !is AdapterState || state.forceExpandIcon) { customDrawableView.setImageDrawable(null) customDrawableView.visibility = GONE chevronView.visibility = VISIBLE Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/viewmodel/QSTileViewModelAdapter.kt +1 −1 Original line number Diff line number Diff line Loading @@ -227,7 +227,7 @@ constructor( ): QSTile.State = // we have to use QSTile.BooleanState to support different side icons // which are bound to instanceof QSTile.BooleanState in QSTileView. QSTile.BooleanState().apply { QSTile.AdapterState().apply { spec = config.tileSpec.spec label = viewModelState.label // This value is synthetic and doesn't have any meaning. It's only needed to satisfy Loading