Merge "Amend "Reset notification importance" list item style" am: aef592eb18
am: 9c8ff84746
am: 8601b70e1c
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2382194 Change-Id: I1e2cabff29c20c9a759743116ba9d57710c3d1bb Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -17,24 +17,20 @@
|
||||
package com.android.settings.notification;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.BasePreferenceController;
|
||||
import com.android.settingslib.widget.LayoutPreference;
|
||||
|
||||
public class ImportanceResetPreferenceController extends BasePreferenceController implements
|
||||
View.OnClickListener {
|
||||
public class ImportanceResetPreferenceController extends BasePreferenceController {
|
||||
|
||||
public static final String KEY = "asst_importance_reset";
|
||||
private static final String TAG = "ResetImportanceButton";
|
||||
|
||||
private NotificationBackend mBackend;
|
||||
private Button mButton;
|
||||
|
||||
public ImportanceResetPreferenceController(Context context, String key) {
|
||||
super(context, key);
|
||||
@@ -47,19 +43,14 @@ public class ImportanceResetPreferenceController extends BasePreferenceControlle
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
super.updateState(preference);
|
||||
|
||||
mButton = ((LayoutPreference) preference)
|
||||
.findViewById(R.id.reset_importance_button);
|
||||
mButton.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
public boolean handlePreferenceTreeClick(Preference preference) {
|
||||
if (!TextUtils.equals(preference.getKey(), getPreferenceKey())) {
|
||||
return false;
|
||||
}
|
||||
mBackend.resetNotificationImportance();
|
||||
Toast.makeText(mContext, R.string.reset_importance_completed, Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
.show();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user