mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-26 18:45:49 +01:00
Apply gray images on non-connected devices in the list.
This commit is contained in:
parent
e5726075a4
commit
39cba84ab1
@ -60,11 +60,11 @@ public class GBDeviceAdapter extends ArrayAdapter<GBDevice> {
|
|||||||
if (device.isBusy()) {
|
if (device.isBusy()) {
|
||||||
deviceStatusLabel.setText(device.getBusyTask());
|
deviceStatusLabel.setText(device.getBusyTask());
|
||||||
busyIndicator.setVisibility(View.VISIBLE);
|
busyIndicator.setVisibility(View.VISIBLE);
|
||||||
batteryLabel.setVisibility(View.GONE);
|
batteryLabel.setVisibility(View.INVISIBLE);
|
||||||
batteryStatusLabel.setVisibility(View.GONE);
|
batteryStatusLabel.setVisibility(View.INVISIBLE);
|
||||||
} else {
|
} else {
|
||||||
deviceStatusLabel.setText(device.getStateString());
|
deviceStatusLabel.setText(device.getStateString());
|
||||||
busyIndicator.setVisibility(View.GONE);
|
busyIndicator.setVisibility(View.INVISIBLE);
|
||||||
batteryLabel.setVisibility(View.VISIBLE);
|
batteryLabel.setVisibility(View.VISIBLE);
|
||||||
batteryStatusLabel.setVisibility(View.VISIBLE);
|
batteryStatusLabel.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
@ -113,13 +113,25 @@ public class GBDeviceAdapter extends ArrayAdapter<GBDevice> {
|
|||||||
|
|
||||||
switch (device.getType()) {
|
switch (device.getType()) {
|
||||||
case PEBBLE:
|
case PEBBLE:
|
||||||
deviceImageView.setImageResource(R.drawable.ic_device_pebble);
|
if (device.isConnected()) {
|
||||||
|
deviceImageView.setImageResource(R.drawable.ic_device_pebble);
|
||||||
|
} else {
|
||||||
|
deviceImageView.setImageResource(R.drawable.ic_device_pebble_disabled);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case MIBAND:
|
case MIBAND:
|
||||||
deviceImageView.setImageResource(R.drawable.ic_device_miband);
|
if (device.isConnected()) {
|
||||||
|
deviceImageView.setImageResource(R.drawable.ic_device_miband);
|
||||||
|
} else {
|
||||||
|
deviceImageView.setImageResource(R.drawable.ic_device_miband_disabled);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
deviceImageView.setImageResource(R.drawable.ic_launcher);
|
if (device.isConnected()) {
|
||||||
|
deviceImageView.setImageResource(R.drawable.ic_launcher);
|
||||||
|
} else {
|
||||||
|
deviceImageView.setImageResource(R.drawable.ic_device_default_disabled);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
|
BIN
app/src/main/res/drawable-hdpi/ic_device_pebble_disabled.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ic_device_pebble_disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1008 B |
BIN
app/src/main/res/drawable-mdpi/ic_device_pebble_disabled.png
Normal file
BIN
app/src/main/res/drawable-mdpi/ic_device_pebble_disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 650 B |
BIN
app/src/main/res/drawable-xhdpi/ic_device_pebble_disabled.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_device_pebble_disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_device_pebble_disabled.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_device_pebble_disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
@ -73,17 +73,15 @@
|
|||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/device_busy_indicator"
|
android:id="@+id/device_busy_indicator"
|
||||||
|
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||||
android:layout_width="140dp"
|
android:layout_width="140dp"
|
||||||
android:layout_height="4dp"
|
android:layout_height="4dp"
|
||||||
android:layout_rowSpan="1"
|
|
||||||
android:indeterminate="true"
|
android:indeterminate="true"
|
||||||
android:visibility="visible"
|
android:visibility="visible"
|
||||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
</GridLayout>
|
</GridLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/device_item_infos"
|
android:id="@+id/device_item_infos"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
Loading…
Reference in New Issue
Block a user