chore: get Android project building (toolchain, deps, manifest, launcher icon)
- Fix dependency versions (Retrofit 2.11, OkHttp 4.12, Compose BOM) - Add Material Components for the app theme - Add --add-exports/--add-opens for kapt on JDK 21 - Remove deprecated manifest package attr; add INTERNET permission - Add adaptive launcher icon Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package com.scarriffle.calendarr
|
||||
|
||||
import android.app.Application
|
||||
import dagger.hilt.android.HiltAndroidApp
|
||||
|
||||
@HiltAndroidApp
|
||||
class CalendarrApplication : Application()
|
||||
30
app/src/main/java/com/scarriffle/calendarr/MainActivity.kt
Normal file
30
app/src/main/java/com/scarriffle/calendarr/MainActivity.kt
Normal file
@@ -0,0 +1,30 @@
|
||||
package com.scarriffle.calendarr
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import com.scarriffle.calendarr.ui.theme.CalendarrTheme
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
@AndroidEntryPoint
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContent {
|
||||
CalendarrTheme {
|
||||
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) {
|
||||
Box(contentAlignment = Alignment.Center, modifier = Modifier.fillMaxSize()) {
|
||||
Text(text = "Calendarr Android", style = MaterialTheme.typography.headlineMedium)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
app/src/main/java/com/scarriffle/calendarr/ui/theme/Color.kt
Normal file
13
app/src/main/java/com/scarriffle/calendarr/ui/theme/Color.kt
Normal file
@@ -0,0 +1,13 @@
|
||||
package com.scarriffle.calendarr.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
val md_theme_light_primary = Color(0xFF4285F4)
|
||||
val md_theme_light_onPrimary = Color(0xFFFFFFFF)
|
||||
val md_theme_light_background = Color(0xFFFFFFFF)
|
||||
val md_theme_light_onBackground = Color(0xFF000000)
|
||||
|
||||
val md_theme_dark_primary = Color(0xFF8AB4F8)
|
||||
val md_theme_dark_onPrimary = Color(0xFF000000)
|
||||
val md_theme_dark_background = Color(0xFF000000)
|
||||
val md_theme_dark_onBackground = Color(0xFFFFFFFF)
|
||||
35
app/src/main/java/com/scarriffle/calendarr/ui/theme/Theme.kt
Normal file
35
app/src/main/java/com/scarriffle/calendarr/ui/theme/Theme.kt
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.scarriffle.calendarr.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 LightColors = lightColorScheme(
|
||||
primary = md_theme_light_primary,
|
||||
onPrimary = md_theme_light_onPrimary,
|
||||
background = md_theme_light_background,
|
||||
onBackground = md_theme_light_onBackground,
|
||||
)
|
||||
|
||||
private val DarkColors = darkColorScheme(
|
||||
primary = md_theme_dark_primary,
|
||||
onPrimary = md_theme_dark_onPrimary,
|
||||
background = md_theme_dark_background,
|
||||
onBackground = md_theme_dark_onBackground,
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun CalendarrTheme(
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
val colors = if (darkTheme) DarkColors else LightColors
|
||||
|
||||
MaterialTheme(
|
||||
colorScheme = colors,
|
||||
typography = androidx.compose.material3.Typography(),
|
||||
content = content,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user