Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0dc89bc8 authored by Chaohui Wang's avatar Chaohui Wang Committed by Android (Google) Code Review
Browse files

Merge "Fix Conversation page flickers when back" into tm-dev

parents 24654a3d d30d1a74
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -41,8 +41,7 @@ import java.util.List;

public abstract class ConversationListPreferenceController extends AbstractPreferenceController {

    private static final String KEY = "all_conversations";

    private static final String SUMMARY_KEY_SUFFIX = "_summary";
    protected final NotificationBackend mBackend;

    public ConversationListPreferenceController(Context context,
@@ -51,11 +50,6 @@ public abstract class ConversationListPreferenceController extends AbstractPrefe
        mBackend = backend;
    }

    @Override
    public String getPreferenceKey() {
        return KEY;
    }

    @Override
    public boolean isAvailable() {
        return true;
@@ -72,6 +66,7 @@ public abstract class ConversationListPreferenceController extends AbstractPrefe
        if (containerGroup.getPreferenceCount() != 0) {
            Preference summaryPref = getSummaryPreference();
            if (summaryPref != null) {
                summaryPref.setKey(getPreferenceKey() + SUMMARY_KEY_SUFFIX);
                containerGroup.addPreference(summaryPref);
            }
            containerGroup.setVisible(true);
+3 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.app.people.IPeopleManager;
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.ShortcutInfo;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.UserHandle;
@@ -51,6 +50,7 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC

    private static final String TAG = "RecentConversationsPC";
    private static final String KEY = "recent_conversations";
    private static final String CLEAR_ALL_KEY_SUFFIX = "_clear_all";
    private List<ConversationChannel> mConversations;
    private final IPeopleManager mPs;
    private final NotificationBackend mBackend;
@@ -72,9 +72,11 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC
        return true;
    }

    //TODO(b/233325816): Use ButtonPreference instead.
    LayoutPreference getClearAll(PreferenceGroup parent) {
        LayoutPreference pref = new LayoutPreference(
                mContext, R.layout.conversations_clear_recents);
        pref.setKey(getPreferenceKey() + CLEAR_ALL_KEY_SUFFIX);
        pref.setOrder(1);
        Button button = pref.findViewById(R.id.conversation_settings_clear_recents);
        button.setOnClickListener(v -> {