first screen 1/2
This commit is contained in:
parent
74206f0bbe
commit
f9960a2fcf
10
.idea/deploymentTargetSelector.xml
Normal file
10
.idea/deploymentTargetSelector.xml
Normal 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>
|
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
|
@ -5,7 +5,7 @@ plugins {
|
||||
|
||||
android {
|
||||
namespace = "com.example.appwithwin"
|
||||
compileSdk = 34
|
||||
compileSdk = 35
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.appwithwin"
|
||||
|
@ -23,6 +23,9 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<meta-data
|
||||
android:name="preloaded_fonts"
|
||||
android:resource="@array/preloaded_fonts" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -1,47 +1,20 @@
|
||||
package com.example.appwithwin
|
||||
|
||||
import android.os.Bundle
|
||||
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.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
|
||||
import com.example.appwithwin.ui.screen.signIn.SignInScreen
|
||||
import com.example.appwithwin.ui.theme.MatuleTheme
|
||||
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
setContent {
|
||||
AppWithWinTheme {
|
||||
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
||||
Greeting(
|
||||
name = "Android",
|
||||
modifier = Modifier.padding(innerPadding)
|
||||
)
|
||||
}
|
||||
MatuleTheme {
|
||||
SignInScreen()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun Greeting(name: String, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
text = "Hello $name!",
|
||||
modifier = modifier
|
||||
)
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
fun GreetingPreview() {
|
||||
AppWithWinTheme {
|
||||
Greeting("Android")
|
||||
}
|
||||
}
|
@ -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
|
||||
)
|
||||
}
|
||||
}
|
@ -9,50 +9,97 @@ import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
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.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,
|
||||
secondary = PurpleGrey80,
|
||||
tertiary = Pink80
|
||||
|
||||
@Immutable
|
||||
data class MatuleColors(
|
||||
val block: Color,
|
||||
val text: Color,
|
||||
val subTextDark: Color,
|
||||
val background:Color,
|
||||
val hint: Color,
|
||||
val accent: Color
|
||||
)
|
||||
|
||||
private val LightColorScheme = lightColorScheme(
|
||||
primary = Purple40,
|
||||
secondary = PurpleGrey40,
|
||||
tertiary = Pink40
|
||||
@Immutable
|
||||
data class MatuleTextStyle(
|
||||
val headingBold32: TextStyle,
|
||||
val subTitleRegular16: TextStyle,
|
||||
val bodyRegular16: TextStyle,
|
||||
val bodyRegular14: TextStyle,
|
||||
val bodyRegular12: TextStyle,
|
||||
)
|
||||
|
||||
/* 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),
|
||||
*/
|
||||
val LocalMatuleTypography = staticCompositionLocalOf {
|
||||
MatuleTextStyle(
|
||||
headingBold32 = TextStyle.Default,
|
||||
subTitleRegular16 = TextStyle.Default,
|
||||
bodyRegular12 = TextStyle.Default,
|
||||
bodyRegular16 = TextStyle.Default,
|
||||
bodyRegular14 = TextStyle.Default
|
||||
)
|
||||
}
|
||||
|
||||
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
|
||||
fun AppWithWinTheme(
|
||||
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,
|
||||
fun MatuleTheme( content: @Composable () -> Unit){
|
||||
val matuleColors = MatuleColors(
|
||||
block = Color(0xFFFFFFFF),
|
||||
text = Color(0xFF2B2B2B),
|
||||
subTextDark = Color(0xFF707B81),
|
||||
background = Color(0xFFF7F7F9),
|
||||
hint = Color(0xFF6A6A6A),
|
||||
accent = Color(0xFF48B2E7)
|
||||
)
|
||||
val matuleTypography = MatuleTextStyle(
|
||||
headingBold32 = TextStyle(fontFamily = matuleFontFamily, fontWeight = FontWeight.Bold, fontSize = 32.sp),
|
||||
subTitleRegular16 = TextStyle(fontFamily = matuleFontFamily, fontWeight = FontWeight.Normal, fontSize = 16.sp),
|
||||
bodyRegular16 = TextStyle(fontFamily = matuleFontFamily, fontWeight = FontWeight.Normal, fontSize = 16.sp),
|
||||
bodyRegular14 = TextStyle(fontFamily = matuleFontFamily, fontWeight = FontWeight.Normal, fontSize = 14.sp),
|
||||
bodyRegular12 = TextStyle(fontFamily = matuleFontFamily, fontWeight = FontWeight.Normal, fontSize = 12.sp),
|
||||
)
|
||||
CompositionLocalProvider(
|
||||
LocalMatuleColors provides matuleColors,
|
||||
LocalMatuleTypography provides matuleTypography,
|
||||
content = content
|
||||
)
|
||||
}
|
||||
|
||||
object MatuleTheme{
|
||||
val colors: MatuleColors
|
||||
@Composable
|
||||
get() = LocalMatuleColors.current
|
||||
val typography
|
||||
@Composable
|
||||
get() = LocalMatuleTypography.current
|
||||
}
|
BIN
app/src/main/res/font/roboto_mono_semibold.ttf
Normal file
BIN
app/src/main/res/font/roboto_mono_semibold.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/roboto_serif.ttf
Normal file
BIN
app/src/main/res/font/roboto_serif.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/roboto_serif_black.ttf
Normal file
BIN
app/src/main/res/font/roboto_serif_black.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/roboto_serif_bold.ttf
Normal file
BIN
app/src/main/res/font/roboto_serif_bold.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/roboto_serif_extrabold.ttf
Normal file
BIN
app/src/main/res/font/roboto_serif_extrabold.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/roboto_serif_medium.ttf
Normal file
BIN
app/src/main/res/font/roboto_serif_medium.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/roboto_serif_semibold.ttf
Normal file
BIN
app/src/main/res/font/roboto_serif_semibold.ttf
Normal file
Binary file not shown.
17
app/src/main/res/values/font_certs.xml
Normal file
17
app/src/main/res/values/font_certs.xml
Normal 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>
|
||||
MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4G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dIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
|
||||
</item>
|
||||
</string-array>
|
||||
<string-array name="com_google_android_gms_fonts_certs_prod">
|
||||
<item>
|
||||
MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
|
||||
</item>
|
||||
</string-array>
|
||||
</resources>
|
9
app/src/main/res/values/preloaded_fonts.xml
Normal file
9
app/src/main/res/values/preloaded_fonts.xml
Normal 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>
|
Loading…
Reference in New Issue
Block a user