mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-25 10:05: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()) {
|
||||
deviceStatusLabel.setText(device.getBusyTask());
|
||||
busyIndicator.setVisibility(View.VISIBLE);
|
||||
batteryLabel.setVisibility(View.GONE);
|
||||
batteryStatusLabel.setVisibility(View.GONE);
|
||||
batteryLabel.setVisibility(View.INVISIBLE);
|
||||
batteryStatusLabel.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
deviceStatusLabel.setText(device.getStateString());
|
||||
busyIndicator.setVisibility(View.GONE);
|
||||
busyIndicator.setVisibility(View.INVISIBLE);
|
||||
batteryLabel.setVisibility(View.VISIBLE);
|
||||
batteryStatusLabel.setVisibility(View.VISIBLE);
|
||||
}
|
||||
@ -113,13 +113,25 @@ public class GBDeviceAdapter extends ArrayAdapter<GBDevice> {
|
||||
|
||||
switch (device.getType()) {
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
|
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
|
||||
android:id="@+id/device_busy_indicator"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="140dp"
|
||||
android:layout_height="4dp"
|
||||
android:layout_rowSpan="1"
|
||||
android:indeterminate="true"
|
||||
android:visibility="visible"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
tools:visibility="visible" />
|
||||
</GridLayout>
|
||||
|
||||
|
||||
|
||||
<ListView
|
||||
android:id="@+id/device_item_infos"
|
||||
android:layout_width="match_parent"
|
||||
|
Loading…
Reference in New Issue
Block a user