From 0935cd88d434f26fe958aebf237e65ea703b7b8c Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 6 Jun 2023 14:57:49 +0400 Subject: [PATCH 01/28] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D1=91?= =?UTF-8?q?=D1=81=20=D0=BA=D0=B0=D1=80=D1=82=D1=83=20=D0=B2=20=D0=BE=D1=82?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=BA=D0=BE=D0=BC?= =?UTF-8?q?=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82=20=D0=B2=D0=BC=D0=B5=D1=81?= =?UTF-8?q?=D1=82=D0=B5=20=D1=81=D0=BE=20state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ru/nm17/narodmon/ui/elements/TileMap.kt | 57 +++++++++++++++++++ .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 16 +----- .../narodmon/ui/viewmodel/MapViewModel.kt | 39 ------------- 3 files changed, 59 insertions(+), 53 deletions(-) create mode 100644 app/src/main/java/ru/nm17/narodmon/ui/elements/TileMap.kt delete mode 100644 app/src/main/java/ru/nm17/narodmon/ui/viewmodel/MapViewModel.kt diff --git a/app/src/main/java/ru/nm17/narodmon/ui/elements/TileMap.kt b/app/src/main/java/ru/nm17/narodmon/ui/elements/TileMap.kt new file mode 100644 index 0000000..6f20744 --- /dev/null +++ b/app/src/main/java/ru/nm17/narodmon/ui/elements/TileMap.kt @@ -0,0 +1,57 @@ +package ru.nm17.narodmon.ui.elements + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.compose.ui.geometry.Offset +import io.ktor.client.HttpClient +import io.ktor.client.engine.cio.CIO +import io.ktor.client.request.get +import io.ktor.client.statement.bodyAsChannel +import io.ktor.utils.io.jvm.javaio.toInputStream +import ovh.plrapps.mapcompose.api.addLayer +import ovh.plrapps.mapcompose.api.scale +import ovh.plrapps.mapcompose.api.setScroll +import ovh.plrapps.mapcompose.core.TileStreamProvider +import ovh.plrapps.mapcompose.ui.MapUI +import ovh.plrapps.mapcompose.ui.state.MapState +import java.io.InputStream + +const val mapSize = 32768 + +val client = HttpClient(CIO) +val tileStreamProvider = TileStreamProvider { row, col, zoom -> + requestTile(row, col, zoom) +} + +suspend fun requestTile(row: Int, col: Int, zoom: Int): InputStream { + val response = client.get("https://tile.openstreetmap.org/${zoom}/${col}/${row}.png") + return response.bodyAsChannel().toInputStream() +} + +@Composable +fun TileMap(modifier: Modifier = Modifier) { + val state by remember { + mutableStateOf( + MapState( + levelCount = 8, + fullWidth = mapSize, + fullHeight = mapSize, + workerCount = 16, + ).apply { + addLayer(tileStreamProvider) + } + ) + } + + LaunchedEffect(state) { + // TODO: Подгружать сохранённую позицию + state.setScroll(Offset(28702.6F, 14787.6F)) + state.scale = 1.4658884F + } + + MapUI(modifier = modifier, state = state) +} \ No newline at end of file diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index 6bd37c1..8ff760f 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -9,23 +9,18 @@ import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.FilterChip import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier -import androidx.compose.ui.geometry.Offset import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.navigation.NavController -import ovh.plrapps.mapcompose.api.scale -import ovh.plrapps.mapcompose.api.setScroll -import ovh.plrapps.mapcompose.ui.MapUI import ru.nm17.narodmon.R import ru.nm17.narodmon.ui.elements.GenericNavScaffold -import ru.nm17.narodmon.ui.viewmodel.MapViewModel +import ru.nm17.narodmon.ui.elements.TileMap enum class SensorsFilter { All, Thermometer, Camera, @@ -34,24 +29,17 @@ enum class SensorsFilter { @ExperimentalMaterial3Api @Composable fun SensorsPage(navController: NavController) { - val mapVM by remember { mutableStateOf(MapViewModel()) } var filter by remember { mutableStateOf(SensorsFilter.All) } val scrConfig = LocalConfiguration.current val mapHeight = scrConfig.screenHeightDp / 3 - - LaunchedEffect(mapVM) { - // TODO: Подгружать сохранённую позицию - mapVM.state.setScroll(Offset(28702.6F, 14787.6F)) - mapVM.state.scale = 1.4658884F - } GenericNavScaffold( title = { Text(text = stringResource(R.string.sensors_page_title)) } ) { Column(modifier = Modifier.padding(it)) { - MapUI(state = mapVM.state, modifier = Modifier.height(mapHeight.dp)) + TileMap(modifier = Modifier.height(mapHeight.dp)) Row( modifier = Modifier.padding(horizontal = 8.dp), diff --git a/app/src/main/java/ru/nm17/narodmon/ui/viewmodel/MapViewModel.kt b/app/src/main/java/ru/nm17/narodmon/ui/viewmodel/MapViewModel.kt deleted file mode 100644 index 4d330ba..0000000 --- a/app/src/main/java/ru/nm17/narodmon/ui/viewmodel/MapViewModel.kt +++ /dev/null @@ -1,39 +0,0 @@ -package ru.nm17.narodmon.ui.viewmodel - -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.lifecycle.ViewModel -import io.ktor.client.HttpClient -import io.ktor.client.engine.cio.CIO -import io.ktor.client.request.get -import io.ktor.client.statement.bodyAsChannel -import io.ktor.utils.io.jvm.javaio.toInputStream -import ovh.plrapps.mapcompose.api.addLayer -import ovh.plrapps.mapcompose.core.TileStreamProvider -import ovh.plrapps.mapcompose.ui.state.MapState -import java.io.InputStream - -class MapViewModel : ViewModel() { - private val client = HttpClient(CIO) - - private val tileStreamProvider = TileStreamProvider { row, col, zoom -> - requestTile(row, col, zoom) - } - - private val mapSize = 32768 - val state: MapState by mutableStateOf( - MapState( - levelCount = 8, - fullWidth = mapSize, - fullHeight = mapSize, - workerCount = 16, - ).apply { - addLayer(tileStreamProvider) - } - ) - - private suspend fun requestTile(row: Int, col: Int, zoom: Int): InputStream { - val response = client.get("https://tile.openstreetmap.org/${zoom}/${col}/${row}.png") - return response.bodyAsChannel().toInputStream() - } -} \ No newline at end of file -- 2.45.2 From 2b2a2c2f5ae1959115daa7c1db7c574ebfa07cd4 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 6 Jun 2023 15:33:43 +0400 Subject: [PATCH 02/28] =?UTF-8?q?IDE=20=D0=BD=D0=B5=20=D0=B2=D0=B8=D0=B4?= =?UTF-8?q?=D0=B8=D1=82=20@file:OptIn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/ru/nm17/narodmon/MainActivity.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/ru/nm17/narodmon/MainActivity.kt b/app/src/main/java/ru/nm17/narodmon/MainActivity.kt index 63b65e5..b673692 100644 --- a/app/src/main/java/ru/nm17/narodmon/MainActivity.kt +++ b/app/src/main/java/ru/nm17/narodmon/MainActivity.kt @@ -41,6 +41,7 @@ import ru.nm17.narodmon.ui.pages.SensorsPage import ru.nm17.narodmon.ui.theme.NarodMonTheme +@OptIn(ExperimentalMaterial3Api::class) @Composable fun AppNavHost() { val navController = rememberNavController() -- 2.45.2 From 06bc8a839e8b9db20ab03fac3196e0c4ce555878 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 6 Jun 2023 15:50:31 +0400 Subject: [PATCH 03/28] Fix: java.security.cert.CertificateException --- app/src/main/java/ru/nm17/narodmon/ui/elements/TileMap.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/elements/TileMap.kt b/app/src/main/java/ru/nm17/narodmon/ui/elements/TileMap.kt index 6f20744..3da671e 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/elements/TileMap.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/elements/TileMap.kt @@ -8,7 +8,7 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.geometry.Offset import io.ktor.client.HttpClient -import io.ktor.client.engine.cio.CIO +import io.ktor.client.engine.okhttp.OkHttp import io.ktor.client.request.get import io.ktor.client.statement.bodyAsChannel import io.ktor.utils.io.jvm.javaio.toInputStream @@ -22,7 +22,7 @@ import java.io.InputStream const val mapSize = 32768 -val client = HttpClient(CIO) +val client = HttpClient(OkHttp) val tileStreamProvider = TileStreamProvider { row, col, zoom -> requestTile(row, col, zoom) } -- 2.45.2 From 1334014c04cacaebd34166cbd2801fada608317a Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 6 Jun 2023 15:50:55 +0400 Subject: [PATCH 04/28] =?UTF-8?q?=D0=9D=D0=B5=D0=B1=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D1=88=D0=B8=D0=B5=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=B2=20UI=20=D1=8D=D0=BA=D1=80=D0=B0=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=81=D0=B5=D0=BD=D1=81=D0=BE=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 57 +++++++------------ app/src/main/res/values/strings.xml | 2 + 2 files changed, 23 insertions(+), 36 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index 8ff760f..d08d804 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -3,10 +3,12 @@ package ru.nm17.narodmon.ui.pages import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.material3.AssistChip import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.FilterChip +import androidx.compose.material3.SearchBar import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -29,7 +31,8 @@ enum class SensorsFilter { @ExperimentalMaterial3Api @Composable fun SensorsPage(navController: NavController) { - var filter by remember { mutableStateOf(SensorsFilter.All) } + var searchQuery by remember { mutableStateOf("") } + var searchActive by remember { mutableStateOf(false) } val scrConfig = LocalConfiguration.current val mapHeight = scrConfig.screenHeightDp / 3 @@ -41,45 +44,27 @@ fun SensorsPage(navController: NavController) { TileMap(modifier = Modifier.height(mapHeight.dp)) + SearchBar( + query = searchQuery, + active = searchActive, + onActiveChange = { active -> searchActive = active }, + onQueryChange = { query -> searchQuery = query }, + onSearch = { searchActive = false }, + placeholder = { Text(stringResource(R.string.search)) }, + modifier = Modifier + //.padding(horizontal = 8.dp) + .fillMaxWidth() + ) {} + Row( - modifier = Modifier.padding(horizontal = 8.dp), horizontalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier.padding(horizontal = 8.dp), ) { - SensorsFilterChip( - name = stringResource(R.string.sensors_filter_all), - checkFilter = { filter == SensorsFilter.All }, - updateFilter = { filter = SensorsFilter.All }, - ) - - SensorsFilterChip( - name = stringResource(R.string.sensors_filter_temp), - checkFilter = { filter == SensorsFilter.Thermometer }, - updateFilter = { filter = SensorsFilter.Thermometer }, - ) - - SensorsFilterChip( - name = stringResource(R.string.sensors_filter_camera), - checkFilter = { filter == SensorsFilter.Camera }, - updateFilter = { filter = SensorsFilter.Camera }, + AssistChip( + onClick = { }, + label = { Text(text = stringResource(R.string.sensors_filter)) }, ) } - - //Text(mapVM.state.scroll.toString()) - //Text(mapVM.state.scale.toString()) } } -} - -@OptIn(ExperimentalMaterial3Api::class) -@Composable -fun SensorsFilterChip( - name: String, - checkFilter: () -> Boolean, - updateFilter: () -> Unit, -) { - FilterChip( - selected = checkFilter(), - onClick = updateFilter, - label = { Text(name) }, - ) } \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e6c67e6..037d8ed 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -18,4 +18,6 @@ Все Термометры Камеры + Поиск + Фильтр \ No newline at end of file -- 2.45.2 From 3a873725f289fdee4b0cac85dc2e71d174cf29f5 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 6 Jun 2023 17:12:20 +0400 Subject: [PATCH 05/28] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20BottomSheet=20=D0=B4=D0=BB=D1=8F=20=D1=84=D0=B8?= =?UTF-8?q?=D0=BB=D1=8C=D1=82=D1=80=D0=BE=D0=B2=20=D0=B8=20=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 50 ++++++++++++++++++- app/src/main/res/values/strings.xml | 28 +++++++++-- 2 files changed, 74 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index d08d804..d016d78 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -8,6 +8,8 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.material3.AssistChip import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.FilterChip +import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.SearchBar import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -34,6 +36,35 @@ fun SensorsPage(navController: NavController) { var searchQuery by remember { mutableStateOf("") } var searchActive by remember { mutableStateOf(false) } + var filterShown by remember { mutableStateOf(false) } + var filterMine by remember { mutableStateOf(false) } + + val filterItems = listOf( + stringResource(R.string.filter_temp), + stringResource(R.string.filter_temp_water), + stringResource(R.string.filter_temp_ground), + stringResource(R.string.filter_temp_dew_point), + stringResource(R.string.filter_humidity), + stringResource(R.string.filter_pressure), + stringResource(R.string.filter_lightness), + stringResource(R.string.filter_uv), + stringResource(R.string.filter_radiation), + stringResource(R.string.filter_rainfall), + stringResource(R.string.filter_dust), + stringResource(R.string.filter_wind_speed), + stringResource(R.string.filter_wind_direction), + stringResource(R.string.filter_concentration), + stringResource(R.string.filter_power), + stringResource(R.string.filter_voltage), + stringResource(R.string.filter_amperage), + stringResource(R.string.filter_energy), + stringResource(R.string.filter_battery), + stringResource(R.string.filter_rxtx), + stringResource(R.string.filter_signal), + stringResource(R.string.filter_water_meter), + stringResource(R.string.filter_time), + ) + val scrConfig = LocalConfiguration.current val mapHeight = scrConfig.screenHeightDp / 3 @@ -61,10 +92,27 @@ fun SensorsPage(navController: NavController) { modifier = Modifier.padding(horizontal = 8.dp), ) { AssistChip( - onClick = { }, + onClick = { filterShown = true }, label = { Text(text = stringResource(R.string.sensors_filter)) }, ) + + AssistChip( + onClick = { }, + label = { Text(text = stringResource(R.string.sensors_sorting)) }, + ) + + FilterChip( + selected = filterMine, + onClick = { filterMine = !filterMine }, + label = { Text(text = stringResource(R.string.sensors_mine)) }, + ) } } } + + if (filterShown) { + ModalBottomSheet(onDismissRequest = { filterShown = false }) { + Text(text = "Hello") + } + } } \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 037d8ed..5db243f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -15,9 +15,31 @@ Примите необходимые соглашения Сенсоры Ожидаю соглашение пользователя - Все - Термометры - Камеры Поиск Фильтр + Сортировка + Мои + Температура точки росы + Температура воздуха + Температура воды + Температура почвы + Влажность + Давление + Освещённость + УФ-индекс + Радиация + Осадки + Запылённость + Скорость ветра + Направление ветра + Концентрация + Мощность + Напряжение + Сила тока + Энергия + % батареи + Rx/Tx трафик + Сигнал в dBm + Счётчик воды + Время работы \ No newline at end of file -- 2.45.2 From 2a318d551c1fa8782257a0b2846c3ac74c7f336e Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 6 Jun 2023 17:50:37 +0400 Subject: [PATCH 06/28] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D1=81=D0=BE=D0=B4=D0=B5=D1=80=D0=B6=D0=B8?= =?UTF-8?q?=D0=BC=D0=BE=D0=B5=20=D0=B2=20BottomSheet=20=D1=84=D0=B8=D0=BB?= =?UTF-8?q?=D1=8C=D1=82=D1=80=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 38 ++++++++++++++++--- app/src/main/res/values/strings.xml | 1 + 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index d016d78..07da696 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -1,12 +1,16 @@ package ru.nm17.narodmon.ui.pages +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items import androidx.compose.material3.AssistChip +import androidx.compose.material3.Card import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.FilterChip import androidx.compose.material3.ModalBottomSheet @@ -21,6 +25,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp import androidx.navigation.NavController import ru.nm17.narodmon.R import ru.nm17.narodmon.ui.elements.GenericNavScaffold @@ -39,7 +44,7 @@ fun SensorsPage(navController: NavController) { var filterShown by remember { mutableStateOf(false) } var filterMine by remember { mutableStateOf(false) } - val filterItems = listOf( + val filterItems = listOf( stringResource(R.string.filter_temp), stringResource(R.string.filter_temp_water), stringResource(R.string.filter_temp_ground), @@ -82,9 +87,7 @@ fun SensorsPage(navController: NavController) { onQueryChange = { query -> searchQuery = query }, onSearch = { searchActive = false }, placeholder = { Text(stringResource(R.string.search)) }, - modifier = Modifier - //.padding(horizontal = 8.dp) - .fillMaxWidth() + modifier = Modifier.fillMaxWidth() ) {} Row( @@ -112,7 +115,32 @@ fun SensorsPage(navController: NavController) { if (filterShown) { ModalBottomSheet(onDismissRequest = { filterShown = false }) { - Text(text = "Hello") + Text( + text = stringResource(R.string.sensors_filter_title), + fontSize = 26.sp, + ) + + LazyColumn( + verticalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier.padding(horizontal = 4.dp), + ) { + items(filterItems) { + Card( + modifier = Modifier + .fillMaxWidth() + .clickable { } + ) { + Text( + text = it, + fontSize = 18.sp, + modifier = Modifier.padding( + horizontal = 8.dp, + vertical = 16.dp, + ), + ) + } + } + } } } } \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5db243f..4661411 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -42,4 +42,5 @@ Сигнал в dBm Счётчик воды Время работы + Тип датчиков \ No newline at end of file -- 2.45.2 From d1e7b603786ed15050eb3547b42f4125119fde19 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 6 Jun 2023 20:56:15 +0400 Subject: [PATCH 07/28] =?UTF-8?q?=D0=A4=D0=B8=D0=BB=D1=8C=D1=82=D1=80:=20C?= =?UTF-8?q?ard-=D1=8B=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D1=8B?= =?UTF-8?q?=20=D0=BD=D0=B0=20CheckBox+Text,=20=D1=81=D0=BE=D0=B7=D0=B4?= =?UTF-8?q?=D0=B0=D0=BD=20=D0=B4=D0=B0=D1=82=D0=B0=D0=BA=D0=BB=D0=B0=D1=81?= =?UTF-8?q?=D1=81=20=D0=B4=D0=BB=D1=8F=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 89 ++++++++++--------- 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index 07da696..fe77b98 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -10,7 +10,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.material3.AssistChip -import androidx.compose.material3.Card +import androidx.compose.material3.Checkbox import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.FilterChip import androidx.compose.material3.ModalBottomSheet @@ -21,7 +21,9 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.layout.VerticalAlignmentLine import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp @@ -31,9 +33,7 @@ import ru.nm17.narodmon.R import ru.nm17.narodmon.ui.elements.GenericNavScaffold import ru.nm17.narodmon.ui.elements.TileMap -enum class SensorsFilter { - All, Thermometer, Camera, -} +data class SensorFilter(val stringRes: Int, val code: Int, var enabled: Boolean = false) @ExperimentalMaterial3Api @Composable @@ -44,31 +44,37 @@ fun SensorsPage(navController: NavController) { var filterShown by remember { mutableStateOf(false) } var filterMine by remember { mutableStateOf(false) } - val filterItems = listOf( - stringResource(R.string.filter_temp), - stringResource(R.string.filter_temp_water), - stringResource(R.string.filter_temp_ground), - stringResource(R.string.filter_temp_dew_point), - stringResource(R.string.filter_humidity), - stringResource(R.string.filter_pressure), - stringResource(R.string.filter_lightness), - stringResource(R.string.filter_uv), - stringResource(R.string.filter_radiation), - stringResource(R.string.filter_rainfall), - stringResource(R.string.filter_dust), - stringResource(R.string.filter_wind_speed), - stringResource(R.string.filter_wind_direction), - stringResource(R.string.filter_concentration), - stringResource(R.string.filter_power), - stringResource(R.string.filter_voltage), - stringResource(R.string.filter_amperage), - stringResource(R.string.filter_energy), - stringResource(R.string.filter_battery), - stringResource(R.string.filter_rxtx), - stringResource(R.string.filter_signal), - stringResource(R.string.filter_water_meter), - stringResource(R.string.filter_time), - ) + val filterItems = remember { + mutableListOf( + /* TODO: + * Заменить `code` на настоящее значение + * либо динамически его подгружать из ответа АПИ + * (см. /appInit, ключ в жсоне: types.type) */ + SensorFilter(R.string.filter_temp, 0), + SensorFilter(R.string.filter_temp_water, 1), + SensorFilter(R.string.filter_temp_ground, 2), + SensorFilter(R.string.filter_temp_dew_point, 3), + SensorFilter(R.string.filter_humidity, 4), + SensorFilter(R.string.filter_pressure, 5), + SensorFilter(R.string.filter_lightness, 6), + SensorFilter(R.string.filter_uv, 7), + SensorFilter(R.string.filter_radiation, 8), + SensorFilter(R.string.filter_rainfall, 9), + SensorFilter(R.string.filter_dust, 10), + SensorFilter(R.string.filter_wind_speed, 11), + SensorFilter(R.string.filter_wind_direction, 12), + SensorFilter(R.string.filter_concentration, 13), + SensorFilter(R.string.filter_power, 14), + SensorFilter(R.string.filter_voltage, 15), + SensorFilter(R.string.filter_amperage, 16), + SensorFilter(R.string.filter_energy, 17), + SensorFilter(R.string.filter_battery, 18), + SensorFilter(R.string.filter_rxtx, 19), + SensorFilter(R.string.filter_signal, 20), + SensorFilter(R.string.filter_water_meter, 21), + SensorFilter(R.string.filter_time, 22), + ) + } val scrConfig = LocalConfiguration.current val mapHeight = scrConfig.screenHeightDp / 3 @@ -125,19 +131,22 @@ fun SensorsPage(navController: NavController) { modifier = Modifier.padding(horizontal = 4.dp), ) { items(filterItems) { - Card( - modifier = Modifier - .fillMaxWidth() - .clickable { } + Row( + verticalAlignment = Alignment.CenterVertically, ) { - Text( - text = it, - fontSize = 18.sp, - modifier = Modifier.padding( - horizontal = 8.dp, - vertical = 16.dp, - ), + Checkbox( + checked = it.enabled, + onCheckedChange = { checked -> it.enabled = checked }, ) + + Text( + text = stringResource(id = it.stringRes), + modifier = Modifier.clickable { + it.enabled = !it.enabled + } + ) + + Text(text = it.toString()) } } } -- 2.45.2 From 5639ebd4cda2c3f2dd0d16ba48d78f45fa337c58 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 6 Jun 2023 21:14:50 +0400 Subject: [PATCH 08/28] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D1=8B=20=D1=87=D0=B5=D0=BA=D0=B1=D0=BE=D0=BA?= =?UTF-8?q?=D1=81=D1=8B=20(=D0=B7=D0=B0=D0=B1=D1=8B=D0=BB=20MutableState?= =?UTF-8?q?=20=D0=B2=20=D0=B4=D0=B0=D1=82=D0=B0=D0=BA=D0=BB=D0=B0=D1=81?= =?UTF-8?q?=D1=81=D0=B5),=20=D1=86=D0=B5=D0=BD=D1=82=D1=80=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=20=D0=B7=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2=D0=BE=D0=BA=20BottomSheet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index fe77b98..1f7dbbd 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -17,15 +17,16 @@ import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.SearchBar import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.MutableState import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.layout.VerticalAlignmentLine import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.navigation.NavController @@ -33,7 +34,11 @@ import ru.nm17.narodmon.R import ru.nm17.narodmon.ui.elements.GenericNavScaffold import ru.nm17.narodmon.ui.elements.TileMap -data class SensorFilter(val stringRes: Int, val code: Int, var enabled: Boolean = false) +data class SensorFilter( + val stringRes: Int, + val code: Int, + var enabled: MutableState = mutableStateOf(false), +) @ExperimentalMaterial3Api @Composable @@ -45,7 +50,7 @@ fun SensorsPage(navController: NavController) { var filterMine by remember { mutableStateOf(false) } val filterItems = remember { - mutableListOf( + listOf( /* TODO: * Заменить `code` на настоящее значение * либо динамически его подгружать из ответа АПИ @@ -121,13 +126,18 @@ fun SensorsPage(navController: NavController) { if (filterShown) { ModalBottomSheet(onDismissRequest = { filterShown = false }) { - Text( - text = stringResource(R.string.sensors_filter_title), - fontSize = 26.sp, - ) + Row( + horizontalArrangement = Arrangement.Center, + modifier = Modifier.fillMaxWidth(), + ) { + Text( + text = stringResource(R.string.sensors_filter_title), + fontSize = 24.sp, + fontWeight = FontWeight(500), + ) + } LazyColumn( - verticalArrangement = Arrangement.spacedBy(8.dp), modifier = Modifier.padding(horizontal = 4.dp), ) { items(filterItems) { @@ -135,18 +145,17 @@ fun SensorsPage(navController: NavController) { verticalAlignment = Alignment.CenterVertically, ) { Checkbox( - checked = it.enabled, - onCheckedChange = { checked -> it.enabled = checked }, + checked = it.enabled.value, + onCheckedChange = { checked -> + it.enabled.value = checked + }, ) - Text( text = stringResource(id = it.stringRes), modifier = Modifier.clickable { - it.enabled = !it.enabled + it.enabled.value = !it.enabled.value } ) - - Text(text = it.toString()) } } } -- 2.45.2 From e6f7ff8238a53653e8d59b131433758ab7310446 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 7 Jun 2023 15:41:44 +0400 Subject: [PATCH 09/28] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20Gradle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a952870..a1a48e8 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -agp = "8.2.0-alpha06" +agp = "8.2.0-alpha07" kotlin = "1.8.10" core-ktx = "1.9.0" junit = "4.13.2" -- 2.45.2 From ebd8dadf7ff3dbac6bec59f26f4548843de3500d Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 7 Jun 2023 15:41:53 +0400 Subject: [PATCH 10/28] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=81=D0=BE=D1=80=D1=82=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 53 ++++++++++++++++++- app/src/main/res/values/strings.xml | 5 ++ 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index 1f7dbbd..c7d61a9 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -14,13 +14,14 @@ import androidx.compose.material3.Checkbox import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.FilterChip import androidx.compose.material3.ModalBottomSheet +import androidx.compose.material3.RadioButton import androidx.compose.material3.SearchBar import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.MutableState -import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember +import androidx.compose.runtime.getValue import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -40,12 +41,35 @@ data class SensorFilter( var enabled: MutableState = mutableStateOf(false), ) +data class SensorSortingItem( + val stringRes: Int, + val sortingType: SortingType, +) + +enum class SortingType { + DISTANCE, TYPE, UPD_TIME, + NAME, VALUE, +} + @ExperimentalMaterial3Api @Composable fun SensorsPage(navController: NavController) { var searchQuery by remember { mutableStateOf("") } var searchActive by remember { mutableStateOf(false) } + var sortingShown by remember { mutableStateOf(false) } + var sortingType by remember { mutableStateOf(SortingType.DISTANCE) } + + val sortingTypes = remember { + listOf( + SensorSortingItem(R.string.sort_distance, SortingType.DISTANCE), + SensorSortingItem(R.string.sort_type, SortingType.TYPE), + SensorSortingItem(R.string.sort_update_time, SortingType.UPD_TIME), + SensorSortingItem(R.string.sort_name, SortingType.NAME), + SensorSortingItem(R.string.sort_value, SortingType.VALUE), + ) + } + var filterShown by remember { mutableStateOf(false) } var filterMine by remember { mutableStateOf(false) } @@ -111,7 +135,7 @@ fun SensorsPage(navController: NavController) { ) AssistChip( - onClick = { }, + onClick = { sortingShown = true }, label = { Text(text = stringResource(R.string.sensors_sorting)) }, ) @@ -161,4 +185,29 @@ fun SensorsPage(navController: NavController) { } } } + + if (sortingShown) { + ModalBottomSheet(onDismissRequest = { sortingShown = false }) { + LazyColumn( + modifier = Modifier.padding(horizontal = 4.dp), + ) { + items (sortingTypes) { + Row ( + verticalAlignment = Alignment.CenterVertically, + ) { + RadioButton( + selected = (sortingType == it.sortingType), + onClick = { sortingType = it.sortingType }, + ) + Text( + text = stringResource(id = it.stringRes), + modifier = Modifier.clickable { + sortingType = it.sortingType + } + ) + } + } + } + } + } } \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4661411..d2ceb5e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -43,4 +43,9 @@ Счётчик воды Время работы Тип датчиков + Расстояние + Тип датчика + Время последнего обновления + Название + Данные \ No newline at end of file -- 2.45.2 From 965533c8cc2ba8d7bc334115f02deceaacdb4e7e Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 7 Jun 2023 15:42:40 +0400 Subject: [PATCH 11/28] =?UTF-8?q?=D0=9D=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D1=85:=20filter/sortingShown=20->=20...Show?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index c7d61a9..b5e2f81 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -57,7 +57,7 @@ fun SensorsPage(navController: NavController) { var searchQuery by remember { mutableStateOf("") } var searchActive by remember { mutableStateOf(false) } - var sortingShown by remember { mutableStateOf(false) } + var sortingShow by remember { mutableStateOf(false) } var sortingType by remember { mutableStateOf(SortingType.DISTANCE) } val sortingTypes = remember { @@ -70,7 +70,7 @@ fun SensorsPage(navController: NavController) { ) } - var filterShown by remember { mutableStateOf(false) } + var filterShow by remember { mutableStateOf(false) } var filterMine by remember { mutableStateOf(false) } val filterItems = remember { @@ -130,12 +130,12 @@ fun SensorsPage(navController: NavController) { modifier = Modifier.padding(horizontal = 8.dp), ) { AssistChip( - onClick = { filterShown = true }, + onClick = { filterShow = true }, label = { Text(text = stringResource(R.string.sensors_filter)) }, ) AssistChip( - onClick = { sortingShown = true }, + onClick = { sortingShow = true }, label = { Text(text = stringResource(R.string.sensors_sorting)) }, ) @@ -148,8 +148,8 @@ fun SensorsPage(navController: NavController) { } } - if (filterShown) { - ModalBottomSheet(onDismissRequest = { filterShown = false }) { + if (filterShow) { + ModalBottomSheet(onDismissRequest = { filterShow = false }) { Row( horizontalArrangement = Arrangement.Center, modifier = Modifier.fillMaxWidth(), @@ -186,8 +186,8 @@ fun SensorsPage(navController: NavController) { } } - if (sortingShown) { - ModalBottomSheet(onDismissRequest = { sortingShown = false }) { + if (sortingShow) { + ModalBottomSheet(onDismissRequest = { sortingShow = false }) { LazyColumn( modifier = Modifier.padding(horizontal = 4.dp), ) { -- 2.45.2 From 95e849e27ae02d4ea58e1a4ccb55d60043e25aa5 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 7 Jun 2023 16:02:42 +0400 Subject: [PATCH 12/28] =?UTF-8?q?=D0=A7=D0=B5=D0=BA=D0=B1=D0=BE=D0=BA?= =?UTF-8?q?=D1=81/=D1=80=D0=B0=D0=B4=D0=B8=D0=BE=20=D0=B2=D1=8B=D0=BD?= =?UTF-8?q?=D0=B5=D1=81=D0=B5=D0=BD=D1=8B=20=D0=B2=20=D0=BE=D1=82=D0=B4?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20composable,=20=D0=B4?= =?UTF-8?q?=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BE=D0=BF?= =?UTF-8?q?=D1=86=D0=B8=D0=B8=20=D1=81=D0=BE=D1=80=D1=82=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 101 ++++++++++++------ app/src/main/res/values/strings.xml | 3 + 2 files changed, 74 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index b5e2f81..f5f1d60 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -59,6 +59,9 @@ fun SensorsPage(navController: NavController) { var sortingShow by remember { mutableStateOf(false) } var sortingType by remember { mutableStateOf(SortingType.DISTANCE) } + var sortingDesc by remember { mutableStateOf(false) } + var sortingMine by remember { mutableStateOf(false) } + var sortingFav by remember { mutableStateOf(false) } val sortingTypes = remember { listOf( @@ -165,22 +168,11 @@ fun SensorsPage(navController: NavController) { modifier = Modifier.padding(horizontal = 4.dp), ) { items(filterItems) { - Row( - verticalAlignment = Alignment.CenterVertically, - ) { - Checkbox( - checked = it.enabled.value, - onCheckedChange = { checked -> - it.enabled.value = checked - }, - ) - Text( - text = stringResource(id = it.stringRes), - modifier = Modifier.clickable { - it.enabled.value = !it.enabled.value - } - ) - } + FilterCheckbox( + checked = it.enabled.value, + onCheckedChange = { it.enabled.value = !it.enabled.value }, + stringRes = it.stringRes, + ) } } } @@ -192,22 +184,71 @@ fun SensorsPage(navController: NavController) { modifier = Modifier.padding(horizontal = 4.dp), ) { items (sortingTypes) { - Row ( - verticalAlignment = Alignment.CenterVertically, - ) { - RadioButton( - selected = (sortingType == it.sortingType), - onClick = { sortingType = it.sortingType }, - ) - Text( - text = stringResource(id = it.stringRes), - modifier = Modifier.clickable { - sortingType = it.sortingType - } - ) - } + FilterRadioButton( + selected = (sortingType == it.sortingType), + onClick = { sortingType = it.sortingType }, + stringRes = it.stringRes, + ) + } + + item { + FilterCheckbox( + checked = sortingDesc, + onCheckedChange = { sortingDesc = !sortingDesc }, + stringRes = R.string.sort_option_desc, + ) + } + + item { + FilterCheckbox( + checked = sortingFav, + onCheckedChange = { sortingFav = !sortingFav }, + stringRes = R.string.sort_option_fav, + ) + } + + item { + FilterCheckbox( + checked = sortingMine, + onCheckedChange = { sortingMine = !sortingMine }, + stringRes = R.string.sort_option_mine, + ) } } } } +} + +@ExperimentalMaterial3Api +@Composable +fun FilterCheckbox(checked: Boolean, onCheckedChange: () -> Unit, stringRes: Int) { + Row( + verticalAlignment = Alignment.CenterVertically, + ) { + Checkbox( + checked = checked, + onCheckedChange = { onCheckedChange() }, + ) + Text( + text = stringResource(id = stringRes), + modifier = Modifier.clickable { onCheckedChange() }, + ) + } +} + +@ExperimentalMaterial3Api +@Composable +fun FilterRadioButton(selected: Boolean, onClick: () -> Unit, stringRes: Int) { + Row ( + verticalAlignment = Alignment.CenterVertically, + ) { + RadioButton( + selected = selected, + onClick = onClick, + ) + Text( + text = stringResource(id = stringRes), + modifier = Modifier.clickable { onClick() }, + ) + } } \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d2ceb5e..b16dda2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -48,4 +48,7 @@ Время последнего обновления Название Данные + По убыванию + Избранные сверху + Мои датчики сверху \ No newline at end of file -- 2.45.2 From 12db4ba8df9536754df5d9bedf0414a7b343c1dc Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 7 Jun 2023 16:07:45 +0400 Subject: [PATCH 13/28] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D0=BE=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2=D0=BE=D0=BA=20=D0=B4=D0=BB=D1=8F=20BottomSheet=20=D1=81?= =?UTF-8?q?=20=D1=81=D0=BE=D1=80=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=BE?= =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/ru/nm17/narodmon/ui/pages/Sensors.kt | 11 +++++++++++ app/src/main/res/values/strings.xml | 1 + 2 files changed, 12 insertions(+) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index f5f1d60..9a8b6de 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -180,6 +180,17 @@ fun SensorsPage(navController: NavController) { if (sortingShow) { ModalBottomSheet(onDismissRequest = { sortingShow = false }) { + Row( + horizontalArrangement = Arrangement.Center, + modifier = Modifier.fillMaxWidth(), + ) { + Text( + text = stringResource(R.string.sensors_sort_title), + fontSize = 24.sp, + fontWeight = FontWeight(500), + ) + } + LazyColumn( modifier = Modifier.padding(horizontal = 4.dp), ) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b16dda2..2694904 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -51,4 +51,5 @@ По убыванию Избранные сверху Мои датчики сверху + Сортировка \ No newline at end of file -- 2.45.2 From 9c6be5d8c5df82c46b0b712914eae0fc86ea0eab Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 7 Jun 2023 16:45:32 +0400 Subject: [PATCH 14/28] =?UTF-8?q?=D0=9F=D0=BE=D1=84=D0=B8=D0=BA=D1=88?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D0=BA=D1=80=D1=83=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B2=20BottomSheet-=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index 9a8b6de..5b104ab 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -165,7 +165,9 @@ fun SensorsPage(navController: NavController) { } LazyColumn( - modifier = Modifier.padding(horizontal = 4.dp), + modifier = Modifier + .padding(horizontal = 4.dp) + .fillMaxWidth(), ) { items(filterItems) { FilterCheckbox( @@ -192,9 +194,11 @@ fun SensorsPage(navController: NavController) { } LazyColumn( - modifier = Modifier.padding(horizontal = 4.dp), + modifier = Modifier + .padding(horizontal = 4.dp) + .fillMaxWidth(), ) { - items (sortingTypes) { + items(sortingTypes) { FilterRadioButton( selected = (sortingType == it.sortingType), onClick = { sortingType = it.sortingType }, -- 2.45.2 From 9739d1cdfe50c5320e75e1f8f65b30e907fbb7ef Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 7 Jun 2023 21:07:46 +0400 Subject: [PATCH 15/28] =?UTF-8?q?=D0=A0=D0=B0=D0=B7=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D0=B0=D0=BD=20UI=20=D0=B4=D0=BB=D1=8F=20=D1=81?= =?UTF-8?q?=D0=BF=D0=B8=D1=81=D0=BA=D0=B0=20=D0=B4=D0=B0=D1=82=D1=87=D0=B8?= =?UTF-8?q?=D0=BA=D0=BE=D0=B2,=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D1=82=D0=B5=D1=81=D1=82=D0=BE=D0=B2=D1=8B?= =?UTF-8?q?=D0=B5=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index 5b104ab..3c2938a 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -4,18 +4,24 @@ import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.material3.AssistChip +import androidx.compose.material3.Card import androidx.compose.material3.Checkbox +import androidx.compose.material3.Divider +import androidx.compose.material3.ElevatedCard import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.FilterChip +import androidx.compose.material3.ListItem import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.RadioButton import androidx.compose.material3.SearchBar +import androidx.compose.material3.Shapes import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.MutableState @@ -25,17 +31,39 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.RectangleShape +import androidx.compose.ui.graphics.Shape import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.navigation.NavController import ru.nm17.narodmon.R +import ru.nm17.narodmon.db.entities.SensorType import ru.nm17.narodmon.ui.elements.GenericNavScaffold import ru.nm17.narodmon.ui.elements.TileMap +data class Sensor( + // TODO: Вынести в отдельный класс, и явно не в директорию `ui` + val id: Int, + val type: SensorType, + val deviceName: String, + val deviceOwner: Int, + val name: String, + val favorite: Boolean, + val public: Boolean, + val mine: Boolean, + val location: String, + val distance: Double, // километры + val value: Double, + val unit: String, + val changed: Int, +) + data class SensorFilter( + // TODO: Можно попробовать объединить с db/SensorType.kt val stringRes: Int, val code: Int, var enabled: MutableState = mutableStateOf(false), @@ -108,6 +136,39 @@ fun SensorsPage(navController: NavController) { ) } + val sensors = remember { + mutableListOf( + // TODO: загружать датчики с сервера. Этот список -- для макета + Sensor( + 0, + SensorType(0, "temp", "C"), + "device0", 0, + "sensor0", favorite = true, + public = true, mine = false, + "Москва", 0.4, + 20.0, "C", 1686142800, + ), + Sensor( + 1, + SensorType(4, "humidity", "%"), + "device1", 0, + "sensor1", favorite = true, + public = false, mine = false, + "Подмосковье", 1.1, + 39.0, "%", 1686142800, + ), + Sensor( + 2, + SensorType(11, "wind speed", "m/s"), + "device2", 1, + "sensor2", favorite = false, + public = true, mine = true, + "Москва", 0.01, + 3.2, "m/s", 1686142800, + ), + ) + } + val scrConfig = LocalConfiguration.current val mapHeight = scrConfig.screenHeightDp / 3 @@ -148,6 +209,16 @@ fun SensorsPage(navController: NavController) { label = { Text(text = stringResource(R.string.sensors_mine)) }, ) } + + Divider() + + LazyColumn( + modifier = Modifier.fillMaxHeight(), + ) { + items(sensors) { sensor -> + SensorItem(sensor) + } + } } } @@ -234,6 +305,33 @@ fun SensorsPage(navController: NavController) { } } +@ExperimentalMaterial3Api +@Composable +fun SensorItem(sensor: Sensor) { + ListItem( + overlineContent = { Text(text = "${sensor.deviceName} от ${sensor.deviceOwner}") }, + headlineContent = { Text(text = sensor.type.name) }, + supportingContent = { Text(text = sensor.name) }, + trailingContent = { + Column( + horizontalAlignment = Alignment.End, + ) { + Text(text = "${sensor.distance} km") + ElevatedCard( + shape = RectangleShape, + ) { + Text( + text = "${sensor.value} ${sensor.unit}", + fontFamily = FontFamily.Monospace, + fontSize = 14.sp, + modifier = Modifier.padding(horizontal = 3.dp, vertical = 1.dp) + ) + } + } + } + ) +} + @ExperimentalMaterial3Api @Composable fun FilterCheckbox(checked: Boolean, onCheckedChange: () -> Unit, stringRes: Int) { -- 2.45.2 From 4c3584d63c864a42e174cb5dcc9aaf975b2f81bf Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 7 Jun 2023 21:42:26 +0400 Subject: [PATCH 16/28] =?UTF-8?q?=D0=A8=D1=80=D0=B8=D1=84=D1=82=20Iosevka?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20=D0=B7=D0=BD=D0=B0=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B9=20=D0=B4=D0=B0=D1=82=D1=87=D0=B8=D0=BA=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/ru/nm17/narodmon/ui/Font.kt | 10 ++++++++++ .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 4 +++- app/src/main/res/font/iosevka.ttf | Bin 0 -> 75308 bytes 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/ru/nm17/narodmon/ui/Font.kt create mode 100644 app/src/main/res/font/iosevka.ttf diff --git a/app/src/main/java/ru/nm17/narodmon/ui/Font.kt b/app/src/main/java/ru/nm17/narodmon/ui/Font.kt new file mode 100644 index 0000000..a1c20f0 --- /dev/null +++ b/app/src/main/java/ru/nm17/narodmon/ui/Font.kt @@ -0,0 +1,10 @@ +package ru.nm17.narodmon.ui + +import androidx.compose.ui.text.font.Font +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import ru.nm17.narodmon.R + +val iosevkaFamily = FontFamily( + Font(R.font.iosevka, FontWeight.Medium) +) \ No newline at end of file diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index 3c2938a..93d5117 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -44,6 +44,7 @@ import ru.nm17.narodmon.R import ru.nm17.narodmon.db.entities.SensorType import ru.nm17.narodmon.ui.elements.GenericNavScaffold import ru.nm17.narodmon.ui.elements.TileMap +import ru.nm17.narodmon.ui.iosevkaFamily data class Sensor( // TODO: Вынести в отдельный класс, и явно не в директорию `ui` @@ -322,7 +323,8 @@ fun SensorItem(sensor: Sensor) { ) { Text( text = "${sensor.value} ${sensor.unit}", - fontFamily = FontFamily.Monospace, + fontFamily = iosevkaFamily, + fontWeight = FontWeight.Medium, fontSize = 14.sp, modifier = Modifier.padding(horizontal = 3.dp, vertical = 1.dp) ) diff --git a/app/src/main/res/font/iosevka.ttf b/app/src/main/res/font/iosevka.ttf new file mode 100644 index 0000000000000000000000000000000000000000..bab9e518b5e5eb8eb659bf5159a31aba78a9a99b GIT binary patch literal 75308 zcmdqK37i~fc_;k7Roz|H_gQ^a-*-gsy0=lDPW=Xn`tjQR1$!hAOz-M!XGy%2 zz;R~Z(PO*5`-I%Z@ixYk@J&a@r_N13whO1O;Qij6_pd&*<4>nvhT{+8_&?tH(jUtt z^Ntr75C0{OfAa2!&fI@T^YY6XkDOr4<2ti??jgMH!~0*xqk87Pm)-r^U;i(!V$6Oc zV;2+m+_ic-_mO=+!MOD_-k-S#FWBzlufg%#a9p_O{vUgM_kGrF5LIvovYsa z4)hpTzlr0_{i}~ZB!|5ZFz&M8{LBNZ_us{LXI5~G_Br1C(1YiG?D7{`3*S%on|bJw zyB>P+Z>4rKUZn5)IC?^29z0_#$`W{vZsI>9Ud0oFIQu%Y+^~0Pg`K$bWsls) z;%6SY>t1%^zSSRlfSq8wn7nJ>kqiqTI(S2djU7F*3x65Ae3>cY3KElQ~FFe9t{2;wf zt&y1>_v#eav5I4HCG)yQTj;ORF8W@M&uFa9rr9>OmmNl1dh8zd5Ze3G>_4$zXTQZh z#{LWY9QzXcDth2M#wV>~=HrBTl&r6{{(|}Jt=9LN?|s00e4qLFVWWN0LrfLl`&x0V zNNsRUgLG%;7vZxC-@|v;w?VSvpmQ1yugdR#LK+G zt9%TzLuLV{<8%Lpe-3tuThZGRlempz^zfN!T$gjqeDT+TJHMHq;HUWA{C@sp{3pa1u6@LS+u+``AF}zEkTjEFgi})(Phd;<)%3sc3 z&EF_KxB2z{aQL}He1+f2@8DC|AV-X&Avy*I|2OW#8nv!jf_;A--vfMA5Z#RSd5>9u{(hy#)A0EA;rvV zl57;O)ActW#le{Y^Gv@ubF=v{xX=G#o(WlrYhJBIzh|E56=!bNmxF8mf_bJ#oVnR( z4bFUtc_y`V^Z6xj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2bb4ab7df4faaa5 Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Thu, 8 Jun 2023 17:14:04 +0500 Subject: [PATCH 17/28] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D0=BB?= =?UTF-8?q?=D0=B8=D1=88=D0=BD=D0=B8=D0=B5=20=D0=B1=D0=B8=D0=B1=D0=BB=D0=B8?= =?UTF-8?q?=D0=BE=D1=82=D0=B5=D0=BA=D0=B8.=20=D0=9C=D1=8B=20=D0=B6=D0=B5?= =?UTF-8?q?=20=D0=BD=D0=B5=20=D0=B1=D1=83=D0=B4=D0=B5=D0=BC=20RxJava=20?= =?UTF-8?q?=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9a73f7f..9be7f7e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -106,12 +106,6 @@ dependencies { // optional - Kotlin Extensions and Coroutines support for Room implementation("androidx.room:room-ktx:$room_version") - // optional - RxJava2 support for Room - implementation("androidx.room:room-rxjava2:$room_version") - - // optional - RxJava3 support for Room - implementation("androidx.room:room-rxjava3:$room_version") - // optional - Guava support for Room, including Optional and ListenableFuture implementation("androidx.room:room-guava:$room_version") -- 2.45.2 From b17e8531036f5c4b4cb0ee512a57577c170a7533 Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Thu, 8 Jun 2023 17:15:35 +0500 Subject: [PATCH 18/28] =?UTF-8?q?=D0=A7=D0=B5=D0=BA=D0=B1=D0=BE=D0=BA?= =?UTF-8?q?=D1=81=D1=8B=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BF=D1=80=D0=BE=D0=BA=D0=BB=D0=B8=D0=BA=D0=B8=D0=B2=D0=B0?= =?UTF-8?q?=D1=8E=D1=82=D1=81=D1=8F=20=D0=BF=D0=BE=20=D0=B2=D1=81=D0=B5?= =?UTF-8?q?=D0=B9=20=D1=88=D0=B8=D1=80=D0=B8=D0=BD=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index 93d5117..eb9fd98 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -11,7 +11,6 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.material3.AssistChip -import androidx.compose.material3.Card import androidx.compose.material3.Checkbox import androidx.compose.material3.Divider import androidx.compose.material3.ElevatedCard @@ -21,7 +20,6 @@ import androidx.compose.material3.ListItem import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.RadioButton import androidx.compose.material3.SearchBar -import androidx.compose.material3.Shapes import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.MutableState @@ -32,10 +30,8 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.RectangleShape -import androidx.compose.ui.graphics.Shape import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.res.stringResource -import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @@ -244,9 +240,8 @@ fun SensorsPage(navController: NavController) { items(filterItems) { FilterCheckbox( checked = it.enabled.value, - onCheckedChange = { it.enabled.value = !it.enabled.value }, stringRes = it.stringRes, - ) + ) { it.enabled.value = !it.enabled.value } } } } @@ -264,7 +259,7 @@ fun SensorsPage(navController: NavController) { fontWeight = FontWeight(500), ) } - + LazyColumn( modifier = Modifier .padding(horizontal = 4.dp) @@ -281,25 +276,22 @@ fun SensorsPage(navController: NavController) { item { FilterCheckbox( checked = sortingDesc, - onCheckedChange = { sortingDesc = !sortingDesc }, stringRes = R.string.sort_option_desc, - ) + ) { sortingDesc = !sortingDesc } } item { FilterCheckbox( checked = sortingFav, - onCheckedChange = { sortingFav = !sortingFav }, stringRes = R.string.sort_option_fav, - ) + ) { sortingFav = !sortingFav } } item { FilterCheckbox( checked = sortingMine, - onCheckedChange = { sortingMine = !sortingMine }, stringRes = R.string.sort_option_mine, - ) + ) { sortingMine = !sortingMine } } } } @@ -336,9 +328,10 @@ fun SensorItem(sensor: Sensor) { @ExperimentalMaterial3Api @Composable -fun FilterCheckbox(checked: Boolean, onCheckedChange: () -> Unit, stringRes: Int) { +fun FilterCheckbox(checked: Boolean, stringRes: Int, onCheckedChange: () -> Unit) { Row( verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.fillMaxWidth().clickable { onCheckedChange() } ) { Checkbox( checked = checked, @@ -346,7 +339,6 @@ fun FilterCheckbox(checked: Boolean, onCheckedChange: () -> Unit, stringRes: Int ) Text( text = stringResource(id = stringRes), - modifier = Modifier.clickable { onCheckedChange() }, ) } } -- 2.45.2 From c32ea30772aacb597cb063f47b87dcd79488052c Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Thu, 8 Jun 2023 17:16:30 +0500 Subject: [PATCH 19/28] =?UTF-8?q?=D0=9E=D1=82=D1=81=D1=82=D1=83=D0=BF?= =?UTF-8?q?=D1=8B=20=20=D1=83=20searchbar'=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index eb9fd98..566f394 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -183,7 +183,7 @@ fun SensorsPage(navController: NavController) { onQueryChange = { query -> searchQuery = query }, onSearch = { searchActive = false }, placeholder = { Text(stringResource(R.string.search)) }, - modifier = Modifier.fillMaxWidth() + modifier = Modifier.fillMaxWidth().padding(horizontal = if(!searchActive) 8.dp else 0.dp) ) {} Row( -- 2.45.2 From 9d024a0c6966a78fd70f75e14c2b71e1859ff8fd Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Thu, 8 Jun 2023 18:32:24 +0500 Subject: [PATCH 20/28] =?UTF-8?q?Bottom=20Sheet'=D1=8B=20=D1=82=D0=B5?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D1=8C=20=D0=B6=D0=B8=D0=B2=D1=83=D1=82=20?= =?UTF-8?q?=D0=B2=20=D0=BE=D1=82=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D1=85?= =?UTF-8?q?=20=D1=84=D0=B0=D0=B9=D0=BB=D0=B0=D1=85,=20=D1=87=D1=82=D0=BE?= =?UTF-8?q?=D0=B1=D1=8B=20Sensors.kt=20=D0=B1=D1=8B=D0=BB=20=D1=87=D0=B8?= =?UTF-8?q?=D1=82=D0=B0=D0=B1=D0=B5=D0=BB=D1=8C=D0=BD=D0=B5=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bottomSheets/FilterSensorsBottomSheet.kt | 53 ++++++++++ .../ui/bottomSheets/SortSensorsBottomSheet.kt | 97 +++++++++++++++++++ .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 82 ++-------------- 3 files changed, 160 insertions(+), 72 deletions(-) create mode 100644 app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/FilterSensorsBottomSheet.kt create mode 100644 app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/SortSensorsBottomSheet.kt diff --git a/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/FilterSensorsBottomSheet.kt b/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/FilterSensorsBottomSheet.kt new file mode 100644 index 0000000..92283bd --- /dev/null +++ b/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/FilterSensorsBottomSheet.kt @@ -0,0 +1,53 @@ +package ru.nm17.narodmon.ui.bottomSheets + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.ModalBottomSheet +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import ru.nm17.narodmon.R +import ru.nm17.narodmon.ui.pages.FilterCheckbox +import ru.nm17.narodmon.ui.pages.SensorFilter + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun FilterSensorsBottomSheet( + filterItems: List, + onDismissRequest: () -> Unit +) { + ModalBottomSheet(onDismissRequest = { onDismissRequest.invoke() }) { + Row( + horizontalArrangement = Arrangement.Center, + modifier = Modifier.fillMaxWidth(), + ) { + Text( + text = stringResource(R.string.sensors_filter_title), + fontSize = 24.sp, + fontWeight = FontWeight(500), + ) + } + + LazyColumn( + modifier = Modifier + .padding(horizontal = 4.dp) + .fillMaxWidth(), + ) { + items(filterItems) { + FilterCheckbox( + checked = it.enabled.value, + stringRes = it.stringRes, + ) { it.enabled.value = !it.enabled.value } + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/SortSensorsBottomSheet.kt b/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/SortSensorsBottomSheet.kt new file mode 100644 index 0000000..8287226 --- /dev/null +++ b/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/SortSensorsBottomSheet.kt @@ -0,0 +1,97 @@ +package ru.nm17.narodmon.ui.bottomSheets + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.material3.Button +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.ModalBottomSheet +import androidx.compose.material3.SheetState +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import ru.nm17.narodmon.R +import ru.nm17.narodmon.ui.entities.SensorSortingUiEntity +import ru.nm17.narodmon.ui.entities.SortingTypes +import ru.nm17.narodmon.ui.pages.FilterRadioButton +import ru.nm17.narodmon.ui.theme.NarodMonTheme + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun SortSensorsBottomSheet( + onApply: (sortingType: SortingTypes) -> Unit, + onDismissRequest: () -> Unit +) { + var sortingType by remember { mutableStateOf(SortingTypes.DISTANCE) } + + val sortingTypes = remember { + listOf( + SensorSortingUiEntity(R.string.sort_by_name, SortingTypes.NAME), + SensorSortingUiEntity(R.string.sort_by_name_desc, SortingTypes.NAME_DESC), + SensorSortingUiEntity(R.string.sort_by_distance, SortingTypes.DISTANCE), + SensorSortingUiEntity(R.string.sort_by_distance_desc, SortingTypes.DISTANCE_DESC), + SensorSortingUiEntity(R.string.sort_by_type, SortingTypes.TYPE), + SensorSortingUiEntity(R.string.sort_by_type_desc, SortingTypes.TYPE_DESC), + SensorSortingUiEntity(R.string.sort_update_time, SortingTypes.UPD_TIME), + ) + } + + ModalBottomSheet( + onDismissRequest = { onDismissRequest.invoke() }, + sheetState = SheetState(true) + ) { + Row( + horizontalArrangement = Arrangement.Center, + modifier = Modifier.fillMaxWidth(), + ) { + Text( + text = stringResource(R.string.sensors_sort_title), + fontSize = 24.sp, + fontWeight = FontWeight(500), + ) + } + + LazyColumn( + modifier = Modifier + .padding(horizontal = 4.dp) + .fillMaxWidth(), + ) { + items(sortingTypes) { + FilterRadioButton( + selected = (sortingType == it.sortingType), + onClick = { sortingType = it.sortingType }, + stringRes = it.stringRes, + ) + } + } + Button( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 64.dp, vertical = 8.dp), + onClick = { + onApply.invoke(sortingType) + }) { + Text(text = stringResource(R.string.apply)) + } + } +} + +@Preview +@Composable +fun PreviewSortBottomSheet() { + NarodMonTheme { + SortSensorsBottomSheet(onApply = {}) {} + } +} \ No newline at end of file diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index 566f394..aaac7dc 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -220,81 +220,19 @@ fun SensorsPage(navController: NavController) { } if (filterShow) { - ModalBottomSheet(onDismissRequest = { filterShow = false }) { - Row( - horizontalArrangement = Arrangement.Center, - modifier = Modifier.fillMaxWidth(), - ) { - Text( - text = stringResource(R.string.sensors_filter_title), - fontSize = 24.sp, - fontWeight = FontWeight(500), - ) - } - - LazyColumn( - modifier = Modifier - .padding(horizontal = 4.dp) - .fillMaxWidth(), - ) { - items(filterItems) { - FilterCheckbox( - checked = it.enabled.value, - stringRes = it.stringRes, - ) { it.enabled.value = !it.enabled.value } - } - } - } + FilterSensorsBottomSheet( + filterItems, + onDismissRequest = { filterShow = false } + ) } if (sortingShow) { - ModalBottomSheet(onDismissRequest = { sortingShow = false }) { - Row( - horizontalArrangement = Arrangement.Center, - modifier = Modifier.fillMaxWidth(), - ) { - Text( - text = stringResource(R.string.sensors_sort_title), - fontSize = 24.sp, - fontWeight = FontWeight(500), - ) - } - - LazyColumn( - modifier = Modifier - .padding(horizontal = 4.dp) - .fillMaxWidth(), - ) { - items(sortingTypes) { - FilterRadioButton( - selected = (sortingType == it.sortingType), - onClick = { sortingType = it.sortingType }, - stringRes = it.stringRes, - ) - } - - item { - FilterCheckbox( - checked = sortingDesc, - stringRes = R.string.sort_option_desc, - ) { sortingDesc = !sortingDesc } - } - - item { - FilterCheckbox( - checked = sortingFav, - stringRes = R.string.sort_option_fav, - ) { sortingFav = !sortingFav } - } - - item { - FilterCheckbox( - checked = sortingMine, - stringRes = R.string.sort_option_mine, - ) { sortingMine = !sortingMine } - } - } - } + SortSensorsBottomSheet( + onApply = { s -> + sortingType = s + sortingShow = false + }, + onDismissRequest = { sortingShow = false }) } } -- 2.45.2 From d82a4b28b7b9797f8da4ba76509037b13b29d352 Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Thu, 8 Jun 2023 18:33:57 +0500 Subject: [PATCH 21/28] =?UTF-8?q?=D0=92=D1=8B=D0=BD=D0=B5=D1=81=20data=20?= =?UTF-8?q?=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D1=8B=20=D0=B2=20=D0=BE=D1=82?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20=D1=84=D0=B0=D0=B9?= =?UTF-8?q?=D0=BB=D1=8B.=20=D0=A2=D0=B0=D0=BA=20=D0=BF=D1=80=D0=B8=D0=BD?= =?UTF-8?q?=D1=8F=D1=82=D0=BE=20=D0=B4=D0=B5=D0=BB=D0=B0=D1=82=D1=8C.=20?= =?UTF-8?q?=D0=9F=D0=BE=20=D0=BA=D1=80=D0=B0=D0=B9=D0=BD=D0=B5=D0=B9=20?= =?UTF-8?q?=D0=BC=D0=B5=D1=80=D0=B5=20=D1=83=20=D1=81=D0=B5=D0=B1=D1=8F=20?= =?UTF-8?q?=D1=8F=20=D1=82=D0=B0=D0=BA=20=D1=81=D1=82=D0=B0=D1=80=D0=B0?= =?UTF-8?q?=D1=8E=D1=81=D1=8C=20=D0=B4=D0=B5=D0=BB=D0=B0=D1=82=D1=8C=20:)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nm17/narodmon/ui/entities/SensorEntity.kt | 21 +++ .../ui/entities/SensorFilerUiEntity.kt | 11 ++ .../ui/entities/SensorSortingUiEntity.kt | 7 + .../ui/entities/SortingSensorsEntity.kt | 1 + .../narodmon/ui/entities/SortingTypesEnum.kt | 13 ++ .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 136 +++++++----------- 6 files changed, 103 insertions(+), 86 deletions(-) create mode 100644 app/src/main/java/ru/nm17/narodmon/ui/entities/SensorEntity.kt create mode 100644 app/src/main/java/ru/nm17/narodmon/ui/entities/SensorFilerUiEntity.kt create mode 100644 app/src/main/java/ru/nm17/narodmon/ui/entities/SensorSortingUiEntity.kt create mode 100644 app/src/main/java/ru/nm17/narodmon/ui/entities/SortingSensorsEntity.kt create mode 100644 app/src/main/java/ru/nm17/narodmon/ui/entities/SortingTypesEnum.kt diff --git a/app/src/main/java/ru/nm17/narodmon/ui/entities/SensorEntity.kt b/app/src/main/java/ru/nm17/narodmon/ui/entities/SensorEntity.kt new file mode 100644 index 0000000..84aeb23 --- /dev/null +++ b/app/src/main/java/ru/nm17/narodmon/ui/entities/SensorEntity.kt @@ -0,0 +1,21 @@ +package ru.nm17.narodmon.ui.entities + +import ru.nm17.narodmon.db.entities.SensorType + + +data class SensorEntity( + // TODO: Вынести в отдельный класс, и явно не в директорию `ui` + val id: Int, + val type: SensorType, + val deviceName: String, + val deviceOwner: Int, + val name: String, + val favorite: Boolean, + val public: Boolean, + val mine: Boolean, + val location: String, + val distance: Double, // километры + val value: Double, + val unit: String, + val changed: Int, +) \ No newline at end of file diff --git a/app/src/main/java/ru/nm17/narodmon/ui/entities/SensorFilerUiEntity.kt b/app/src/main/java/ru/nm17/narodmon/ui/entities/SensorFilerUiEntity.kt new file mode 100644 index 0000000..62277d8 --- /dev/null +++ b/app/src/main/java/ru/nm17/narodmon/ui/entities/SensorFilerUiEntity.kt @@ -0,0 +1,11 @@ +package ru.nm17.narodmon.ui.entities + +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.mutableStateOf + +data class SensorFilterUiEntity( + // TODO: Можно попробовать объединить с db/SensorType.kt + val stringRes: Int, + val code: Int, + var enabled: MutableState = mutableStateOf(false), +) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/entities/SensorSortingUiEntity.kt b/app/src/main/java/ru/nm17/narodmon/ui/entities/SensorSortingUiEntity.kt new file mode 100644 index 0000000..96e4604 --- /dev/null +++ b/app/src/main/java/ru/nm17/narodmon/ui/entities/SensorSortingUiEntity.kt @@ -0,0 +1,7 @@ +package ru.nm17.narodmon.ui.entities + + +data class SensorSortingUiEntity( + val stringRes: Int, + val sortingType: SortingTypes, +) \ No newline at end of file diff --git a/app/src/main/java/ru/nm17/narodmon/ui/entities/SortingSensorsEntity.kt b/app/src/main/java/ru/nm17/narodmon/ui/entities/SortingSensorsEntity.kt new file mode 100644 index 0000000..82e230c --- /dev/null +++ b/app/src/main/java/ru/nm17/narodmon/ui/entities/SortingSensorsEntity.kt @@ -0,0 +1 @@ +package ru.nm17.narodmon.ui.entities diff --git a/app/src/main/java/ru/nm17/narodmon/ui/entities/SortingTypesEnum.kt b/app/src/main/java/ru/nm17/narodmon/ui/entities/SortingTypesEnum.kt new file mode 100644 index 0000000..0cb7aa3 --- /dev/null +++ b/app/src/main/java/ru/nm17/narodmon/ui/entities/SortingTypesEnum.kt @@ -0,0 +1,13 @@ +package ru.nm17.narodmon.ui.entities + +enum class SortingTypes { + DISTANCE, + DISTANCE_DESC, + TYPE, + TYPE_DESC, + UPD_TIME, + NAME, + NAME_DESC, + VALUE, + VALUE_DESC +} \ No newline at end of file diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index aaac7dc..a1092f5 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -16,13 +16,12 @@ import androidx.compose.material3.Divider import androidx.compose.material3.ElevatedCard import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.FilterChip +import androidx.compose.material3.Icon import androidx.compose.material3.ListItem -import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.RadioButton import androidx.compose.material3.SearchBar import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.MutableState import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.getValue @@ -31,6 +30,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.RectangleShape import androidx.compose.ui.platform.LocalConfiguration +import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp @@ -38,43 +38,15 @@ import androidx.compose.ui.unit.sp import androidx.navigation.NavController import ru.nm17.narodmon.R import ru.nm17.narodmon.db.entities.SensorType +import ru.nm17.narodmon.ui.bottomSheets.FilterSensorsBottomSheet +import ru.nm17.narodmon.ui.bottomSheets.SortSensorsBottomSheet import ru.nm17.narodmon.ui.elements.GenericNavScaffold import ru.nm17.narodmon.ui.elements.TileMap +import ru.nm17.narodmon.ui.entities.SensorEntity +import ru.nm17.narodmon.ui.entities.SensorFilterUiEntity +import ru.nm17.narodmon.ui.entities.SortingTypes import ru.nm17.narodmon.ui.iosevkaFamily -data class Sensor( - // TODO: Вынести в отдельный класс, и явно не в директорию `ui` - val id: Int, - val type: SensorType, - val deviceName: String, - val deviceOwner: Int, - val name: String, - val favorite: Boolean, - val public: Boolean, - val mine: Boolean, - val location: String, - val distance: Double, // километры - val value: Double, - val unit: String, - val changed: Int, -) - -data class SensorFilter( - // TODO: Можно попробовать объединить с db/SensorType.kt - val stringRes: Int, - val code: Int, - var enabled: MutableState = mutableStateOf(false), -) - -data class SensorSortingItem( - val stringRes: Int, - val sortingType: SortingType, -) - -enum class SortingType { - DISTANCE, TYPE, UPD_TIME, - NAME, VALUE, -} @ExperimentalMaterial3Api @Composable @@ -82,21 +54,9 @@ fun SensorsPage(navController: NavController) { var searchQuery by remember { mutableStateOf("") } var searchActive by remember { mutableStateOf(false) } - var sortingShow by remember { mutableStateOf(false) } - var sortingType by remember { mutableStateOf(SortingType.DISTANCE) } - var sortingDesc by remember { mutableStateOf(false) } - var sortingMine by remember { mutableStateOf(false) } - var sortingFav by remember { mutableStateOf(false) } - val sortingTypes = remember { - listOf( - SensorSortingItem(R.string.sort_distance, SortingType.DISTANCE), - SensorSortingItem(R.string.sort_type, SortingType.TYPE), - SensorSortingItem(R.string.sort_update_time, SortingType.UPD_TIME), - SensorSortingItem(R.string.sort_name, SortingType.NAME), - SensorSortingItem(R.string.sort_value, SortingType.VALUE), - ) - } + var sortingShow by remember { mutableStateOf(false) } + var sortingType by remember { mutableStateOf(SortingTypes.DISTANCE) } var filterShow by remember { mutableStateOf(false) } var filterMine by remember { mutableStateOf(false) } @@ -107,36 +67,36 @@ fun SensorsPage(navController: NavController) { * Заменить `code` на настоящее значение * либо динамически его подгружать из ответа АПИ * (см. /appInit, ключ в жсоне: types.type) */ - SensorFilter(R.string.filter_temp, 0), - SensorFilter(R.string.filter_temp_water, 1), - SensorFilter(R.string.filter_temp_ground, 2), - SensorFilter(R.string.filter_temp_dew_point, 3), - SensorFilter(R.string.filter_humidity, 4), - SensorFilter(R.string.filter_pressure, 5), - SensorFilter(R.string.filter_lightness, 6), - SensorFilter(R.string.filter_uv, 7), - SensorFilter(R.string.filter_radiation, 8), - SensorFilter(R.string.filter_rainfall, 9), - SensorFilter(R.string.filter_dust, 10), - SensorFilter(R.string.filter_wind_speed, 11), - SensorFilter(R.string.filter_wind_direction, 12), - SensorFilter(R.string.filter_concentration, 13), - SensorFilter(R.string.filter_power, 14), - SensorFilter(R.string.filter_voltage, 15), - SensorFilter(R.string.filter_amperage, 16), - SensorFilter(R.string.filter_energy, 17), - SensorFilter(R.string.filter_battery, 18), - SensorFilter(R.string.filter_rxtx, 19), - SensorFilter(R.string.filter_signal, 20), - SensorFilter(R.string.filter_water_meter, 21), - SensorFilter(R.string.filter_time, 22), + SensorFilterUiEntity(R.string.filter_temp, 0), + SensorFilterUiEntity(R.string.filter_temp_water, 1), + SensorFilterUiEntity(R.string.filter_temp_ground, 2), + SensorFilterUiEntity(R.string.filter_temp_dew_point, 3), + SensorFilterUiEntity(R.string.filter_humidity, 4), + SensorFilterUiEntity(R.string.filter_pressure, 5), + SensorFilterUiEntity(R.string.filter_lightness, 6), + SensorFilterUiEntity(R.string.filter_uv, 7), + SensorFilterUiEntity(R.string.filter_radiation, 8), + SensorFilterUiEntity(R.string.filter_rainfall, 9), + SensorFilterUiEntity(R.string.filter_dust, 10), + SensorFilterUiEntity(R.string.filter_wind_speed, 11), + SensorFilterUiEntity(R.string.filter_wind_direction, 12), + SensorFilterUiEntity(R.string.filter_concentration, 13), + SensorFilterUiEntity(R.string.filter_power, 14), + SensorFilterUiEntity(R.string.filter_voltage, 15), + SensorFilterUiEntity(R.string.filter_amperage, 16), + SensorFilterUiEntity(R.string.filter_energy, 17), + SensorFilterUiEntity(R.string.filter_battery, 18), + SensorFilterUiEntity(R.string.filter_rxtx, 19), + SensorFilterUiEntity(R.string.filter_signal, 20), + SensorFilterUiEntity(R.string.filter_water_meter, 21), + SensorFilterUiEntity(R.string.filter_time, 22), ) } - val sensors = remember { + val sensorEntities = remember { mutableListOf( // TODO: загружать датчики с сервера. Этот список -- для макета - Sensor( + SensorEntity( 0, SensorType(0, "temp", "C"), "device0", 0, @@ -145,7 +105,7 @@ fun SensorsPage(navController: NavController) { "Москва", 0.4, 20.0, "C", 1686142800, ), - Sensor( + SensorEntity( 1, SensorType(4, "humidity", "%"), "device1", 0, @@ -154,7 +114,7 @@ fun SensorsPage(navController: NavController) { "Подмосковье", 1.1, 39.0, "%", 1686142800, ), - Sensor( + SensorEntity( 2, SensorType(11, "wind speed", "m/s"), "device2", 1, @@ -183,7 +143,9 @@ fun SensorsPage(navController: NavController) { onQueryChange = { query -> searchQuery = query }, onSearch = { searchActive = false }, placeholder = { Text(stringResource(R.string.search)) }, - modifier = Modifier.fillMaxWidth().padding(horizontal = if(!searchActive) 8.dp else 0.dp) + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = if (!searchActive) 8.dp else 0.dp) ) {} Row( @@ -212,7 +174,7 @@ fun SensorsPage(navController: NavController) { LazyColumn( modifier = Modifier.fillMaxHeight(), ) { - items(sensors) { sensor -> + items(sensorEntities) { sensor -> SensorItem(sensor) } } @@ -238,21 +200,21 @@ fun SensorsPage(navController: NavController) { @ExperimentalMaterial3Api @Composable -fun SensorItem(sensor: Sensor) { +fun SensorItem(sensorEntity: SensorEntity) { ListItem( - overlineContent = { Text(text = "${sensor.deviceName} от ${sensor.deviceOwner}") }, - headlineContent = { Text(text = sensor.type.name) }, - supportingContent = { Text(text = sensor.name) }, + overlineContent = { Text(text = "${sensorEntity.deviceName} от ${sensorEntity.deviceOwner}") }, + headlineContent = { Text(text = sensorEntity.type.name) }, + supportingContent = { Text(text = sensorEntity.name) }, trailingContent = { Column( horizontalAlignment = Alignment.End, ) { - Text(text = "${sensor.distance} km") + Text(text = "${sensorEntity.distance} km") ElevatedCard( shape = RectangleShape, ) { Text( - text = "${sensor.value} ${sensor.unit}", + text = "${sensorEntity.value} ${sensorEntity.unit}", fontFamily = iosevkaFamily, fontWeight = FontWeight.Medium, fontSize = 14.sp, @@ -269,7 +231,9 @@ fun SensorItem(sensor: Sensor) { fun FilterCheckbox(checked: Boolean, stringRes: Int, onCheckedChange: () -> Unit) { Row( verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.fillMaxWidth().clickable { onCheckedChange() } + modifier = Modifier + .fillMaxWidth() + .clickable { onCheckedChange() } ) { Checkbox( checked = checked, @@ -284,7 +248,7 @@ fun FilterCheckbox(checked: Boolean, stringRes: Int, onCheckedChange: () -> Unit @ExperimentalMaterial3Api @Composable fun FilterRadioButton(selected: Boolean, onClick: () -> Unit, stringRes: Int) { - Row ( + Row( verticalAlignment = Alignment.CenterVertically, ) { RadioButton( -- 2.45.2 From 01b362ce4ef6cd4e65fe5d6bd32005949df839f7 Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Thu, 8 Jun 2023 18:34:41 +0500 Subject: [PATCH 22/28] =?UTF-8?q?=D0=9F=D0=BE=D0=BC=D0=B5=D0=BD=D1=8F?= =?UTF-8?q?=D0=BB=20strings.xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/values/strings.xml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2694904..21124ef 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,7 +1,6 @@ Народный Мониторинг - Hello blank fragment Я принимаю соглашения Выйти @@ -18,7 +17,7 @@ Поиск Фильтр Сортировка - Мои + Мои датчики Температура точки росы Температура воздуха Температура воды @@ -43,13 +42,13 @@ Счётчик воды Время работы Тип датчиков - Расстояние - Тип датчика - Время последнего обновления - Название - Данные - По убыванию - Избранные сверху - Мои датчики сверху - Сортировка + От ближних к дальним + По типу (от А до Я) + По типу (от Я до А) + По названию (от А до Я) + По названию (от Я до А) + Сортировка датчиков + По времени обновления + Применить + От дальних к ближним \ No newline at end of file -- 2.45.2 From 937f4890e16926173403bee0930e7a1a3136fd0d Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Thu, 8 Jun 2023 18:48:34 +0500 Subject: [PATCH 23/28] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B8=D0=BA=D0=BE=D0=BD=D0=BA=D0=B8=20=D0=BA=20=D1=87?= =?UTF-8?q?=D0=B8=D0=BF=D0=B0=D0=BC=20=D0=B2=20Sensors.kt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/ru/nm17/narodmon/ui/pages/Sensors.kt | 12 ++++++++++++ app/src/main/res/drawable/ic_filter.xml | 5 +++++ app/src/main/res/drawable/ic_sort.xml | 5 +++++ 3 files changed, 22 insertions(+) create mode 100644 app/src/main/res/drawable/ic_filter.xml create mode 100644 app/src/main/res/drawable/ic_sort.xml diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index a1092f5..8f0e218 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -154,11 +154,23 @@ fun SensorsPage(navController: NavController) { ) { AssistChip( onClick = { filterShow = true }, + leadingIcon = { + Icon( + painter = painterResource(id = R.drawable.ic_filter), + contentDescription = stringResource(id = R.string.sensors_filter) + ) + }, label = { Text(text = stringResource(R.string.sensors_filter)) }, ) AssistChip( onClick = { sortingShow = true }, + leadingIcon = { + Icon( + painter = painterResource(id = R.drawable.ic_sort), + contentDescription = stringResource(id = R.string.sensors_sorting) + ) + }, label = { Text(text = stringResource(R.string.sensors_sorting)) }, ) diff --git a/app/src/main/res/drawable/ic_filter.xml b/app/src/main/res/drawable/ic_filter.xml new file mode 100644 index 0000000..d574422 --- /dev/null +++ b/app/src/main/res/drawable/ic_filter.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_sort.xml b/app/src/main/res/drawable/ic_sort.xml new file mode 100644 index 0000000..ed8927f --- /dev/null +++ b/app/src/main/res/drawable/ic_sort.xml @@ -0,0 +1,5 @@ + + + -- 2.45.2 From 1c8f993dcbcf7bec9f34e8203783efd5f289d475 Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Thu, 8 Jun 2023 18:48:47 +0500 Subject: [PATCH 24/28] =?UTF-8?q?=D0=A3=D0=BF=D1=81.=20=D0=9E=D1=87=D0=B5?= =?UTF-8?q?=D0=BF=D1=8F=D1=82=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nm17/narodmon/ui/bottomSheets/FilterSensorsBottomSheet.kt | 4 ++-- .../{SensorFilerUiEntity.kt => SensorFilterUiEntity.kt} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename app/src/main/java/ru/nm17/narodmon/ui/entities/{SensorFilerUiEntity.kt => SensorFilterUiEntity.kt} (100%) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/FilterSensorsBottomSheet.kt b/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/FilterSensorsBottomSheet.kt index 92283bd..63f8b6c 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/FilterSensorsBottomSheet.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/FilterSensorsBottomSheet.kt @@ -16,13 +16,13 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import ru.nm17.narodmon.R +import ru.nm17.narodmon.ui.entities.SensorFilterUiEntity import ru.nm17.narodmon.ui.pages.FilterCheckbox -import ru.nm17.narodmon.ui.pages.SensorFilter @OptIn(ExperimentalMaterial3Api::class) @Composable fun FilterSensorsBottomSheet( - filterItems: List, + filterItems: List, onDismissRequest: () -> Unit ) { ModalBottomSheet(onDismissRequest = { onDismissRequest.invoke() }) { diff --git a/app/src/main/java/ru/nm17/narodmon/ui/entities/SensorFilerUiEntity.kt b/app/src/main/java/ru/nm17/narodmon/ui/entities/SensorFilterUiEntity.kt similarity index 100% rename from app/src/main/java/ru/nm17/narodmon/ui/entities/SensorFilerUiEntity.kt rename to app/src/main/java/ru/nm17/narodmon/ui/entities/SensorFilterUiEntity.kt -- 2.45.2 From 45c9101f9dd47a9e5601ed7edb25ab7f4e7c22fc Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Thu, 8 Jun 2023 18:51:09 +0500 Subject: [PATCH 25/28] =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BB=20=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D1=83=D0=B6=D0=BD=D0=BE=D0=B5=20=D0=B8=D0=B7=20Mai?= =?UTF-8?q?nActivity.kt=20+=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D1=83=D0=B6=D0=BD=D1=8B=D0=B9=20.xml=20?= =?UTF-8?q?=D1=84=D0=B0=D0=B9=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/ru/nm17/narodmon/MainActivity.kt | 16 ---------------- app/src/main/res/layout/fragment_sensors.xml | 14 -------------- 2 files changed, 30 deletions(-) delete mode 100644 app/src/main/res/layout/fragment_sensors.xml diff --git a/app/src/main/java/ru/nm17/narodmon/MainActivity.kt b/app/src/main/java/ru/nm17/narodmon/MainActivity.kt index b673692..baff5ae 100644 --- a/app/src/main/java/ru/nm17/narodmon/MainActivity.kt +++ b/app/src/main/java/ru/nm17/narodmon/MainActivity.kt @@ -132,23 +132,7 @@ class MainActivity : ComponentActivity() { } } -@Composable -fun Greeting(name: String, modifier: Modifier = Modifier) { - Text( - text = "Hello $name!", - modifier = modifier - ) -} - @Composable fun NavHolderEl() { //NavHost(navController = NavHostController(N), graph =) } - -@Preview(showBackground = true) -@Composable -fun GreetingPreview() { - NarodMonTheme { - Greeting("Android") - } -} \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_sensors.xml b/app/src/main/res/layout/fragment_sensors.xml deleted file mode 100644 index e076d3b..0000000 --- a/app/src/main/res/layout/fragment_sensors.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - \ No newline at end of file -- 2.45.2 From 9cd0bcddc87093e3cf826eaa75c46181688c051d Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Thu, 8 Jun 2023 18:54:41 +0500 Subject: [PATCH 26/28] =?UTF-8?q?=D0=A0=D0=B0=D0=B4=D0=B8=D0=BE=20=D0=BA?= =?UTF-8?q?=D0=BD=D0=BE=D0=BF=D0=BA=D0=B8=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D1=8C=20=D0=BF=D1=80=D0=BE=D0=BA=D0=BB=D0=B8=D0=BA=D0=B8=D0=B2?= =?UTF-8?q?=D0=B0=D1=8E=D1=82=D1=81=D1=8F=20=D0=BF=D0=BE=20=D0=B2=D1=81?= =?UTF-8?q?=D0=B5=D0=B9=20=D1=88=D0=B8=D1=80=D0=B8=D0=BD=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index 8f0e218..1abff3a 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -262,14 +262,12 @@ fun FilterCheckbox(checked: Boolean, stringRes: Int, onCheckedChange: () -> Unit fun FilterRadioButton(selected: Boolean, onClick: () -> Unit, stringRes: Int) { Row( verticalAlignment = Alignment.CenterVertically, + modifier = Modifier.fillMaxWidth().clickable { onClick.invoke() } ) { RadioButton( selected = selected, onClick = onClick, ) - Text( - text = stringResource(id = stringRes), - modifier = Modifier.clickable { onClick() }, - ) + Text(text = stringResource(id = stringRes)) } } \ No newline at end of file -- 2.45.2 From 2a6bfb205c34fb5e7892019311484168f9af0167 Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Thu, 8 Jun 2023 19:26:56 +0500 Subject: [PATCH 27/28] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5?= =?UTF-8?q?=D0=BD=20UX=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bottomSheets/FilterSensorsBottomSheet.kt | 92 ++++++++++++++++--- .../java/ru/nm17/narodmon/ui/pages/Sensors.kt | 40 ++------ 2 files changed, 86 insertions(+), 46 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/FilterSensorsBottomSheet.kt b/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/FilterSensorsBottomSheet.kt index 63f8b6c..ce8be73 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/FilterSensorsBottomSheet.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/bottomSheets/FilterSensorsBottomSheet.kt @@ -1,53 +1,119 @@ package ru.nm17.narodmon.ui.bottomSheets import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items +import androidx.compose.material3.Button import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ModalBottomSheet +import androidx.compose.material3.SheetState +import androidx.compose.material3.SheetValue import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import ru.nm17.narodmon.R import ru.nm17.narodmon.ui.entities.SensorFilterUiEntity import ru.nm17.narodmon.ui.pages.FilterCheckbox +import ru.nm17.narodmon.ui.theme.NarodMonTheme @OptIn(ExperimentalMaterial3Api::class) @Composable fun FilterSensorsBottomSheet( - filterItems: List, + onApply: (filters: List) -> Unit, onDismissRequest: () -> Unit ) { - ModalBottomSheet(onDismissRequest = { onDismissRequest.invoke() }) { + val filterItems = remember { + listOf( + /* TODO: + * Заменить `code` на настоящее значение + * либо динамически его подгружать из ответа АПИ + * (см. /appInit, ключ в жсоне: types.type) */ + SensorFilterUiEntity(R.string.filter_temp, 0), + SensorFilterUiEntity(R.string.filter_temp_water, 1), + SensorFilterUiEntity(R.string.filter_temp_ground, 2), + SensorFilterUiEntity(R.string.filter_temp_dew_point, 3), + SensorFilterUiEntity(R.string.filter_humidity, 4), + SensorFilterUiEntity(R.string.filter_pressure, 5), + SensorFilterUiEntity(R.string.filter_lightness, 6), + SensorFilterUiEntity(R.string.filter_uv, 7), + SensorFilterUiEntity(R.string.filter_radiation, 8), + SensorFilterUiEntity(R.string.filter_rainfall, 9), + SensorFilterUiEntity(R.string.filter_dust, 10), + SensorFilterUiEntity(R.string.filter_wind_speed, 11), + SensorFilterUiEntity(R.string.filter_wind_direction, 12), + SensorFilterUiEntity(R.string.filter_concentration, 13), + SensorFilterUiEntity(R.string.filter_power, 14), + SensorFilterUiEntity(R.string.filter_voltage, 15), + SensorFilterUiEntity(R.string.filter_amperage, 16), + SensorFilterUiEntity(R.string.filter_energy, 17), + SensorFilterUiEntity(R.string.filter_battery, 18), + SensorFilterUiEntity(R.string.filter_rxtx, 19), + SensorFilterUiEntity(R.string.filter_signal, 20), + SensorFilterUiEntity(R.string.filter_water_meter, 21), + SensorFilterUiEntity(R.string.filter_time, 22), + ) + } + + ModalBottomSheet( + onDismissRequest = { onDismissRequest.invoke() }, + sheetState = SheetState(true) + ) { Row( horizontalArrangement = Arrangement.Center, modifier = Modifier.fillMaxWidth(), ) { + Text( text = stringResource(R.string.sensors_filter_title), fontSize = 24.sp, fontWeight = FontWeight(500), ) } - - LazyColumn( - modifier = Modifier - .padding(horizontal = 4.dp) - .fillMaxWidth(), - ) { - items(filterItems) { - FilterCheckbox( - checked = it.enabled.value, - stringRes = it.stringRes, - ) { it.enabled.value = !it.enabled.value } + Box(contentAlignment = Alignment.BottomCenter) { + LazyColumn( + modifier = Modifier + .padding(horizontal = 4.dp) + .fillMaxWidth(), + ) { + items(filterItems) { + FilterCheckbox( + checked = it.enabled.value, + stringRes = it.stringRes, + ) { it.enabled.value = !it.enabled.value } + } } + Button( + onClick = { onApply.invoke(filterItems) }, + modifier = Modifier + .fillMaxWidth() + .padding(vertical = 16.dp, horizontal = 64.dp) + ) { + Text(text = stringResource(id = R.string.apply)) + } + } + + } +} + +@Preview +@Composable +fun PreviewSensorFilterBottomSheet() { + NarodMonTheme { + FilterSensorsBottomSheet({}) { + } } } \ No newline at end of file diff --git a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt index 1abff3a..b67adfc 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/pages/Sensors.kt @@ -61,37 +61,6 @@ fun SensorsPage(navController: NavController) { var filterShow by remember { mutableStateOf(false) } var filterMine by remember { mutableStateOf(false) } - val filterItems = remember { - listOf( - /* TODO: - * Заменить `code` на настоящее значение - * либо динамически его подгружать из ответа АПИ - * (см. /appInit, ключ в жсоне: types.type) */ - SensorFilterUiEntity(R.string.filter_temp, 0), - SensorFilterUiEntity(R.string.filter_temp_water, 1), - SensorFilterUiEntity(R.string.filter_temp_ground, 2), - SensorFilterUiEntity(R.string.filter_temp_dew_point, 3), - SensorFilterUiEntity(R.string.filter_humidity, 4), - SensorFilterUiEntity(R.string.filter_pressure, 5), - SensorFilterUiEntity(R.string.filter_lightness, 6), - SensorFilterUiEntity(R.string.filter_uv, 7), - SensorFilterUiEntity(R.string.filter_radiation, 8), - SensorFilterUiEntity(R.string.filter_rainfall, 9), - SensorFilterUiEntity(R.string.filter_dust, 10), - SensorFilterUiEntity(R.string.filter_wind_speed, 11), - SensorFilterUiEntity(R.string.filter_wind_direction, 12), - SensorFilterUiEntity(R.string.filter_concentration, 13), - SensorFilterUiEntity(R.string.filter_power, 14), - SensorFilterUiEntity(R.string.filter_voltage, 15), - SensorFilterUiEntity(R.string.filter_amperage, 16), - SensorFilterUiEntity(R.string.filter_energy, 17), - SensorFilterUiEntity(R.string.filter_battery, 18), - SensorFilterUiEntity(R.string.filter_rxtx, 19), - SensorFilterUiEntity(R.string.filter_signal, 20), - SensorFilterUiEntity(R.string.filter_water_meter, 21), - SensorFilterUiEntity(R.string.filter_time, 22), - ) - } val sensorEntities = remember { mutableListOf( @@ -195,7 +164,10 @@ fun SensorsPage(navController: NavController) { if (filterShow) { FilterSensorsBottomSheet( - filterItems, + onApply = { + // TODO применение фильтров + filterShow = false + }, onDismissRequest = { filterShow = false } ) } @@ -262,7 +234,9 @@ fun FilterCheckbox(checked: Boolean, stringRes: Int, onCheckedChange: () -> Unit fun FilterRadioButton(selected: Boolean, onClick: () -> Unit, stringRes: Int) { Row( verticalAlignment = Alignment.CenterVertically, - modifier = Modifier.fillMaxWidth().clickable { onClick.invoke() } + modifier = Modifier + .fillMaxWidth() + .clickable { onClick.invoke() } ) { RadioButton( selected = selected, -- 2.45.2 From 0bdf64b7ed0d99eb549625f6009c8f813c4d9d4f Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Fri, 9 Jun 2023 19:31:08 +0500 Subject: [PATCH 28/28] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20Ui=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D0=B5=D0=B1-?= =?UTF-8?q?=D0=BA=D0=B0=D0=BC=D0=B5=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 6 +- .../narodmon/ui/webCamsScreen/WebCamItem.kt | 74 +++++++++++++++++++ .../ui/webCamsScreen/WebCamUiEntity.kt | 13 ++++ .../ui/webCamsScreen/WebCamsScreen.kt | 63 ++++++++++++++++ 4 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamItem.kt create mode 100644 app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamUiEntity.kt create mode 100644 app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamsScreen.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9be7f7e..153e5da 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -145,4 +145,8 @@ dependencies { // Map Compose library implementation("ovh.plrapps:mapcompose:2.7.1") -} \ No newline at end of file + + // Glide + implementation ("com.github.bumptech.glide:glide:4.14.2") + implementation("com.github.bumptech.glide:compose:1.0.0-alpha.1") + } \ No newline at end of file diff --git a/app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamItem.kt b/app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamItem.kt new file mode 100644 index 0000000..1bf1928 --- /dev/null +++ b/app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamItem.kt @@ -0,0 +1,74 @@ +package ru.nm17.narodmon.ui.webCamsScreen + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import com.bumptech.glide.integration.compose.ExperimentalGlideComposeApi +import com.bumptech.glide.integration.compose.GlideImage +import ru.nm17.narodmon.ui.iosevkaFamily + +@OptIn(ExperimentalGlideComposeApi::class) +@Composable +fun WebCamItem(webCamEntity: WebCamUiEntity) { + Box( + modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp), + contentAlignment = Alignment.BottomStart + ) { + GlideImage( + model = webCamEntity.imageUrl, + contentDescription = webCamEntity.name, + contentScale = ContentScale.FillHeight, + modifier = Modifier + .clip(RoundedCornerShape(8.dp)) + .height(240.dp) + .fillMaxWidth() + ) + Row( + modifier = Modifier + .clip( + RoundedCornerShape(bottomEnd = 8.dp, bottomStart = 8.dp) + ) + .background(Color(0f, 0f, 0f, 0.55f)) + .padding(start = 16.dp, end = 16.dp, bottom = 12.dp, top = 8.dp), + verticalAlignment = Alignment.CenterVertically + ) { + Column { + Text( + text = webCamEntity.time, + color = Color.White, + fontFamily = iosevkaFamily + ) + Text( + text = webCamEntity.name, + color = Color.White, + maxLines = 1, + fontFamily = iosevkaFamily + ) + + } + Text( + text = "${webCamEntity.distance} км", + color = Color.White, + fontFamily = iosevkaFamily, + modifier = Modifier.fillMaxWidth(), + textAlign = TextAlign.End + ) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamUiEntity.kt b/app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamUiEntity.kt new file mode 100644 index 0000000..e17a48e --- /dev/null +++ b/app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamUiEntity.kt @@ -0,0 +1,13 @@ +package ru.nm17.narodmon.ui.webCamsScreen + +import android.graphics.Bitmap +import androidx.compose.ui.graphics.ImageBitmap + +data class WebCamUiEntity( + val id: Int, + val name: String, + val distance: Int, + val location: String, + val time: String, + val imageUrl: String +) diff --git a/app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamsScreen.kt b/app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamsScreen.kt new file mode 100644 index 0000000..98298b9 --- /dev/null +++ b/app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamsScreen.kt @@ -0,0 +1,63 @@ +package ru.nm17.narodmon.ui.webCamsScreen + +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.items +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.viewinterop.AndroidView +import ru.nm17.narodmon.ui.theme.NarodMonTheme + +@Composable +fun WebCamsScreen() { + + var webCams by remember { + mutableStateOf( + listOf( + WebCamUiEntity( + 1, + "Крутая камера", + 1, + "Улица Пушкина, дом Калатушкина, кватира под номером 5", + "12:45", + "https://images-webcams.windy.com/51/1559159251/current/preview/1559159251.jpg?1686320054" + ), + WebCamUiEntity( + 2, + "Крутая камера 2", + 2, + "Улица Пушкина, дом Калатушкина, кватира под номером 5", + "12:45", + "https://images-webcams.windy.com/51/1559159251/current/preview/1559159251.jpg?1686320054" + ), + WebCamUiEntity( + 3, + "Крутая камера 3", + 3, + "Улица Пушкина, дом Калатушкина, кватира под номером 5", + "12:45", + "https://images-webcams.windy.com/51/1559159251/current/preview/1559159251.jpg?1686320054" + ) + ) + ) + } // TODO источник камер + + LazyColumn() { + items(webCams) { + WebCamItem(webCamEntity = it) + } + } +} + +@Preview +@Composable +fun PreviewWebCams() { + NarodMonTheme { + WebCamsScreen() + } +} \ No newline at end of file -- 2.45.2