feature: UI, lab2 maybe done
This commit is contained in:
parent
4902705f9c
commit
471645fb6e
@ -10,24 +10,34 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="7c94e195-a540-483e-9a1c-11797aeb1741" name="Changes" comment="empty activity test">
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Basket/Basket.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/List_of_Services/ListOfServices.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Navbar/NavBar.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Navbar/NavController.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Navbar/NavItem.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Profile/Profile.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/UIComponents/Button.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/UIComponents/SearchBar.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/res/drawable/icon_basket.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/res/drawable/icon_list_of_services.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/res/drawable/icon_profile.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Basket/BasketItem.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/List_of_Services/AddService.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/List_of_Services/Service.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Orders/OrderItem.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Orders/Orders.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Profile/Login.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Profile/ProfileChange.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Profile/ProfileNotAuth.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Profile/Registration.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/TestServiceItem.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/UIComponents/MyTextField.kt" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/res/drawable/icon_calendar.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/res/drawable/image_service.png" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/app/src/main/res/drawable/upload.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/build.gradle.kts" beforeDir="false" afterPath="$PROJECT_DIR$/app/build.gradle.kts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/AndroidManifest.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/MainActivity.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/App.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/App.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/App.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Basket/Basket.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Basket/Basket.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/List_of_Services/ListOfServices.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/List_of_Services/ListOfServices.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Navbar/NavBar.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Navbar/NavBar.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Navbar/NavController.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Navbar/NavController.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Navbar/NavItem.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Navbar/NavItem.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Profile/Profile.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/Profile/Profile.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/UIComponents/Button.kt" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/UIComponents/SearchBar.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/UIComponents/SearchBar.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/ui/theme/Color.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/ui/theme/Color.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/ui/theme/Theme.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/ui/theme/Theme.kt" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/res/values/strings.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/ui/theme/Type.kt" beforeDir="false" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/myapplication/ui/theme/Type.kt" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@ -43,11 +53,17 @@
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="Class" />
|
||||
<option value="resourceFile" />
|
||||
<option value="Kotlin Class" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="GenerateSignedApkSettings">
|
||||
<option name="KEY_STORE_PATH" value="C:\Users\Danil\Desktop\app.jks" />
|
||||
<option name="KEY_ALIAS" value="key0" />
|
||||
<option name="BUILD_TARGET_KEY" value="apk" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_BRANCH_BY_REPOSITORY">
|
||||
<map>
|
||||
@ -64,26 +80,106 @@
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.cidr.known.project.marker": "true",
|
||||
"cidr.known.project.marker": "true",
|
||||
"com.android.tools.idea.devicemanager.tab": "Physical",
|
||||
"last_opened_file_path": "C:/Users/Danil/Downloads/test",
|
||||
"settings.editor.selected.configurable": "trusted.hosts"
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"ApkExportedModule": "My_Application.app",
|
||||
"ExportApk.ApkPathForMy_Application.app": "C:\\Users\\Danil\\Desktop\\MDP\\labs\\app",
|
||||
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.cidr.known.project.marker": "true",
|
||||
"cidr.known.project.marker": "true",
|
||||
"com.android.tools.idea.devicemanager.tab": "Physical",
|
||||
"last_opened_file_path": "C:/Users/Danil/Downloads/test",
|
||||
"project.structure.last.edited": "Build Variants",
|
||||
"project.structure.proportion": "0.17",
|
||||
"project.structure.side.proportion": "0.2",
|
||||
"settings.editor.selected.configurable": "trusted.hosts"
|
||||
},
|
||||
"keyToStringList": {
|
||||
"ExportApk.BuildVariants": [
|
||||
"release"
|
||||
]
|
||||
}
|
||||
}]]></component>
|
||||
}</component>
|
||||
<component name="PsdUISettings">
|
||||
<option name="LAST_EDITED_BUILD_TYPE" value="release" />
|
||||
</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="android.template.-1413981578">
|
||||
<recent name="com.example.myapplication.Navbar" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="C:\Users\Danil\Desktop\MDP\labs\app\src\main\res\drawable" />
|
||||
<recent name="C:\Users\Danil\Desktop\MDP\labs\app\src\main\java\com\example\myapplication\UIComponents" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<component name="RunManager" selected="Android App.App">
|
||||
<configuration name="App" type="AndroidRunConfigurationType" factoryName="Android App" temporary="true">
|
||||
<module name="My_Application.app.main" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
<option name="DEPLOY_APK_FROM_BUNDLE" value="false" />
|
||||
<option name="DEPLOY_AS_INSTANT" value="false" />
|
||||
<option name="ARTIFACT_NAME" value="" />
|
||||
<option name="PM_INSTALL_OPTIONS" value="" />
|
||||
<option name="ALL_USERS" value="false" />
|
||||
<option name="ALWAYS_INSTALL_WITH_PM" value="false" />
|
||||
<option name="CLEAR_APP_STORAGE" value="false" />
|
||||
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
|
||||
<option name="MODE" value="specific_activity" />
|
||||
<option name="CLEAR_LOGCAT" value="false" />
|
||||
<option name="SHOW_LOGCAT_AUTOMATICALLY" value="false" />
|
||||
<option name="INSPECTION_WITHOUT_ACTIVITY_RESTART" value="false" />
|
||||
<option name="TARGET_SELECTION_MODE" value="DEVICE_AND_SNAPSHOT_COMBO_BOX" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_CONFIGURATION_ID" value="-1" />
|
||||
<option name="SELECTED_CLOUD_MATRIX_PROJECT_ID" value="" />
|
||||
<option name="DEBUGGER_TYPE" value="Auto" />
|
||||
<Auto>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||
</Auto>
|
||||
<Hybrid>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||
</Hybrid>
|
||||
<Java>
|
||||
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||
</Java>
|
||||
<Native>
|
||||
<option name="USE_JAVA_AWARE_DEBUGGER" value="false" />
|
||||
<option name="SHOW_STATIC_VARS" value="true" />
|
||||
<option name="WORKING_DIR" value="" />
|
||||
<option name="TARGET_LOGGING_CHANNELS" value="lldb process:gdb-remote packets" />
|
||||
<option name="SHOW_OPTIMIZED_WARNING" value="true" />
|
||||
<option name="ATTACH_ON_WAIT_FOR_DEBUGGER" value="false" />
|
||||
<option name="DEBUG_SANDBOX_SDK" value="false" />
|
||||
</Native>
|
||||
<Profilers>
|
||||
<option name="ADVANCED_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_ENABLED" value="false" />
|
||||
<option name="STARTUP_CPU_PROFILING_CONFIGURATION_NAME" value="Java/Kotlin Method Sample (legacy)" />
|
||||
<option name="STARTUP_NATIVE_MEMORY_PROFILING_ENABLED" value="false" />
|
||||
<option name="NATIVE_MEMORY_SAMPLE_RATE_BYTES" value="2048" />
|
||||
</Profilers>
|
||||
<option name="DEEP_LINK" value="" />
|
||||
<option name="ACTIVITY_CLASS" value="com.example.myapplication.App" />
|
||||
<option name="SEARCH_ACTIVITY_IN_GLOBAL_SCOPE" value="false" />
|
||||
<option name="SKIP_ACTIVITY_VALIDATION" value="false" />
|
||||
<method v="2">
|
||||
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="app" type="AndroidRunConfigurationType" factoryName="Android App">
|
||||
<module name="My_Application.app.main" />
|
||||
<option name="DEPLOY" value="true" />
|
||||
@ -150,6 +246,11 @@
|
||||
<option name="Android.Gradle.BeforeRunTask" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Android App.App" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
@ -167,7 +268,14 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1696075970008</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="2" />
|
||||
<task id="LOCAL-00002" summary="empty activity test">
|
||||
<created>1696755925297</created>
|
||||
<option name="number" value="00002" />
|
||||
<option name="presentableId" value="LOCAL-00002" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1696755925297</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="3" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
|
@ -3,22 +3,27 @@ package com.example.myapplication
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material.SnackbarDefaults.backgroundColor
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.ui.Modifier
|
||||
import com.example.myapplication.Navbar.NavBar
|
||||
import com.example.myapplication.ui.theme.AppTheme
|
||||
import com.example.myapplication.ui.theme.BlueMain
|
||||
|
||||
class App : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContent {
|
||||
AppTheme {
|
||||
AppTheme (darkTheme = false){
|
||||
// A surface container using the 'background' color from the theme
|
||||
|
||||
Surface(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
color = MaterialTheme.colorScheme.background
|
||||
modifier = Modifier.fillMaxSize()
|
||||
.background(BlueMain),
|
||||
) {
|
||||
NavBar();
|
||||
}
|
||||
|
@ -1,8 +1,118 @@
|
||||
package com.example.myapplication.Basket
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.horizontalScroll
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.itemsIndexed
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
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.res.painterResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.navigation.NavHostController
|
||||
import com.example.myapplication.R
|
||||
import com.example.myapplication.TestServiceItem
|
||||
import com.example.myapplication.getServices
|
||||
import com.example.myapplication.ui.theme.BlueMain
|
||||
import com.example.myapplication.ui.theme.GreenBtn
|
||||
|
||||
@Composable
|
||||
fun Basket(navController : NavHostController,userId : Long){
|
||||
fun Basket(navController : NavHostController){
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(BlueMain)
|
||||
.padding(15.dp)
|
||||
.padding(bottom = 60.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
Image(
|
||||
painter = painterResource(id = R.drawable.icon_calendar),
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.padding(5.dp)
|
||||
)
|
||||
LazyColumn(){
|
||||
val items = listOf<TestServiceItem>(getServices()[1])
|
||||
itemsIndexed(items){
|
||||
_, item ->
|
||||
BasketItem(item = item)
|
||||
}
|
||||
}
|
||||
Box(modifier = Modifier
|
||||
.clip(RoundedCornerShape(15.dp, 15.dp, 0.dp, 0.dp))
|
||||
.background(Color.Transparent)
|
||||
.height(130.dp),
|
||||
){
|
||||
Column (modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(100.dp)
|
||||
.background(Color.White)
|
||||
.padding(PaddingValues(15.dp)),
|
||||
){
|
||||
Row (
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
){
|
||||
Text(
|
||||
text = "Total:",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
Text(
|
||||
text = "40$",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
}
|
||||
Row (
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
){
|
||||
Text(
|
||||
text = "Date:",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
Text(
|
||||
text = "11.11.2023:",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
}
|
||||
}
|
||||
Button(
|
||||
onClick = { /*TODO*/ },
|
||||
modifier = Modifier
|
||||
.height(60.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape)
|
||||
.align(Alignment.BottomCenter),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Text(text = "Confirm order", style = MaterialTheme.typography.bodyMedium.copy(Color.White))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
150
app/src/main/java/com/example/myapplication/Basket/BasketItem.kt
Normal file
150
app/src/main/java/com/example/myapplication/Basket/BasketItem.kt
Normal file
@ -0,0 +1,150 @@
|
||||
package com.example.myapplication.Basket
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
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.PaddingValues
|
||||
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.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
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.draw.clip
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.platform.LocalConfiguration
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.example.myapplication.TestServiceItem
|
||||
import com.example.myapplication.ui.theme.GreenBtn
|
||||
import com.example.myapplication.ui.theme.TextPrimary
|
||||
import com.example.myapplication.ui.theme.TextSecondary
|
||||
|
||||
@Composable
|
||||
fun BasketItem(item: TestServiceItem){
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.padding(0.dp, 0.dp, 0.dp, 10.dp)
|
||||
.height(150.dp)
|
||||
.shadow(
|
||||
elevation = 4.dp,
|
||||
shape = RoundedCornerShape(15.dp),
|
||||
clip = false
|
||||
),
|
||||
){
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(145.dp)
|
||||
.background(color = Color.White, RoundedCornerShape(15.dp))
|
||||
.padding(15.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
){
|
||||
Image(
|
||||
painter = painterResource(id = item.image),
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.heightIn(min = 100.dp)
|
||||
.widthIn(max = (LocalConfiguration.current.screenWidthDp / 3).dp),
|
||||
contentScale = ContentScale.FillHeight,
|
||||
)
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.widthIn(max = (LocalConfiguration.current.screenWidthDp / 3).dp),
|
||||
verticalArrangement = Arrangement.Top,
|
||||
){
|
||||
var animalsString = ""
|
||||
item.name?.let {
|
||||
Text(
|
||||
text = it,
|
||||
color = TextPrimary,
|
||||
style = MaterialTheme.typography.bodyMedium)
|
||||
}
|
||||
item.animals?.forEach { animal -> animalsString += "$animal, " }
|
||||
Text(
|
||||
text = animalsString,
|
||||
color = TextSecondary,
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
}
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.widthIn(max = (LocalConfiguration.current.screenWidthDp / 3).dp),
|
||||
verticalArrangement = Arrangement.SpaceBetween,
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
){
|
||||
Text(
|
||||
text = "$${item.price}",
|
||||
color = TextPrimary,
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
Row(verticalAlignment = Alignment.CenterVertically){
|
||||
var num by remember { mutableIntStateOf(5) }
|
||||
Text(
|
||||
text = num.toString(),
|
||||
color = TextPrimary
|
||||
)
|
||||
Column(verticalArrangement = Arrangement.SpaceAround){
|
||||
Button(
|
||||
onClick = { num+=1 },
|
||||
modifier = Modifier
|
||||
.size(42.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Text(text = "+")
|
||||
}
|
||||
Button(
|
||||
onClick = { num-=1 },
|
||||
modifier = Modifier
|
||||
.size(42.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Text(text = "-")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,214 @@
|
||||
package com.example.myapplication.List_of_Services
|
||||
|
||||
import android.content.ContentResolver
|
||||
import android.content.Intent
|
||||
import android.graphics.BitmapFactory
|
||||
import android.provider.MediaStore
|
||||
import android.widget.Toast
|
||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.compose.foundation.Image
|
||||
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.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.DropdownMenuItem
|
||||
import androidx.compose.material.ExperimentalMaterialApi
|
||||
import androidx.compose.material.ExposedDropdownMenuBox
|
||||
import androidx.compose.material.ExposedDropdownMenuDefaults
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.DropdownMenu
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextField
|
||||
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.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.ImageBitmap
|
||||
import androidx.compose.ui.graphics.asImageBitmap
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.platform.LocalConfiguration
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.navigation.NavController
|
||||
import com.example.myapplication.UIComponents.MyTextField
|
||||
import com.example.myapplication.ui.theme.BlueMain
|
||||
import com.example.myapplication.ui.theme.GreenBtn
|
||||
import com.example.myapplication.ui.theme.TextPrimary
|
||||
import com.example.myapplication.ui.theme.TextSecondary
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
@OptIn(ExperimentalMaterialApi::class, ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun AddService (navController: NavController){
|
||||
var serviceName = ""
|
||||
var price = ""
|
||||
var animals = ""
|
||||
val availableAnimals = listOf("Dogs", "Cats")
|
||||
var expanded by remember { mutableStateOf(false) }
|
||||
Column (
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(BlueMain)
|
||||
.padding(15.dp)
|
||||
.padding(bottom = 60.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
){
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.padding(0.dp, 0.dp, 0.dp, 10.dp)
|
||||
.height(150.dp)
|
||||
.shadow(
|
||||
elevation = 4.dp,
|
||||
shape = RoundedCornerShape(15.dp),
|
||||
clip = false
|
||||
),
|
||||
){
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(145.dp)
|
||||
.background(color = Color.White, RoundedCornerShape(15.dp))
|
||||
.padding(15.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
){
|
||||
/* Image(
|
||||
bitmap = selectedImage!!,
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.heightIn(min = 100.dp)
|
||||
.widthIn(max = (LocalConfiguration.current.screenWidthDp / 3).dp),
|
||||
contentScale = ContentScale.FillHeight,
|
||||
)*/
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.widthIn(max = (LocalConfiguration.current.screenWidthDp / 3).dp),
|
||||
verticalArrangement = Arrangement.Top,
|
||||
){
|
||||
var animalsString = ""
|
||||
serviceName?.let {
|
||||
Text(
|
||||
text = it,
|
||||
color = TextPrimary,
|
||||
style = MaterialTheme.typography.bodyMedium)
|
||||
}
|
||||
animals?.forEach { animal -> animalsString += "$animal, " }
|
||||
Text(
|
||||
text = animalsString,
|
||||
color = TextSecondary,
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
}
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.widthIn(max = (LocalConfiguration.current.screenWidthDp / 3).dp),
|
||||
verticalArrangement = Arrangement.SpaceBetween,
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
){
|
||||
Text(
|
||||
text = "${price}$",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Column (
|
||||
){
|
||||
Row (modifier = Modifier.padding(vertical = 5.dp)){
|
||||
MyTextField(label = "Service name"){
|
||||
newValue ->
|
||||
serviceName = newValue
|
||||
}
|
||||
}
|
||||
Row (modifier = Modifier.padding(vertical = 5.dp)){
|
||||
DropdownMenu(
|
||||
expanded = expanded,
|
||||
onDismissRequest = { expanded = false }
|
||||
) {
|
||||
availableAnimals.forEach {
|
||||
DropdownMenuItem(onClick = { animals += "$it, " }) {
|
||||
Text(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Row (modifier = Modifier.padding(vertical = 5.dp)){
|
||||
MyTextField(label = "Price"){
|
||||
newValue ->
|
||||
price = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
Button(
|
||||
onClick = {
|
||||
// val intent = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
|
||||
// launcher.launch(intent)
|
||||
},
|
||||
modifier = Modifier
|
||||
.height(60.dp)
|
||||
.padding(top = 10.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Text(text = "Upload image", style = MaterialTheme.typography.bodyMedium.copy(Color.White))
|
||||
}
|
||||
Button(
|
||||
onClick = {
|
||||
|
||||
},
|
||||
modifier = Modifier
|
||||
.height(60.dp)
|
||||
.padding(top = 10.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Text(text = "Add service", style = MaterialTheme.typography.bodyMedium.copy(Color.White))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun loadSelectedImage(uri: android.net.Uri, contentResolver: ContentResolver): ImageBitmap {
|
||||
return withContext(Dispatchers.IO) {
|
||||
val inputStream = contentResolver.openInputStream(uri)
|
||||
val bitmap = BitmapFactory.decodeStream(inputStream)
|
||||
bitmap.asImageBitmap()
|
||||
}
|
||||
}
|
@ -1,8 +1,43 @@
|
||||
package com.example.myapplication.List_of_Services
|
||||
|
||||
import SearchBar
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.itemsIndexed
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.navigation.NavHostController
|
||||
import com.example.myapplication.getServices
|
||||
import com.example.myapplication.ui.theme.BlueMain
|
||||
|
||||
@Composable
|
||||
fun ListOfServices(){
|
||||
fun ListOfServices(navController: NavHostController){
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(BlueMain)
|
||||
.padding(bottom = 60.dp)
|
||||
){
|
||||
SearchBar(
|
||||
modifier = Modifier)
|
||||
{
|
||||
searchText ->
|
||||
//TODO search logic
|
||||
}
|
||||
LazyColumn(modifier = Modifier.padding(15.dp, 0.dp)){
|
||||
var serviceList = getServices()
|
||||
itemsIndexed(serviceList){_, item ->
|
||||
Service(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package com.example.myapplication.List_of_Services
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
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.IntrinsicSize
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.RowScope
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Add
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
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.draw.drawWithContent
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.platform.LocalConfiguration
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.TextUnit
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.navigation.NavHostController
|
||||
import com.example.myapplication.TestServiceItem
|
||||
import com.example.myapplication.ui.theme.GreenBtn
|
||||
import com.example.myapplication.ui.theme.TextPrimary
|
||||
import com.example.myapplication.ui.theme.TextSecondary
|
||||
import java.security.Provider.Service
|
||||
|
||||
@Composable
|
||||
fun Service(item: TestServiceItem){
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.padding(0.dp, 0.dp, 0.dp, 10.dp)
|
||||
.height(150.dp)
|
||||
.shadow(
|
||||
elevation = 4.dp,
|
||||
shape = RoundedCornerShape(15.dp),
|
||||
clip = false
|
||||
),
|
||||
){
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(145.dp)
|
||||
.background(color = Color.White, RoundedCornerShape(15.dp))
|
||||
.padding(15.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
){
|
||||
Image(
|
||||
painter = painterResource(id = item.image),
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.heightIn(min = 100.dp)
|
||||
.widthIn(max = (LocalConfiguration.current.screenWidthDp / 3).dp),
|
||||
contentScale = ContentScale.FillHeight,
|
||||
)
|
||||
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.widthIn(max = (LocalConfiguration.current.screenWidthDp / 3).dp),
|
||||
verticalArrangement = Arrangement.Top,
|
||||
){
|
||||
var animalsString = ""
|
||||
item.name?.let {
|
||||
Text(
|
||||
text = it,
|
||||
color = TextPrimary,
|
||||
style = MaterialTheme.typography.bodyMedium)
|
||||
}
|
||||
item.animals?.forEach { animal -> animalsString += "$animal, " }
|
||||
Text(
|
||||
text = animalsString,
|
||||
color = TextSecondary,
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
}
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxHeight()
|
||||
.widthIn(max = (LocalConfiguration.current.screenWidthDp / 3).dp),
|
||||
verticalArrangement = Arrangement.SpaceBetween,
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
){
|
||||
Text(
|
||||
text = "$${item.price}",
|
||||
color = TextPrimary,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
Button(
|
||||
onClick = { /*TODO*/ },
|
||||
modifier = Modifier
|
||||
.size(42.dp)
|
||||
.clip(CircleShape),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
){
|
||||
Text(text = "+")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -2,11 +2,19 @@ package com.example.myapplication.Navbar
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.res.Resources
|
||||
import androidx.compose.foundation.BorderStroke
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.BottomNavigation
|
||||
import androidx.compose.material.BottomNavigationItem
|
||||
@ -20,16 +28,25 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.ControlledComposition
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.painter.Painter
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.max
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.res.ResourcesCompat.getColor
|
||||
import androidx.navigation.NavDestination.Companion.hierarchy
|
||||
import androidx.navigation.NavGraph.Companion.findStartDestination
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.currentBackStackEntryAsState
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import com.example.myapplication.R
|
||||
import com.example.myapplication.ui.theme.BlueMain
|
||||
import com.example.myapplication.ui.theme.BlueNavbar
|
||||
import com.example.myapplication.ui.theme.GreenBtn
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@SuppressLint("UnusedMaterialScaffoldPaddingParameter")
|
||||
@ -37,22 +54,32 @@ import com.example.myapplication.ui.theme.BlueNavbar
|
||||
fun NavBar(){
|
||||
val navController = rememberNavController()
|
||||
val items = listOf(
|
||||
NavItem.Basket,
|
||||
NavItem.ListOfServices,
|
||||
NavItem.Basket,
|
||||
NavItem.Profile
|
||||
)
|
||||
|
||||
Scaffold(bottomBar = {
|
||||
BottomNavigation(
|
||||
backgroundColor = BlueNavbar
|
||||
backgroundColor = BlueNavbar,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(60.dp)
|
||||
.clip(RoundedCornerShape(15.dp, 15.dp, 0.dp, 0.dp)),
|
||||
){
|
||||
val navBackStackEntry by navController.currentBackStackEntryAsState()
|
||||
val currentDestination = navBackStackEntry?.destination
|
||||
|
||||
items.forEach { screen ->
|
||||
BottomNavigationItem(
|
||||
icon = { ContextCompat.getDrawable(LocalContext.current, screen.icon)},
|
||||
icon = {
|
||||
Icon(painterResource(screen.icon),
|
||||
null,
|
||||
modifier = Modifier,
|
||||
GreenBtn)
|
||||
},
|
||||
selected = currentDestination?.hierarchy?.any { it.route == screen.route } == true,
|
||||
modifier = Modifier
|
||||
.padding(15.dp),
|
||||
onClick = {
|
||||
navController.navigate(screen.route){
|
||||
popUpTo(navController.graph.findStartDestination().id) {
|
||||
|
@ -6,41 +6,81 @@ import androidx.navigation.NavHostController
|
||||
import androidx.navigation.compose.NavHost
|
||||
import androidx.navigation.compose.composable
|
||||
import com.example.myapplication.Basket.Basket
|
||||
import com.example.myapplication.List_of_Services.AddService
|
||||
import com.example.myapplication.List_of_Services.ListOfServices
|
||||
import com.example.myapplication.Orders.Orders
|
||||
import com.example.myapplication.Profile.Login
|
||||
import com.example.myapplication.Profile.Profile
|
||||
import com.example.myapplication.Profile.ProfileChange
|
||||
import com.example.myapplication.Profile.ProfileNotAuth
|
||||
import com.example.myapplication.Profile.Registration
|
||||
|
||||
@Composable
|
||||
fun NavController(navController : NavHostController){
|
||||
NavHost(
|
||||
navController = navController,
|
||||
startDestination = "list_of_services"
|
||||
startDestination = NavItem.Profile.route
|
||||
){
|
||||
composable(
|
||||
"list_of_services"
|
||||
NavItem.ListOfServices.route
|
||||
){
|
||||
ListOfServices()
|
||||
ListOfServices(navController)
|
||||
}
|
||||
composable(
|
||||
"basket/{userId}"
|
||||
// "${NavItem.Basket.route}/{userId}"
|
||||
"${NavItem.Basket.route}"
|
||||
){
|
||||
backStackEntry ->
|
||||
backStackEntry.arguments?.getString("userId")?.let {
|
||||
Basket(
|
||||
navController,
|
||||
it.toLong()
|
||||
)
|
||||
}
|
||||
Basket(navController)
|
||||
// backStackEntry ->
|
||||
// backStackEntry.arguments?.getString("userId")?.let {
|
||||
// Basket(
|
||||
// navController,
|
||||
// it.toLong()
|
||||
// )
|
||||
// }
|
||||
}
|
||||
composable(
|
||||
"profile/{userId}"
|
||||
// "${NavItem.Profile.route}/{userId}"
|
||||
"${NavItem.Profile.route}"
|
||||
){
|
||||
backStackEntry ->
|
||||
backStackEntry.arguments?.getString("userId")?.let {
|
||||
Profile(
|
||||
navController,
|
||||
it.toLong()
|
||||
)
|
||||
Profile(navController)
|
||||
// backStackEntry ->
|
||||
// backStackEntry.arguments?.getString("userId")?.let {
|
||||
// Profile(
|
||||
// navController,
|
||||
// it.toLong()
|
||||
// )
|
||||
// }
|
||||
}
|
||||
composable(
|
||||
"${NavItem.ProfileChange.route}"
|
||||
){
|
||||
ProfileChange(navController)
|
||||
}
|
||||
composable(
|
||||
"${NavItem.Orders.route}"
|
||||
){
|
||||
Orders(navController)
|
||||
}
|
||||
composable(
|
||||
"${NavItem.ProfileNotAuth.route}"
|
||||
){
|
||||
ProfileNotAuth(navController)
|
||||
}
|
||||
composable(
|
||||
"${NavItem.Login.route}"
|
||||
){
|
||||
Login(navController)
|
||||
}
|
||||
composable(
|
||||
"${NavItem.Registration.route}"
|
||||
){
|
||||
Registration(navController)
|
||||
}
|
||||
composable(
|
||||
"${NavItem.AddService.route}"
|
||||
){
|
||||
AddService(navController)
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
package com.example.myapplication.Navbar
|
||||
|
||||
import androidx.annotation.DrawableRes
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.vectorResource
|
||||
import com.example.myapplication.R
|
||||
|
||||
@ -21,4 +23,28 @@ sealed class NavItem(
|
||||
"profile",
|
||||
R.drawable.icon_profile
|
||||
)
|
||||
object ProfileChange : NavItem(
|
||||
"profile_change",
|
||||
R.drawable.icon_profile
|
||||
)
|
||||
object Orders : NavItem(
|
||||
"orders",
|
||||
R.drawable.icon_profile
|
||||
)
|
||||
object ProfileNotAuth : NavItem(
|
||||
"profile_not_auth",
|
||||
R.drawable.icon_profile
|
||||
)
|
||||
object Login : NavItem(
|
||||
"login",
|
||||
R.drawable.icon_profile
|
||||
)
|
||||
object Registration : NavItem(
|
||||
"registration",
|
||||
R.drawable.icon_profile
|
||||
)
|
||||
object AddService : NavItem(
|
||||
"add_service",
|
||||
R.drawable.icon_list_of_services
|
||||
)
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package com.example.myapplication.Orders
|
||||
|
||||
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.PaddingValues
|
||||
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.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
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.alpha
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.modifier.modifierLocalConsumer
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.example.myapplication.ui.theme.TextPrimary
|
||||
import com.example.myapplication.ui.theme.TextSecondary
|
||||
import java.util.Date
|
||||
|
||||
@Composable
|
||||
fun OrderItem (orderId: Int, date: String, price: Double, list: String){
|
||||
Column(modifier = Modifier.fillMaxWidth().clip(RoundedCornerShape(15.dp))){
|
||||
Column (
|
||||
modifier = Modifier
|
||||
.padding(0.dp, 0.dp, 0.dp, 0.dp)
|
||||
.shadow(
|
||||
elevation = 4.dp,
|
||||
shape = RoundedCornerShape(15.dp),
|
||||
clip = false
|
||||
)
|
||||
){
|
||||
Row (
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
modifier = Modifier
|
||||
.background(Color.White)
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 15.dp, vertical = 10.dp),
|
||||
){
|
||||
Text(text = "Order:$orderId", modifier = Modifier.weight(1f), style = MaterialTheme.typography.bodyMedium)
|
||||
Text(text = "$price$", style = MaterialTheme.typography.bodyMedium)
|
||||
}
|
||||
Row (
|
||||
modifier = Modifier
|
||||
.background(Color.White)
|
||||
.fillMaxWidth()
|
||||
.padding(horizontal = 15.dp),
|
||||
){
|
||||
Text(text = date, style = MaterialTheme.typography.bodyMedium)
|
||||
}
|
||||
}
|
||||
Row (
|
||||
modifier = Modifier
|
||||
.background(Color.White)
|
||||
.fillMaxWidth()
|
||||
.padding(15.dp)
|
||||
){
|
||||
Text(text = list, style = MaterialTheme.typography.bodyMedium.copy(TextSecondary))
|
||||
}
|
||||
}
|
||||
}
|
27
app/src/main/java/com/example/myapplication/Orders/Orders.kt
Normal file
27
app/src/main/java/com/example/myapplication/Orders/Orders.kt
Normal file
@ -0,0 +1,27 @@
|
||||
package com.example.myapplication.Orders
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.navigation.NavController
|
||||
import com.example.myapplication.ui.theme.BlueMain
|
||||
import java.util.Date
|
||||
|
||||
@Composable
|
||||
fun Orders (navController: NavController){
|
||||
Column (
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(BlueMain)
|
||||
.padding(15.dp)
|
||||
.padding(bottom = 60.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
){
|
||||
OrderItem(orderId = 1, date = "11.11.2023", price = 40.0, list = "Inoculation x2")
|
||||
}
|
||||
}
|
107
app/src/main/java/com/example/myapplication/Profile/Login.kt
Normal file
107
app/src/main/java/com/example/myapplication/Profile/Login.kt
Normal file
@ -0,0 +1,107 @@
|
||||
package com.example.myapplication.Profile
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
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.unit.TextUnit
|
||||
import androidx.compose.ui.unit.TextUnitType
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.navigation.NavController
|
||||
import com.example.myapplication.Navbar.NavItem
|
||||
import com.example.myapplication.UIComponents.MyTextField
|
||||
import com.example.myapplication.ui.theme.BlueMain
|
||||
import com.example.myapplication.ui.theme.GreenBtn
|
||||
import com.example.myapplication.ui.theme.TextSecondary
|
||||
|
||||
@Composable
|
||||
fun Login (navController: NavController){
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(BlueMain)
|
||||
.padding(15.dp)
|
||||
.padding(bottom = 60.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center,
|
||||
){
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(bottom = 30.dp),
|
||||
horizontalArrangement = Arrangement.Center
|
||||
){
|
||||
Text(
|
||||
text = "PetMed",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
.copy(Color.White, fontSize = TextUnit(16.0f, TextUnitType.Em))
|
||||
)
|
||||
}
|
||||
Column (
|
||||
){
|
||||
Row (modifier = Modifier
|
||||
.padding(vertical = 5.dp)
|
||||
){
|
||||
MyTextField(label = "Email", onValueChanged = {})
|
||||
}
|
||||
Row (modifier = Modifier
|
||||
.padding(vertical = 5.dp)
|
||||
){
|
||||
MyTextField(label = "Password", onValueChanged = {})
|
||||
}
|
||||
}
|
||||
Button(
|
||||
onClick = { navController.navigate(NavItem.ListOfServices.route) },
|
||||
modifier = Modifier
|
||||
.height(60.dp)
|
||||
.padding(top = 10.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Text(
|
||||
text = "Login",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
.copy(Color.White)
|
||||
)
|
||||
}
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.Center
|
||||
){
|
||||
Text(
|
||||
text = "Don't have an account? ",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
.copy(TextSecondary)
|
||||
)
|
||||
Text(
|
||||
text = "Sign up",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
.copy(GreenBtn),
|
||||
modifier = Modifier
|
||||
.clickable { navController.navigate(NavItem.Registration.route) }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,154 @@
|
||||
package com.example.myapplication.Profile
|
||||
|
||||
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.PaddingValues
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.ExitToApp
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
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.alpha
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.navigation.NavHostController
|
||||
import com.example.myapplication.Navbar.NavItem
|
||||
import com.example.myapplication.ui.theme.BlueMain
|
||||
import com.example.myapplication.ui.theme.GreenBtn
|
||||
import com.example.myapplication.ui.theme.RedBtn
|
||||
|
||||
fun Profile(navController: NavHostController, userId : Long){
|
||||
@Composable
|
||||
fun Profile(navController: NavHostController){
|
||||
Column (
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(BlueMain)
|
||||
.padding(15.dp)
|
||||
.padding(bottom = 60.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
){
|
||||
Box(modifier = Modifier
|
||||
.clip(CircleShape)
|
||||
.size(200.dp)
|
||||
.background(Color.White)
|
||||
){
|
||||
// TODO: upload profile image
|
||||
}
|
||||
Box(modifier = Modifier.padding(15.dp)){
|
||||
Text(
|
||||
text = "Name Surname",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.align(Alignment.Center),
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
}
|
||||
Box(modifier = Modifier.padding(15.dp)){
|
||||
Text(
|
||||
text = "example@mail.ex",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.align(Alignment.Center),
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
}
|
||||
Button(
|
||||
onClick = { navController.navigate(NavItem.ProfileChange.route) },
|
||||
modifier = Modifier
|
||||
.height(60.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape)
|
||||
.padding(vertical = 5.dp),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Text(
|
||||
text = "Change profile",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = Color.White
|
||||
)
|
||||
}
|
||||
Button(
|
||||
onClick = { navController.navigate(NavItem.Orders.route) },
|
||||
modifier = Modifier
|
||||
.height(60.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape)
|
||||
.padding(vertical = 5.dp),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Text(
|
||||
text = "Orders",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = Color.White
|
||||
)
|
||||
}
|
||||
Button(
|
||||
onClick = { navController.navigate(NavItem.AddService.route) },
|
||||
modifier = Modifier
|
||||
.height(60.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape)
|
||||
.padding(vertical = 5.dp),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Text(
|
||||
text = "Add service",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = Color.White
|
||||
)
|
||||
}
|
||||
Button(
|
||||
onClick = { navController.navigate(NavItem.ProfileNotAuth.route) },
|
||||
modifier = Modifier
|
||||
.height(60.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape)
|
||||
.padding(vertical = 5.dp),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = RedBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.ExitToApp,
|
||||
contentDescription = null,
|
||||
modifier = Modifier,
|
||||
)
|
||||
Text(
|
||||
text = "Exit",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = Color.White
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
package com.example.myapplication.Profile
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.BasicTextField
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.KeyboardArrowDown
|
||||
import androidx.compose.material3.AlertDialogDefaults.shape
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
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.rememberUpdatedState
|
||||
import androidx.compose.runtime.setValue
|
||||
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.graphics.Shape
|
||||
import androidx.compose.ui.modifier.modifierLocalConsumer
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.input.TextFieldValue
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.navigation.NavHostController
|
||||
import com.example.myapplication.R
|
||||
import com.example.myapplication.UIComponents.MyTextField
|
||||
import com.example.myapplication.ui.theme.BlueBorder
|
||||
import com.example.myapplication.ui.theme.BlueMain
|
||||
import com.example.myapplication.ui.theme.GreenBtn
|
||||
import com.example.myapplication.ui.theme.TextSecondary
|
||||
|
||||
@Composable
|
||||
fun ProfileChange (navController: NavHostController){
|
||||
Column (
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(BlueMain)
|
||||
.padding(15.dp)
|
||||
.padding(bottom = 60.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
){
|
||||
Box(modifier = Modifier
|
||||
.clip(CircleShape)
|
||||
.size(200.dp)
|
||||
.background(Color.White)
|
||||
.padding(PaddingValues(0.dp))
|
||||
){
|
||||
Icon(
|
||||
painterResource(id = R.drawable.upload),
|
||||
contentDescription = null,
|
||||
modifier = Modifier.align(Alignment.Center),
|
||||
GreenBtn
|
||||
)
|
||||
}
|
||||
Box(modifier = Modifier.padding(15.dp)){
|
||||
Text(
|
||||
text = "Name Surname",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.align(Alignment.Center),
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
}
|
||||
Box(modifier = Modifier.padding(15.dp)){
|
||||
Text(
|
||||
text = "example@mail.ex",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.align(Alignment.Center),
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
}
|
||||
Column (
|
||||
){
|
||||
Row (modifier = Modifier.padding(vertical = 5.dp)){
|
||||
MyTextField(label = "Name", onValueChanged = {})
|
||||
}
|
||||
Row (modifier = Modifier.padding(vertical = 5.dp)){
|
||||
MyTextField(label = "Surname", onValueChanged = {})
|
||||
}
|
||||
Row (modifier = Modifier.padding(vertical = 5.dp)){
|
||||
MyTextField(label = "Email", onValueChanged = {})
|
||||
}
|
||||
Row (modifier = Modifier.padding(vertical = 5.dp)){
|
||||
MyTextField(label = "Old password", onValueChanged = {})
|
||||
}
|
||||
Row (modifier = Modifier.padding(vertical = 5.dp)){
|
||||
MyTextField(label = "New password", onValueChanged = {})
|
||||
}
|
||||
}
|
||||
Button(
|
||||
onClick = { /*TODO*/ },
|
||||
modifier = Modifier
|
||||
.height(60.dp)
|
||||
.padding(top = 10.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Text(text = "Confirm changes", style = MaterialTheme.typography.bodyMedium.copy(Color.White))
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package com.example.myapplication.Profile
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
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.unit.dp
|
||||
import androidx.navigation.NavController
|
||||
import com.example.myapplication.Navbar.NavItem
|
||||
import com.example.myapplication.ui.theme.BlueMain
|
||||
import com.example.myapplication.ui.theme.GreenBtn
|
||||
|
||||
@Composable
|
||||
fun ProfileNotAuth (navController: NavController){
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(BlueMain)
|
||||
.padding(15.dp)
|
||||
.padding(bottom = 60.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center,
|
||||
){
|
||||
Row (
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.padding(bottom = 15.dp)
|
||||
){
|
||||
Button(
|
||||
onClick = { navController.navigate(NavItem.Login.route) },
|
||||
modifier = Modifier
|
||||
.height(60.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Text(
|
||||
text = "Login",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
.copy(Color.White)
|
||||
)
|
||||
}
|
||||
}
|
||||
Button(
|
||||
onClick = { navController.navigate(NavItem.Registration.route) },
|
||||
modifier = Modifier
|
||||
.height(60.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Text(
|
||||
text = "Registration",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
.copy(Color.White)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package com.example.myapplication.Profile
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.PaddingValues
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
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.unit.TextUnit
|
||||
import androidx.compose.ui.unit.TextUnitType
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.navigation.NavController
|
||||
import com.example.myapplication.Navbar.NavItem
|
||||
import com.example.myapplication.UIComponents.MyTextField
|
||||
import com.example.myapplication.ui.theme.BlueMain
|
||||
import com.example.myapplication.ui.theme.GreenBtn
|
||||
import com.example.myapplication.ui.theme.TextSecondary
|
||||
|
||||
@Composable
|
||||
fun Registration (navController: NavController){
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(BlueMain)
|
||||
.padding(15.dp)
|
||||
.padding(bottom = 60.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center,
|
||||
){
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(bottom = 30.dp),
|
||||
horizontalArrangement = Arrangement.Center,
|
||||
){
|
||||
Text(
|
||||
text = "PetMed",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
.copy(Color.White, fontSize = TextUnit(16.0f, TextUnitType.Em))
|
||||
)
|
||||
}
|
||||
Column (
|
||||
){
|
||||
Row (modifier = Modifier.padding(vertical = 5.dp)){
|
||||
MyTextField(label = "Name", onValueChanged = {})
|
||||
}
|
||||
Row (modifier = Modifier.padding(vertical = 5.dp)){
|
||||
MyTextField(label = "Surname", onValueChanged = {})
|
||||
}
|
||||
Row (modifier = Modifier.padding(vertical = 5.dp)){
|
||||
MyTextField(label = "Email", onValueChanged = {})
|
||||
}
|
||||
Row (modifier = Modifier.padding(vertical = 5.dp)){
|
||||
MyTextField(label = "Password", onValueChanged = {})
|
||||
}
|
||||
}
|
||||
Button(
|
||||
onClick = { navController.navigate(NavItem.ListOfServices.route) },
|
||||
modifier = Modifier
|
||||
.height(60.dp)
|
||||
.padding(top = 10.dp)
|
||||
.fillMaxWidth()
|
||||
.clip(CircleShape),
|
||||
colors = ButtonDefaults.buttonColors(
|
||||
containerColor = GreenBtn,
|
||||
contentColor = Color.White
|
||||
),
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
) {
|
||||
Text(
|
||||
text = "Registration",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
.copy(Color.White)
|
||||
)
|
||||
}
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.Center
|
||||
){
|
||||
Text(
|
||||
text = "Already have a account? ",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
.copy(TextSecondary)
|
||||
)
|
||||
Text(
|
||||
text = "Login",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
.copy(GreenBtn),
|
||||
modifier = Modifier.clickable { navController.navigate(NavItem.Login.route) }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.example.myapplication
|
||||
|
||||
import android.os.Parcel
|
||||
import android.os.Parcelable
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
data class TestServiceItem(
|
||||
val image: Int,
|
||||
val name: String?,
|
||||
val animals: ArrayList<String>?,
|
||||
val price: Double
|
||||
) : Parcelable {
|
||||
|
||||
constructor(parcel: Parcel) : this(
|
||||
parcel.readInt(),
|
||||
parcel.readString(),
|
||||
parcel.createStringArrayList(),
|
||||
parcel.readDouble()
|
||||
) {
|
||||
}
|
||||
|
||||
override fun writeToParcel(parcel: Parcel, flags: Int) {
|
||||
parcel.writeInt(image)
|
||||
parcel.writeString(name)
|
||||
parcel.writeStringList(animals)
|
||||
parcel.writeDouble(price)
|
||||
}
|
||||
|
||||
override fun describeContents(): Int {
|
||||
return 0
|
||||
}
|
||||
|
||||
companion object CREATOR : Parcelable.Creator<TestServiceItem> {
|
||||
override fun createFromParcel(parcel: Parcel): TestServiceItem {
|
||||
return TestServiceItem(parcel)
|
||||
}
|
||||
|
||||
override fun newArray(size: Int): Array<TestServiceItem?> {
|
||||
return arrayOfNulls(size)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getServices(): List<TestServiceItem>{
|
||||
return listOf(
|
||||
TestServiceItem(R.drawable.image_service, "Inoculation", arrayListOf("Dogs", "Cats","Dogs", "Cats","Dogs", "Cats","Dogs", "Cats","Dogs", "Cats","Dogs", "Cats","Dogs", "Cats",), 20.0),
|
||||
TestServiceItem(R.drawable.image_service, "Inoculation", arrayListOf("Dogs", "Cats"), 20.0),
|
||||
TestServiceItem(R.drawable.image_service, "Inoculation", arrayListOf("Dogs", "Cats"), 20.0),
|
||||
TestServiceItem(R.drawable.image_service, "Inoculation", arrayListOf("Dogs", "Cats"), 20.0),
|
||||
TestServiceItem(R.drawable.image_service, "Inoculation", arrayListOf("Dogs", "Cats"), 20.0),
|
||||
TestServiceItem(R.drawable.image_service, "Inoculation", arrayListOf("Dogs", "Cats"), 20.0),
|
||||
TestServiceItem(R.drawable.image_service, "Inoculation", arrayListOf("Dogs", "Cats"), 20.0),
|
||||
TestServiceItem(R.drawable.image_service, "Inoculation", arrayListOf("Dogs", "Cats"), 20.0),
|
||||
TestServiceItem(R.drawable.image_service, "Inoculation", arrayListOf("Dogs", "Cats"), 20.0),
|
||||
TestServiceItem(R.drawable.image_service, "Inoculation", arrayListOf("Dogs", "Cats"), 20.0),
|
||||
TestServiceItem(R.drawable.image_service, "Inoculation", arrayListOf("Dogs", "Cats"), 20.0),
|
||||
TestServiceItem(R.drawable.image_service, "Inoculation", arrayListOf("Dogs", "Cats"), 20.0),
|
||||
)
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package com.example.myapplication.UIComponents
|
||||
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
@Composable
|
||||
fun Button(color: Color, text: String){
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.example.myapplication.UIComponents
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
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.foundation.text.BasicTextField
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
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.rememberUpdatedState
|
||||
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.text.input.TextFieldValue
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.example.myapplication.ui.theme.BlueBorder
|
||||
import com.example.myapplication.ui.theme.TextSecondary
|
||||
|
||||
@Composable
|
||||
fun MyTextField (
|
||||
label: String,
|
||||
onValueChanged: (String) -> Unit
|
||||
){
|
||||
val textState = remember { mutableStateOf(TextFieldValue()) }
|
||||
val text by rememberUpdatedState(newValue = textState.value)
|
||||
Row (
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.Center,
|
||||
modifier = Modifier
|
||||
.clip(RoundedCornerShape(15.dp))
|
||||
.fillMaxWidth()
|
||||
.background(Color.White)
|
||||
.border(2.dp, color = BlueBorder, RoundedCornerShape(15.dp))
|
||||
.height(45.dp)
|
||||
.padding(horizontal = 15.dp),
|
||||
){
|
||||
if(textState.value.text.isEmpty()){
|
||||
Text(
|
||||
text = label,
|
||||
style = MaterialTheme.typography.bodyMedium.copy(color = TextSecondary)
|
||||
)
|
||||
}
|
||||
BasicTextField(
|
||||
value = text,
|
||||
onValueChange = { newValue ->
|
||||
textState.value = newValue
|
||||
},
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
textStyle = MaterialTheme.typography.bodyMedium,
|
||||
singleLine = true,
|
||||
)
|
||||
}
|
||||
}
|
@ -1,5 +1,10 @@
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
@ -9,31 +14,66 @@ import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Search
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.TextFieldDefaults.indicatorLine
|
||||
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.draw.clip
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.example.myapplication.R
|
||||
import com.example.myapplication.ui.theme.TextSecondary
|
||||
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun SearchBar(
|
||||
modifier: Modifier = Modifier
|
||||
modifier: Modifier = Modifier,
|
||||
onSearch: (String) -> Unit
|
||||
) {
|
||||
var searchText by remember { mutableStateOf("") }
|
||||
|
||||
TextField(
|
||||
value = "",
|
||||
onValueChange = {},
|
||||
value = searchText,
|
||||
onValueChange = {
|
||||
searchText = it
|
||||
onSearch(it)
|
||||
},
|
||||
leadingIcon = {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Search,
|
||||
contentDescription = null
|
||||
contentDescription = "Search",
|
||||
modifier = Modifier,
|
||||
TextSecondary
|
||||
)
|
||||
},
|
||||
placeholder = {
|
||||
Text(stringResource(R.string.placeholder_search))
|
||||
Text(stringResource(R.string.placeholder_search), style = MaterialTheme.typography.bodyMedium.copy(TextSecondary))
|
||||
},
|
||||
modifier = modifier
|
||||
.fillMaxWidth()
|
||||
.heightIn(min = 56.dp)
|
||||
.height(80.dp)
|
||||
.padding(15.dp)
|
||||
.clip(RoundedCornerShape(15.dp)),
|
||||
singleLine = true,
|
||||
colors = TextFieldDefaults.textFieldColors(
|
||||
textColor = Color.Black,
|
||||
containerColor = Color.White,
|
||||
placeholderColor = TextSecondary,
|
||||
focusedIndicatorColor = Color.Transparent,
|
||||
disabledIndicatorColor = Color.Transparent,
|
||||
unfocusedIndicatorColor = Color.Transparent,
|
||||
errorIndicatorColor = Color.Red,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
fun testSearchBar(){
|
||||
SearchBar(modifier = Modifier){}
|
||||
}
|
@ -16,4 +16,5 @@ val GreenBtn = Color(0xFF009688)
|
||||
val TextPrimary = Color(0xFF212121)
|
||||
val TextSecondary = Color(0xFF757575)
|
||||
val White = Color(0xFFFFFFFF)
|
||||
val BlueNavbar = Color(0x6603A9F4)
|
||||
val BlueNavbar = Color(0xFF79D5FF)
|
||||
val BlueBorder = Color(0xFF79D5FF)
|
||||
|
@ -3,6 +3,7 @@ package com.example.myapplication.ui.theme
|
||||
import android.app.Activity
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.Typography
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
@ -13,6 +14,7 @@ import androidx.compose.runtime.SideEffect
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.core.view.WindowCompat
|
||||
|
||||
private val DarkColorScheme = darkColorScheme(
|
||||
|
@ -2,18 +2,19 @@ package com.example.myapplication.ui.theme
|
||||
|
||||
import androidx.compose.material3.Typography
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.Font
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.example.myapplication.R
|
||||
|
||||
// Set of Material typography styles to start with
|
||||
val Typography = Typography(
|
||||
bodyLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
bodyMedium = TextStyle(
|
||||
fontFamily = FontFamily(Font(R.font.roboto_serif_regular)),
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 24.sp,
|
||||
letterSpacing = 0.5.sp
|
||||
color = TextPrimary
|
||||
)
|
||||
/* Other default text styles to override
|
||||
titleLarge = TextStyle(
|
||||
|
9
app/src/main/res/drawable/icon_calendar.xml
Normal file
9
app/src/main/res/drawable/icon_calendar.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="42dp"
|
||||
android:height="44dp"
|
||||
android:viewportWidth="42"
|
||||
android:viewportHeight="44">
|
||||
<path
|
||||
android:pathData="M4.167,16.667H33.333V20.833H37.5V8.333C37.5,6.042 35.625,4.167 33.333,4.167H31.25V0H27.083V4.167H10.417V0H6.25V4.167H4.167C1.854,4.167 0.021,6.042 0.021,8.333L0,37.5C0,39.792 1.854,41.667 4.167,41.667H18.75V37.5H4.167V16.667ZM4.167,8.333H33.333V12.5H4.167V8.333ZM41.333,29.75L39.854,31.229L35.438,26.813L36.917,25.333C37.729,24.521 39.042,24.521 39.854,25.333L41.333,26.813C42.146,27.625 42.146,28.938 41.333,29.75ZM33.958,28.292L38.375,32.708L27.333,43.75H22.917V39.333L33.958,28.292Z"
|
||||
android:fillColor="#009688"/>
|
||||
</vector>
|
BIN
app/src/main/res/drawable/image_service.png
Normal file
BIN
app/src/main/res/drawable/image_service.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
9
app/src/main/res/drawable/upload.xml
Normal file
9
app/src/main/res/drawable/upload.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="69dp"
|
||||
android:height="83dp"
|
||||
android:viewportWidth="69"
|
||||
android:viewportHeight="83">
|
||||
<path
|
||||
android:pathData="M68.042,29.521H48.875V0.771H20.125V29.521H0.958L34.5,63.063L68.042,29.521ZM29.708,39.104V10.354H39.292V39.104H44.898L34.5,49.502L24.102,39.104H29.708ZM0.958,72.646H68.042V82.229H0.958V72.646Z"
|
||||
android:fillColor="#009688"/>
|
||||
</vector>
|
Loading…
Reference in New Issue
Block a user