Так, убрал анимацию пагинаций, вроде все работает, остался рефакторинг, отчет и пабеда....

This commit is contained in:
Кашин Максим 2023-12-27 14:07:10 +04:00
parent 8d30b2eddb
commit 3242f68787
22 changed files with 79593 additions and 70 deletions

View File

@ -148,9 +148,9 @@ interface MyServerService {
companion object { companion object {
//Раздача с тлф //Раздача с тлф
/* private const val BASE_URL = "http://192.168.138.47:8079/"*/ private const val BASE_URL = "http://192.168.138.47:8079/"
//Пк дома //Пк дома
private const val BASE_URL = "http://192.168.0.104:8079/" /* private const val BASE_URL = "http://192.168.0.104:8079/"*/
//private const val BASE_URL = "http://10.0.2.2:8079/" //private const val BASE_URL = "http://10.0.2.2:8079/"
@Volatile @Volatile

View File

@ -6,10 +6,10 @@ import androidx.lifecycle.viewmodel.CreationExtras
import androidx.lifecycle.viewmodel.initializer import androidx.lifecycle.viewmodel.initializer
import androidx.lifecycle.viewmodel.viewModelFactory import androidx.lifecycle.viewmodel.viewModelFactory
import com.example.myapplication.BikeApplication import com.example.myapplication.BikeApplication
import com.example.myapplication.database.entities.composeui.BikeListViewModel
import com.example.myapplication.database.entities.composeui.BikeViewModel
import com.example.myapplication.database.entities.composeui.edit.BikeEditViewModel import com.example.myapplication.database.entities.composeui.edit.BikeEditViewModel
import com.example.myapplication.database.room.viewmodel.item.ItemEditViewModel import com.example.myapplication.database.entities.composeui.edit.ItemEditViewModel
import com.example.myapplication.database.room.viewmodel.bike.BikeListViewModel
import com.example.myapplication.database.room.viewmodel.bike.BikeViewModel
import com.example.myapplication.database.room.viewmodel.cart.CartViewModel import com.example.myapplication.database.room.viewmodel.cart.CartViewModel
import com.example.myapplication.database.room.viewmodel.user.CurrentUserViewModel import com.example.myapplication.database.room.viewmodel.user.CurrentUserViewModel
import com.example.myapplication.database.room.viewmodel.user.EntryUserViewModel import com.example.myapplication.database.room.viewmodel.user.EntryUserViewModel

View File

@ -19,7 +19,8 @@ import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavController import androidx.navigation.NavController
import com.example.myapplication.R import com.example.myapplication.R
import com.example.myapplication.database.entities.composeui.AppViewModelProvider import com.example.myapplication.database.AppViewModelProvider
import com.example.myapplication.setting.ImageUploader
import com.example.myapplication.ui.theme.PmudemoTheme import com.example.myapplication.ui.theme.PmudemoTheme
import kotlinx.coroutines.launch import kotlinx.coroutines.launch

View File

@ -6,10 +6,10 @@ import androidx.compose.runtime.setValue
import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.example.myapplication.database.entities.model.Bike import com.example.myapplication.database.room.model.bike.Bike
import com.example.myapplication.database.entities.model.BikeWithItems import com.example.myapplication.database.room.model.bike.BikeWithItems
import com.example.myapplication.database.entities.model.ItemFromBike import com.example.myapplication.database.room.model.item.ItemFromBike
import com.example.myapplication.database.entities.repository.BikeRepository import com.example.myapplication.database.room.repository.online.BikeRepository
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
class BikeEditViewModel( class BikeEditViewModel(

View File

@ -2,8 +2,8 @@ package com.example.myapplication.database.entities.composeui
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import androidx.paging.PagingData import androidx.paging.PagingData
import com.example.myapplication.database.entities.model.Bike import com.example.myapplication.database.room.model.bike.Bike
import com.example.myapplication.database.entities.repository.BikeRepository import com.example.myapplication.database.room.repository.online.BikeRepository
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
class BikeListViewModel( class BikeListViewModel(

View File

@ -5,8 +5,8 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import com.example.myapplication.database.entities.model.BikeWithItems import com.example.myapplication.database.room.model.bike.BikeWithItems
import com.example.myapplication.database.entities.repository.BikeRepository import com.example.myapplication.database.room.repository.online.BikeRepository
class BikeViewModel( class BikeViewModel(
savedStateHandle: SavedStateHandle, private val bikeRepository: BikeRepository savedStateHandle: SavedStateHandle, private val bikeRepository: BikeRepository

View File

@ -3,6 +3,7 @@ package com.example.myapplication.database.room.viewmodel.cart
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.lifecycle.ViewModel
import com.example.myapplication.database.room.model.item.Item import com.example.myapplication.database.room.model.item.Item
import com.example.myapplication.database.room.model.item.ItemFromCart import com.example.myapplication.database.room.model.item.ItemFromCart
import com.example.myapplication.database.room.model.rent.Rent import com.example.myapplication.database.room.model.rent.Rent
@ -12,7 +13,6 @@ import com.example.myapplication.database.room.repository.online.RentItemReposit
import com.example.myapplication.database.room.repository.online.RentRepository import com.example.myapplication.database.room.repository.online.RentRepository
import com.example.myapplication.database.room.repository.online.UserItemRepository import com.example.myapplication.database.room.repository.online.UserItemRepository
import com.example.myapplication.database.room.repository.online.UserRepository import com.example.myapplication.database.room.repository.online.UserRepository
import com.example.myapplication.database.room.viewmodel.LoadingViewModel
class CartViewModel( class CartViewModel(
private val userItemRepository: UserItemRepository, private val userItemRepository: UserItemRepository,

View File

@ -6,8 +6,8 @@ import androidx.compose.runtime.setValue
import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.example.myapplication.database.entities.model.Item import com.example.myapplication.database.room.model.item.Item
import com.example.myapplication.database.entities.repository.ItemRepository import com.example.myapplication.database.room.repository.online.ItemRepository
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.threeten.bp.LocalDateTime import org.threeten.bp.LocalDateTime

View File

@ -1,12 +1,11 @@
package com.example.myapplication.database.room.viewmodel.item package com.example.myapplication.database.room.viewmodel.item
import androidx.lifecycle.ViewModel
import com.example.myapplication.database.room.model.item.Item import com.example.myapplication.database.room.model.item.Item
import com.example.myapplication.database.room.model.item.ItemFromBike import com.example.myapplication.database.room.model.item.ItemFromBike
import com.example.myapplication.database.room.model.user.UserItemCrossRef import com.example.myapplication.database.room.model.user.UserItemCrossRef
import com.example.myapplication.database.room.repository.online.ItemRepository import com.example.myapplication.database.room.repository.online.ItemRepository
import com.example.myapplication.database.room.repository.online.UserItemRepository import com.example.myapplication.database.room.repository.online.UserItemRepository
import com.example.myapplication.database.room.viewmodel.LoadingViewModel
class ItemListViewModel( class ItemListViewModel(
private val itemRepository: ItemRepository, private val itemRepository: ItemRepository,
private val userItemRepository: UserItemRepository private val userItemRepository: UserItemRepository

View File

@ -1,9 +1,9 @@
package com.example.myapplication.database.room.viewmodel.rent package com.example.myapplication.database.room.viewmodel.rent
import androidx.lifecycle.ViewModel
import androidx.paging.PagingData import androidx.paging.PagingData
import com.example.myapplication.database.room.model.rent.Rent import com.example.myapplication.database.room.model.rent.Rent
import com.example.myapplication.database.room.repository.online.RentRepository import com.example.myapplication.database.room.repository.online.RentRepository
import com.example.myapplication.database.room.viewmodel.LoadingViewModel
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.StateFlow

View File

@ -1,11 +1,11 @@
package com.example.myapplication.database.room.viewmodel.rent package com.example.myapplication.database.room.viewmodel.rent
import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.SavedStateHandle
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.example.myapplication.database.room.model.item.ItemFromRent import com.example.myapplication.database.room.model.item.ItemFromRent
import com.example.myapplication.database.room.repository.AppContainer import com.example.myapplication.database.room.repository.AppContainer
import com.example.myapplication.database.room.repository.online.RentRepository import com.example.myapplication.database.room.repository.online.RentRepository
import com.example.myapplication.database.room.viewmodel.LoadingViewModel
import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.flow

View File

@ -5,10 +5,10 @@ import android.util.Log
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.example.myapplication.api.item.repository.RestItemRepository import com.example.myapplication.api.item.repository.RestItemRepository
import com.example.myapplication.api.report.remote.ReportRemote import com.example.myapplication.api.report.remote.ReportRemote
import com.example.myapplication.database.room.viewmodel.LoadingViewModel
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import java.text.ParseException import java.text.ParseException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat

View File

@ -3,10 +3,10 @@ package com.example.myapplication.database.room.viewmodel.user
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.example.myapplication.database.room.model.user.User import com.example.myapplication.database.room.model.user.User
import com.example.myapplication.database.room.repository.online.UserRepository import com.example.myapplication.database.room.repository.online.UserRepository
import com.example.myapplication.database.room.viewmodel.LoadingViewModel
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
class CurrentUserViewModel(private val userRepository: UserRepository) : ViewModel(){ class CurrentUserViewModel(private val userRepository: UserRepository) : ViewModel(){

View File

@ -3,10 +3,10 @@ package com.example.myapplication.database.room.viewmodel.user
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.example.myapplication.database.room.model.user.User import com.example.myapplication.database.room.model.user.User
import com.example.myapplication.database.room.repository.online.UserRepository import com.example.myapplication.database.room.repository.online.UserRepository
import com.example.myapplication.database.room.viewmodel.LoadingViewModel
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
class EntryUserViewModel(private val userRepository: UserRepository) : ViewModel() { class EntryUserViewModel(private val userRepository: UserRepository) : ViewModel() {

View File

@ -2,10 +2,10 @@ package com.example.myapplication.database.room.viewmodel.user
import androidx.lifecycle.LiveData import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope import androidx.lifecycle.viewModelScope
import com.example.myapplication.database.room.model.user.User import com.example.myapplication.database.room.model.user.User
import com.example.myapplication.database.room.repository.online.UserRepository import com.example.myapplication.database.room.repository.online.UserRepository
import com.example.myapplication.database.room.viewmodel.LoadingViewModel
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
class RegisterUserViewModel(private val userRepository: UserRepository) : ViewModel() { class RegisterUserViewModel(private val userRepository: UserRepository) : ViewModel() {

View File

@ -37,10 +37,10 @@ import androidx.compose.ui.unit.dp
import androidx.lifecycle.viewmodel.compose.viewModel import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavController import androidx.navigation.NavController
import com.example.myapplication.database.AppViewModelProvider import com.example.myapplication.database.AppViewModelProvider
import com.example.myapplication.database.entities.composeui.edit.ItemDetails
import com.example.myapplication.database.entities.composeui.edit.ItemEditViewModel
import com.example.myapplication.database.entities.composeui.edit.ItemUiState
import com.example.myapplication.database.room.viewmodel.user.CurrentUserViewModel import com.example.myapplication.database.room.viewmodel.user.CurrentUserViewModel
import com.example.myapplication.database.room.viewmodel.item.ItemDetails
import com.example.myapplication.database.room.viewmodel.item.ItemEditViewModel
import com.example.myapplication.database.room.viewmodel.item.ItemUiState
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.threeten.bp.Instant import org.threeten.bp.Instant
import org.threeten.bp.LocalDateTime import org.threeten.bp.LocalDateTime

View File

@ -44,8 +44,11 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavController import androidx.navigation.NavController
import androidx.paging.compose.LazyPagingItems import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.collectAsLazyPagingItems import androidx.paging.compose.collectAsLazyPagingItems
import com.example.myapplication.composeui.navigation.Screen import com.example.myapplication.database.AppViewModelProvider
import com.example.myapplication.database.entities.model.Bike import com.example.myapplication.database.room.model.bike.Bike
import com.example.myapplication.database.room.viewmodel.user.CurrentUserViewModel
import com.example.myapplication.ui.navigation.Screen
import com.example.myapplication.ui.view.ErroreView
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
@Composable @Composable
@ -108,7 +111,7 @@ fun BikeList(
) )
} }
} else { } else {
ErroreList() ErroreView()
} }
} }

View File

@ -38,7 +38,7 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavController import androidx.navigation.NavController
import com.example.myapplication.R import com.example.myapplication.R
import com.example.myapplication.database.AppViewModelProvider import com.example.myapplication.database.AppViewModelProvider
import com.example.myapplication.database.room.viewmodel.bike.BikeViewModel import com.example.myapplication.database.entities.composeui.BikeViewModel
import com.example.myapplication.database.room.viewmodel.user.CurrentUserViewModel import com.example.myapplication.database.room.viewmodel.user.CurrentUserViewModel
import com.example.myapplication.database.room.viewmodel.item.ItemListViewModel import com.example.myapplication.database.room.viewmodel.item.ItemListViewModel
import com.example.myapplication.ui.navigation.Screen import com.example.myapplication.ui.navigation.Screen

View File

@ -49,9 +49,9 @@ import androidx.navigation.compose.rememberNavController
import androidx.navigation.navArgument import androidx.navigation.navArgument
import com.example.myapplication.ui.list.CartList import com.example.myapplication.ui.list.CartList
import com.example.myapplication.database.AppViewModelProvider import com.example.myapplication.database.AppViewModelProvider
import com.example.myapplication.database.entities.composeui.BikeList
import com.example.myapplication.database.entities.composeui.BikeView
import com.example.myapplication.database.entities.composeui.edit.BikeEdit import com.example.myapplication.database.entities.composeui.edit.BikeEdit
import com.example.myapplication.ui.list.BikeList
import com.example.myapplication.ui.view.BikeView
import com.example.myapplication.database.room.viewmodel.user.CurrentUserViewModel import com.example.myapplication.database.room.viewmodel.user.CurrentUserViewModel
import com.example.myapplication.ui.list.LoginScreen import com.example.myapplication.ui.list.LoginScreen
import com.example.myapplication.ui.list.RentList import com.example.myapplication.ui.list.RentList
@ -66,7 +66,6 @@ fun Topbar(
navController: NavHostController, navController: NavHostController,
currentScreen: Screen? currentScreen: Screen?
) { ) {
var searchQuery by remember { mutableStateOf("") }
Box( Box(
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
@ -102,35 +101,7 @@ fun Topbar(
Spacer(modifier = Modifier.width(16.dp)) Spacer(modifier = Modifier.width(16.dp))
BasicTextField(
value = searchQuery,
onValueChange = { newValue -> searchQuery = newValue },
modifier = Modifier
.weight(1f)
.height(36.dp)
.background(
color = MaterialTheme.colorScheme.onPrimary,
RoundedCornerShape(18.dp)
)
.padding(start = 13.dp, top = 8.dp),
keyboardOptions = KeyboardOptions.Default.copy(
imeAction = androidx.compose.ui.text.input.ImeAction.Search
),
keyboardActions = KeyboardActions(
onSearch = { }
)
)
Spacer(modifier = Modifier.width(16.dp))
Icon(
imageVector = Icons.Default.Search,
contentDescription = null,
modifier = Modifier
.size(30.dp)
.clickable { },
tint = MaterialTheme.colorScheme.secondary
)
} }
} }
} }

View File

@ -34,8 +34,11 @@ 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 com.example.myapplication.composeui.navigation.Screen import com.example.myapplication.database.AppViewModelProvider
import com.example.myapplication.database.entities.model.Bike import com.example.myapplication.database.room.model.bike.Bike
import com.example.myapplication.database.room.viewmodel.user.CurrentUserViewModel
import com.example.myapplication.ui.list.ItemList
import com.example.myapplication.ui.navigation.Screen
@Composable @Composable
fun BikeView( fun BikeView(

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<network-security-config> <network-security-config>
<domain-config cleartextTrafficPermitted="true"> <domain-config cleartextTrafficPermitted="true">
<!--Раздача с тлф--> <!-- Раздача с тлф-->
<!-- <domain includeSubdomains="true">192.168.138.47</domain>--> <domain includeSubdomains="true">192.168.138.47</domain>
<!--Дома пк--> <!--Дома пк-->
<domain includeSubdomains="true">192.168.0.104</domain> <!-- <domain includeSubdomains="true">192.168.0.104</domain>-->
<!-- <domain includeSubdomains="true">10.0.2.2</domain>--> <!-- <domain includeSubdomains="true">10.0.2.2</domain>-->
</domain-config> </domain-config>
</network-security-config> </network-security-config>

File diff suppressed because it is too large Load Diff