feat: add Application, MainActivity and Material3 theme
This commit is contained in:
19
app/src/main/java/com/radiola/MainActivity.kt
Normal file
19
app/src/main/java/com/radiola/MainActivity.kt
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.radiola
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import com.radiola.ui.theme.RadiolaTheme
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
setContent {
|
||||
RadiolaTheme {
|
||||
// TODO: Navigation will go here
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
7
app/src/main/java/com/radiola/RadiolaApplication.kt
Normal file
7
app/src/main/java/com/radiola/RadiolaApplication.kt
Normal file
@@ -0,0 +1,7 @@
|
||||
package com.radiola
|
||||
|
||||
import android.app.Application
|
||||
import dagger.hilt.android.HiltAndroidApp
|
||||
|
||||
@HiltAndroidApp
|
||||
class RadiolaApplication : Application()
|
||||
13
app/src/main/java/com/radiola/ui/theme/Color.kt
Normal file
13
app/src/main/java/com/radiola/ui/theme/Color.kt
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.radiola.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
val Primary = Color(0xFF6200EE)
|
||||
val PrimaryDark = Color(0xFF3700B3)
|
||||
val Secondary = Color(0xFF03DAC6)
|
||||
val Background = Color(0xFF121212)
|
||||
val Surface = Color(0xFF1E1E1E)
|
||||
val OnPrimary = Color.White
|
||||
val OnSecondary = Color.Black
|
||||
val OnBackground = Color.White
|
||||
val OnSurface = Color.White
|
||||
38
app/src/main/java/com/radiola/ui/theme/Theme.kt
Normal file
38
app/src/main/java/com/radiola/ui/theme/Theme.kt
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.radiola.ui.theme
|
||||
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
|
||||
private val DarkColorScheme = darkColorScheme(
|
||||
primary = Primary,
|
||||
secondary = Secondary,
|
||||
background = Background,
|
||||
surface = Surface,
|
||||
onPrimary = OnPrimary,
|
||||
onSecondary = OnSecondary,
|
||||
onBackground = OnBackground,
|
||||
onSurface = OnSurface
|
||||
)
|
||||
|
||||
private val LightColorScheme = lightColorScheme(
|
||||
primary = Primary,
|
||||
secondary = Secondary,
|
||||
onPrimary = OnPrimary,
|
||||
onSecondary = OnSecondary
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun RadiolaTheme(
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
val colorScheme = if (darkTheme) DarkColorScheme else LightColorScheme
|
||||
MaterialTheme(
|
||||
colorScheme = colorScheme,
|
||||
typography = Typography,
|
||||
content = content
|
||||
)
|
||||
}
|
||||
35
app/src/main/java/com/radiola/ui/theme/Type.kt
Normal file
35
app/src/main/java/com/radiola/ui/theme/Type.kt
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.radiola.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
|
||||
|
||||
val Typography = Typography(
|
||||
headlineLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontSize = 28.sp
|
||||
),
|
||||
headlineMedium = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.SemiBold,
|
||||
fontSize = 22.sp
|
||||
),
|
||||
titleMedium = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 16.sp
|
||||
),
|
||||
bodyMedium = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 14.sp
|
||||
),
|
||||
labelMedium = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Medium,
|
||||
fontSize = 12.sp
|
||||
)
|
||||
)
|
||||
Reference in New Issue
Block a user