Skip to content

Commit 578857c

Browse files
committed
Reworked some UI models (still needs to be done for tablets)
1 parent cab7602 commit 578857c

15 files changed

+23
-19
lines changed

app/src/main/java/nl/hnogames/domoticz/adapters/DashboardAdapter.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -695,25 +695,24 @@ private void SetCameraBackGround(DevicesInfo mDeviceInfo, final DataObjectHolder
695695
});
696696

697697
final String imageUrl = domoticz.getSnapshotUrl(mDeviceInfo.getCameraIdx());
698-
holder.dummyImg.setVisibility(View.VISIBLE);
699-
holder.row_wrapper.setBackground(null);
700-
701698
Drawable cache = CameraUtil.getDrawable(imageUrl);
702699
if (cache == null) {
703700
picasso.load(imageUrl)
704701
.noPlaceholder()
702+
.noFade()
705703
.networkPolicy(NetworkPolicy.NO_CACHE, NetworkPolicy.NO_STORE)
706704
.into(holder.dummyImg, new Callback() {
707705
@Override
708706
public void onSuccess() {
707+
holder.contentWrapper.setBackgroundDrawable(holder.dummyImg.getDrawable());
708+
holder.dummyImg.setVisibility(View.GONE);
709709
CameraUtil.setDrawable(imageUrl, holder.dummyImg.getDrawable());
710710
}
711711

712712
@Override
713713
public void onError(Exception e) {
714714
if (holder.dummyImg.getDrawable() == null)
715715
holder.dummyImg.setVisibility(View.GONE);
716-
holder.row_wrapper.setBackgroundColor(listviewRowBackground);
717716
}
718717
});
719718
} else {
@@ -725,21 +724,22 @@ public void onError(Exception e) {
725724
.into(holder.dummyImg, new Callback() {
726725
@Override
727726
public void onSuccess() {
727+
holder.contentWrapper.setBackgroundDrawable(holder.dummyImg.getDrawable());
728+
holder.dummyImg.setImageDrawable(null);
729+
holder.dummyImg.setVisibility(View.GONE);
728730
CameraUtil.setDrawable(imageUrl, holder.dummyImg.getDrawable());
729731
}
730732

731733
@Override
732734
public void onError(Exception e) {
733735
if (holder.dummyImg.getDrawable() == null)
734736
holder.dummyImg.setVisibility(View.GONE);
735-
holder.row_wrapper.setBackgroundColor(listviewRowBackground);
736737
}
737738
});
738739
}
739740
} else {
740741
holder.full_screen_icon.setVisibility(View.GONE);
741742
holder.dummyImg.setVisibility(View.GONE);
742-
holder.row_wrapper.setBackgroundColor(listviewRowBackground);
743743
}
744744
}
745745

app/src/main/res/layout/dashboard_row.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131

3232
<nl.hnogames.domoticz.ads.TemplateView
3333
android:id="@+id/adview"
34-
android:background="@color/red_600"
3534
android:layout_width="fill_parent"
3635
android:layout_height="wrap_content"
3736
android:visibility="gone"
@@ -48,9 +47,9 @@
4847
android:layout_width="match_parent"
4948
android:layout_height="match_parent"
5049
android:adjustViewBounds="true"
51-
android:scaleType="fitCenter"
52-
android:tintMode="src_atop"
5350
android:visibility="gone"
51+
android:scaleType="centerCrop"
52+
android:tintMode="src_atop"
5453
app:tint="?attr/listviewRowTintBackground" />
5554

5655
<LinearLayout

app/src/main/res/layout/dashboard_row_noads.xml

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
app:cardElevation="1dp">
3131

3232
<RelativeLayout
33-
android:background="?attr/listviewRowBackground"
3433
android:id="@+id/contentWrapper"
3534
android:layout_width="match_parent"
3635
android:layout_height="wrap_content">
@@ -40,9 +39,9 @@
4039
android:layout_width="match_parent"
4140
android:layout_height="match_parent"
4241
android:adjustViewBounds="true"
43-
android:scaleType="fitCenter"
44-
android:tintMode="src_atop"
42+
android:scaleType="centerCrop"
4543
android:visibility="gone"
44+
android:tintMode="src_atop"
4645
app:tint="?attr/listviewRowTintBackground" />
4746

4847
<LinearLayout

app/src/main/res/layout/scene_row_default.xml

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
android:id="@+id/switch_name"
9999
style="@style/row_name"
100100
android:layout_width="fill_parent"
101+
android:layout_marginTop="-10dp"
101102
android:layout_height="wrap_content"
102103
android:layout_alignParentTop="true"
103104
android:layout_marginRight="35dp"

app/src/main/res/layout/scene_row_default_noads.xml

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
android:id="@+id/switch_name"
9494
style="@style/row_name"
9595
android:layout_width="fill_parent"
96+
android:layout_marginTop="-10dp"
9697
android:layout_height="wrap_content"
9798
android:layout_alignParentTop="true"
9899
android:layout_marginRight="35dp"

app/src/main/res/layout/switch_row_list.xml

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
android:id="@+id/switch_name"
114114
style="@style/row_name"
115115
android:layout_width="fill_parent"
116+
android:layout_marginTop="-10dp"
116117
android:layout_height="wrap_content"
117118
android:layout_alignParentTop="true"
118119
android:layout_marginRight="35dp"

app/src/main/res/layout/switch_row_list_noads.xml

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
style="@style/row_name"
108108
android:layout_width="fill_parent"
109109
android:layout_height="wrap_content"
110+
android:layout_marginTop="-10dp"
110111
android:layout_alignParentTop="true"
111112
android:layout_marginRight="35dp"
112113
android:text="Switch" />

app/src/main/res/layout/temperature_row_default.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,9 @@
8080
android:paddingRight="5dp"
8181
android:src="@drawable/clock48" />
8282

83-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
83+
<LinearLayout
8484
android:layout_width="wrap_content"
8585
android:layout_height="wrap_content"
86-
android:layout_marginBottom="10dp"
8786
android:orientation="vertical">
8887

8988
<RelativeLayout

app/src/main/res/layout/temperature_row_default_noads.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
7979
android:layout_width="wrap_content"
8080
android:layout_height="wrap_content"
81-
android:layout_marginBottom="10dp"
8281
android:orientation="vertical">
8382

8483
<RelativeLayout
@@ -104,11 +103,11 @@
104103
android:id="@+id/temperature_data"
105104
style="@style/row_body1"
106105
android:layout_width="wrap_content"
107-
android:layout_marginTop="-8dp"
108106
android:layout_height="wrap_content"
109107
android:layout_below="@+id/temperature_name"
110108
android:layout_alignParentStart="true"
111109
android:layout_alignParentLeft="true"
110+
android:layout_marginTop="-8dp"
112111
android:text="@string/temperature" />
113112

114113
<LinearLayout

app/src/main/res/layout/utilities_row_default.xml

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
android:id="@+id/utilities_name"
9090
style="@style/row_name"
9191
android:layout_width="wrap_content"
92+
android:layout_marginTop="-10dp"
9293
android:layout_height="wrap_content"
9394
android:layout_alignParentTop="true"
9495
tools:text="Utility name" />

app/src/main/res/layout/utilities_row_default_noads.xml

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
<TextView
8484
android:id="@+id/utilities_name"
8585
style="@style/row_name"
86+
android:layout_marginTop="-10dp"
8687
android:layout_width="wrap_content"
8788
android:layout_height="wrap_content"
8889
android:layout_alignParentTop="true"

app/src/main/res/layout/weather_row_default.xml

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
<TextView
101101
android:id="@+id/weather_name"
102102
style="@style/row_name"
103+
android:layout_marginTop="-10dp"
103104
android:layout_width="wrap_content"
104105
android:layout_height="wrap_content"
105106
tools:text="Utility name" />

app/src/main/res/layout/weather_row_default_noads.xml

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
<TextView
9696
android:id="@+id/weather_name"
9797
style="@style/row_name"
98+
android:layout_marginTop="-10dp"
9899
android:layout_width="wrap_content"
99100
android:layout_height="wrap_content"
100101
tools:text="Utility name" />

app/version.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Sun May 15 14:04:01 CEST 2022
2-
VERSION_BUILD=8698
1+
#Fri May 20 13:25:22 CEST 2022
2+
VERSION_BUILD=8730
33
VERSION_CODE=620
44
VERSION_PATCH=320

domoticzapi/version.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Sun May 15 14:04:01 CEST 2022
1+
#Fri May 20 13:25:22 CEST 2022
22
VERSION_BUILD=3675
33
VERSION_CODE=254
44
VERSION_PATCH=254

0 commit comments

Comments
 (0)