Remove sub-text from the lines of AP list in Wi-Fi Slice
- Remove sub-text from the lines of AP list - Add colors to the AP names to indicate the connection status of each AP Fixes: 120685004 Bug: 120786304 Test: make RunSettingsRoboTests -j Change-Id: I7b879248528a293d14d959994bb054275f0d69a1
This commit is contained in:
@@ -957,6 +957,22 @@ public final class Utils extends com.android.settingslib.Utils {
|
||||
return new BitmapDrawable(null, bitmap);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the {@link Drawable} to a {@link Bitmap}.
|
||||
*/
|
||||
public static Bitmap drawableToBitmap(Drawable drawable) {
|
||||
if (drawable instanceof BitmapDrawable) {
|
||||
return ((BitmapDrawable)drawable).getBitmap();
|
||||
}
|
||||
|
||||
final Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(),
|
||||
drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
|
||||
final Canvas canvas = new Canvas(bitmap);
|
||||
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||
drawable.draw(canvas);
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the {@link Drawable} that represents the app icon
|
||||
*/
|
||||
|
Reference in New Issue
Block a user