Add setting page for swipe to notification.

In this change input & gesture page added 5 separate gesture
preferences, each should lead to a new page to set gesture setting. For
now only swipe to notification preference is wired up. Will implement
the rest in later changes.

Bug: 32637613
Test: make RunSettingsRoboTests -j40
Change-Id: I57ceea8fcd85f3a0ab59cbd12da50b7138f5ca0c
This commit is contained in:
Fan Zhang
2016-11-08 12:45:26 -08:00
parent 50e19f6e8f
commit b52c50d01d
9 changed files with 214 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ import android.provider.Settings;
import android.support.v7.preference.Preference;
import android.support.v7.preference.TwoStatePreference;
import com.android.settings.R;
import com.android.settings.core.PreferenceController;
public class SwipeToNotificationPreferenceController extends PreferenceController
@@ -45,8 +46,15 @@ public class SwipeToNotificationPreferenceController extends PreferenceControlle
@Override
public void updateState(Preference preference) {
super.updateState(preference);
if (preference != null && preference instanceof TwoStatePreference) {
((TwoStatePreference) preference).setChecked(isSystemUINavigationEnabled());
final boolean isEnabled = isSystemUINavigationEnabled();
if (preference != null) {
if (preference instanceof TwoStatePreference) {
((TwoStatePreference) preference).setChecked(isEnabled);
} else {
preference.setSummary(isEnabled
? R.string.gesture_setting_on
: R.string.gesture_setting_off);
}
}
}