Importance shift.
Change-Id: If39ee2c4665aa27de4e32b73ecf2d5917f7ed4ca
This commit is contained in:
@@ -33,7 +33,6 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements
|
|||||||
SeekBar.OnSeekBarChangeListener {
|
SeekBar.OnSeekBarChangeListener {
|
||||||
private static final String TAG = "ImportanceSeekBarPref";
|
private static final String TAG = "ImportanceSeekBarPref";
|
||||||
|
|
||||||
public static final int IMPORTANCE_PROGRESS_OFFSET = 2;
|
|
||||||
private Callback mCallback;
|
private Callback mCallback;
|
||||||
private TextView mSummaryTextView;
|
private TextView mSummaryTextView;
|
||||||
private String mSummary;
|
private String mSummary;
|
||||||
@@ -89,8 +88,6 @@ public class ImportanceSeekBarPreference extends SeekBarPreference implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String getProgressSummary(int progress) {
|
private String getProgressSummary(int progress) {
|
||||||
// Map progress 0-4 values to Importance's -2-2.
|
|
||||||
progress = progress - IMPORTANCE_PROGRESS_OFFSET;
|
|
||||||
switch (progress) {
|
switch (progress) {
|
||||||
case NotificationListenerService.Ranking.IMPORTANCE_NONE:
|
case NotificationListenerService.Ranking.IMPORTANCE_NONE:
|
||||||
return getContext().getString(
|
return getContext().getString(
|
||||||
|
@@ -135,13 +135,11 @@ public class TopicNotificationSettings extends SettingsPreferenceFragment {
|
|||||||
mTopicRow.importance == NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED
|
mTopicRow.importance == NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED
|
||||||
? NotificationListenerService.Ranking.IMPORTANCE_DEFAULT
|
? NotificationListenerService.Ranking.IMPORTANCE_DEFAULT
|
||||||
: mTopicRow.importance;
|
: mTopicRow.importance;
|
||||||
mImportance.setProgress(
|
mImportance.setProgress(importance);
|
||||||
importance + ImportanceSeekBarPreference.IMPORTANCE_PROGRESS_OFFSET);
|
|
||||||
mImportance.setCallback(new ImportanceSeekBarPreference.Callback() {
|
mImportance.setCallback(new ImportanceSeekBarPreference.Callback() {
|
||||||
@Override
|
@Override
|
||||||
public void onImportanceChanged(int progress) {
|
public void onImportanceChanged(int progress) {
|
||||||
mBackend.setImportance(mTopicRow.pkg, mTopicRow.uid, mTopicRow.topic,
|
mBackend.setImportance(mTopicRow.pkg, mTopicRow.uid, mTopicRow.topic, progress);
|
||||||
progress - ImportanceSeekBarPreference.IMPORTANCE_PROGRESS_OFFSET);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mPriority.setChecked(mTopicRow.priority);
|
mPriority.setChecked(mTopicRow.priority);
|
||||||
|
Reference in New Issue
Block a user