This commit is contained in:
ElEgEv 2023-12-16 17:02:20 +04:00
parent 36dd3727b9
commit a7fe8a973c
5 changed files with 7 additions and 35 deletions

View File

@ -2,6 +2,9 @@
<module version="4"> <module version="4">
<component name="ModuleClassLoaderOverlays"> <component name="ModuleClassLoaderOverlays">
<paths> <paths>
<option value="C:\Users\egore\AppData\Local\Temp\overlay18323405549060409157" />
<option value="C:\Users\egore\AppData\Local\Temp\overlay16485769531165389458" />
<option value="C:\Users\egore\AppData\Local\Temp\overlay7802277587693817774" />
<option value="C:\Users\egore\AppData\Local\Temp\overlay16197097467506260191" /> <option value="C:\Users\egore\AppData\Local\Temp\overlay16197097467506260191" />
</paths> </paths>
</component> </component>

View File

@ -9,8 +9,6 @@ import androidx.room.Update
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import ru.ulstu.`is`.pmu.tank.model.Level import ru.ulstu.`is`.pmu.tank.model.Level
import ru.ulstu.`is`.pmu.tank.model.LevelWithTanks import ru.ulstu.`is`.pmu.tank.model.LevelWithTanks
import ru.ulstu.`is`.pmu.tank.model.Nation
import ru.ulstu.`is`.pmu.tank.model.User
@Dao @Dao
interface LevelDao { interface LevelDao {

View File

@ -1,14 +1,11 @@
package ru.ulstu.`is`.pmu.tanks.composeui package ru.ulstu.`is`.pmu.tanks.composeui
import android.content.res.Configuration import android.content.res.Configuration
import android.util.Log
import androidx.compose.foundation.Image
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
@ -20,20 +17,12 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Surface import androidx.compose.material3.Surface
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.key
import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.asImageBitmap import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
@ -41,25 +30,10 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import androidx.lifecycle.viewmodel.compose.viewModel import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavController import androidx.navigation.NavController
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.FlowCollector
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.withContext
import ru.ulstu.`is`.pmu.R
import ru.ulstu.`is`.pmu.composeui.navigation.Screen
import ru.ulstu.`is`.pmu.tank.composeui.list.TankListViewModel import ru.ulstu.`is`.pmu.tank.composeui.list.TankListViewModel
import ru.ulstu.`is`.pmu.tank.database.AppDatabase
import ru.ulstu.`is`.pmu.tank.model.Level
import ru.ulstu.`is`.pmu.tank.model.Nation
import ru.ulstu.`is`.pmu.tank.model.Tank
import ru.ulstu.`is`.pmu.tank.model.TankWithNationAndLevel import ru.ulstu.`is`.pmu.tank.model.TankWithNationAndLevel
import ru.ulstu.`is`.pmu.tank.model.UserWithTanks
import ru.ulstu.`is`.pmu.tanks.composeui.image.CuteImage
import ru.ulstu.`is`.pmu.tanks.composeui.image.Dimensions import ru.ulstu.`is`.pmu.tanks.composeui.image.Dimensions
import ru.ulstu.`is`.pmu.tanks.composeui.image.RoundedCorderImage import ru.ulstu.`is`.pmu.tanks.composeui.image.RoundedCornerImage
import ru.ulstu.`is`.pmu.ui.AppViewModelProvider import ru.ulstu.`is`.pmu.ui.AppViewModelProvider
import ru.ulstu.`is`.pmu.ui.theme.CustomDark import ru.ulstu.`is`.pmu.ui.theme.CustomDark
import ru.ulstu.`is`.pmu.ui.theme.CustomYellow import ru.ulstu.`is`.pmu.ui.theme.CustomYellow
@ -134,7 +108,7 @@ private fun Hangar(
.size(width = 185.dp, height = 250.dp) .size(width = 185.dp, height = 250.dp)
.padding(10.dp, 0.dp, 10.dp, 0.dp) .padding(10.dp, 0.dp, 10.dp, 0.dp)
) { ) {
RoundedCorderImage( RoundedCornerImage(
imageBitmap = tankList[index].image.asImageBitmap(), imageBitmap = tankList[index].image.asImageBitmap(),
modifier = Modifier.weight(0.5F) modifier = Modifier.weight(0.5F)
) )

View File

@ -12,10 +12,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.IntrinsicSize import androidx.compose.foundation.layout.IntrinsicSize
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.width
@ -79,7 +76,7 @@ fun CuteImageUploader(
.weight(1F) .weight(1F)
) { ) {
if (bitmap != null) { if (bitmap != null) {
RoundedCorderImage( RoundedCornerImage(
imageBitmap = bitmap.asImageBitmap(), imageBitmap = bitmap.asImageBitmap(),
modifier = Modifier.fillMaxSize() modifier = Modifier.fillMaxSize()
) )

View File

@ -10,7 +10,7 @@ import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.layout.ContentScale
@Composable @Composable
fun RoundedCorderImage( fun RoundedCornerImage(
imageBitmap: ImageBitmap, imageBitmap: ImageBitmap,
modifier: Modifier = Modifier modifier: Modifier = Modifier
) { ) {