Изменение структуры проекта
This commit is contained in:
parent
6f5f1c40d3
commit
95189032c2
@ -3,16 +3,9 @@ package com.example.shawarma
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import com.example.shawarma.ui.screens.MainNavBar
|
||||||
import androidx.compose.material.Surface
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import com.example.shawarma.screens.MainNavBar
|
|
||||||
import com.example.shawarma.screens.authorization.AuthorizationScreen
|
|
||||||
import com.example.shawarma.screens.registration.RegistrationScreen
|
|
||||||
import com.example.shawarma.ui.theme.MyLightYellow
|
|
||||||
import com.example.shawarma.ui.theme.ShawarmaTheme
|
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
import dagger.hilt.android.HiltAndroidApp
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
class MainActivity : ComponentActivity() {
|
class MainActivity : ComponentActivity() {
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
@ -9,8 +9,8 @@ import com.example.shawarma.data.api.MyServerService
|
|||||||
import com.example.shawarma.data.api.models.OrderListResponse
|
import com.example.shawarma.data.api.models.OrderListResponse
|
||||||
import com.example.shawarma.data.api.models.toOrderModel
|
import com.example.shawarma.data.api.models.toOrderModel
|
||||||
import com.example.shawarma.data.db.AppDatabase
|
import com.example.shawarma.data.db.AppDatabase
|
||||||
import com.example.shawarma.data.models.OrderModel
|
import com.example.shawarma.data.db.models.OrderModel
|
||||||
import com.example.shawarma.data.models.OrderWithProducts
|
import com.example.shawarma.data.db.models.OrderWithProducts
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
|
||||||
@OptIn(ExperimentalPagingApi::class)
|
@OptIn(ExperimentalPagingApi::class)
|
||||||
|
@ -9,7 +9,7 @@ import com.example.shawarma.data.api.MyServerService
|
|||||||
import com.example.shawarma.data.api.models.ProductListResponse
|
import com.example.shawarma.data.api.models.ProductListResponse
|
||||||
import com.example.shawarma.data.api.models.toProductModel
|
import com.example.shawarma.data.api.models.toProductModel
|
||||||
import com.example.shawarma.data.db.AppDatabase
|
import com.example.shawarma.data.db.AppDatabase
|
||||||
import com.example.shawarma.data.models.ProductModel
|
import com.example.shawarma.data.db.models.ProductModel
|
||||||
import kotlinx.coroutines.flow.first
|
import kotlinx.coroutines.flow.first
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.example.shawarma.data.api.models
|
package com.example.shawarma.data.api.models
|
||||||
|
|
||||||
import com.example.shawarma.data.models.OrderModel
|
import com.example.shawarma.data.db.models.OrderModel
|
||||||
import com.example.shawarma.data.models.OrderProductModel
|
import com.example.shawarma.data.db.models.OrderProductModel
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.example.shawarma.data.api.models
|
package com.example.shawarma.data.api.models
|
||||||
|
|
||||||
import com.example.shawarma.data.models.ProductModel
|
import com.example.shawarma.data.db.models.ProductModel
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.example.shawarma.data.api.models
|
package com.example.shawarma.data.api.models
|
||||||
|
|
||||||
import com.example.shawarma.data.models.UserModel
|
import com.example.shawarma.data.db.models.UserModel
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
|
@ -3,7 +3,7 @@ package com.example.shawarma.data.api.repos
|
|||||||
import com.example.shawarma.data.api.MyServerService
|
import com.example.shawarma.data.api.MyServerService
|
||||||
import com.example.shawarma.data.api.models.ProductModelRemote
|
import com.example.shawarma.data.api.models.ProductModelRemote
|
||||||
import com.example.shawarma.data.api.models.toProductModelRemote
|
import com.example.shawarma.data.api.models.toProductModelRemote
|
||||||
import com.example.shawarma.data.models.ProductModel
|
import com.example.shawarma.data.db.models.ProductModel
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class RestProductRepository @Inject constructor(
|
class RestProductRepository @Inject constructor(
|
||||||
|
@ -4,7 +4,7 @@ import com.example.shawarma.data.api.MyServerService
|
|||||||
import com.example.shawarma.data.api.models.TokenModelRemote
|
import com.example.shawarma.data.api.models.TokenModelRemote
|
||||||
import com.example.shawarma.data.api.models.UserModelRemote
|
import com.example.shawarma.data.api.models.UserModelRemote
|
||||||
import com.example.shawarma.data.api.models.toUserModelRemote
|
import com.example.shawarma.data.api.models.toUserModelRemote
|
||||||
import com.example.shawarma.data.models.UserModel
|
import com.example.shawarma.data.db.models.UserModel
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class RestUserRepository @Inject constructor(
|
class RestUserRepository @Inject constructor(
|
||||||
|
@ -7,14 +7,14 @@ import androidx.room.Room
|
|||||||
import androidx.room.RoomDatabase
|
import androidx.room.RoomDatabase
|
||||||
import androidx.room.TypeConverters
|
import androidx.room.TypeConverters
|
||||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||||
import com.example.shawarma.data.interfaces.dao.OrderDao
|
import com.example.shawarma.data.db.dao.OrderDao
|
||||||
import com.example.shawarma.data.interfaces.dao.OrderProductDao
|
import com.example.shawarma.data.db.dao.OrderProductDao
|
||||||
import com.example.shawarma.data.interfaces.dao.ProductDao
|
import com.example.shawarma.data.db.dao.ProductDao
|
||||||
import com.example.shawarma.data.interfaces.dao.UserDao
|
import com.example.shawarma.data.db.dao.UserDao
|
||||||
import com.example.shawarma.data.models.OrderModel
|
import com.example.shawarma.data.db.models.OrderModel
|
||||||
import com.example.shawarma.data.models.OrderProductModel
|
import com.example.shawarma.data.db.models.OrderProductModel
|
||||||
import com.example.shawarma.data.models.ProductModel
|
import com.example.shawarma.data.db.models.ProductModel
|
||||||
import com.example.shawarma.data.models.UserModel
|
import com.example.shawarma.data.db.models.UserModel
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.data.interfaces.dao
|
package com.example.shawarma.data.db.dao
|
||||||
|
|
||||||
import androidx.paging.PagingSource
|
import androidx.paging.PagingSource
|
||||||
import androidx.room.Dao
|
import androidx.room.Dao
|
||||||
@ -7,8 +7,8 @@ import androidx.room.Insert
|
|||||||
import androidx.room.OnConflictStrategy.Companion.REPLACE
|
import androidx.room.OnConflictStrategy.Companion.REPLACE
|
||||||
import androidx.room.Query
|
import androidx.room.Query
|
||||||
import androidx.room.Update
|
import androidx.room.Update
|
||||||
import com.example.shawarma.data.models.OrderModel
|
import com.example.shawarma.data.db.models.OrderModel
|
||||||
import com.example.shawarma.data.models.OrderWithProducts
|
import com.example.shawarma.data.db.models.OrderWithProducts
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
@Dao
|
@Dao
|
||||||
interface OrderDao {
|
interface OrderDao {
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.data.interfaces.dao
|
package com.example.shawarma.data.db.dao
|
||||||
|
|
||||||
import androidx.room.Dao
|
import androidx.room.Dao
|
||||||
import androidx.room.Delete
|
import androidx.room.Delete
|
||||||
@ -6,7 +6,7 @@ import androidx.room.Insert
|
|||||||
import androidx.room.OnConflictStrategy.Companion.REPLACE
|
import androidx.room.OnConflictStrategy.Companion.REPLACE
|
||||||
import androidx.room.Query
|
import androidx.room.Query
|
||||||
import androidx.room.Update
|
import androidx.room.Update
|
||||||
import com.example.shawarma.data.models.OrderProductModel
|
import com.example.shawarma.data.db.models.OrderProductModel
|
||||||
@Dao
|
@Dao
|
||||||
interface OrderProductDao {
|
interface OrderProductDao {
|
||||||
@Insert(onConflict = REPLACE)
|
@Insert(onConflict = REPLACE)
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.data.interfaces.dao
|
package com.example.shawarma.data.db.dao
|
||||||
|
|
||||||
import androidx.paging.PagingSource
|
import androidx.paging.PagingSource
|
||||||
import androidx.room.Dao
|
import androidx.room.Dao
|
||||||
@ -7,7 +7,7 @@ import androidx.room.Insert
|
|||||||
import androidx.room.OnConflictStrategy.Companion.REPLACE
|
import androidx.room.OnConflictStrategy.Companion.REPLACE
|
||||||
import androidx.room.Query
|
import androidx.room.Query
|
||||||
import androidx.room.Update
|
import androidx.room.Update
|
||||||
import com.example.shawarma.data.models.ProductModel
|
import com.example.shawarma.data.db.models.ProductModel
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|
||||||
@Dao
|
@Dao
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.data.interfaces.dao
|
package com.example.shawarma.data.db.dao
|
||||||
|
|
||||||
import androidx.room.Dao
|
import androidx.room.Dao
|
||||||
import androidx.room.Delete
|
import androidx.room.Delete
|
||||||
@ -6,7 +6,7 @@ import androidx.room.Insert
|
|||||||
import androidx.room.OnConflictStrategy.Companion.ABORT
|
import androidx.room.OnConflictStrategy.Companion.ABORT
|
||||||
import androidx.room.Query
|
import androidx.room.Query
|
||||||
import androidx.room.Update
|
import androidx.room.Update
|
||||||
import com.example.shawarma.data.models.UserModel
|
import com.example.shawarma.data.db.models.UserModel
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
|
||||||
@Dao
|
@Dao
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.data.models
|
package com.example.shawarma.data.db.models
|
||||||
|
|
||||||
import androidx.room.ColumnInfo
|
import androidx.room.ColumnInfo
|
||||||
import androidx.room.Entity
|
import androidx.room.Entity
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.data.models
|
package com.example.shawarma.data.db.models
|
||||||
|
|
||||||
import androidx.room.ColumnInfo
|
import androidx.room.ColumnInfo
|
||||||
import androidx.room.Entity
|
import androidx.room.Entity
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.data.models
|
package com.example.shawarma.data.db.models
|
||||||
|
|
||||||
import androidx.room.Embedded
|
import androidx.room.Embedded
|
||||||
import androidx.room.Relation
|
import androidx.room.Relation
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.data.models
|
package com.example.shawarma.data.db.models
|
||||||
|
|
||||||
import androidx.room.Embedded
|
import androidx.room.Embedded
|
||||||
import androidx.room.Relation
|
import androidx.room.Relation
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.data.models
|
package com.example.shawarma.data.db.models
|
||||||
|
|
||||||
import androidx.room.ColumnInfo
|
import androidx.room.ColumnInfo
|
||||||
import androidx.room.Entity
|
import androidx.room.Entity
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.data.models
|
package com.example.shawarma.data.db.models
|
||||||
|
|
||||||
enum class OrderStatus {
|
enum class OrderStatus {
|
||||||
Неоплачено, Готовится, Готово, Выдано
|
Неоплачено, Готовится, Готово, Выдано
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.data.models
|
package com.example.shawarma.data.db.models
|
||||||
|
|
||||||
import androidx.room.ColumnInfo
|
import androidx.room.ColumnInfo
|
||||||
import androidx.room.Entity
|
import androidx.room.Entity
|
@ -2,8 +2,8 @@ package com.example.shawarma.data.repos
|
|||||||
|
|
||||||
import com.example.shawarma.data.api.models.toOrderProductRemote
|
import com.example.shawarma.data.api.models.toOrderProductRemote
|
||||||
import com.example.shawarma.data.api.repos.RestOrderProductRepository
|
import com.example.shawarma.data.api.repos.RestOrderProductRepository
|
||||||
import com.example.shawarma.data.interfaces.dao.OrderProductDao
|
import com.example.shawarma.data.db.dao.OrderProductDao
|
||||||
import com.example.shawarma.data.models.OrderProductModel
|
import com.example.shawarma.data.db.models.OrderProductModel
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
class OrderProductRepository @Inject constructor(
|
class OrderProductRepository @Inject constructor(
|
||||||
|
@ -11,11 +11,11 @@ import com.example.shawarma.data.api.models.toOrderModelRemote
|
|||||||
import com.example.shawarma.data.api.models.toOrderProductModel
|
import com.example.shawarma.data.api.models.toOrderProductModel
|
||||||
import com.example.shawarma.data.api.repos.RestOrderRepository
|
import com.example.shawarma.data.api.repos.RestOrderRepository
|
||||||
import com.example.shawarma.data.db.AppDatabase
|
import com.example.shawarma.data.db.AppDatabase
|
||||||
import com.example.shawarma.data.interfaces.dao.OrderDao
|
import com.example.shawarma.data.db.dao.OrderDao
|
||||||
import com.example.shawarma.data.interfaces.dao.OrderProductDao
|
import com.example.shawarma.data.db.dao.OrderProductDao
|
||||||
import com.example.shawarma.data.interfaces.dao.ProductDao
|
import com.example.shawarma.data.db.dao.ProductDao
|
||||||
import com.example.shawarma.data.models.OrderModel
|
import com.example.shawarma.data.db.models.OrderModel
|
||||||
import com.example.shawarma.data.models.OrderWithProducts
|
import com.example.shawarma.data.db.models.OrderWithProducts
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.first
|
import kotlinx.coroutines.flow.first
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
@ -9,8 +9,8 @@ import com.example.shawarma.data.api.mediators.ProductRemoteMediator
|
|||||||
import com.example.shawarma.data.api.models.ProductModelRemote
|
import com.example.shawarma.data.api.models.ProductModelRemote
|
||||||
import com.example.shawarma.data.api.repos.RestProductRepository
|
import com.example.shawarma.data.api.repos.RestProductRepository
|
||||||
import com.example.shawarma.data.db.AppDatabase
|
import com.example.shawarma.data.db.AppDatabase
|
||||||
import com.example.shawarma.data.interfaces.dao.ProductDao
|
import com.example.shawarma.data.db.dao.ProductDao
|
||||||
import com.example.shawarma.data.models.ProductModel
|
import com.example.shawarma.data.db.models.ProductModel
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package com.example.shawarma.data.repos
|
package com.example.shawarma.data.repos
|
||||||
|
|
||||||
import com.example.shawarma.data.interfaces.dao.UserDao
|
import com.example.shawarma.data.db.dao.UserDao
|
||||||
import com.example.shawarma.data.models.UserModel
|
import com.example.shawarma.data.db.models.UserModel
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.screens
|
package com.example.shawarma.ui.screens
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
@ -12,18 +12,18 @@ import androidx.navigation.compose.composable
|
|||||||
import androidx.navigation.compose.currentBackStackEntryAsState
|
import androidx.navigation.compose.currentBackStackEntryAsState
|
||||||
import androidx.navigation.compose.rememberNavController
|
import androidx.navigation.compose.rememberNavController
|
||||||
import androidx.navigation.navArgument
|
import androidx.navigation.navArgument
|
||||||
import com.example.shawarma.screens.authorization.AuthorizationScreen
|
import com.example.shawarma.ui.screens.authorization.AuthorizationScreen
|
||||||
import com.example.shawarma.screens.cart.CartScreen
|
import com.example.shawarma.ui.screens.cart.CartScreen
|
||||||
import com.example.shawarma.screens.discount.DiscountScreen
|
import com.example.shawarma.ui.screens.discount.DiscountScreen
|
||||||
import com.example.shawarma.screens.home.HomeScreen
|
import com.example.shawarma.ui.screens.home.HomeScreen
|
||||||
import com.example.shawarma.screens.orders.OrdersScreen
|
import com.example.shawarma.ui.screens.orders.OrdersScreen
|
||||||
import com.example.shawarma.screens.products.ProductScreen
|
import com.example.shawarma.ui.screens.products.ProductScreen
|
||||||
import com.example.shawarma.screens.products.ProductsAnalysis
|
import com.example.shawarma.ui.screens.products.ProductsAnalysis
|
||||||
import com.example.shawarma.screens.products.ProductsScreen
|
import com.example.shawarma.ui.screens.products.ProductsScreen
|
||||||
import com.example.shawarma.screens.registration.RegistrationScreen
|
import com.example.shawarma.ui.screens.registration.RegistrationScreen
|
||||||
import com.example.shawarma.ui.theme.MyLightYellow
|
import com.example.shawarma.ui.theme.MyLightYellow
|
||||||
import com.example.shawarma.utils.ScreenPaths
|
import com.example.shawarma.ui.utils.ScreenPaths
|
||||||
import com.example.shawarma.widgets.BottomNavBar
|
import com.example.shawarma.ui.widgets.BottomNavBar
|
||||||
|
|
||||||
@SuppressLint("UnusedMaterialScaffoldPaddingParameter")
|
@SuppressLint("UnusedMaterialScaffoldPaddingParameter")
|
||||||
@Composable
|
@Composable
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.screens.authorization
|
package com.example.shawarma.ui.screens.authorization
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@ -37,10 +37,10 @@ import com.example.shawarma.data.sharedpref.PreferencesManager
|
|||||||
import com.example.shawarma.ui.theme.JejuFamily
|
import com.example.shawarma.ui.theme.JejuFamily
|
||||||
import com.example.shawarma.ui.theme.MyLightRed
|
import com.example.shawarma.ui.theme.MyLightRed
|
||||||
import com.example.shawarma.ui.theme.NunitoFamily
|
import com.example.shawarma.ui.theme.NunitoFamily
|
||||||
import com.example.shawarma.utils.ScreenPaths
|
import com.example.shawarma.ui.utils.ScreenPaths
|
||||||
import com.example.shawarma.viewmodels.UserViewModel
|
import com.example.shawarma.viewmodels.UserViewModel
|
||||||
import com.example.shawarma.widgets.MyTextField
|
import com.example.shawarma.ui.widgets.MyTextField
|
||||||
import com.example.shawarma.widgets.ShawarmaLogo1
|
import com.example.shawarma.ui.widgets.ShawarmaLogo1
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun AuthorizationScreen(navHostController: NavHostController) {
|
fun AuthorizationScreen(navHostController: NavHostController) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.screens.cart
|
package com.example.shawarma.ui.screens.cart
|
||||||
|
|
||||||
import androidx.compose.foundation.BorderStroke
|
import androidx.compose.foundation.BorderStroke
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
@ -38,7 +38,7 @@ import androidx.compose.ui.unit.sp
|
|||||||
import androidx.compose.ui.zIndex
|
import androidx.compose.ui.zIndex
|
||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
import com.example.shawarma.data.models.OrderWithProducts
|
import com.example.shawarma.data.db.models.OrderWithProducts
|
||||||
import com.example.shawarma.data.sharedpref.PreferencesManager
|
import com.example.shawarma.data.sharedpref.PreferencesManager
|
||||||
import com.example.shawarma.ui.theme.MarckFamily
|
import com.example.shawarma.ui.theme.MarckFamily
|
||||||
import com.example.shawarma.ui.theme.MyLightYellow
|
import com.example.shawarma.ui.theme.MyLightYellow
|
||||||
@ -46,7 +46,7 @@ import com.example.shawarma.ui.theme.MyMainBackground
|
|||||||
import com.example.shawarma.ui.theme.MyOrange
|
import com.example.shawarma.ui.theme.MyOrange
|
||||||
import com.example.shawarma.ui.theme.NunitoFamily
|
import com.example.shawarma.ui.theme.NunitoFamily
|
||||||
import com.example.shawarma.viewmodels.CartViewModel
|
import com.example.shawarma.viewmodels.CartViewModel
|
||||||
import com.example.shawarma.widgets.ShawarmaLogo2
|
import com.example.shawarma.ui.widgets.ShawarmaLogo2
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun CartScreen() {
|
fun CartScreen() {
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.screens.discount
|
package com.example.shawarma.ui.screens.discount
|
||||||
|
|
||||||
import androidx.compose.foundation.BorderStroke
|
import androidx.compose.foundation.BorderStroke
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
@ -35,7 +35,7 @@ import androidx.compose.ui.zIndex
|
|||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
import com.example.shawarma.R
|
import com.example.shawarma.R
|
||||||
import com.example.shawarma.data.models.ProductModel
|
import com.example.shawarma.data.db.models.ProductModel
|
||||||
import com.example.shawarma.data.sharedpref.PreferencesManager
|
import com.example.shawarma.data.sharedpref.PreferencesManager
|
||||||
import com.example.shawarma.ui.theme.MarckFamily
|
import com.example.shawarma.ui.theme.MarckFamily
|
||||||
import com.example.shawarma.ui.theme.MyLightYellow
|
import com.example.shawarma.ui.theme.MyLightYellow
|
||||||
@ -44,7 +44,7 @@ import com.example.shawarma.ui.theme.MyOrange
|
|||||||
import com.example.shawarma.ui.theme.MyPriceBackground
|
import com.example.shawarma.ui.theme.MyPriceBackground
|
||||||
import com.example.shawarma.ui.theme.NunitoFamily
|
import com.example.shawarma.ui.theme.NunitoFamily
|
||||||
import com.example.shawarma.viewmodels.HomeViewModel
|
import com.example.shawarma.viewmodels.HomeViewModel
|
||||||
import com.example.shawarma.widgets.ShawarmaLogo2
|
import com.example.shawarma.ui.widgets.ShawarmaLogo2
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun DiscountScreen() {
|
fun DiscountScreen() {
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.screens.home
|
package com.example.shawarma.ui.screens.home
|
||||||
|
|
||||||
import androidx.compose.foundation.BorderStroke
|
import androidx.compose.foundation.BorderStroke
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
@ -35,7 +35,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
|
|||||||
import androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
import androidx.paging.compose.itemKey
|
import androidx.paging.compose.itemKey
|
||||||
import com.example.shawarma.R
|
import com.example.shawarma.R
|
||||||
import com.example.shawarma.data.models.ProductModel
|
import com.example.shawarma.data.db.models.ProductModel
|
||||||
import com.example.shawarma.data.sharedpref.PreferencesManager
|
import com.example.shawarma.data.sharedpref.PreferencesManager
|
||||||
import com.example.shawarma.ui.theme.MarckFamily
|
import com.example.shawarma.ui.theme.MarckFamily
|
||||||
import com.example.shawarma.ui.theme.MyLightYellow
|
import com.example.shawarma.ui.theme.MyLightYellow
|
||||||
@ -44,7 +44,7 @@ import com.example.shawarma.ui.theme.MyOrange
|
|||||||
import com.example.shawarma.ui.theme.MyPriceBackground
|
import com.example.shawarma.ui.theme.MyPriceBackground
|
||||||
import com.example.shawarma.ui.theme.NunitoFamily
|
import com.example.shawarma.ui.theme.NunitoFamily
|
||||||
import com.example.shawarma.viewmodels.HomeViewModel
|
import com.example.shawarma.viewmodels.HomeViewModel
|
||||||
import com.example.shawarma.widgets.ShawarmaLogo2
|
import com.example.shawarma.ui.widgets.ShawarmaLogo2
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun HomeScreen() {
|
fun HomeScreen() {
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.screens.orders
|
package com.example.shawarma.ui.screens.orders
|
||||||
|
|
||||||
import androidx.compose.foundation.BorderStroke
|
import androidx.compose.foundation.BorderStroke
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
@ -36,8 +36,8 @@ import androidx.compose.ui.zIndex
|
|||||||
import androidx.hilt.navigation.compose.hiltViewModel
|
import androidx.hilt.navigation.compose.hiltViewModel
|
||||||
import androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
import com.example.shawarma.R
|
import com.example.shawarma.R
|
||||||
import com.example.shawarma.data.models.OrderStatus
|
import com.example.shawarma.data.db.models.OrderStatus
|
||||||
import com.example.shawarma.data.models.OrderWithProducts
|
import com.example.shawarma.data.db.models.OrderWithProducts
|
||||||
import com.example.shawarma.data.sharedpref.PreferencesManager
|
import com.example.shawarma.data.sharedpref.PreferencesManager
|
||||||
import com.example.shawarma.ui.theme.MarckFamily
|
import com.example.shawarma.ui.theme.MarckFamily
|
||||||
import com.example.shawarma.ui.theme.MyLightRed
|
import com.example.shawarma.ui.theme.MyLightRed
|
||||||
@ -46,7 +46,7 @@ import com.example.shawarma.ui.theme.MyMainBackground
|
|||||||
import com.example.shawarma.ui.theme.MyOrange
|
import com.example.shawarma.ui.theme.MyOrange
|
||||||
import com.example.shawarma.ui.theme.NunitoFamily
|
import com.example.shawarma.ui.theme.NunitoFamily
|
||||||
import com.example.shawarma.viewmodels.OrdersViewModel
|
import com.example.shawarma.viewmodels.OrdersViewModel
|
||||||
import com.example.shawarma.widgets.ShawarmaLogo2
|
import com.example.shawarma.ui.widgets.ShawarmaLogo2
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun OrdersScreen() {
|
fun OrdersScreen() {
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.screens.products
|
package com.example.shawarma.ui.screens.products
|
||||||
|
|
||||||
import androidx.compose.foundation.BorderStroke
|
import androidx.compose.foundation.BorderStroke
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
@ -34,10 +34,10 @@ import com.example.shawarma.ui.theme.MyLightYellow
|
|||||||
import com.example.shawarma.ui.theme.MyMainBackground
|
import com.example.shawarma.ui.theme.MyMainBackground
|
||||||
import com.example.shawarma.ui.theme.MyOrange
|
import com.example.shawarma.ui.theme.MyOrange
|
||||||
import com.example.shawarma.ui.theme.NunitoFamily
|
import com.example.shawarma.ui.theme.NunitoFamily
|
||||||
import com.example.shawarma.utils.ScreenPaths
|
import com.example.shawarma.ui.utils.ScreenPaths
|
||||||
import com.example.shawarma.viewmodels.ProductViewModel
|
import com.example.shawarma.viewmodels.ProductViewModel
|
||||||
import com.example.shawarma.widgets.MyTextField
|
import com.example.shawarma.ui.widgets.MyTextField
|
||||||
import com.example.shawarma.widgets.ShawarmaLogo2
|
import com.example.shawarma.ui.widgets.ShawarmaLogo2
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ProductScreen(navHostController: NavHostController, productId: Int?) {
|
fun ProductScreen(navHostController: NavHostController, productId: Int?) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.screens.products
|
package com.example.shawarma.ui.screens.products
|
||||||
|
|
||||||
import androidx.compose.foundation.BorderStroke
|
import androidx.compose.foundation.BorderStroke
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
@ -39,7 +39,7 @@ import com.example.shawarma.ui.theme.MyMainBackground
|
|||||||
import com.example.shawarma.ui.theme.MyOrange
|
import com.example.shawarma.ui.theme.MyOrange
|
||||||
import com.example.shawarma.ui.theme.NunitoFamily
|
import com.example.shawarma.ui.theme.NunitoFamily
|
||||||
import com.example.shawarma.viewmodels.ProductsViewModel
|
import com.example.shawarma.viewmodels.ProductsViewModel
|
||||||
import com.example.shawarma.widgets.ShawarmaLogo2
|
import com.example.shawarma.ui.widgets.ShawarmaLogo2
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ProductsAnalysis() {
|
fun ProductsAnalysis() {
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.screens.products
|
package com.example.shawarma.ui.screens.products
|
||||||
|
|
||||||
import androidx.compose.foundation.BorderStroke
|
import androidx.compose.foundation.BorderStroke
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
@ -36,7 +36,7 @@ import androidx.navigation.NavHostController
|
|||||||
import androidx.paging.compose.collectAsLazyPagingItems
|
import androidx.paging.compose.collectAsLazyPagingItems
|
||||||
import androidx.paging.compose.itemKey
|
import androidx.paging.compose.itemKey
|
||||||
import com.example.shawarma.R
|
import com.example.shawarma.R
|
||||||
import com.example.shawarma.data.models.ProductModel
|
import com.example.shawarma.data.db.models.ProductModel
|
||||||
import com.example.shawarma.data.sharedpref.PreferencesManager
|
import com.example.shawarma.data.sharedpref.PreferencesManager
|
||||||
import com.example.shawarma.ui.theme.MarckFamily
|
import com.example.shawarma.ui.theme.MarckFamily
|
||||||
import com.example.shawarma.ui.theme.MyLightRed
|
import com.example.shawarma.ui.theme.MyLightRed
|
||||||
@ -44,9 +44,9 @@ import com.example.shawarma.ui.theme.MyLightYellow
|
|||||||
import com.example.shawarma.ui.theme.MyMainBackground
|
import com.example.shawarma.ui.theme.MyMainBackground
|
||||||
import com.example.shawarma.ui.theme.MyOrange
|
import com.example.shawarma.ui.theme.MyOrange
|
||||||
import com.example.shawarma.ui.theme.NunitoFamily
|
import com.example.shawarma.ui.theme.NunitoFamily
|
||||||
import com.example.shawarma.utils.ScreenPaths
|
import com.example.shawarma.ui.utils.ScreenPaths
|
||||||
import com.example.shawarma.viewmodels.ProductsViewModel
|
import com.example.shawarma.viewmodels.ProductsViewModel
|
||||||
import com.example.shawarma.widgets.ShawarmaLogo2
|
import com.example.shawarma.ui.widgets.ShawarmaLogo2
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ProductsScreen(navHostController: NavHostController) {
|
fun ProductsScreen(navHostController: NavHostController) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.screens.registration
|
package com.example.shawarma.ui.screens.registration
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@ -35,10 +35,10 @@ import androidx.navigation.NavHostController
|
|||||||
import com.example.shawarma.ui.theme.JejuFamily
|
import com.example.shawarma.ui.theme.JejuFamily
|
||||||
import com.example.shawarma.ui.theme.MyLightRed
|
import com.example.shawarma.ui.theme.MyLightRed
|
||||||
import com.example.shawarma.ui.theme.NunitoFamily
|
import com.example.shawarma.ui.theme.NunitoFamily
|
||||||
import com.example.shawarma.utils.ScreenPaths
|
import com.example.shawarma.ui.utils.ScreenPaths
|
||||||
import com.example.shawarma.viewmodels.UserViewModel
|
import com.example.shawarma.viewmodels.UserViewModel
|
||||||
import com.example.shawarma.widgets.MyTextField
|
import com.example.shawarma.ui.widgets.MyTextField
|
||||||
import com.example.shawarma.widgets.ShawarmaLogo1
|
import com.example.shawarma.ui.widgets.ShawarmaLogo1
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun RegistrationScreen(navHostController: NavHostController) {
|
fun RegistrationScreen(navHostController: NavHostController) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.utils
|
package com.example.shawarma.ui.utils
|
||||||
|
|
||||||
import com.example.shawarma.R
|
import com.example.shawarma.R
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.utils
|
package com.example.shawarma.ui.utils
|
||||||
|
|
||||||
enum class ScreenPaths {
|
enum class ScreenPaths {
|
||||||
authorization, registration, home, discount, cart, orders, products, product, analysis
|
authorization, registration, home, discount, cart, orders, products, product, analysis
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.widgets
|
package com.example.shawarma.ui.widgets
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
@ -15,7 +15,7 @@ import androidx.compose.ui.unit.dp
|
|||||||
import androidx.navigation.NavController
|
import androidx.navigation.NavController
|
||||||
import androidx.navigation.compose.currentBackStackEntryAsState
|
import androidx.navigation.compose.currentBackStackEntryAsState
|
||||||
import com.example.shawarma.data.sharedpref.PreferencesManager
|
import com.example.shawarma.data.sharedpref.PreferencesManager
|
||||||
import com.example.shawarma.utils.BottomNavItem
|
import com.example.shawarma.ui.utils.BottomNavItem
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun BottomNavBar(navController: NavController) {
|
fun BottomNavBar(navController: NavController) {
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.widgets
|
package com.example.shawarma.ui.widgets
|
||||||
|
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material.Text
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.widgets
|
package com.example.shawarma.ui.widgets
|
||||||
|
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
@ -1,4 +1,4 @@
|
|||||||
package com.example.shawarma.widgets
|
package com.example.shawarma.ui.widgets
|
||||||
|
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
@ -5,8 +5,8 @@ import androidx.lifecycle.MutableLiveData
|
|||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import androidx.paging.PagingData
|
import androidx.paging.PagingData
|
||||||
import com.example.shawarma.data.models.OrderStatus
|
import com.example.shawarma.data.db.models.OrderStatus
|
||||||
import com.example.shawarma.data.models.OrderWithProducts
|
import com.example.shawarma.data.db.models.OrderWithProducts
|
||||||
import com.example.shawarma.data.repos.OrderProductRepository
|
import com.example.shawarma.data.repos.OrderProductRepository
|
||||||
import com.example.shawarma.data.repos.OrderRepository
|
import com.example.shawarma.data.repos.OrderRepository
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
|
@ -3,10 +3,10 @@ package com.example.shawarma.viewmodels
|
|||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import androidx.paging.PagingData
|
import androidx.paging.PagingData
|
||||||
import com.example.shawarma.data.models.OrderModel
|
import com.example.shawarma.data.db.models.OrderModel
|
||||||
import com.example.shawarma.data.models.OrderProductModel
|
import com.example.shawarma.data.db.models.OrderProductModel
|
||||||
import com.example.shawarma.data.models.OrderStatus
|
import com.example.shawarma.data.db.models.OrderStatus
|
||||||
import com.example.shawarma.data.models.ProductModel
|
import com.example.shawarma.data.db.models.ProductModel
|
||||||
import com.example.shawarma.data.repos.OrderProductRepository
|
import com.example.shawarma.data.repos.OrderProductRepository
|
||||||
import com.example.shawarma.data.repos.OrderRepository
|
import com.example.shawarma.data.repos.OrderRepository
|
||||||
import com.example.shawarma.data.repos.ProductRepository
|
import com.example.shawarma.data.repos.ProductRepository
|
||||||
|
@ -3,7 +3,7 @@ package com.example.shawarma.viewmodels
|
|||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import androidx.paging.PagingData
|
import androidx.paging.PagingData
|
||||||
import com.example.shawarma.data.models.OrderWithProducts
|
import com.example.shawarma.data.db.models.OrderWithProducts
|
||||||
import com.example.shawarma.data.repos.OrderRepository
|
import com.example.shawarma.data.repos.OrderRepository
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
@ -4,7 +4,7 @@ import androidx.lifecycle.LiveData
|
|||||||
import androidx.lifecycle.MutableLiveData
|
import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.example.shawarma.data.models.ProductModel
|
import com.example.shawarma.data.db.models.ProductModel
|
||||||
import com.example.shawarma.data.repos.ProductRepository
|
import com.example.shawarma.data.repos.ProductRepository
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
@ -5,7 +5,7 @@ import androidx.lifecycle.ViewModel
|
|||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import androidx.paging.PagingData
|
import androidx.paging.PagingData
|
||||||
import com.example.shawarma.data.api.models.ProductModelRemote
|
import com.example.shawarma.data.api.models.ProductModelRemote
|
||||||
import com.example.shawarma.data.models.ProductModel
|
import com.example.shawarma.data.db.models.ProductModel
|
||||||
import com.example.shawarma.data.repos.ProductRepository
|
import com.example.shawarma.data.repos.ProductRepository
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
@ -5,7 +5,7 @@ import androidx.lifecycle.MutableLiveData
|
|||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.example.shawarma.data.api.repos.RestUserRepository
|
import com.example.shawarma.data.api.repos.RestUserRepository
|
||||||
import com.example.shawarma.data.models.UserModel
|
import com.example.shawarma.data.db.models.UserModel
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
Loading…
Reference in New Issue
Block a user