use of com.android.settings.notification.app.ImportancePreference in project android_packages_apps_Settings by omnirom.
the class ImportancePreferenceTest method setImportanceSummary_default.
@Test
public void setImportanceSummary_default() {
final ImportancePreference preference = spy(new ImportancePreference(mContext));
final LayoutInflater inflater = LayoutInflater.from(mContext);
final PreferenceViewHolder holder = PreferenceViewHolder.createInstanceForTests(inflater.inflate(R.layout.notif_importance_preference, null));
preference.setConfigurable(true);
preference.setImportance(IMPORTANCE_DEFAULT);
preference.onBindViewHolder(holder);
TextView tv = holder.itemView.findViewById(R.id.alert_summary);
preference.setDisplayInStatusBar(true);
preference.setDisplayOnLockscreen(true);
preference.setImportanceSummary((ViewGroup) holder.itemView, IMPORTANCE_DEFAULT, true);
assertThat(tv.getText()).isEqualTo(mContext.getString(R.string.notification_channel_summary_default));
}
Aggregations