Loading res/xml/conversation_list_settings.xml +3 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ <PreferenceCategory android:key="important_conversations" android:title="@string/important_conversations" android:visibility="gone" settings:isPreferenceVisible="false" settings:allowDividerAbove="false" settings:allowDividerBelow="true" > <Preference Loading @@ -48,6 +48,7 @@ <PreferenceCategory android:title="@string/other_conversations" android:key="other_conversations" settings:isPreferenceVisible="false" settings:allowDividerAbove="true" settings:allowDividerBelow="false" /> Loading @@ -55,6 +56,7 @@ <PreferenceCategory android:title="@string/recent_conversations" android:key="recent_conversations" settings:isPreferenceVisible="false" settings:allowDividerAbove="true" settings:allowDividerBelow="false" /> Loading src/com/android/settings/notification/app/AllConversationsPreferenceController.java +5 −16 Original line number Diff line number Diff line Loading @@ -68,21 +68,10 @@ public class AllConversationsPreferenceController extends ConversationListPrefer public void updateState(Preference preference) { PreferenceCategory pref = (PreferenceCategory) preference; // Load conversations new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... unused) { mConversations = mBackend.getConversations(false).getList(); Collections.sort(mConversations, mConversationComparator); return null; } @Override protected void onPostExecute(Void unused) { if (mContext == null) { return; } populateList(mConversations, pref); } }.execute(); } } src/com/android/settings/notification/app/ConversationListPreferenceController.java +2 −2 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ public abstract class ConversationListPreferenceController extends AbstractPrefe protected void populateList(List<ConversationChannelWrapper> conversations, PreferenceGroup containerGroup) { // TODO: if preference has children, compare with newly loaded list containerGroup.setVisible(false); containerGroup.removeAll(); if (conversations != null) { populateConversations(conversations, containerGroup); Loading @@ -72,11 +72,11 @@ public abstract class ConversationListPreferenceController extends AbstractPrefe if (containerGroup.getPreferenceCount() == 0) { containerGroup.setVisible(false); } else { containerGroup.setVisible(true); Preference summaryPref = getSummaryPreference(); if (summaryPref != null) { containerGroup.addPreference(summaryPref); } containerGroup.setVisible(true); } } Loading src/com/android/settings/notification/app/PriorityConversationsPreferenceController.java +3 −16 Original line number Diff line number Diff line Loading @@ -67,22 +67,9 @@ public class PriorityConversationsPreferenceController extends public void updateState(Preference preference) { PreferenceCategory pref = (PreferenceCategory) preference; // Load conversations new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... unused) { mConversations = mBackend.getConversations(true).getList(); Collections.sort(mConversations, mConversationComparator); return null; } @Override protected void onPostExecute(Void unused) { if (mContext == null) { return; } populateList(mConversations, pref); } }.execute(); } } src/com/android/settings/notification/app/RecentConversationsPreferenceController.java +7 −19 Original line number Diff line number Diff line Loading @@ -104,26 +104,14 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC public void updateState(Preference preference) { PreferenceCategory pref = (PreferenceCategory) preference; // Load conversations new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... unused) { try { mConversations = mPs.getRecentConversations().getList(); } catch (RemoteException e) { Slog.w(TAG, "Could get recents", e); } Collections.sort(mConversations, mConversationComparator); return null; } @Override protected void onPostExecute(Void unused) { if (mContext == null) { return; } populateList(mConversations, pref); } }.execute(); } Loading Loading
res/xml/conversation_list_settings.xml +3 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ <PreferenceCategory android:key="important_conversations" android:title="@string/important_conversations" android:visibility="gone" settings:isPreferenceVisible="false" settings:allowDividerAbove="false" settings:allowDividerBelow="true" > <Preference Loading @@ -48,6 +48,7 @@ <PreferenceCategory android:title="@string/other_conversations" android:key="other_conversations" settings:isPreferenceVisible="false" settings:allowDividerAbove="true" settings:allowDividerBelow="false" /> Loading @@ -55,6 +56,7 @@ <PreferenceCategory android:title="@string/recent_conversations" android:key="recent_conversations" settings:isPreferenceVisible="false" settings:allowDividerAbove="true" settings:allowDividerBelow="false" /> Loading
src/com/android/settings/notification/app/AllConversationsPreferenceController.java +5 −16 Original line number Diff line number Diff line Loading @@ -68,21 +68,10 @@ public class AllConversationsPreferenceController extends ConversationListPrefer public void updateState(Preference preference) { PreferenceCategory pref = (PreferenceCategory) preference; // Load conversations new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... unused) { mConversations = mBackend.getConversations(false).getList(); Collections.sort(mConversations, mConversationComparator); return null; } @Override protected void onPostExecute(Void unused) { if (mContext == null) { return; } populateList(mConversations, pref); } }.execute(); } }
src/com/android/settings/notification/app/ConversationListPreferenceController.java +2 −2 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ public abstract class ConversationListPreferenceController extends AbstractPrefe protected void populateList(List<ConversationChannelWrapper> conversations, PreferenceGroup containerGroup) { // TODO: if preference has children, compare with newly loaded list containerGroup.setVisible(false); containerGroup.removeAll(); if (conversations != null) { populateConversations(conversations, containerGroup); Loading @@ -72,11 +72,11 @@ public abstract class ConversationListPreferenceController extends AbstractPrefe if (containerGroup.getPreferenceCount() == 0) { containerGroup.setVisible(false); } else { containerGroup.setVisible(true); Preference summaryPref = getSummaryPreference(); if (summaryPref != null) { containerGroup.addPreference(summaryPref); } containerGroup.setVisible(true); } } Loading
src/com/android/settings/notification/app/PriorityConversationsPreferenceController.java +3 −16 Original line number Diff line number Diff line Loading @@ -67,22 +67,9 @@ public class PriorityConversationsPreferenceController extends public void updateState(Preference preference) { PreferenceCategory pref = (PreferenceCategory) preference; // Load conversations new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... unused) { mConversations = mBackend.getConversations(true).getList(); Collections.sort(mConversations, mConversationComparator); return null; } @Override protected void onPostExecute(Void unused) { if (mContext == null) { return; } populateList(mConversations, pref); } }.execute(); } }
src/com/android/settings/notification/app/RecentConversationsPreferenceController.java +7 −19 Original line number Diff line number Diff line Loading @@ -104,26 +104,14 @@ public class RecentConversationsPreferenceController extends AbstractPreferenceC public void updateState(Preference preference) { PreferenceCategory pref = (PreferenceCategory) preference; // Load conversations new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... unused) { try { mConversations = mPs.getRecentConversations().getList(); } catch (RemoteException e) { Slog.w(TAG, "Could get recents", e); } Collections.sort(mConversations, mConversationComparator); return null; } @Override protected void onPostExecute(Void unused) { if (mContext == null) { return; } populateList(mConversations, pref); } }.execute(); } Loading