use of androidx.core.graphics.drawable.IconCompat in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiSlice method getLoadingRow.
private ListBuilder.RowBuilder getLoadingRow(CharSequence placeholder) {
final CharSequence title = mContext.getText(R.string.wifi_empty_list_wifi_on);
// for aligning to the Wi-Fi AP's name
final IconCompat emptyIcon = Utils.createIconWithDrawable(new ColorDrawable(Color.TRANSPARENT));
return new ListBuilder.RowBuilder().setTitleItem(emptyIcon, ListBuilder.ICON_IMAGE).setTitle(placeholder).setSubtitle(title);
}
use of androidx.core.graphics.drawable.IconCompat in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiSlice method getAccessPointRow.
private ListBuilder.RowBuilder getAccessPointRow(AccessPoint accessPoint) {
final boolean isCaptivePortal = accessPoint.isActive() && isCaptivePortal();
final CharSequence title = accessPoint.getTitle();
final CharSequence summary = getAccessPointSummary(accessPoint, isCaptivePortal);
final IconCompat levelIcon = getAccessPointLevelIcon(accessPoint);
final ListBuilder.RowBuilder rowBuilder = new ListBuilder.RowBuilder().setTitleItem(levelIcon, ListBuilder.ICON_IMAGE).setTitle(title).setSubtitle(summary).setPrimaryAction(getAccessPointAction(accessPoint, isCaptivePortal, levelIcon, title));
if (isCaptivePortal) {
rowBuilder.addEndItem(getCaptivePortalEndAction(accessPoint, title));
} else {
final IconCompat endIcon = getEndIcon(accessPoint);
if (endIcon != null) {
rowBuilder.addEndItem(endIcon, ListBuilder.ICON_IMAGE);
}
}
return rowBuilder;
}
use of androidx.core.graphics.drawable.IconCompat in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class UtilsTest method createIconWithDrawable_VectorDrawable.
@Test
public void createIconWithDrawable_VectorDrawable() {
final VectorDrawable drawable = VectorDrawable.create(mContext.getResources(), R.drawable.ic_settings_accent);
final IconCompat icon = Utils.createIconWithDrawable(drawable);
assertThat(icon.getBitmap()).isNotNull();
}
use of androidx.core.graphics.drawable.IconCompat in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class UtilsTest method createIconWithDrawable_BitmapDrawable.
@Test
public void createIconWithDrawable_BitmapDrawable() {
final Bitmap bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888);
final BitmapDrawable drawable = new BitmapDrawable(mContext.getResources(), bitmap);
final IconCompat icon = Utils.createIconWithDrawable(drawable);
assertThat(icon.getBitmap()).isNotNull();
}
use of androidx.core.graphics.drawable.IconCompat in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class UtilsTest method createIconWithDrawable_ColorDrawable.
@Test
public void createIconWithDrawable_ColorDrawable() {
final ColorDrawable drawable = new ColorDrawable(Color.BLACK);
final IconCompat icon = Utils.createIconWithDrawable(drawable);
assertThat(icon.getBitmap()).isNotNull();
}
Aggregations