Focus remains on the button after turning on/off
Test: manually test talkback Fixes: 145181672 Change-Id: I16ceb81dd686e4a18354dfd464c7683ba94df79d
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/night_display_turn_on_button"
|
android:id="@+id/night_display_turn_on_button"
|
||||||
style="@style/ActionPrimaryButton"
|
style="@style/ActionPrimaryButton"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
android:layout_marginStart="@dimen/screen_margin_sides"
|
android:layout_marginStart="@dimen/screen_margin_sides"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -32,6 +33,7 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/night_display_turn_off_button"
|
android:id="@+id/night_display_turn_off_button"
|
||||||
style="@style/ActionSecondaryButton"
|
style="@style/ActionSecondaryButton"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
android:layout_marginStart="@dimen/screen_margin_sides"
|
android:layout_marginStart="@dimen/screen_margin_sides"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@@ -24,6 +24,7 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/zen_mode_settings_turn_on_button"
|
android:id="@+id/zen_mode_settings_turn_on_button"
|
||||||
style="@style/ActionPrimaryButton"
|
style="@style/ActionPrimaryButton"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
android:layout_marginStart="@dimen/screen_margin_sides"
|
android:layout_marginStart="@dimen/screen_margin_sides"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -33,6 +34,7 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/zen_mode_settings_turn_off_button"
|
android:id="@+id/zen_mode_settings_turn_off_button"
|
||||||
style="@style/ActionSecondaryButton"
|
style="@style/ActionSecondaryButton"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
android:layout_marginStart="@dimen/screen_margin_sides"
|
android:layout_marginStart="@dimen/screen_margin_sides"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@@ -126,10 +126,12 @@ public class NightDisplayActivationPreferenceController extends TogglePreference
|
|||||||
mTurnOnButton.setVisibility(View.GONE);
|
mTurnOnButton.setVisibility(View.GONE);
|
||||||
mTurnOffButton.setVisibility(View.VISIBLE);
|
mTurnOffButton.setVisibility(View.VISIBLE);
|
||||||
mTurnOffButton.setText(buttonText);
|
mTurnOffButton.setText(buttonText);
|
||||||
|
mTurnOffButton.requestFocus();
|
||||||
} else {
|
} else {
|
||||||
mTurnOnButton.setVisibility(View.VISIBLE);
|
mTurnOnButton.setVisibility(View.VISIBLE);
|
||||||
mTurnOffButton.setVisibility(View.GONE);
|
mTurnOffButton.setVisibility(View.GONE);
|
||||||
mTurnOnButton.setText(buttonText);
|
mTurnOnButton.setText(buttonText);
|
||||||
|
mTurnOnButton.requestFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -63,6 +63,7 @@ public class ZenModeButtonPreferenceController extends AbstractZenModePreference
|
|||||||
if (null == mZenButtonOn) {
|
if (null == mZenButtonOn) {
|
||||||
mZenButtonOn = ((LayoutPreference) preference)
|
mZenButtonOn = ((LayoutPreference) preference)
|
||||||
.findViewById(R.id.zen_mode_settings_turn_on_button);
|
.findViewById(R.id.zen_mode_settings_turn_on_button);
|
||||||
|
mZenButtonOn.setFocusableInTouchMode(true);
|
||||||
updateZenButtonOnClickListener();
|
updateZenButtonOnClickListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,12 +87,14 @@ public class ZenModeButtonPreferenceController extends AbstractZenModePreference
|
|||||||
case Settings.Global.ZEN_MODE_NO_INTERRUPTIONS:
|
case Settings.Global.ZEN_MODE_NO_INTERRUPTIONS:
|
||||||
mZenButtonOff.setVisibility(View.VISIBLE);
|
mZenButtonOff.setVisibility(View.VISIBLE);
|
||||||
mZenButtonOn.setVisibility(View.GONE);
|
mZenButtonOn.setVisibility(View.GONE);
|
||||||
|
mZenButtonOff.requestFocus();
|
||||||
break;
|
break;
|
||||||
case Settings.Global.ZEN_MODE_OFF:
|
case Settings.Global.ZEN_MODE_OFF:
|
||||||
default:
|
default:
|
||||||
mZenButtonOff.setVisibility(View.GONE);
|
mZenButtonOff.setVisibility(View.GONE);
|
||||||
updateZenButtonOnClickListener();
|
updateZenButtonOnClickListener();
|
||||||
mZenButtonOn.setVisibility(View.VISIBLE);
|
mZenButtonOn.setVisibility(View.VISIBLE);
|
||||||
|
mZenButtonOn.requestFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user