Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 254b3730 authored by Eugene Susla's avatar Eugene Susla
Browse files

Use wifi icon for wifi devices in companion chooser

Test: Ensure wifi devices have wifi icon
Change-Id: I08c9fba1acaefb097a010b1150cc052d5a397adc
parent 5b06dbd1
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -314,8 +314,8 @@ public class DeviceDiscoveryService extends Service {
    }

    class DevicesAdapter extends ArrayAdapter<DeviceFilterPair> {
        //TODO wifi icon
        private Drawable BLUETOOTH_ICON = icon(android.R.drawable.stat_sys_data_bluetooth);
        private Drawable WIFI_ICON = icon(com.android.internal.R.drawable.ic_wifi_signal_3);

        private Drawable icon(int drawableRes) {
            Drawable icon = getResources().getDrawable(drawableRes, null);
@@ -345,6 +345,11 @@ public class DeviceDiscoveryService extends Service {
                    device.equals(mSelectedDevice)
                            ? Color.GRAY
                            : Color.TRANSPARENT);
            textView.setCompoundDrawablesWithIntrinsicBounds(
                    device.device instanceof android.net.wifi.ScanResult
                        ? WIFI_ICON
                        : BLUETOOTH_ICON,
                    null, null, null);
            textView.setOnClickListener((view) -> {
                mSelectedDevice = device;
                notifyDataSetChanged();
@@ -357,8 +362,6 @@ public class DeviceDiscoveryService extends Service {
            textView.setTextColor(Color.BLACK);
            final int padding = DeviceChooserActivity.getPadding(getResources());
            textView.setPadding(padding, padding, padding, padding);
            textView.setCompoundDrawablesWithIntrinsicBounds(
                    BLUETOOTH_ICON, null, null, null);
            textView.setCompoundDrawablePadding(padding);
            return textView;
        }