chore(scaffold): M0 Gradle + Compose + Hilt skeleton with CI
Some checks failed
PR Checks / android-build (pull_request) Failing after 5m13s
Some checks failed
PR Checks / android-build (pull_request) Failing after 5m13s
Stand up the Android-app repo per docs/android/PLAN.md M0: a buildable Kotlin + Jetpack Compose (Material 3) single-activity skeleton wired for Hilt, ready for the M1-M4 functional pass. - Gradle 8.7 wrapper; AGP 8.6.1 / Kotlin 2.0.20, JDK 17, minSdk 29, target 35. - Version catalog (gradle/libs.versions.toml) pins the full planned stack (Compose, Hilt, Retrofit/OkHttp + kotlinx.serialization, DataStore, security-crypto, Coil, Navigation) so later milestones reference by alias. - RunicGatewayApp (@HiltAndroidApp) + MainActivity (Compose) + ui/theme/*. - Strings externalized from day one; adaptive launcher icon; backup rules exclude the token store / DataStore (no session material off-device). - CI: .gitea/workflows/pr-checks.yml gates PRs with lint + test + assembleDebug (JDK 17 + Android SDK on the self-hosted runner; debug builds auto-signed, no secrets). Placeholder JVM unit test so the test gate runs. - .gitattributes forces LF on gradlew so the wrapper runs on the Linux runner. Verified locally: `gradle help`/`projects` configure the :app module and resolve all six plugins cleanly (full assemble needs the Android SDK, done in CI). app id: com.runicgateway.app (PLAN.md §13, pending runicgateway.app domain). Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
64
app/src/main/java/com/runicgateway/app/MainActivity.kt
Normal file
64
app/src/main/java/com/runicgateway/app/MainActivity.kt
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
package com.runicgateway.app
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
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.tooling.preview.Preview
|
||||
import com.runicgateway.app.ui.theme.RunicGatewayTheme
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
|
||||
/**
|
||||
* Single-activity host. Navigation-Compose and the first-run base-URL flow (§3)
|
||||
* land in M1; this M0 skeleton only proves the Compose + Hilt + theme wiring.
|
||||
*/
|
||||
@AndroidEntryPoint
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
setContent {
|
||||
RunicGatewayTheme {
|
||||
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
||||
Placeholder(modifier = Modifier.padding(innerPadding))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Placeholder(modifier: Modifier = Modifier) {
|
||||
Column(
|
||||
modifier = modifier.fillMaxSize(),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center,
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.app_scaffold_ready),
|
||||
style = MaterialTheme.typography.titleLarge,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Preview(showBackground = true)
|
||||
@Composable
|
||||
private fun PlaceholderPreview() {
|
||||
RunicGatewayTheme {
|
||||
Placeholder()
|
||||
}
|
||||
}
|
||||
15
app/src/main/java/com/runicgateway/app/RunicGatewayApp.kt
Normal file
15
app/src/main/java/com/runicgateway/app/RunicGatewayApp.kt
Normal file
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* Runic Gateway — native Android client of a shard's website API.
|
||||
*/
|
||||
package com.runicgateway.app
|
||||
|
||||
import android.app.Application
|
||||
import dagger.hilt.android.HiltAndroidApp
|
||||
|
||||
/**
|
||||
* Application entry point. Annotated for Hilt so the DI graph is available
|
||||
* to activities, view models, and (from M1) repositories / API services.
|
||||
*/
|
||||
@HiltAndroidApp
|
||||
class RunicGatewayApp : Application()
|
||||
16
app/src/main/java/com/runicgateway/app/ui/theme/Color.kt
Normal file
16
app/src/main/java/com/runicgateway/app/ui/theme/Color.kt
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
package com.runicgateway.app.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
// Placeholder palette for the M0 skeleton. The M5 design pass replaces this and
|
||||
// derives Material 3 colors from each shard's per-install branding (PLAN.md §3, §5).
|
||||
val Purple80 = Color(0xFFD0BCFF)
|
||||
val PurpleGrey80 = Color(0xFFCCC2DC)
|
||||
val Pink80 = Color(0xFFEFB8C8)
|
||||
|
||||
val Purple40 = Color(0xFF6650A4)
|
||||
val PurpleGrey40 = Color(0xFF625B71)
|
||||
val Pink40 = Color(0xFF7D5260)
|
||||
53
app/src/main/java/com/runicgateway/app/ui/theme/Theme.kt
Normal file
53
app/src/main/java/com/runicgateway/app/ui/theme/Theme.kt
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
package com.runicgateway.app.ui.theme
|
||||
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
|
||||
private val DarkColorScheme = darkColorScheme(
|
||||
primary = Purple80,
|
||||
secondary = PurpleGrey80,
|
||||
tertiary = Pink80,
|
||||
)
|
||||
|
||||
private val LightColorScheme = lightColorScheme(
|
||||
primary = Purple40,
|
||||
secondary = PurpleGrey40,
|
||||
tertiary = Pink40,
|
||||
)
|
||||
|
||||
/**
|
||||
* App theme for the M0 skeleton. Dynamic color (Android 12+) is used when
|
||||
* available; otherwise a static placeholder scheme. The M5 design pass wires
|
||||
* the color scheme to per-shard branding (PLAN.md §3, §5).
|
||||
*/
|
||||
@Composable
|
||||
fun RunicGatewayTheme(
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
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,
|
||||
content = content,
|
||||
)
|
||||
}
|
||||
21
app/src/main/java/com/runicgateway/app/ui/theme/Type.kt
Normal file
21
app/src/main/java/com/runicgateway/app/ui/theme/Type.kt
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
package com.runicgateway.app.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
|
||||
|
||||
// Default Material 3 type scale for the skeleton; refined in the M5 design pass.
|
||||
val Typography = Typography(
|
||||
bodyLarge = TextStyle(
|
||||
fontFamily = FontFamily.Default,
|
||||
fontWeight = FontWeight.Normal,
|
||||
fontSize = 16.sp,
|
||||
lineHeight = 24.sp,
|
||||
letterSpacing = 0.5.sp,
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user