From 4f6756940974d5092d8dd10c4dadf4a8a8a909bb Mon Sep 17 00:00:00 2001 From: mezhendosina Date: Wed, 21 Jun 2023 14:39:25 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D1=87=D0=B8=D1=81=D1=82=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B8=D0=BC=D0=BF=D0=BE=D1=80=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/ru/nm17/narodmon/MainActivity.kt | 25 +------------------ .../narodmon/ui/messages/MessagesScreen.kt | 3 --- .../ru/nm17/narodmon/ui/navHost/AppNavHost.kt | 16 ------------ .../ru/nm17/narodmon/ui/navHost/MainScreen.kt | 7 ------ .../narodmon/ui/navHost/MainScreenSealed.kt | 5 ---- .../ui/sensorsScreen/SensorsScreen.kt | 18 +------------ .../ui/webCamsScreen/WebCamsScreen.kt | 3 --- 7 files changed, 2 insertions(+), 75 deletions(-) diff --git a/app/src/main/java/ru/nm17/narodmon/MainActivity.kt b/app/src/main/java/ru/nm17/narodmon/MainActivity.kt index 6216071..fb62ffc 100644 --- a/app/src/main/java/ru/nm17/narodmon/MainActivity.kt +++ b/app/src/main/java/ru/nm17/narodmon/MainActivity.kt @@ -1,27 +1,16 @@ -@file:OptIn( - ExperimentalMaterial3Api::class, ExperimentalMaterial3Api::class, - ExperimentalMaterial3Api::class -) + package ru.nm17.narodmon import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent -import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Person -import androidx.compose.material.icons.rounded.Add -import androidx.compose.material.icons.rounded.Menu -import androidx.compose.material3.BottomAppBar import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.FloatingActionButton import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -33,23 +22,14 @@ import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource -import androidx.compose.ui.unit.dp -import androidx.navigation.compose.NavHost -import androidx.navigation.compose.composable -import androidx.navigation.compose.rememberNavController import androidx.room.Room -import androidx.security.crypto.EncryptedSharedPreferences -import androidx.security.crypto.MasterKeys import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import ru.nm17.narodmon.db.AppDatabase import ru.nm17.narodmon.db.entities.KVSetting import ru.nm17.narodmon.ui.dialogs.AgreementDialog import ru.nm17.narodmon.ui.navHost.AppNavHost -import ru.nm17.narodmon.ui.navHost.MainScreen -import ru.nm17.narodmon.ui.sensorsScreen.SensorsScreen import ru.nm17.narodmon.ui.theme.NarodMonTheme @@ -116,9 +96,6 @@ class MainActivity : ComponentActivity() { } else { AppNavHost() } - - // A surface container using the 'background' color from the theme - } } } diff --git a/app/src/main/java/ru/nm17/narodmon/ui/messages/MessagesScreen.kt b/app/src/main/java/ru/nm17/narodmon/ui/messages/MessagesScreen.kt index 04fb587..b6dafaa 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/messages/MessagesScreen.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/messages/MessagesScreen.kt @@ -1,10 +1,7 @@ package ru.nm17.narodmon.ui.messages -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview @Composable diff --git a/app/src/main/java/ru/nm17/narodmon/ui/navHost/AppNavHost.kt b/app/src/main/java/ru/nm17/narodmon/ui/navHost/AppNavHost.kt index 25bb97d..8a53f00 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/navHost/AppNavHost.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/navHost/AppNavHost.kt @@ -1,27 +1,11 @@ package ru.nm17.narodmon.ui.navHost -import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.PaddingValues -import androidx.compose.foundation.layout.padding -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.rounded.Add -import androidx.compose.material.icons.rounded.Menu -import androidx.compose.material3.BottomAppBar import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.FloatingActionButton -import androidx.compose.material3.Scaffold import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.rememberCoroutineScope -import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable -import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController -import ru.nm17.narodmon.ui.sensorsScreen.SensorsScreen import ru.nm17.narodmon.ui.settings.SettingsScreen diff --git a/app/src/main/java/ru/nm17/narodmon/ui/navHost/MainScreen.kt b/app/src/main/java/ru/nm17/narodmon/ui/navHost/MainScreen.kt index a8af55f..b3b8e10 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/navHost/MainScreen.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/navHost/MainScreen.kt @@ -2,29 +2,22 @@ package ru.nm17.narodmon.ui.navHost import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.rounded.Menu import androidx.compose.material3.Icon import androidx.compose.material3.NavigationBar import androidx.compose.material3.NavigationBarItem import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.navigation.NavController -import androidx.navigation.NavDestination.Companion.hierarchy import androidx.navigation.NavGraph.Companion.findStartDestination import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable -import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController -import ru.nm17.narodmon.ui.messages.MessagesScreen import ru.nm17.narodmon.ui.sensorsScreen.SensorsScreen -import ru.nm17.narodmon.ui.settings.SettingsScreen import ru.nm17.narodmon.ui.theme.NarodMonTheme import ru.nm17.narodmon.ui.webCamsScreen.WebCamsScreen diff --git a/app/src/main/java/ru/nm17/narodmon/ui/navHost/MainScreenSealed.kt b/app/src/main/java/ru/nm17/narodmon/ui/navHost/MainScreenSealed.kt index 0dd0636..89fcdde 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/navHost/MainScreenSealed.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/navHost/MainScreenSealed.kt @@ -1,12 +1,7 @@ package ru.nm17.narodmon.ui.navHost -import android.widget.ImageView import androidx.annotation.DrawableRes import androidx.annotation.StringRes -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Home -import androidx.compose.material.icons.filled.Menu -import androidx.compose.ui.graphics.vector.ImageVector import ru.nm17.narodmon.R sealed class MainScreenSealed( diff --git a/app/src/main/java/ru/nm17/narodmon/ui/sensorsScreen/SensorsScreen.kt b/app/src/main/java/ru/nm17/narodmon/ui/sensorsScreen/SensorsScreen.kt index 60ec870..d2f24a6 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/sensorsScreen/SensorsScreen.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/sensorsScreen/SensorsScreen.kt @@ -1,6 +1,5 @@ package ru.nm17.narodmon.ui.sensorsScreen -import androidx.compose.animation.AnimatedContent import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.ExperimentalAnimationApi import androidx.compose.foundation.layout.Arrangement @@ -13,26 +12,18 @@ import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyRow import androidx.compose.foundation.lazy.items import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.ArrowDropDown import androidx.compose.material.icons.outlined.Settings -import androidx.compose.material.icons.rounded.ArrowDropDown import androidx.compose.material.icons.rounded.Check -import androidx.compose.material.icons.rounded.Person -import androidx.compose.material.icons.rounded.Settings import androidx.compose.material3.BottomSheetScaffold import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.FilterChip import androidx.compose.material3.Icon import androidx.compose.material3.IconButton -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.SearchBar import androidx.compose.material3.SearchBarDefaults import androidx.compose.material3.SheetValue import androidx.compose.material3.Text -import androidx.compose.material3.TextField -import androidx.compose.material3.TextFieldColors -import androidx.compose.material3.TextFieldDefaults import androidx.compose.material3.rememberBottomSheetScaffoldState import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -48,21 +39,15 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.navigation.NavController import androidx.navigation.compose.rememberNavController -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.delay -import kotlinx.coroutines.launch -import ovh.plrapps.mapcompose.core.debounce import ru.nm17.narodmon.R import ru.nm17.narodmon.db.entities.SensorType import ru.nm17.narodmon.ui.dialogs.FilterSensorsDialog -import ru.nm17.narodmon.ui.elements.SensorItem import ru.nm17.narodmon.ui.dialogs.SortSensorsDialog +import ru.nm17.narodmon.ui.elements.SensorItem import ru.nm17.narodmon.ui.elements.TileMap import ru.nm17.narodmon.ui.entities.SensorEntity import ru.nm17.narodmon.ui.entities.SensorSortingUiEntity import ru.nm17.narodmon.ui.entities.SortingTypes -import ru.nm17.narodmon.ui.navHost.MainScreenSealed import ru.nm17.narodmon.ui.theme.NarodMonTheme import ru.nm17.narodmon.ui.toChipTitle @@ -70,7 +55,6 @@ import ru.nm17.narodmon.ui.toChipTitle @OptIn(ExperimentalMaterial3Api::class, ExperimentalAnimationApi::class) @Composable fun SensorsScreen(navController: NavController, onSettingsClick: () -> Unit) { - val coroutineScope = rememberCoroutineScope() var searchQuery by remember { mutableStateOf("") } var searchActive by remember { mutableStateOf(false) } 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 index 0bdbcc9..38a4a3a 100644 --- a/app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamsScreen.kt +++ b/app/src/main/java/ru/nm17/narodmon/ui/webCamsScreen/WebCamsScreen.kt @@ -1,6 +1,5 @@ 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 @@ -8,9 +7,7 @@ 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 androidx.navigation.NavController import androidx.navigation.compose.rememberNavController import ru.nm17.narodmon.ui.theme.NarodMonTheme