diff --git a/android/README.md b/android/README.md new file mode 100644 index 0000000..e6504f2 --- /dev/null +++ b/android/README.md @@ -0,0 +1,13 @@ +# Android App (Phase 0) + +Минимальный каркас Android-клиента на Kotlin + Jetpack Compose. + +## Что уже есть +- Gradle multi-module root (`:app`) +- Compose `MainActivity` +- Базовые зависимости для дальнейшей реализации + +## Следующий шаг +1. Добавить network layer (Retrofit/OkHttp + auth interceptor). +2. Внедрить DI и feature-модули. +3. Поднять auth flow (email-first) и chat list. diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts new file mode 100644 index 0000000..1494463 --- /dev/null +++ b/android/app/build.gradle.kts @@ -0,0 +1,68 @@ +plugins { + id("com.android.application") + id("org.jetbrains.kotlin.android") +} + +android { + namespace = "ru.daemonlord.messenger" + compileSdk = 35 + + defaultConfig { + applicationId = "ru.daemonlord.messenger" + minSdk = 26 + targetSdk = 35 + versionCode = 1 + versionName = "0.1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables { + useSupportLibrary = true + } + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = "17" + } + + buildFeatures { + compose = true + } + + composeOptions { + kotlinCompilerExtensionVersion = "1.5.15" + } + + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } +} + +dependencies { + implementation("androidx.core:core-ktx:1.15.0") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7") + implementation("androidx.activity:activity-compose:1.10.1") + implementation("androidx.compose.ui:ui:1.7.6") + implementation("androidx.compose.ui:ui-tooling-preview:1.7.6") + implementation("androidx.compose.material3:material3:1.3.1") + implementation("androidx.navigation:navigation-compose:2.8.5") + + debugImplementation("androidx.compose.ui:ui-tooling:1.7.6") + debugImplementation("androidx.compose.ui:ui-test-manifest:1.7.6") +} diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro new file mode 100644 index 0000000..97e9466 --- /dev/null +++ b/android/app/proguard-rules.pro @@ -0,0 +1 @@ +# App-specific ProGuard rules. diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..2fbf62a --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + diff --git a/android/app/src/main/java/ru/daemonlord/messenger/MainActivity.kt b/android/app/src/main/java/ru/daemonlord/messenger/MainActivity.kt new file mode 100644 index 0000000..f9fd6ec --- /dev/null +++ b/android/app/src/main/java/ru/daemonlord/messenger/MainActivity.kt @@ -0,0 +1,43 @@ +package ru.daemonlord.messenger + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +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.Surface +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp + +class MainActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContent { + MaterialTheme { + Surface(modifier = Modifier.fillMaxSize()) { + AppRoot() + } + } + } + } +} + +@Composable +private fun AppRoot() { + Column( + modifier = Modifier + .fillMaxSize() + .padding(24.dp), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally + ) { + Text(text = "Benya Messenger Android", style = MaterialTheme.typography.headlineSmall) + Text(text = "Phase 0 skeleton is ready.", style = MaterialTheme.typography.bodyMedium) + } +} diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..5153ab7 --- /dev/null +++ b/android/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + Benya Messenger + diff --git a/android/build.gradle.kts b/android/build.gradle.kts new file mode 100644 index 0000000..d176100 --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,4 @@ +plugins { + id("com.android.application") version "8.7.2" apply false + id("org.jetbrains.kotlin.android") version "2.0.21" apply false +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..9650bbc --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +android.useAndroidX=true +android.enableJetifier=true +kotlin.code.style=official diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts new file mode 100644 index 0000000..c296dcc --- /dev/null +++ b/android/settings.gradle.kts @@ -0,0 +1,18 @@ +pluginManagement { + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "BenyaMessengerAndroid" +include(":app")