Skip to content

Commit e5a7234

Browse files
committed
Initial commit
0 parents  commit e5a7234

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1234
-0
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/deploymentTargetDropDown.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlinc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/migrations.xml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle.kts

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
2+
plugins {
3+
alias(libs.plugins.androidApplication)
4+
alias(libs.plugins.kotlinAndroid)
5+
alias(libs.plugins.devtoolsKsp)
6+
alias(libs.plugins.protobuf)
7+
}
8+
9+
android {
10+
namespace = "com.nekodev.hackathonapp"
11+
compileSdk = 34
12+
13+
defaultConfig {
14+
applicationId = "com.nekodev.hackathonapp"
15+
minSdk = 27
16+
targetSdk = 34
17+
versionCode = 1
18+
versionName = "1.0"
19+
20+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
21+
vectorDrawables {
22+
useSupportLibrary = true
23+
}
24+
}
25+
26+
buildTypes {
27+
release {
28+
isMinifyEnabled = false
29+
proguardFiles(
30+
getDefaultProguardFile("proguard-android-optimize.txt"),
31+
"proguard-rules.pro"
32+
)
33+
}
34+
}
35+
compileOptions {
36+
sourceCompatibility = JavaVersion.VERSION_1_8
37+
targetCompatibility = JavaVersion.VERSION_1_8
38+
}
39+
kotlinOptions {
40+
jvmTarget = "1.8"
41+
}
42+
buildFeatures {
43+
compose = true
44+
}
45+
composeOptions {
46+
kotlinCompilerExtensionVersion = "1.5.1"
47+
}
48+
packaging {
49+
resources {
50+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
51+
}
52+
}
53+
}
54+
55+
// Setup protobuf configuration, generating lite Java and Kotlin classes
56+
protobuf {
57+
protoc {
58+
artifact = libs.protobuf.protoc.get().toString()
59+
}
60+
generateProtoTasks {
61+
all().forEach { task ->
62+
task.builtins {
63+
val java by registering {
64+
option("lite")
65+
}
66+
val kotlin by registering {
67+
option("lite")
68+
}
69+
}
70+
}
71+
}
72+
}
73+
74+
dependencies {
75+
implementation(platform(libs.androidx.compose.bom))
76+
implementation(libs.androidx.compose.material.iconsExtended)
77+
implementation(libs.androidx.compose.material3)
78+
implementation(libs.androidx.compose.ui.graphics)
79+
80+
debugImplementation(libs.androidx.compose.ui.tooling)
81+
implementation(libs.androidx.compose.ui.tooling.preview)
82+
implementation(libs.androidx.compose.ui.util)
83+
implementation(libs.androidx.compose.runtime)
84+
implementation(libs.androidx.lifecycle.runtime.compose)
85+
86+
// Decompose
87+
implementation(libs.decompose.jetpack.compose)
88+
implementation(libs.decompose.main)
89+
90+
// Coil
91+
implementation(libs.coil)
92+
implementation(libs.coil.compose)
93+
94+
// DataStore
95+
implementation(libs.androidx.datastore.preferences)
96+
implementation(libs.androidx.datastore)
97+
98+
// ProtoBuf
99+
implementation(libs.protobuf.kotlin.lite)
100+
101+
// Koin
102+
implementation(libs.koin.android)
103+
implementation(libs.koin.androidx.compose)
104+
105+
// MVIKotlin
106+
implementation(libs.mvikotlin)
107+
implementation(libs.mvikotlin.main)
108+
implementation(libs.mvikotlin.logging)
109+
implementation(libs.mvikotlin.timetravel)
110+
implementation(libs.mvikotlin.extensions.coroutines)
111+
112+
// Arrow
113+
implementation(libs.arrow.core)
114+
implementation(libs.arrow.fx.coroutines)
115+
116+
// Kotlin Serialization
117+
implementation(libs.kotlinx.serialization.json)
118+
119+
// Retrofit
120+
implementation(libs.retrofit)
121+
implementation(libs.retrofit2.kotlinx.serialization.converter)
122+
123+
// OkHttp
124+
implementation(libs.okhttp)
125+
implementation(libs.logging.interceptor)
126+
127+
// Lottie
128+
implementation(libs.lottie.compose)
129+
130+
implementation(libs.core.ktx)
131+
implementation(libs.lifecycle.runtime.ktx)
132+
implementation(libs.activity.compose)
133+
testImplementation(libs.junit)
134+
androidTestImplementation(libs.androidx.test.ext.junit)
135+
androidTestImplementation(libs.espresso.core)
136+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.nekodev.hackathonapp
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.nekodev.hackathonapp", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:dataExtractionRules="@xml/data_extraction_rules"
8+
android:fullBackupContent="@xml/backup_rules"
9+
android:icon="@mipmap/ic_launcher"
10+
android:label="@string/app_name"
11+
android:roundIcon="@mipmap/ic_launcher_round"
12+
android:supportsRtl="true"
13+
android:theme="@style/Theme.HackathonApp"
14+
tools:targetApi="31">
15+
<activity
16+
android:name=".MainActivity"
17+
android:exported="true"
18+
android:label="@string/app_name"
19+
android:theme="@style/Theme.HackathonApp">
20+
<intent-filter>
21+
<action android:name="android.intent.action.MAIN" />
22+
23+
<category android:name="android.intent.category.LAUNCHER" />
24+
</intent-filter>
25+
</activity>
26+
</application>
27+
28+
</manifest>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package com.nekodev.hackathonapp
2+
3+
import android.os.Bundle
4+
import androidx.activity.ComponentActivity
5+
import androidx.activity.compose.setContent
6+
import androidx.compose.foundation.layout.fillMaxSize
7+
import androidx.compose.material3.MaterialTheme
8+
import androidx.compose.material3.Surface
9+
import androidx.compose.material3.Text
10+
import androidx.compose.runtime.Composable
11+
import androidx.compose.ui.Modifier
12+
import androidx.compose.ui.tooling.preview.Preview
13+
import com.nekodev.hackathonapp.ui.theme.HackathonAppTheme
14+
15+
class MainActivity : ComponentActivity() {
16+
override fun onCreate(savedInstanceState: Bundle?) {
17+
super.onCreate(savedInstanceState)
18+
setContent {
19+
HackathonAppTheme {
20+
// A surface container using the 'background' color from the theme
21+
Surface(
22+
modifier = Modifier.fillMaxSize(),
23+
color = MaterialTheme.colorScheme.background
24+
) {
25+
Greeting("Android")
26+
}
27+
}
28+
}
29+
}
30+
}
31+
32+
@Composable
33+
fun Greeting(name: String, modifier: Modifier = Modifier) {
34+
Text(
35+
text = "Hello $name!",
36+
modifier = modifier
37+
)
38+
}
39+
40+
@Preview(showBackground = true)
41+
@Composable
42+
fun GreetingPreview() {
43+
HackathonAppTheme {
44+
Greeting("Android")
45+
}
46+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.nekodev.hackathonapp
2+
3+
import android.app.Application
4+
import coil.ImageLoader
5+
import coil.ImageLoaderFactory
6+
import com.nekodev.hackathonapp.di.appModule
7+
import org.koin.android.ext.android.get
8+
import org.koin.android.ext.koin.androidContext
9+
import org.koin.android.ext.koin.androidLogger
10+
import org.koin.core.context.startKoin
11+
import org.koin.core.logger.Level
12+
13+
class MainApplication: Application(), ImageLoaderFactory {
14+
override fun newImageLoader(): ImageLoader {
15+
return get<ImageLoader>()
16+
}
17+
18+
override fun onCreate() {
19+
super.onCreate()
20+
startKoin {
21+
androidContext(applicationContext)
22+
androidLogger(Level.DEBUG)
23+
modules(appModule)
24+
}
25+
}
26+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.nekodev.hackathonapp.datastore.prefs
2+
3+
import androidx.datastore.preferences.core.stringPreferencesKey
4+
5+
object PreferencesKeys {
6+
val JWT_TOKEN = stringPreferencesKey("jwt_token")
7+
}

0 commit comments

Comments
 (0)