From 39cba84ab1e8e5202e5179a4e4780f8ed229acfd Mon Sep 17 00:00:00 2001 From: Lem Dulfo Date: Sun, 10 Apr 2016 20:13:48 +0800 Subject: [PATCH] Apply gray images on non-connected devices in the list. --- .../gadgetbridge/adapter/GBDeviceAdapter.java | 24 +++++++++++++----- .../ic_device_pebble_disabled.png | Bin 0 -> 1008 bytes .../ic_device_pebble_disabled.png | Bin 0 -> 650 bytes .../ic_device_pebble_disabled.png | Bin 0 -> 1351 bytes .../ic_device_pebble_disabled.png | Bin 0 -> 2273 bytes app/src/main/res/layout/device_item.xml | 4 +-- 6 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 app/src/main/res/drawable-hdpi/ic_device_pebble_disabled.png create mode 100644 app/src/main/res/drawable-mdpi/ic_device_pebble_disabled.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_device_pebble_disabled.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_device_pebble_disabled.png diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapter.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapter.java index a1ed4359..92ca09b5 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapter.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/adapter/GBDeviceAdapter.java @@ -60,11 +60,11 @@ public class GBDeviceAdapter extends ArrayAdapter { 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 { 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; diff --git a/app/src/main/res/drawable-hdpi/ic_device_pebble_disabled.png b/app/src/main/res/drawable-hdpi/ic_device_pebble_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..c5772510cca6cd33dce8e8432355456347ade034 GIT binary patch literal 1008 zcmV+}zx!+1c68v$C=>wJ7*zHk+Rn78X9KtgL)=4b=U?nVFd> zo12@fo}8Sl86O|F1%p9HC={xP#>U1pBlx5GX6Js^PESw&nwpv_@9XO`-W!}qBogE| zJLfl6xR}nQaNo~nXJ>;dq?C>%!^Ffy*~rMq*}%X6)3eZra5!9kBQ}Z0oS~tipZo@j z-T|Qx{r&yF5t|T4MIl93D+IZoo}NFl0P5`QbXY8w*9hd-Al(fRqCZxHKp7?d|OmpctS?B$5D!0R0EjP0>$R_VBd4$Slp z2*;#2E?rq!5t6h=u5@Tmfat{`y?Q1R~qRFq++S3oi*ai$Cq(tu?GFVmT%aTa$^?I8*oG-=2#cxrPAOr{(BO5&s2-L~~sJ*?t0ZHVT z87Q+5DMf%8F^amoyQ^iX)$sfMH6MUr{}yHNmfff`ZSnfGk=Y zcI%*x8vznFkN}0{QmaBuSSkbZt>Y0!5|&8Z7{Y!+Yl2_!G1US2wvb|fE}$1Z2pBRl eGBPqU?bsE8OS00_UlV))0000g{W&R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*-=K&#}-7mYT8}bVp+P-~tWn13(bLPemtj zz`)`p-lYwyyXXsz;L9#GBVHc>0uBx!v<1n{L=b#InTagN$d_GeMp~Mlze@}UsI|FI zD8aA4c~{JpvC!8TUQ1wIski9;TSg?ZXfzs)Mx)VaG#V{p`vV2O6^|(F;)4JH002ov JPDHLkV1ndoTfG1P literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/ic_device_pebble_disabled.png b/app/src/main/res/drawable-xxhdpi/ic_device_pebble_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..c1eebfd5974537b27e16dd341de28826c8d03ab9 GIT binary patch literal 2273 zcmZ`*2{_bS8~^{!7{fHSY|Ry8yHsL`%fw}j31yq;hPc+Ur0g_eGFq(-%5E4pg)2!) zV+o~3wjs$@WEok;l3hf1^wslx_j$hWJZE{%`@FyNzUOz|^PUq+v@%5spacK_Kpr(C z*l@?Bod$<-`w5d#1^~c|juMPckOpRH@2zbe#F%%7&k#+!jULJ`;}J)c6t^L@S()`O z)?G)H_Q$SCu|Fxn=AXI~WFs{dQ7#GVFEV0d%jz=BQt=v0?`}SS#cD6IvezwR?D=Vn zss7TB>5=&-k-lXsdJ%cgR`c7kO^=Hm`9F2#+X<77%&0xykv?jLQ3I^6sah6(!)Q=^ zc6K&R$M1t~-Zqx=L5}K!OO+;Aky^AdoSst0&b~edMi{OdRQ=$=oX)`DR26?$iO)zS>rqqDQJ(z>b~CU$)>mPxio+7ugUL1dgX7%3Q1_*R69 z*r}eLo|8}98n2Hp4hb--s=}3K{b&kob9ym;8xX_cos(T8W8!RSG+JGWU0F|j#7im+ z2Fs0a8eP!Mv3UA5JMgeh&3Ffk6U;tU7v{nU$OpAmj>QNwcDdgojV_M29)sOs(ew&g zxxbrt)P zxa;<3lX3HKvI5cuMaXT(zpW7Bd1Hy!s)Q$D4K6NEnuGUFPTL}rIwQMBJ%TrSTdvKfmz4k_p7Qs_)GCscTkUvx-f;C4aVDUaM52kYP5Oqt zYUL^CZ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+eB@jNr&R}o0 zRFw%!Y3=Ajo==Uc$Me8J+WDbc>|>9no6ZY{dKc!T#g)fb7?Cu}Q~!^-L8rF;Qdo1# zIa5vp;g;y$#Y?h5{^|~O?$ON9U%M<#W}wp?PWqip@kEo}zS0#;uC0jnSc4F=S>yYY zg9xu!lEfJ#+p%?wZ&VcxH(%_I_LP9d+q&hn4`1!O)P`1xg}>=f)R%L4olP@jm!rau zTuSz0zvsZ*hNy=F{-6s*TdANNrIt5VIKD~1W`ZYD6z`?82vzVWt+w>LRW8+Z7RXpT zd&-f!^E+BG_8}%<%2t4_HmwFkE`FN9yr;fZ4La9LekItEa7R#?z_7u%?vlog0BPG; z1%H-c#gT`#-)2smfc3K^Oii T{b5;OfLo3pu_8RcyI%eW$RF$t literal 0 HcmV?d00001 diff --git a/app/src/main/res/layout/device_item.xml b/app/src/main/res/layout/device_item.xml index 5813e1a6..18431f2b 100644 --- a/app/src/main/res/layout/device_item.xml +++ b/app/src/main/res/layout/device_item.xml @@ -73,17 +73,15 @@ -