Fixed One-Handed preference item’s second line should show on/off
status in Settings > System > Gesture > One-Handed. To override getSummary() method to display on/off status in One-Handed preference item’s second line. Bug: 154600203 Test: manual Change-Id: Ic9a5b74fbca041a08e712d5529b66e672f0c74ab
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.settings.gestures;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settings.core.TogglePreferenceController;
|
||||
|
||||
@@ -46,4 +47,11 @@ public class OneHandedEnablePreferenceController extends TogglePreferenceControl
|
||||
public boolean isChecked() {
|
||||
return OneHandedSettingsUtils.isOneHandedModeEnabled(mContext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getSummary() {
|
||||
return OneHandedSettingsUtils.isOneHandedModeEnabled(mContext)
|
||||
? mContext.getText(R.string.switch_on_text)
|
||||
: mContext.getText(R.string.switch_off_text);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user