Merge "Add hover effects to Dark mode and battery saver QS tiles" into udc-qpr-dev am: 5462c4f9a8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23711029 Change-Id: Ie89fbeb03dc936d23c81834cd67aafca64b5be04 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -172,7 +172,6 @@ public interface QSTile {
|
|||||||
public String expandedAccessibilityClassName;
|
public String expandedAccessibilityClassName;
|
||||||
public SlashState slash;
|
public SlashState slash;
|
||||||
public boolean handlesLongClick = true;
|
public boolean handlesLongClick = true;
|
||||||
public boolean showRippleEffect = true;
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public Drawable sideViewCustomDrawable;
|
public Drawable sideViewCustomDrawable;
|
||||||
public String spec;
|
public String spec;
|
||||||
@@ -217,7 +216,6 @@ public interface QSTile {
|
|||||||
|| !Objects.equals(other.dualTarget, dualTarget)
|
|| !Objects.equals(other.dualTarget, dualTarget)
|
||||||
|| !Objects.equals(other.slash, slash)
|
|| !Objects.equals(other.slash, slash)
|
||||||
|| !Objects.equals(other.handlesLongClick, handlesLongClick)
|
|| !Objects.equals(other.handlesLongClick, handlesLongClick)
|
||||||
|| !Objects.equals(other.showRippleEffect, showRippleEffect)
|
|
||||||
|| !Objects.equals(other.sideViewCustomDrawable, sideViewCustomDrawable);
|
|| !Objects.equals(other.sideViewCustomDrawable, sideViewCustomDrawable);
|
||||||
other.spec = spec;
|
other.spec = spec;
|
||||||
other.icon = icon;
|
other.icon = icon;
|
||||||
@@ -234,7 +232,6 @@ public interface QSTile {
|
|||||||
other.isTransient = isTransient;
|
other.isTransient = isTransient;
|
||||||
other.slash = slash != null ? slash.copy() : null;
|
other.slash = slash != null ? slash.copy() : null;
|
||||||
other.handlesLongClick = handlesLongClick;
|
other.handlesLongClick = handlesLongClick;
|
||||||
other.showRippleEffect = showRippleEffect;
|
|
||||||
other.sideViewCustomDrawable = sideViewCustomDrawable;
|
other.sideViewCustomDrawable = sideViewCustomDrawable;
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,6 +116,10 @@ open class QSTileViewImpl @JvmOverloads constructor(
|
|||||||
private lateinit var customDrawableView: ImageView
|
private lateinit var customDrawableView: ImageView
|
||||||
private lateinit var chevronView: ImageView
|
private lateinit var chevronView: ImageView
|
||||||
private var mQsLogger: QSLogger? = null
|
private var mQsLogger: QSLogger? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Controls if tile background is set to a [RippleDrawable] see [setClickable]
|
||||||
|
*/
|
||||||
protected var showRippleEffect = true
|
protected var showRippleEffect = true
|
||||||
|
|
||||||
private lateinit var ripple: RippleDrawable
|
private lateinit var ripple: RippleDrawable
|
||||||
@@ -440,7 +444,6 @@ open class QSTileViewImpl @JvmOverloads constructor(
|
|||||||
|
|
||||||
protected open fun handleStateChanged(state: QSTile.State) {
|
protected open fun handleStateChanged(state: QSTile.State) {
|
||||||
val allowAnimations = animationsEnabled()
|
val allowAnimations = animationsEnabled()
|
||||||
showRippleEffect = state.showRippleEffect
|
|
||||||
isClickable = state.state != Tile.STATE_UNAVAILABLE
|
isClickable = state.state != Tile.STATE_UNAVAILABLE
|
||||||
isLongClickable = state.handlesLongClick
|
isLongClickable = state.handlesLongClick
|
||||||
icon.setIcon(state, allowAnimations)
|
icon.setIcon(state, allowAnimations)
|
||||||
|
|||||||
@@ -155,7 +155,6 @@ public class BatterySaverTile extends QSTileImpl<BooleanState> implements
|
|||||||
state.contentDescription = state.label;
|
state.contentDescription = state.label;
|
||||||
state.value = mPowerSave;
|
state.value = mPowerSave;
|
||||||
state.expandedAccessibilityClassName = Switch.class.getName();
|
state.expandedAccessibilityClassName = Switch.class.getName();
|
||||||
state.showRippleEffect = mSetting.getValue() == 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ public class UiModeNightTile extends QSTileImpl<QSTile.BooleanState> implements
|
|||||||
state.icon = ResourceIcon.get(state.state == Tile.STATE_ACTIVE
|
state.icon = ResourceIcon.get(state.state == Tile.STATE_ACTIVE
|
||||||
? R.drawable.qs_light_dark_theme_icon_on
|
? R.drawable.qs_light_dark_theme_icon_on
|
||||||
: R.drawable.qs_light_dark_theme_icon_off);
|
: R.drawable.qs_light_dark_theme_icon_off);
|
||||||
state.showRippleEffect = false;
|
|
||||||
state.expandedAccessibilityClassName = Switch.class.getName();
|
state.expandedAccessibilityClassName = Switch.class.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user