use of com.android.settingslib.drawable.UserIconDrawable in project android_packages_apps_Settings by DirtyUnicorns.
the class UserProfileControllerTest method iconCallbackChangesPreferenceIcon.
@Test
public void iconCallbackChangesPreferenceIcon() throws Exception {
SparseArray<Drawable> icons = new SparseArray<>();
Bitmap userBitmap = BitmapFactory.decodeResource(RuntimeEnvironment.application.getResources(), R.drawable.home);
UserIconDrawable drawable = new UserIconDrawable(100).setIcon(userBitmap).bake();
icons.put(10, drawable);
mController.handleUserIcons(icons);
final ArgumentCaptor<Preference> argumentCaptor = ArgumentCaptor.forClass(Preference.class);
verify(mScreen).addPreference(argumentCaptor.capture());
Preference preference = argumentCaptor.getValue();
assertThat(preference.getIcon()).isEqualTo(drawable);
}
use of com.android.settingslib.drawable.UserIconDrawable in project android_packages_apps_Settings by DirtyUnicorns.
the class SecondaryUserControllerTest method iconCallbackChangesPreferenceIcon.
@Test
public void iconCallbackChangesPreferenceIcon() throws Exception {
SparseArray<Drawable> icons = new SparseArray<>();
Bitmap userBitmap = BitmapFactory.decodeResource(RuntimeEnvironment.application.getResources(), R.drawable.home);
UserIconDrawable drawable = new UserIconDrawable(100).setIcon(userBitmap).bake();
icons.put(10, drawable);
mPrimaryUser.name = TEST_NAME;
mPrimaryUser.id = 10;
mController.displayPreference(mScreen);
mController.handleUserIcons(icons);
final ArgumentCaptor<Preference> argumentCaptor = ArgumentCaptor.forClass(Preference.class);
verify(mGroup).addPreference(argumentCaptor.capture());
Preference preference = argumentCaptor.getValue();
assertThat(preference.getIcon()).isEqualTo(drawable);
}
use of com.android.settingslib.drawable.UserIconDrawable in project android_packages_apps_Settings by crdroidandroid.
the class SecondaryUserControllerTest method iconCallbackChangesPreferenceIcon.
@Test
public void iconCallbackChangesPreferenceIcon() throws Exception {
SparseArray<Drawable> icons = new SparseArray<>();
Bitmap userBitmap = BitmapFactory.decodeResource(RuntimeEnvironment.application.getResources(), R.drawable.home);
UserIconDrawable drawable = new UserIconDrawable(100).setIcon(userBitmap).bake();
icons.put(10, drawable);
mPrimaryUser.name = TEST_NAME;
mPrimaryUser.id = 10;
mController.displayPreference(mScreen);
mController.handleUserIcons(icons);
final ArgumentCaptor<Preference> argumentCaptor = ArgumentCaptor.forClass(Preference.class);
verify(mGroup).addPreference(argumentCaptor.capture());
Preference preference = argumentCaptor.getValue();
assertThat(preference.getIcon()).isEqualTo(drawable);
}
use of com.android.settingslib.drawable.UserIconDrawable in project android_packages_apps_Settings by crdroidandroid.
the class UserProfileControllerTest method iconCallbackChangesPreferenceIcon.
@Test
public void iconCallbackChangesPreferenceIcon() throws Exception {
SparseArray<Drawable> icons = new SparseArray<>();
Bitmap userBitmap = BitmapFactory.decodeResource(RuntimeEnvironment.application.getResources(), R.drawable.home);
UserIconDrawable drawable = new UserIconDrawable(100).setIcon(userBitmap).bake();
icons.put(10, drawable);
mController.handleUserIcons(icons);
final ArgumentCaptor<Preference> argumentCaptor = ArgumentCaptor.forClass(Preference.class);
verify(mScreen).addPreference(argumentCaptor.capture());
Preference preference = argumentCaptor.getValue();
assertThat(preference.getIcon()).isEqualTo(drawable);
}
use of com.android.settingslib.drawable.UserIconDrawable in project android_packages_apps_Settings by SudaMod.
the class SecondaryUserControllerTest method setIcon_doesntNpeOnNullPreference.
@Test
public void setIcon_doesntNpeOnNullPreference() throws Exception {
SparseArray<Drawable> icons = new SparseArray<>();
Bitmap userBitmap = BitmapFactory.decodeResource(RuntimeEnvironment.application.getResources(), R.drawable.home);
UserIconDrawable drawable = new UserIconDrawable(100).setIcon(userBitmap).bake();
icons.put(10, drawable);
mPrimaryUser.name = TEST_NAME;
mPrimaryUser.id = 10;
mController.handleUserIcons(icons);
// Doesn't crash
}
Aggregations