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:
Jason Chiu
2019-01-24 16:32:31 +08:00
parent 5999ba5448
commit 1217bbec70
5 changed files with 73 additions and 43 deletions

View File

@@ -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
*/