Merge "Volume: Force focused state to disambig multiple sliders." into mnc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
82e595fd6e
@@ -155,6 +155,7 @@ public class VolumeDialog {
|
|||||||
lp.y = res.getDimensionPixelSize(R.dimen.volume_offset_top);
|
lp.y = res.getDimensionPixelSize(R.dimen.volume_offset_top);
|
||||||
lp.gravity = Gravity.TOP;
|
lp.gravity = Gravity.TOP;
|
||||||
window.setAttributes(lp);
|
window.setAttributes(lp);
|
||||||
|
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
|
||||||
|
|
||||||
mActiveSliderTint = loadColorStateList(R.color.system_accent_color);
|
mActiveSliderTint = loadColorStateList(R.color.system_accent_color);
|
||||||
mInactiveSliderTint = loadColorStateList(R.color.volume_slider_inactive);
|
mInactiveSliderTint = loadColorStateList(R.color.volume_slider_inactive);
|
||||||
@@ -670,6 +671,14 @@ public class VolumeDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateVolumeRowSliderTintH(VolumeRow row, boolean isActive) {
|
private void updateVolumeRowSliderTintH(VolumeRow row, boolean isActive) {
|
||||||
|
if (isActive && mExpanded) {
|
||||||
|
row.slider.setFocusable(true);
|
||||||
|
row.slider.setFocusableInTouchMode(true);
|
||||||
|
row.slider.requestFocus();
|
||||||
|
} else {
|
||||||
|
row.slider.setFocusableInTouchMode(false);
|
||||||
|
row.slider.setFocusable(false);
|
||||||
|
}
|
||||||
final ColorStateList tint = isActive && row.slider.isEnabled() ? mActiveSliderTint
|
final ColorStateList tint = isActive && row.slider.isEnabled() ? mActiveSliderTint
|
||||||
: mInactiveSliderTint;
|
: mInactiveSliderTint;
|
||||||
if (tint == row.cachedSliderTint) return;
|
if (tint == row.cachedSliderTint) return;
|
||||||
|
|||||||
@@ -3927,7 +3927,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
// A window that has requested to fill the entire screen just
|
// A window that has requested to fill the entire screen just
|
||||||
// gets everything, period.
|
// gets everything, period.
|
||||||
if (attrs.type == TYPE_STATUS_BAR_PANEL
|
if (attrs.type == TYPE_STATUS_BAR_PANEL
|
||||||
|| attrs.type == TYPE_STATUS_BAR_SUB_PANEL) {
|
|| attrs.type == TYPE_STATUS_BAR_SUB_PANEL
|
||||||
|
|| attrs.type == TYPE_VOLUME_OVERLAY) {
|
||||||
pf.left = df.left = of.left = cf.left = hasNavBar
|
pf.left = df.left = of.left = cf.left = hasNavBar
|
||||||
? mDockLeft : mUnrestrictedScreenLeft;
|
? mDockLeft : mUnrestrictedScreenLeft;
|
||||||
pf.top = df.top = of.top = cf.top = mUnrestrictedScreenTop;
|
pf.top = df.top = of.top = cf.top = mUnrestrictedScreenTop;
|
||||||
@@ -4042,9 +4043,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
"): normal window");
|
"): normal window");
|
||||||
// Otherwise, a normal window must be placed inside the content
|
// Otherwise, a normal window must be placed inside the content
|
||||||
// of all screen decorations.
|
// of all screen decorations.
|
||||||
if (attrs.type == TYPE_STATUS_BAR_PANEL) {
|
if (attrs.type == TYPE_STATUS_BAR_PANEL || attrs.type == TYPE_VOLUME_OVERLAY) {
|
||||||
// Status bar panels are the only windows who can go on top of
|
// Status bar panels and the volume dialog are the only windows who can go on
|
||||||
// the status bar. They are protected by the STATUS_BAR_SERVICE
|
// top of the status bar. They are protected by the STATUS_BAR_SERVICE
|
||||||
// permission, so they have the same privileges as the status
|
// permission, so they have the same privileges as the status
|
||||||
// bar itself.
|
// bar itself.
|
||||||
pf.left = df.left = of.left = cf.left = mRestrictedScreenLeft;
|
pf.left = df.left = of.left = cf.left = mRestrictedScreenLeft;
|
||||||
@@ -4053,8 +4054,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
+ mRestrictedScreenWidth;
|
+ mRestrictedScreenWidth;
|
||||||
pf.bottom = df.bottom = of.bottom = cf.bottom = mRestrictedScreenTop
|
pf.bottom = df.bottom = of.bottom = cf.bottom = mRestrictedScreenTop
|
||||||
+ mRestrictedScreenHeight;
|
+ mRestrictedScreenHeight;
|
||||||
} else if (attrs.type == TYPE_TOAST || attrs.type == TYPE_SYSTEM_ALERT
|
} else if (attrs.type == TYPE_TOAST || attrs.type == TYPE_SYSTEM_ALERT) {
|
||||||
|| attrs.type == TYPE_VOLUME_OVERLAY) {
|
|
||||||
// These dialogs are stable to interim decor changes.
|
// These dialogs are stable to interim decor changes.
|
||||||
pf.left = df.left = of.left = cf.left = mStableLeft;
|
pf.left = df.left = of.left = cf.left = mStableLeft;
|
||||||
pf.top = df.top = of.top = cf.top = mStableTop;
|
pf.top = df.top = of.top = cf.top = mStableTop;
|
||||||
|
|||||||
Reference in New Issue
Block a user