first screen 1/2

This commit is contained in:
NikitaOnianov 2025-02-23 20:26:09 +03:00
parent 74206f0bbe
commit f9960a2fcf
16 changed files with 187 additions and 69 deletions

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetSelector">
<selectionStates>
<SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" />
</SelectionState>
</selectionStates>
</component>
</project>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings"> <component name="GradleSettings">
<option name="linkedExternalProjectsSettings"> <option name="linkedExternalProjectsSettings">
<GradleProjectSettings> <GradleProjectSettings>

View File

@ -5,7 +5,7 @@ plugins {
android { android {
namespace = "com.example.appwithwin" namespace = "com.example.appwithwin"
compileSdk = 34 compileSdk = 35
defaultConfig { defaultConfig {
applicationId = "com.example.appwithwin" applicationId = "com.example.appwithwin"

View File

@ -23,6 +23,9 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
</application> </application>
</manifest> </manifest>

View File

@ -1,47 +1,20 @@
package com.example.appwithwin package com.example.appwithwin
import android.os.Bundle import android.os.Bundle
import androidx.activity.ComponentActivity import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.fillMaxSize import com.example.appwithwin.ui.screen.signIn.SignInScreen
import androidx.compose.foundation.layout.padding import com.example.appwithwin.ui.theme.MatuleTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.example.appwithwin.ui.theme.AppWithWinTheme
class MainActivity : ComponentActivity() { class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
enableEdgeToEdge() enableEdgeToEdge()
setContent { setContent {
AppWithWinTheme { MatuleTheme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -> SignInScreen()
Greeting(
name = "Android",
modifier = Modifier.padding(innerPadding)
)
} }
} }
} }
} }
}
@Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {
Text(
text = "Hello $name!",
modifier = modifier
)
}
@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
AppWithWinTheme {
Greeting("Android")
}
}

View File

@ -0,0 +1,58 @@
package com.example.appwithwin.ui.screen.signIn
import androidx.annotation.StringRes
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.example.appwithwin.ui.theme.MatuleTheme
import org.w3c.dom.Text
@Composable
fun SignInScreen(){
SignInContent()
}
@Composable
fun SignInContent(){
Column{
TitleWithSubtitleText(
title = "Привет",
subTitle = "Заполните Свои данные или продолжите через социальные медиа"
)
}
}
@Preview
@Composable
fun TitleWithSubtitleText(title: String, subTitle: String){
Column (
modifier = Modifier.padding(horizontal = 20.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
){
Text(
text = title,
style = MatuleTheme.typography.headingBold32.copy(color = MatuleTheme.colors.text),
textAlign = TextAlign.Center
)
Text(
text = subTitle,
maxLines = 2,
style = MatuleTheme.typography.subTitleRegular16.copy(color = MatuleTheme.colors.subTextDark),
textAlign = TextAlign.Center
)
}
}

View File

@ -9,50 +9,97 @@ import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.material3.lightColorScheme import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
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.appwithwin.R
private val DarkColorScheme = darkColorScheme(
primary = Purple80, @Immutable
secondary = PurpleGrey80, data class MatuleColors(
tertiary = Pink80 val block: Color,
val text: Color,
val subTextDark: Color,
val background:Color,
val hint: Color,
val accent: Color
) )
private val LightColorScheme = lightColorScheme( @Immutable
primary = Purple40, data class MatuleTextStyle(
secondary = PurpleGrey40, val headingBold32: TextStyle,
tertiary = Pink40 val subTitleRegular16: TextStyle,
val bodyRegular16: TextStyle,
val bodyRegular14: TextStyle,
val bodyRegular12: TextStyle,
)
/* Other default colors to override val LocalMatuleTypography = staticCompositionLocalOf {
background = Color(0xFFFFFBFE), MatuleTextStyle(
surface = Color(0xFFFFFBFE), headingBold32 = TextStyle.Default,
onPrimary = Color.White, subTitleRegular16 = TextStyle.Default,
onSecondary = Color.White, bodyRegular12 = TextStyle.Default,
onTertiary = Color.White, bodyRegular16 = TextStyle.Default,
onBackground = Color(0xFF1C1B1F), bodyRegular14 = TextStyle.Default
onSurface = Color(0xFF1C1B1F), )
*/ }
val LocalMatuleColors = staticCompositionLocalOf {
MatuleColors(
block = Color.Unspecified,
text = Color.Unspecified,
subTextDark = Color.Unspecified,
background = Color.Unspecified,
hint = Color.Unspecified,
accent = Color.Unspecified
)
}
val matuleFontFamily = FontFamily(
Font(R.font.roboto_serif, FontWeight.Normal),
Font(R.font.roboto_serif_bold, FontWeight.Bold),
Font(R.font.roboto_serif_black, FontWeight.Black),
Font(R.font.roboto_serif_medium, FontWeight.Medium),
Font(R.font.roboto_serif_extrabold, FontWeight.ExtraBold),
Font(R.font.roboto_serif_semibold, FontWeight.SemiBold),
) )
@Composable @Composable
fun AppWithWinTheme( fun MatuleTheme( content: @Composable () -> Unit){
darkTheme: Boolean = isSystemInDarkTheme(), val matuleColors = MatuleColors(
// Dynamic color is available on Android 12+ block = Color(0xFFFFFFFF),
dynamicColor: Boolean = true, text = Color(0xFF2B2B2B),
content: @Composable () -> Unit subTextDark = Color(0xFF707B81),
) { background = Color(0xFFF7F7F9),
val colorScheme = when { hint = Color(0xFF6A6A6A),
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { accent = Color(0xFF48B2E7)
val context = LocalContext.current )
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) val matuleTypography = MatuleTextStyle(
} headingBold32 = TextStyle(fontFamily = matuleFontFamily, fontWeight = FontWeight.Bold, fontSize = 32.sp),
subTitleRegular16 = TextStyle(fontFamily = matuleFontFamily, fontWeight = FontWeight.Normal, fontSize = 16.sp),
darkTheme -> DarkColorScheme bodyRegular16 = TextStyle(fontFamily = matuleFontFamily, fontWeight = FontWeight.Normal, fontSize = 16.sp),
else -> LightColorScheme bodyRegular14 = TextStyle(fontFamily = matuleFontFamily, fontWeight = FontWeight.Normal, fontSize = 14.sp),
} bodyRegular12 = TextStyle(fontFamily = matuleFontFamily, fontWeight = FontWeight.Normal, fontSize = 12.sp),
)
MaterialTheme( CompositionLocalProvider(
colorScheme = colorScheme, LocalMatuleColors provides matuleColors,
typography = Typography, LocalMatuleTypography provides matuleTypography,
content = content content = content
) )
} }
object MatuleTheme{
val colors: MatuleColors
@Composable
get() = LocalMatuleColors.current
val typography
@Composable
get() = LocalMatuleTypography.current
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="com_google_android_gms_fonts_certs">
<item>@array/com_google_android_gms_fonts_certs_dev</item>
<item>@array/com_google_android_gms_fonts_certs_prod</item>
</array>
<string-array name="com_google_android_gms_fonts_certs_dev">
<item>
MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsS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h4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
</item>
</string-array>
</resources>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="preloaded_fonts" translatable="false">
<item>@font/roboto_mono_semibold</item>
<item>@font/roboto_serif_bold</item>
<item>@font/roboto_serif_extrabold</item>
<item>@font/roboto_serif_medium</item>
</array>
</resources>