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
|
||||||
|
)
|
||||||
|
)
|
||||||
8
app/src/main/res/values/colors.xml
Normal file
8
app/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<resources>
|
||||||
|
<color name="purple_200">#FFBB86FC</color>
|
||||||
|
<color name="purple_500">#FF6200EE</color>
|
||||||
|
<color name="purple_700">#FF3700B3</color>
|
||||||
|
<color name="teal_200">#FF03DAC5</color>
|
||||||
|
<color name="black">#FF000000</color>
|
||||||
|
<color name="white">#FFFFFFFF</color>
|
||||||
|
</resources>
|
||||||
10
app/src/main/res/values/strings.xml
Normal file
10
app/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="app_name">radiOLA</string>
|
||||||
|
<string name="tab_radio">Радио</string>
|
||||||
|
<string name="tab_favorites">Избранное</string>
|
||||||
|
<string name="tab_history">История</string>
|
||||||
|
<string name="tab_settings">Настройки</string>
|
||||||
|
<string name="offline_message">Offline mode</string>
|
||||||
|
<string name="player_play">Play</string>
|
||||||
|
<string name="player_pause">Pause</string>
|
||||||
|
</resources>
|
||||||
3
app/src/main/res/values/themes.xml
Normal file
3
app/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<resources>
|
||||||
|
<style name="Theme.Radiola" parent="android:Theme.Material.Light.NoActionBar" />
|
||||||
|
</resources>
|
||||||
5
app/src/main/res/xml/backup_rules.xml
Normal file
5
app/src/main/res/xml/backup_rules.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<full-backup-content>
|
||||||
|
<exclude domain="sharedpref" path="."/>
|
||||||
|
<exclude domain="database" path="."/>
|
||||||
|
</full-backup-content>
|
||||||
7
app/src/main/res/xml/data_extraction_rules.xml
Normal file
7
app/src/main/res/xml/data_extraction_rules.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<data-extraction-rules>
|
||||||
|
<cloud-backup>
|
||||||
|
<exclude domain="sharedpref" path="."/>
|
||||||
|
<exclude domain="database" path="."/>
|
||||||
|
</cloud-backup>
|
||||||
|
</data-extraction-rules>
|
||||||
Reference in New Issue
Block a user