-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
75 changed files
with
3,306 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
# Created by https://www.gitignore.io/api/android,intellij | ||
|
||
### Android ### | ||
# Built application files | ||
*.apk | ||
*.ap_ | ||
|
||
# Files for the ART/Dalvik VM | ||
*.dex | ||
|
||
# Java class files | ||
*.class | ||
|
||
# Generated files | ||
bin/ | ||
gen/ | ||
out/ | ||
tokenizer/karma.config.d/ | ||
|
||
# Gradle files | ||
.gradle/ | ||
build/ | ||
|
||
# dokka + ank apidocs merge to sources | ||
apidocs/ | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Proguard folder generated by Eclipse | ||
proguard/ | ||
|
||
# Log Files | ||
*.log | ||
|
||
# Android Studio Navigation editor temp files | ||
.navigation/ | ||
|
||
# Android Studio captures folder | ||
captures/ | ||
|
||
# Intellij | ||
*.iml | ||
.idea/* | ||
!.idea/vcs.xml | ||
|
||
# Keystore files | ||
*.jks | ||
|
||
# External native build folder generated in Android Studio 2.2 and later | ||
.externalNativeBuild | ||
|
||
# Google Services (e.g. APIs or Firebase) | ||
google-services.json | ||
|
||
# Freeline | ||
freeline.py | ||
freeline/ | ||
freeline_project_description.json | ||
|
||
### Android Patch ### | ||
gen-external-apklibs | ||
|
||
### Intellij ### | ||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm | ||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
|
||
# User-specific stuff: | ||
.idea/**/workspace.xml | ||
.idea/**/tasks.xml | ||
|
||
# Sensitive or high-churn files: | ||
.idea/**/dataSources/ | ||
.idea/**/dataSources.ids | ||
.idea/**/dataSources.xml | ||
.idea/**/dataSources.local.xml | ||
.idea/**/sqlDataSources.xml | ||
.idea/**/dynamic.xml | ||
.idea/**/uiDesigner.xml | ||
|
||
# Gradle: | ||
.idea/**/gradle.xml | ||
.idea/**/libraries | ||
|
||
#Kotlintest | ||
**/.kotlintest | ||
|
||
# Mongo Explorer plugin: | ||
.idea/**/mongoSettings.xml | ||
|
||
## File-based project format: | ||
*.iws | ||
|
||
## Plugin-specific files: | ||
|
||
# IntelliJ | ||
/out/ | ||
|
||
# mpeltonen/sbt-idea plugin | ||
.idea_modules/ | ||
|
||
# JIRA plugin | ||
atlassian-ide-plugin.xml | ||
|
||
# Crashlytics plugin (for Android Studio and IntelliJ) | ||
com_crashlytics_export_strings.xml | ||
crashlytics.properties | ||
crashlytics-build.properties | ||
fabric.properties | ||
|
||
# Jekyll | ||
_site | ||
.sass-cache | ||
vendor | ||
.bundle | ||
|
||
# Ruby | ||
Gemfile.lock | ||
|
||
### Intellij Patch ### | ||
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 | ||
|
||
# *.iml | ||
# modules.xml | ||
# .idea/misc.xml | ||
# *.ipr | ||
|
||
###################### | ||
|
||
reports/ | ||
|
||
# End of https://www.gitignore.io/api/android,intellij | ||
/.idea/misc.xml | ||
|
||
.DS_Store | ||
|
||
target/ | ||
|
||
.bash_profile | ||
**/.kotlintest/ | ||
|
||
|
||
_site/ | ||
kotlin-js-store/ | ||
.sass-cache/ | ||
.jekyll-cache/ | ||
.jekyll-metadata | ||
|
||
.env | ||
|
||
*.bin | ||
model.log | ||
operations.log |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Compose Multiplatform Application | ||
|
||
## Before running! | ||
- install JDK 17 or higher on your machine | ||
- add `local.properties` file to the project root and set a path to Android SDK there | ||
|
||
### Android | ||
To run the application on android device/emulator: | ||
- open project in Android Studio and run imported android run configuration | ||
|
||
To build the application bundle: | ||
- run `./gradlew :composeApp:assembleDebug` | ||
- find `.apk` file in `composeApp/build/outputs/apk/debug/composeApp-debug.apk` | ||
Run android simulator UI tests: `./gradlew :composeApp:pixel5Check` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
plugins { | ||
alias(libs.plugins.multiplatform).apply(false) | ||
alias(libs.plugins.compose.compiler).apply(false) | ||
alias(libs.plugins.compose).apply(false) | ||
alias(libs.plugins.android.application).apply(false) | ||
alias(libs.plugins.buildConfig).apply(false) | ||
alias(libs.plugins.kotlinx.serialization).apply(false) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
import org.jetbrains.compose.ExperimentalComposeLibrary | ||
import com.android.build.api.dsl.ManagedVirtualDevice | ||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree | ||
|
||
plugins { | ||
alias(libs.plugins.multiplatform) | ||
alias(libs.plugins.compose.compiler) | ||
alias(libs.plugins.compose) | ||
alias(libs.plugins.android.application) | ||
alias(libs.plugins.buildConfig) | ||
alias(libs.plugins.kotlinx.serialization) | ||
} | ||
|
||
kotlin { | ||
androidTarget { | ||
compilations.all { | ||
compileTaskProvider { | ||
compilerOptions { | ||
jvmTarget.set(JvmTarget.JVM_1_8) | ||
freeCompilerArgs.add("-Xjdk-release=${JavaVersion.VERSION_1_8}") | ||
} | ||
} | ||
} | ||
@OptIn(ExperimentalKotlinGradlePluginApi::class) | ||
instrumentedTestVariant { | ||
sourceSetTree.set(KotlinSourceSetTree.test) | ||
dependencies { | ||
debugImplementation(libs.androidx.testManifest) | ||
implementation(libs.androidx.junit4) | ||
} | ||
} | ||
} | ||
|
||
sourceSets { | ||
all { | ||
languageSettings { | ||
optIn("org.jetbrains.compose.resources.ExperimentalResourceApi") | ||
} | ||
} | ||
val commonMain by getting { | ||
dependencies { | ||
implementation(compose.runtime) | ||
implementation(compose.foundation) | ||
implementation(compose.material3) | ||
implementation(compose.components.resources) | ||
implementation(compose.components.uiToolingPreview) | ||
implementation(libs.voyager.navigator) | ||
implementation(libs.composeImageLoader) | ||
implementation(libs.napier) | ||
implementation(libs.kotlinx.coroutines.core) | ||
implementation(libs.ktor.core) | ||
implementation(libs.kotlinx.serialization.json) | ||
implementation(libs.multiplatformSettings) | ||
implementation(libs.ktor.client.json) | ||
implementation("io.ktor:ktor-client-content-negotiation:2.3.11") | ||
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.11") | ||
implementation("androidx.navigation:navigation-compose:2.7.7") | ||
implementation("com.squareup.retrofit2:retrofit:2.11.0") | ||
implementation("com.squareup.retrofit2:converter-gson:2.11.0") | ||
implementation("io.ktor:ktor-client-serialization-jvm:2.3.11") | ||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.6.3") | ||
implementation("com.google.accompanist:accompanist-permissions:0.34.0") | ||
} | ||
} | ||
|
||
val commonTest by getting { | ||
dependencies { | ||
implementation(kotlin("test")) | ||
@OptIn(ExperimentalComposeLibrary::class) | ||
implementation(compose.uiTest) | ||
implementation(libs.kotlinx.coroutines.test) | ||
} | ||
} | ||
|
||
val androidMain by getting { | ||
dependencies { | ||
implementation(compose.uiTooling) | ||
implementation(libs.androidx.activityCompose) | ||
implementation(libs.kotlinx.coroutines.android) | ||
implementation(libs.ktor.client.okhttp) | ||
implementation("io.ktor:ktor-client-android:2.3.11") | ||
implementation(libs.ktor.client.json) | ||
implementation("io.ktor:ktor-client-content-negotiation:2.3.11") | ||
implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.11") | ||
implementation("androidx.navigation:navigation-compose:2.7.7") | ||
implementation("androidx.datastore:datastore-preferences:1.1.1") | ||
implementation("androidx.compose.runtime:runtime-livedata:1.6.7") | ||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.6.3") | ||
implementation("io.ktor:ktor-client-serialization-jvm:2.3.11") | ||
implementation("com.google.accompanist:accompanist-permissions:0.34.0") | ||
} | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "org.xef.xefMobile" | ||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
minSdk = 24 | ||
targetSdk = 34 | ||
applicationId = "org.xef.xefMobile.androidApp" | ||
versionCode = 1 | ||
versionName = "1.0.0" | ||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
sourceSets["main"].apply { | ||
manifest.srcFile("src/androidMain/AndroidManifest.xml") | ||
res.srcDirs("src/androidMain/res") | ||
} | ||
|
||
@Suppress("UnstableApiUsage") | ||
testOptions { | ||
managedDevices.devices { | ||
maybeCreate<ManagedVirtualDevice>("pixel5").apply { | ||
device = "Pixel 5" | ||
apiLevel = 34 | ||
systemImageSource = "aosp" | ||
} | ||
} | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
|
||
buildFeatures { | ||
compose = true | ||
} | ||
|
||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.5.11" | ||
} | ||
} | ||
|
||
buildConfig { | ||
// BuildConfig configuration here. | ||
} |
22 changes: 22 additions & 0 deletions
22
server/xefMobile/composeApp/src/androidMain/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<application | ||
android:icon="@drawable/xef_brand_icon" | ||
android:label="xefMobile" | ||
android:theme="@android:style/Theme.Material.NoActionBar" | ||
android:usesCleartextTraffic="true" | ||
android:networkSecurityConfig="@xml/network_security_config"> | ||
<activity | ||
android:name="com.xef.xefMobile.MainActivity" | ||
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden" | ||
android:launchMode="singleInstance" | ||
android:windowSoftInputMode="adjustPan" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
</manifest> |
20 changes: 20 additions & 0 deletions
20
server/xefMobile/composeApp/src/androidMain/kotlin/com/xef/xefMobile/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.xef.xefMobile | ||
|
||
import android.os.Bundle | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import com.server.movile.xef.android.ui.viewmodels.AuthViewModel | ||
import com.xef.xefMobile.services.ApiService | ||
|
||
class MainActivity : ComponentActivity() { | ||
private lateinit var authViewModel: AuthViewModel | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
authViewModel = AuthViewModel(this, ApiService()) | ||
|
||
setContent { | ||
XefAndroidApp(authViewModel = authViewModel) | ||
} | ||
} | ||
} |
Oops, something went wrong.