commit 0225f4487796448a1993f104142fd2f30b31f3c8 Author: Your Name Date: Wed Feb 5 12:51:17 2025 +0300 first diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..42610da --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +MatuleTest \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..b86273d --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml new file mode 100644 index 0000000..b268ef3 --- /dev/null +++ b/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..7b3006b --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..cde3e19 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,57 @@ + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000..6d0ee1c --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml new file mode 100644 index 0000000..f8051a6 --- /dev/null +++ b/.idea/migrations.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..b2c751a --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..16660f1 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..0b68c63 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,78 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.kotlin.compose) +} + +android { + namespace = "com.example.matuletest" + compileSdk = 35 + + defaultConfig { + applicationId = "com.example.matuletest" + minSdk = 30 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" + } + buildFeatures { + compose = true + } +} + +dependencies { + + implementation(libs.androidx.navigation.compose) + val voyagerVersion = "1.1.0-beta02" + implementation("cafe.adriel.voyager:voyager-navigator:$voyagerVersion") + implementation("cafe.adriel.voyager:voyager-screenmodel:$voyagerVersion") + + + testImplementation("junit:junit:4.13.2") + testImplementation ("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.0") + + + + implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1") + + + implementation(platform("io.github.jan-tennert.supabase:bom:3.0.3")) + implementation("io.github.jan-tennert.supabase:postgrest-kt") + implementation("io.ktor:ktor-client-android:3.0.3") + + + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.lifecycle.runtime.ktx) + implementation(libs.androidx.activity.compose) + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.ui) + implementation(libs.androidx.ui.graphics) + implementation(libs.androidx.ui.tooling.preview) + implementation(libs.androidx.material3) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) + androidTestImplementation(platform(libs.androidx.compose.bom)) + androidTestImplementation(libs.androidx.ui.test.junit4) + debugImplementation(libs.androidx.ui.tooling) + debugImplementation(libs.androidx.ui.test.manifest) +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/example/matuletest/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/example/matuletest/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..9958a92 --- /dev/null +++ b/app/src/androidTest/java/com/example/matuletest/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.example.matuletest + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.example.matuletest", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..00dceed --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/example/matuletest/MainActivity.kt b/app/src/main/java/com/example/matuletest/MainActivity.kt new file mode 100644 index 0000000..d16b515 --- /dev/null +++ b/app/src/main/java/com/example/matuletest/MainActivity.kt @@ -0,0 +1,68 @@ +package com.example.matuletest + +import android.os.Bundle +import android.window.SplashScreen +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Button +import androidx.compose.material3.Scaffold +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.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalUriHandler +import androidx.compose.ui.tooling.preview.Preview +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.composable +import androidx.navigation.compose.rememberNavController +import com.example.matuletest.ui.auth.AuthScreen +import com.example.matuletest.ui.auth.FirstScreen +//import com.example.matuletest.ui.auth.FirstScreen +import com.example.matuletest.ui.auth.SliderScreen +import com.example.matuletest.ui.theme.MatuleTestTheme + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContent { + MatuleTestTheme { +// var isSplashScreenVisible by remember { mutableStateOf(true) } +// +// if (isSplashScreenVisible) { +// FirstScreen (onNavigateToSliderScreen = { +// isSplashScreenVisible = false +// }) +// } else { +// AuthScreen() +// } +// } +// } + val navController = rememberNavController() + + NavHost(navController = navController, startDestination = "first_screen") { + composable("first_screen") { + FirstScreen(onNavigateToSliderScreen = { + navController.navigate("slider_screen") + }) + } + composable("slider_screen") { + SliderScreen(onNavigateToAuthScreen = { + navController.navigate("auth_screen") + }) + } + composable("auth_screen") { + AuthScreen() + } + } + } + } + } +} + diff --git a/app/src/main/java/com/example/matuletest/ViewModelBase.kt b/app/src/main/java/com/example/matuletest/ViewModelBase.kt new file mode 100644 index 0000000..d049ba7 --- /dev/null +++ b/app/src/main/java/com/example/matuletest/ViewModelBase.kt @@ -0,0 +1,25 @@ +package com.example.matuletest + +import cafe.adriel.voyager.core.model.ScreenModel +import cafe.adriel.voyager.core.model.screenModelScope +import kotlinx.coroutines.CloseableCoroutineDispatcher +import kotlinx.coroutines.CoroutineDispatcher +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.launch + +class ViewModelBase(private val coroutineDispatcher: CoroutineDispatcher):ScreenModel { + val errorMessage = MutableStateFlow(null) + + fun auth(email: String, password: String){ + if(!validateEmail(email)){ + screenModelScope.launch(coroutineDispatcher) { + errorMessage.emit("email error") + } + return + } + + } + + private fun validateEmail(email:String) = email.isNotEmpty() +} \ No newline at end of file diff --git a/app/src/main/java/com/example/matuletest/data/remotesource/SupaBaseClient.kt b/app/src/main/java/com/example/matuletest/data/remotesource/SupaBaseClient.kt new file mode 100644 index 0000000..93ec1e6 --- /dev/null +++ b/app/src/main/java/com/example/matuletest/data/remotesource/SupaBaseClient.kt @@ -0,0 +1,17 @@ +package com.example.matuletest.data.remotesource + +import io.github.jan.supabase.auth.Auth +import io.github.jan.supabase.createSupabaseClient +import io.github.jan.supabase.postgrest.Postgrest + +private const val SUPABASE_URL = "https://qpoqccusauhxpcdothgw.supabase.co" +private const val SUBPABASE_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InFwb3FjY3VzYXVoeHBjZG90aGd3Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Mzg2ODczNzksImV4cCI6MjA1NDI2MzM3OX0._jWWZ726CssGNBfyYul1OrewK4hbttF7onBcXXmlniI" +object SupaBaseClient { + val instance = createSupabaseClient( + supabaseUrl = SUPABASE_URL, + supabaseKey = SUBPABASE_KEY){ + install(Auth) + install(Postgrest) + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/example/matuletest/domain/AuthUseCase.kt b/app/src/main/java/com/example/matuletest/domain/AuthUseCase.kt new file mode 100644 index 0000000..3fae06a --- /dev/null +++ b/app/src/main/java/com/example/matuletest/domain/AuthUseCase.kt @@ -0,0 +1,27 @@ +package com.example.matuletest.domain + +import androidx.compose.ui.graphics.drawscope.Stroke +import com.example.matuletest.data.remotesource.SupaBaseClient +import io.github.jan.supabase.auth.SessionManager +import io.github.jan.supabase.auth.auth +import io.github.jan.supabase.auth.providers.builtin.Email +import io.github.jan.supabase.auth.status.SessionStatus +import kotlinx.coroutines.flow.collect +import kotlinx.coroutines.flow.collectLatest +import kotlinx.coroutines.flow.flow + +class AuthUseCase { + suspend fun auth(email: String, password: String)= flow{ + SupaBaseClient.instance.auth.signInWith(Email){ + this.email = email + this.password = password + } + SupaBaseClient.instance.auth.sessionStatus.collect{ status -> + when(status){ + is SessionStatus.Authenticated -> emit(true) + is SessionStatus.Initializing -> {} + else -> emit(false) + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/matuletest/ui/auth/AuthScreen.kt b/app/src/main/java/com/example/matuletest/ui/auth/AuthScreen.kt new file mode 100644 index 0000000..b9220d8 --- /dev/null +++ b/app/src/main/java/com/example/matuletest/ui/auth/AuthScreen.kt @@ -0,0 +1,56 @@ +package com.example.matuletest.ui.auth + +import android.annotation.SuppressLint +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +//import androidx.compose.foundation.text2.input.TextFieldCharSequence +import androidx.compose.material3.Button +import androidx.compose.material3.Text +import androidx.compose.material3.TextField +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.collectAsState +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.input.PasswordVisualTransformation +import androidx.compose.ui.window.Dialog +import androidx.lifecycle.viewmodel.compose.viewModel + +@Composable +fun AuthScreen(){ + val viewModel: AuthScreenViewModel = viewModel() + AuthContent(viewModel) +} + +@Composable +fun AuthContent(viewModel: AuthScreenViewModel){ + val authState = viewModel.authScreenState.collectAsState() + + if(authState.value.isSignIn){ + Text("Success Authorize") + } + Column( + modifier = Modifier.fillMaxSize(), + verticalArrangement = Arrangement.Center + ) { + Text(text = "Email") + TextField( + value = authState.value.email, + onValueChange = { + viewModel.setEmail(it) + }) + Text(text = "Password") + TextField( + value = authState.value.password, + onValueChange = { + viewModel.setPassword(it) + }, + visualTransformation = PasswordVisualTransformation() + ) + Button(onClick = { + viewModel.auth() + }) { + Text("Authorize") + } + } +} diff --git a/app/src/main/java/com/example/matuletest/ui/auth/AuthScreenState.kt b/app/src/main/java/com/example/matuletest/ui/auth/AuthScreenState.kt new file mode 100644 index 0000000..f7ea42e --- /dev/null +++ b/app/src/main/java/com/example/matuletest/ui/auth/AuthScreenState.kt @@ -0,0 +1,7 @@ +package com.example.matuletest.ui.auth + +data class AuthScreenState( + var email: String = "", + var password: String = "", + var isSignIn: Boolean = false +) diff --git a/app/src/main/java/com/example/matuletest/ui/auth/AuthScreenViewModel.kt b/app/src/main/java/com/example/matuletest/ui/auth/AuthScreenViewModel.kt new file mode 100644 index 0000000..7512a8d --- /dev/null +++ b/app/src/main/java/com/example/matuletest/ui/auth/AuthScreenViewModel.kt @@ -0,0 +1,38 @@ +package com.example.matuletest.ui.auth + +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import com.example.matuletest.domain.AuthUseCase +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.update +import kotlinx.coroutines.launch + +class AuthScreenViewModel: ViewModel() { + val authScreenState = MutableStateFlow(AuthScreenState()) + val useCase = AuthUseCase() + fun setPassword(password: String){ + viewModelScope.launch { + authScreenState.update { + it.copy(password = password) + } + } + } + fun setEmail(email: String){ + viewModelScope.launch { + authScreenState.update { + it.copy(email = email) + } + } + } + + fun auth(){ + viewModelScope.launch { + useCase.auth( + authScreenState.value.email, + authScreenState.value.password + ).collect{ result -> + if(result) authScreenState.update { it.copy(isSignIn = true) } + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/matuletest/ui/auth/BeforeAuthScreens.kt b/app/src/main/java/com/example/matuletest/ui/auth/BeforeAuthScreens.kt new file mode 100644 index 0000000..ba4aee9 --- /dev/null +++ b/app/src/main/java/com/example/matuletest/ui/auth/BeforeAuthScreens.kt @@ -0,0 +1,147 @@ +package com.example.matuletest.ui.auth + +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.Spacer +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.material3.Button +import androidx.compose.material3.Slider +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +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.graphics.Brush +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.font.FontStyle +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.LineHeightStyle +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.example.matuletest.R +import io.ktor.websocket.Frame +import java.lang.reflect.Modifier + +@Composable +fun FirstScreen(onNavigateToSliderScreen: () -> Unit) { + LaunchedEffect(Unit) { + kotlinx.coroutines.delay(6000) + onNavigateToSliderScreen() + } + Box( + modifier = androidx.compose.ui.Modifier + .fillMaxSize() + .background(Brush.horizontalGradient(listOf(Color(0xFF48B2E7), Color(0xFF0076B1)))), + ) { + Text( + text = "MATULEme", + fontSize = 32.sp, + color = Color.White, + modifier = androidx.compose.ui.Modifier.align(Alignment.Center) + ) + } +} + +@Composable +fun SliderScreen(onNavigateToAuthScreen: () -> Unit) { + var sliderValue by remember { mutableStateOf(0f) } + val textList = listOf("ДОБРО ПОЖАЛОВАТЬ", "Начнем путешествие", "У вас есть сила, чтобы") + val textList2 = listOf("", "Умная, великолепная и модная коллекция Изучите сейчас", "В вашей комнате много красивых и привлекательных растений") + val maxIndex = textList.size - 1 + + val currentIndex = sliderValue.toInt() + + val imageId = when (currentIndex) { + 0 -> R.drawable.kros1 + 1 -> R.drawable.kros2 + 2 -> R.drawable.kros3 + else -> return + } + + Column( + modifier = androidx.compose.ui.Modifier + .fillMaxSize() + .background(Brush.horizontalGradient(listOf(Color(0xFF48B2E7), Color(0xFF0076B1)))), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Image( + painter = painterResource(id = imageId), + contentDescription = "Изображение", + modifier = androidx.compose.ui.Modifier.width(670.dp).height(600.dp).padding(start = 20.dp) + ) + + Text( + color = Color.White, + fontStyle = FontStyle.Italic, + text = textList[currentIndex], + fontSize = 24.sp, + fontWeight = FontWeight.Bold, + textAlign = TextAlign.Center, + modifier = androidx.compose.ui.Modifier + .fillMaxWidth() + .padding(top = 40.dp) + .width(700.dp).height(30.dp) + ) + Text( + color = Color.White, + fontStyle = FontStyle.Italic, + text = textList2[currentIndex], + fontSize = 18.sp, + fontWeight = FontWeight.Bold, + textAlign = TextAlign.Center, + modifier = androidx.compose.ui.Modifier + .fillMaxWidth() + .padding(top = 40.dp) + ) + + Spacer(modifier = androidx.compose.ui.Modifier.weight(1f)) + + Slider( + value = sliderValue, + onValueChange = { newValue -> sliderValue = newValue }, + valueRange = 0f..maxIndex.toFloat(), + steps = maxIndex - 1, + colors = androidx.compose.material3.SliderDefaults.colors( + thumbColor = Color.White, // Цвет ползунка + activeTrackColor = Color(0xFF0076B1), // Цвет активной части слайдера + inactiveTrackColor = Color(0xFFB0B0B0) // Цвет неактивной части слайдера + ), + modifier = androidx.compose.ui.Modifier.fillMaxWidth() + ) + + Spacer(modifier = androidx.compose.ui.Modifier.height(20.dp)) + + Button( + onClick = { + if (sliderValue < maxIndex) { + sliderValue++ + } else { + onNavigateToAuthScreen() // Переход на экран авторизации + }}, +// enabled = sliderValue < maxIndex, + colors = androidx.compose.material3.ButtonDefaults.buttonColors( + containerColor = Color.White, + contentColor = Color.Black + ), + modifier = androidx.compose.ui.Modifier + .fillMaxWidth() + .padding(bottom = 40.dp) + ) { + Text(text = "Далее", color = Color.Black) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/example/matuletest/ui/theme/Color.kt b/app/src/main/java/com/example/matuletest/ui/theme/Color.kt new file mode 100644 index 0000000..b1eed24 --- /dev/null +++ b/app/src/main/java/com/example/matuletest/ui/theme/Color.kt @@ -0,0 +1,11 @@ +package com.example.matuletest.ui.theme + +import androidx.compose.ui.graphics.Color + +val Purple80 = Color(0xFFD0BCFF) +val PurpleGrey80 = Color(0xFFCCC2DC) +val Pink80 = Color(0xFFEFB8C8) + +val Purple40 = Color(0xFF6650a4) +val PurpleGrey40 = Color(0xFF625b71) +val Pink40 = Color(0xFF7D5260) \ No newline at end of file diff --git a/app/src/main/java/com/example/matuletest/ui/theme/Theme.kt b/app/src/main/java/com/example/matuletest/ui/theme/Theme.kt new file mode 100644 index 0000000..20c7a22 --- /dev/null +++ b/app/src/main/java/com/example/matuletest/ui/theme/Theme.kt @@ -0,0 +1,58 @@ +package com.example.matuletest.ui.theme + +import android.app.Activity +import android.os.Build +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.darkColorScheme +import androidx.compose.material3.dynamicDarkColorScheme +import androidx.compose.material3.dynamicLightColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.platform.LocalContext + +private val DarkColorScheme = darkColorScheme( + primary = Purple80, + secondary = PurpleGrey80, + tertiary = Pink80 +) + +private val LightColorScheme = lightColorScheme( + primary = Purple40, + secondary = PurpleGrey40, + tertiary = Pink40 + + /* Other default colors to override + background = Color(0xFFFFFBFE), + surface = Color(0xFFFFFBFE), + onPrimary = Color.White, + onSecondary = Color.White, + onTertiary = Color.White, + onBackground = Color(0xFF1C1B1F), + onSurface = Color(0xFF1C1B1F), + */ +) + +@Composable +fun MatuleTestTheme( + darkTheme: Boolean = isSystemInDarkTheme(), + // Dynamic color is available on Android 12+ + dynamicColor: Boolean = true, + content: @Composable () -> Unit +) { + val colorScheme = when { + dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { + val context = LocalContext.current + if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) + } + + darkTheme -> DarkColorScheme + else -> LightColorScheme + } + + MaterialTheme( + colorScheme = colorScheme, + typography = Typography, + content = content + ) +} \ No newline at end of file diff --git a/app/src/main/java/com/example/matuletest/ui/theme/Type.kt b/app/src/main/java/com/example/matuletest/ui/theme/Type.kt new file mode 100644 index 0000000..29656a6 --- /dev/null +++ b/app/src/main/java/com/example/matuletest/ui/theme/Type.kt @@ -0,0 +1,34 @@ +package com.example.matuletest.ui.theme + +import androidx.compose.material3.Typography +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp + +// Set of Material typography styles to start with +val Typography = Typography( + bodyLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 16.sp, + lineHeight = 24.sp, + letterSpacing = 0.5.sp + ) + /* Other default text styles to override + titleLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 22.sp, + lineHeight = 28.sp, + letterSpacing = 0.sp + ), + labelSmall = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 11.sp, + lineHeight = 16.sp, + letterSpacing = 0.5.sp + ) + */ +) \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/kros1.png b/app/src/main/res/drawable/kros1.png new file mode 100644 index 0000000..e748c16 Binary files /dev/null and b/app/src/main/res/drawable/kros1.png differ diff --git a/app/src/main/res/drawable/kros2.png b/app/src/main/res/drawable/kros2.png new file mode 100644 index 0000000..0f954f8 Binary files /dev/null and b/app/src/main/res/drawable/kros2.png differ diff --git a/app/src/main/res/drawable/kros3.png b/app/src/main/res/drawable/kros3.png new file mode 100644 index 0000000..e268b9a Binary files /dev/null and b/app/src/main/res/drawable/kros3.png differ diff --git a/app/src/main/res/mipmap-anydpi/ic_launcher.xml b/app/src/main/res/mipmap-anydpi/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c209e78 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..b2dfe3d Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..4f0f1d6 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..62b611d Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..948a307 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..1b9a695 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..28d4b77 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9287f50 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..aa7d642 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..9126ae3 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..492eeae --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + MatuleTest + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..bd8f4df --- /dev/null +++ b/app/src/main/res/values/themes.xml @@ -0,0 +1,5 @@ + + + +