diff options
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r-- | app/src/main/res/layout/activity_main.xml | 27 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_device.xml | 38 |
2 files changed, 51 insertions, 14 deletions
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index fe4da78..aecd8c6 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -6,19 +6,24 @@ android:layout_height="match_parent" tools:context=".MainActivity"> - <androidx.recyclerview.widget.RecyclerView - android:id="@+id/list" - android:name="com.javispedro.rempe.DeviceFragment" + <androidx.swiperefreshlayout.widget.SwipeRefreshLayout + android:id="@+id/srlList" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_marginLeft="16dp" - android:layout_marginRight="16dp" - app:layout_behavior="@string/appbar_scrolling_view_behavior" - app:layoutManager="LinearLayoutManager" - tools:context=".DeviceFragment" - tools:listitem="@layout/fragment_device"> - - </androidx.recyclerview.widget.RecyclerView> + app:layout_behavior="@string/appbar_scrolling_view_behavior"> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/list" + android:name="com.javispedro.rempe.DeviceFragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginLeft="16dp" + android:layout_marginRight="16dp" + app:layoutManager="LinearLayoutManager" + tools:context=".DeviceFragment" + tools:listitem="@layout/fragment_device" /> + + </androidx.swiperefreshlayout.widget.SwipeRefreshLayout> <com.google.android.material.appbar.AppBarLayout android:layout_width="match_parent" diff --git a/app/src/main/res/layout/fragment_device.xml b/app/src/main/res/layout/fragment_device.xml index 0a39ba4..74e067d 100644 --- a/app/src/main/res/layout/fragment_device.xml +++ b/app/src/main/res/layout/fragment_device.xml @@ -1,9 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="horizontal"> + android:orientation="horizontal" + android:padding="16dp"> <TextView android:id="@+id/nameView" @@ -22,6 +24,25 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/nameView" /> + <ImageView + android:id="@+id/statusImageView" + android:layout_width="20dp" + android:layout_height="20dp" + android:layout_marginStart="8dp" + android:visibility="invisible" + app:layout_constraintStart_toEndOf="@+id/statusView" + app:layout_constraintTop_toTopOf="@+id/statusView" /> + + <ProgressBar + android:id="@+id/statusProgressBar" + style="?android:attr/progressBarStyle" + android:layout_width="20dp" + android:layout_height="20dp" + android:layout_marginStart="8dp" + android:indeterminate="true" + app:layout_constraintStart_toEndOf="@+id/statusView" + app:layout_constraintTop_toTopOf="@+id/statusView" /> + <TextView android:id="@+id/temperatureView" android:layout_width="wrap_content" @@ -30,8 +51,19 @@ android:text="@string/temperature_nothing" android:textAppearance="@style/TextAppearance.AppCompat.Large" android:textSize="72sp" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintEnd_toEndOf="parent" /> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/minmaxTemperatureLabel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:text="@string/last_24h" + android:visibility="invisible" + app:layout_constraintBottom_toBottomOf="@+id/minTemperatureView" + app:layout_constraintEnd_toStartOf="@+id/minTemperatureView" + app:layout_constraintTop_toTopOf="@+id/minTemperatureView" /> <TextView android:id="@+id/maxTemperatureView" |