Merge "Do not allow focus on invisible buttons" into udc-dev am: 123057466d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23215701 Change-Id: I194c9e35d24968afa59b0824ef0b7ebe2cdd7cbd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -946,10 +946,15 @@ public class PipController implements PipTransitionController.PipTransitionCallb
|
||||
mPipBoundsState.getDisplayBounds().right,
|
||||
mPipBoundsState.getDisplayBounds().bottom);
|
||||
mPipBoundsState.addNamedUnrestrictedKeepClearArea(LAUNCHER_KEEP_CLEAR_AREA_TAG, rect);
|
||||
updatePipPositionForKeepClearAreas();
|
||||
} else {
|
||||
mPipBoundsState.removeNamedUnrestrictedKeepClearArea(LAUNCHER_KEEP_CLEAR_AREA_TAG);
|
||||
// postpone moving in response to hide of Launcher in case there's another change
|
||||
mMainExecutor.removeCallbacks(mMovePipInResponseToKeepClearAreasChangeCallback);
|
||||
mMainExecutor.executeDelayed(
|
||||
mMovePipInResponseToKeepClearAreasChangeCallback,
|
||||
PIP_KEEP_CLEAR_AREAS_DELAY);
|
||||
}
|
||||
updatePipPositionForKeepClearAreas();
|
||||
}
|
||||
|
||||
private void setLauncherAppIconSize(int iconSizePx) {
|
||||
|
||||
@@ -1235,6 +1235,8 @@ public class MediaControlPanel {
|
||||
if ((buttonId == R.id.actionPrev && semanticActions.getReservePrev())
|
||||
|| (buttonId == R.id.actionNext && semanticActions.getReserveNext())) {
|
||||
notVisibleValue = ConstraintSet.INVISIBLE;
|
||||
mMediaViewHolder.getAction(buttonId).setFocusable(visible);
|
||||
mMediaViewHolder.getAction(buttonId).setClickable(visible);
|
||||
} else {
|
||||
notVisibleValue = ConstraintSet.GONE;
|
||||
}
|
||||
|
||||
@@ -530,6 +530,8 @@ public class MediaControlPanelTest : SysuiTestCase() {
|
||||
verify(collapsedSet).setVisibility(R.id.actionPlayPause, ConstraintSet.VISIBLE)
|
||||
|
||||
assertThat(actionNext.isEnabled()).isTrue()
|
||||
assertThat(actionNext.isFocusable()).isTrue()
|
||||
assertThat(actionNext.isClickable()).isTrue()
|
||||
assertThat(actionNext.contentDescription).isEqualTo("next")
|
||||
verify(collapsedSet).setVisibility(R.id.actionNext, ConstraintSet.VISIBLE)
|
||||
|
||||
@@ -576,6 +578,8 @@ public class MediaControlPanelTest : SysuiTestCase() {
|
||||
|
||||
assertThat(actionPrev.isEnabled()).isFalse()
|
||||
assertThat(actionPrev.drawable).isNull()
|
||||
assertThat(actionPrev.isFocusable()).isFalse()
|
||||
assertThat(actionPrev.isClickable()).isFalse()
|
||||
verify(expandedSet).setVisibility(R.id.actionPrev, ConstraintSet.INVISIBLE)
|
||||
|
||||
assertThat(actionNext.isEnabled()).isFalse()
|
||||
@@ -610,6 +614,8 @@ public class MediaControlPanelTest : SysuiTestCase() {
|
||||
|
||||
assertThat(actionNext.isEnabled()).isFalse()
|
||||
assertThat(actionNext.drawable).isNull()
|
||||
assertThat(actionNext.isFocusable()).isFalse()
|
||||
assertThat(actionNext.isClickable()).isFalse()
|
||||
verify(expandedSet).setVisibility(R.id.actionNext, ConstraintSet.INVISIBLE)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user