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

@@ -21,9 +21,6 @@ import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
@@ -84,17 +81,6 @@ public class BluetoothDevicesSlice implements CustomSliceable {
mContext = context;
}
private static Bitmap getBitmapFromVectorDrawable(Drawable VectorDrawable) {
final Bitmap bitmap = Bitmap.createBitmap(VectorDrawable.getIntrinsicWidth(),
VectorDrawable.getIntrinsicHeight(), Config.ARGB_8888);
final Canvas canvas = new Canvas(bitmap);
VectorDrawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
VectorDrawable.draw(canvas);
return bitmap;
}
@Override
public Uri getUri() {
return CustomSliceRegistry.BLUETOOTH_DEVICES_SLICE_URI;
@@ -234,7 +220,7 @@ public class BluetoothDevicesSlice implements CustomSliceable {
.getBtClassDrawableWithDescription(mContext, device);
if (pair.first != null) {
return IconCompat.createWithBitmap(getBitmapFromVectorDrawable(pair.first));
return IconCompat.createWithBitmap(Utils.drawableToBitmap(pair.first));
} else {
return IconCompat.createWithResource(mContext,
com.android.internal.R.drawable.ic_settings_bluetooth);