Merge "Support updated rendering of conversation icons." into rvc-dev

This commit is contained in:
Daniel Sandler
2020-02-28 00:26:10 +00:00
committed by Android (Google) Code Review
8 changed files with 23 additions and 15 deletions

View File

@@ -127,7 +127,8 @@ public class AppConversationListPreferenceController extends NotificationPrefere
conversation.getParentChannelLabel(), conversation.getGroupLabel())
: conversation.getParentChannelLabel());
if (si != null) {
pref.setIcon(mBackend.getConversationDrawable(mContext, si, mAppRow.pkg, mAppRow.uid));
pref.setIcon(mBackend.getConversationDrawable(mContext, si, mAppRow.pkg, mAppRow.uid,
conversation.getNotificationChannel().isImportantConversation()));
}
pref.setKey(conversation.getNotificationChannel().getId());

View File

@@ -86,6 +86,7 @@ public class ConversationHeaderPreferenceController extends NotificationPreferen
.setHasAppInfoLink(true)
.setRecyclerView(mFragment.getListView(), mFragment.getSettingsLifecycle())
.done(activity, mContext);
pref.findViewById(R.id.entity_header).setVisibility(View.VISIBLE);
}
}

View File

@@ -74,8 +74,8 @@ public class ConversationImportantPreferenceController extends NotificationPrefe
mChannel.setImportantConversation(value);
if (value && bubbleImportantConversations()) {
mChannel.setAllowBubbles(true);
mDependentFieldListener.onFieldValueChanged();
}
mDependentFieldListener.onFieldValueChanged();
saveChannel();
return true;

View File

@@ -88,7 +88,8 @@ public abstract class ConversationListPreferenceController extends AbstractPrefe
pref.setTitle(getTitle(conversation));
pref.setSummary(getSummary(conversation));
pref.setIcon(mBackend.getConversationDrawable(mContext, conversation.getShortcutInfo(),
conversation.getPkg(), conversation.getUid()));
conversation.getPkg(), conversation.getUid(),
conversation.getNotificationChannel().isImportantConversation()));
pref.setKey(conversation.getNotificationChannel().getId());
pref.setIntent(getIntent(conversation, pref.getTitle()));

View File

@@ -49,6 +49,7 @@ import com.android.settings.applications.AppInfoBase;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.notification.NotificationBackend;
import com.android.settingslib.RestrictedLockUtilsInternal;
import com.android.settingslib.notification.ConversationIconFactory;
import java.util.ArrayList;
import java.util.List;
@@ -204,7 +205,8 @@ abstract public class NotificationSettings extends DashboardFragment {
mContext, mPkg, mUid, mChannel.getConversationId());
if (mConversationInfo != null) {
mConversationDrawable = mBackend.getConversationDrawable(
mContext, mConversationInfo, mAppRow.pkg, mAppRow.uid);
mContext, mConversationInfo, mAppRow.pkg, mAppRow.uid,
mChannel.isImportantConversation());
}
}
@@ -329,6 +331,12 @@ abstract public class NotificationSettings extends DashboardFragment {
protected class DependentFieldListener {
protected void onFieldValueChanged() {
// Reload the conversation drawable, which shows some channel/conversation state
if (mConversationDrawable != null && mConversationDrawable
instanceof ConversationIconFactory.ConversationIconDrawable) {
((ConversationIconFactory.ConversationIconDrawable) mConversationDrawable)
.setImportant(mChannel.isImportantConversation());
}
final PreferenceScreen screen = getPreferenceScreen();
for (NotificationPreferenceController controller : mControllers) {
controller.displayPreference(screen);