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

Commit 52b03b8c authored by Eugene Susla's avatar Eugene Susla Committed by android-build-merger
Browse files

Merge "Use wifi icon for wifi devices in companion chooser" into oc-dev am: 1888f634

am: 7853ba0f

Change-Id: I87369297c38c6d01fed56d1a15e5dcb37ad0adc6
parents f684547d 7853ba0f
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;
        }