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:
24
app/src/main/AndroidManifest.xml
Normal file
24
app/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<application
|
||||
android:name=".CalendarrApplication"
|
||||
android:allowBackup="true"
|
||||
android:label="@string/app_name"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:theme="@style/Theme.Calendarr"
|
||||
android:supportsRtl="true">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.Calendarr">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -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,
|
||||
)
|
||||
}
|
||||
27
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
27
app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M34,30h40a6,6 0 0 1 6,6v40a6,6 0 0 1 -6,6H34a6,6 0 0 1 -6,-6V36a6,6 0 0 1 6,-6z" />
|
||||
<path
|
||||
android:fillColor="#4285F4"
|
||||
android:pathData="M34,30h40a6,6 0 0 1 6,6v8H28v-8a6,6 0 0 1 6,-6z" />
|
||||
<path
|
||||
android:fillColor="#4285F4"
|
||||
android:pathData="M40,24h4v12h-4z M64,24h4v12h-4z" />
|
||||
<path
|
||||
android:fillColor="#EA4335"
|
||||
android:pathData="M38,52h8v8h-8z" />
|
||||
<path
|
||||
android:fillColor="#34A853"
|
||||
android:pathData="M50,52h8v8h-8z" />
|
||||
<path
|
||||
android:fillColor="#FBBC05"
|
||||
android:pathData="M62,52h8v8h-8z" />
|
||||
<path
|
||||
android:fillColor="#7090C0"
|
||||
android:pathData="M38,64h8v8h-8z M50,64h8v8h-8z" />
|
||||
</vector>
|
||||
4
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
4
app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
4
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
4
app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/ic_launcher_background" />
|
||||
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||
</adaptive-icon>
|
||||
3
app/src/main/res/values/ic_launcher_colors.xml
Normal file
3
app/src/main/res/values/ic_launcher_colors.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#0B1220</color>
|
||||
</resources>
|
||||
3
app/src/main/res/values/strings.xml
Normal file
3
app/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">Calendarr</string>
|
||||
</resources>
|
||||
5
app/src/main/res/values/themes.xml
Normal file
5
app/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<resources>
|
||||
<style name="Theme.Calendarr" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<item name="android:windowBackground">?android:colorBackground</item>
|
||||
</style>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user