diff options
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/drawable/ic_baseline_add_24.xml | 10 | ||||
-rw-r--r-- | app/src/main/res/drawable/ic_icon.xml | 24 | ||||
-rw-r--r-- | app/src/main/res/layout/activity_main.xml | 46 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_device.xml | 86 | ||||
-rw-r--r-- | app/src/main/res/menu/menu_main.xml | 14 | ||||
-rw-r--r-- | app/src/main/res/values-night/themes.xml | 16 | ||||
-rw-r--r-- | app/src/main/res/values/colors.xml | 10 | ||||
-rw-r--r-- | app/src/main/res/values/dimens.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 39 | ||||
-rw-r--r-- | app/src/main/res/values/themes.xml | 25 |
10 files changed, 274 insertions, 0 deletions
diff --git a/app/src/main/res/drawable/ic_baseline_add_24.xml b/app/src/main/res/drawable/ic_baseline_add_24.xml new file mode 100644 index 0000000..eb23254 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_add_24.xml @@ -0,0 +1,10 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24" + android:tint="?attr/colorControlNormal"> + <path + android:fillColor="@android:color/white" + android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/> +</vector> diff --git a/app/src/main/res/drawable/ic_icon.xml b/app/src/main/res/drawable/ic_icon.xml new file mode 100644 index 0000000..b9624de --- /dev/null +++ b/app/src/main/res/drawable/ic_icon.xml @@ -0,0 +1,24 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:viewportWidth="24" + android:viewportHeight="24" + android:width="24dp" + android:height="24dp"> + <path + android:pathData="M12 22c-5.52 0 -10 -4.48 -10 -10 0 -2.85 1.2 -5.41 3.11 -7.24l1.42 1.42c-1.55 1.46 -2.53 3.53 -2.53 5.82 0 4.41 3.59 8 8 8s8 -3.59 8 -8c0 -2.29 -0.98 -4.36 -2.53 -5.82l1.42 -1.42c1.91 1.83 3.11 4.39 3.11 7.24 0 5.52 -4.48 10 -10 10z" + android:fillColor="#000000" /> + <path + android:pathData="M12 18c-3.31 0 -6 -2.69 -6 -6 0 -1.74 0.75 -3.31 1.94 -4.4l1.42 1.42c-0.83 0.73 -1.36 1.79 -1.36 2.98 0 2.21 1.79 4 4 4s4 -1.79 4 -4c0 -1.19 -0.53 -2.25 -1.36 -2.98l1.42 -1.42c1.19 1.09 1.94 2.66 1.94 4.4 0 3.31 -2.69 6 -6 6z" + android:fillColor="#000000" /> + <path + android:pathData="M14 12c0 -0.74 -0.4 -1.38 -1 -1.72v-8.28h-2v8.28c-0.6 0.35 -1 0.98 -1 1.72 0 1.1 0.9 2 2 2s2 -0.9 2 -2z" + android:fillColor="#000000" /> + <path + android:pathData="M13.1925 12A1.1925 1.1785 0 0 1 10.8075 12A1.1925 1.1785 0 0 1 13.1925 12Z" + android:fillColor="#FFFFFF" /> + <path + android:pathData="M11.555 4.9574H12.44677V11.054H11.555V4.9574Z" + android:fillColor="#FFFFFF" /> + <path + android:pathData="M13 2.1074A1 0.71138 0 0 1 11 2.1074A1 0.71138 0 0 1 13 2.1074Z" + android:fillColor="#000000" /> +</vector>
\ No newline at end of file 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 diff --git a/app/src/main/res/menu/menu_main.xml b/app/src/main/res/menu/menu_main.xml new file mode 100644 index 0000000..5320159 --- /dev/null +++ b/app/src/main/res/menu/menu_main.xml @@ -0,0 +1,14 @@ +<menu 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" + tools:context="com.javispedro.rempe.MainActivity"> + <item + android:id="@+id/action_remove_all" + android:orderInCategory="100" + android:title="Remove all" /> + <item + android:id="@+id/action_settings" + android:orderInCategory="101" + android:title="@string/action_settings" + app:showAsAction="never" /> +</menu>
\ No newline at end of file diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml new file mode 100644 index 0000000..017308e --- /dev/null +++ b/app/src/main/res/values-night/themes.xml @@ -0,0 +1,16 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Theme.Rempe" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> + <!-- Primary brand color. --> + <item name="colorPrimary">@color/purple_200</item> + <item name="colorPrimaryVariant">@color/purple_700</item> + <item name="colorOnPrimary">@color/black</item> + <!-- Secondary brand color. --> + <item name="colorSecondary">@color/teal_200</item> + <item name="colorSecondaryVariant">@color/teal_200</item> + <item name="colorOnSecondary">@color/black</item> + <!-- Status bar color. --> + <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> + <!-- Customize your theme here. --> + </style> +</resources>
\ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="purple_200">#FFBB86FC</color> + <color name="purple_500">#FF6200EE</color> + <color name="purple_700">#FF3700B3</color> + <color name="teal_200">#FF03DAC5</color> + <color name="teal_700">#FF018786</color> + <color name="black">#FF000000</color> + <color name="white">#FFFFFFFF</color> +</resources>
\ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..cf00d3f --- /dev/null +++ b/app/src/main/res/values/dimens.xml @@ -0,0 +1,4 @@ +<resources> + <dimen name="fab_margin">16dp</dimen> + <dimen name="text_margin">16dp</dimen> +</resources>
\ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..97e603d --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,39 @@ +<resources> + <string name="app_name">Rempe</string> + <string name="action_remove_all">Remove all</string> + <string name="action_settings">Settings</string> + + <string name="fab_add_device">Add device...</string> + <string name="add_device_failed">Cannot connect to device: %1$s</string> + <string name="add_device_already">Device already on list</string> + + <string name="device_placeholder_name">Device</string> + <string name="device_placeholder_status">Status</string> + + <string name="temperature_nothing">--</string> + <string name="temperature_celsius">%1$s °C</string> + + <string name="signal_level">Signal:</string> + + <string name="state_dead">Disconnected</string> + <string name="state_closed">Disconnected</string> + <string name="state_searching">Searching</string> + <string name="state_tracking">Tracking</string> + <string name="state_processing">Processing request</string> + <string name="state_unrecognized">Unrecognized</string> + <string name="state_unknown">Unknown state</string> + + <string name="connection_result_success">Success</string> + <string name="connection_result_user_cancelled">User cancelled</string> + <string name="connection_result_channel_not_available">Channel not available</string> + <string name="connection_result_other_failure">Unknown failure</string> + <string name="connection_result_dependency_not_installed">ANT+ dependencies not installed</string> + <string name="connection_result_device_already_in_use">Device already in use</string> + <string name="connection_result_search_timeout">Search timed out</string> + <string name="connection_result_already_subscribed">Already subscribed</string> + <string name="connection_result_bad_params">Bad parameters</string> + <string name="connection_result_adapter_not_detected">Adapter not detected</string> + <string name="connection_result_unrecognized">Unrecognized device</string> + <string name="connection_result_unknown">Unknown failure</string> + +</resources>
\ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..e59570a --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,25 @@ +<resources xmlns:tools="http://schemas.android.com/tools"> + <!-- Base application theme. --> + <style name="Theme.Rempe" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> + <!-- Primary brand color. --> + <item name="colorPrimary">@color/purple_500</item> + <item name="colorPrimaryVariant">@color/purple_700</item> + <item name="colorOnPrimary">@color/white</item> + <!-- Secondary brand color. --> + <item name="colorSecondary">@color/teal_200</item> + <item name="colorSecondaryVariant">@color/teal_700</item> + <item name="colorOnSecondary">@color/black</item> + <!-- Status bar color. --> + <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> + <!-- Customize your theme here. --> + </style> + + <style name="Theme.Rempe.NoActionBar"> + <item name="windowActionBar">false</item> + <item name="windowNoTitle">true</item> + </style> + + <style name="Theme.Rempe.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> + + <style name="Theme.Rempe.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> +</resources>
\ No newline at end of file |