diff options
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r-- | app/src/main/res/layout/activity_main.xml | 46 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_device.xml | 86 |
2 files changed, 132 insertions, 0 deletions
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..fe4da78 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.coordinatorlayout.widget.CoordinatorLayout 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="match_parent" + tools:context=".MainActivity"> + + <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:layout_behavior="@string/appbar_scrolling_view_behavior" + app:layoutManager="LinearLayoutManager" + tools:context=".DeviceFragment" + tools:listitem="@layout/fragment_device"> + + </androidx.recyclerview.widget.RecyclerView> + + <com.google.android.material.appbar.AppBarLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:theme="@style/Theme.Rempe.AppBarOverlay"> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize" + android:background="?attr/colorPrimary" + app:popupTheme="@style/Theme.Rempe.PopupOverlay" /> + + </com.google.android.material.appbar.AppBarLayout> + + <com.google.android.material.floatingactionbutton.FloatingActionButton + android:id="@+id/fabAddDevice" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="bottom|end" + android:layout_margin="@dimen/fab_margin" + android:contentDescription="@string/fab_add_device" + app:srcCompat="@drawable/ic_baseline_add_24" /> + +</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_device.xml b/app/src/main/res/layout/fragment_device.xml new file mode 100644 index 0000000..0a39ba4 --- /dev/null +++ b/app/src/main/res/layout/fragment_device.xml @@ -0,0 +1,86 @@ +<?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" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + + <TextView + android:id="@+id/nameView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/device_placeholder_name" + android:textAppearance="@style/TextAppearance.AppCompat.Large" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/statusView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/device_placeholder_status" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/nameView" /> + + <TextView + android:id="@+id/temperatureView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + + android:text="@string/temperature_nothing" + android:textAppearance="@style/TextAppearance.AppCompat.Large" + android:textSize="72sp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintEnd_toEndOf="parent" /> + + <TextView + android:id="@+id/maxTemperatureView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + + android:text="@string/temperature_nothing" + android:textAppearance="@style/TextAppearance.AppCompat.Large" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toBottomOf="@+id/temperatureView" /> + + <View + android:id="@+id/minmaxTemperatureSeparator" + android:layout_width="1dp" + android:layout_height="0dp" + android:layout_marginEnd="8dp" + android:background="?android:attr/dividerVertical" + app:layout_constraintBottom_toBottomOf="@+id/maxTemperatureView" + app:layout_constraintEnd_toStartOf="@+id/maxTemperatureView" + app:layout_constraintTop_toTopOf="@+id/maxTemperatureView" /> + + <TextView + android:id="@+id/minTemperatureView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + + android:layout_marginEnd="8dp" + android:text="@string/temperature_nothing" + android:textAppearance="@style/TextAppearance.AppCompat.Large" + app:layout_constraintEnd_toStartOf="@+id/minmaxTemperatureSeparator" + app:layout_constraintTop_toTopOf="@+id/maxTemperatureView" /> + + <ProgressBar + android:id="@+id/signalBar" + style="?android:attr/progressBarStyleHorizontal" + android:layout_width="0dp" + android:layout_height="wrap_content" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/maxTemperatureView" /> + + <TextView + android:id="@+id/signalLabel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/signal_level" + android:visibility="invisible" + app:layout_constraintBottom_toTopOf="@+id/signalBar" + app:layout_constraintStart_toStartOf="@+id/signalBar" /> + +</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file |