-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit 6d10cce
Showing
79 changed files
with
1,876 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,15 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,40 @@ | ||
# Koffie Mobile | ||
|
||
Koffie is a product that can help to manage a Cafe orders and as an interface to the user. | ||
|
||
This project serve just as a demonstration. It can be used in a real world Cafe but it needs | ||
some tuning. | ||
|
||
**This project is work in progress** | ||
|
||
## Features | ||
|
||
- Order | ||
- Profile | ||
|
||
## What I used and learned from | ||
|
||
- MVVM | ||
- Flexbox | ||
- Splashscreen | ||
- Dagger Hilt | ||
- Flow coroutine | ||
- Compose Navigation | ||
- Retrofit | ||
- Project structure | ||
- Networking using Retrofit | ||
- Data serialization and deserialization using Moshi | ||
|
||
## Backend | ||
|
||
See https://github.com/shaderboi/koffie-backend for the backend source | ||
|
||
## Special Thanks | ||
|
||
- [Buildwithangga](https://buildwithangga.com/) course | ||
- [Phillipp Lackner](https://www.youtube.com/c/PhilippLackner) videos | ||
- Android official documentation and guide | ||
|
||
## License | ||
|
||
Licensed under [MIT License](LICENSE) |
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 @@ | ||
/build |
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,97 @@ | ||
plugins { | ||
id 'com.android.application' | ||
id 'org.jetbrains.kotlin.android' | ||
id 'kotlin-kapt' | ||
id "dagger.hilt.android.plugin" | ||
} | ||
|
||
android { | ||
compileSdk 32 | ||
|
||
defaultConfig { | ||
applicationId "id.shaderboi.koffie" | ||
minSdk 21 | ||
targetSdk 32 | ||
versionCode 1 | ||
versionName "1.0" | ||
|
||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
debug { | ||
buildConfigField "String", "MIDTRANS_API", "Mid-client-ezhmz-zycV9jTa5b" | ||
} | ||
|
||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
|
||
buildConfigField "String", "MIDTRANS_API", "SB-Mid-client-FGDd5FsG_5p0EiWB" | ||
} | ||
} | ||
buildFeatures { | ||
buildConfig true | ||
viewBinding true | ||
dataBinding true | ||
} | ||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = '1.8' | ||
} | ||
} | ||
|
||
dependencies { | ||
// Lifecycle | ||
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycleVersion" | ||
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion" | ||
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion" | ||
|
||
/// Coroutine | ||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion" | ||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutineVersion" | ||
|
||
// Firebase | ||
implementation platform('com.google.firebase:firebase-bom:28.1.0') | ||
implementation 'com.google.firebase:firebase-analytics-ktx' | ||
implementation 'com.google.firebase:firebase-crashlytics-ktx' | ||
|
||
// Network | ||
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion" | ||
implementation "com.squareup.retrofit2:converter-moshi:$retrofitVersion" | ||
|
||
// Serializer & deserializer | ||
implementation "com.squareup.moshi:moshi:$moshiVersion" | ||
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion" | ||
|
||
implementation "androidx.core:core-splashscreen:1.0.0-beta02" | ||
|
||
implementation "com.airbnb.android:lottie:$lottieVersion" | ||
|
||
implementation "androidx.preference:preference:1.2.0" | ||
|
||
debugImplementation "com.midtrans:uikit:1.28.0-SANDBOX" | ||
implementation "com.midtrans:uikit:1.28.0" | ||
implementation 'com.google.android.flexbox:flexbox:3.0.0' | ||
|
||
// Hilt | ||
implementation "com.google.dagger:hilt-android:$hiltVersion" | ||
kapt "com.google.dagger:hilt-compiler:$hiltVersion" | ||
|
||
// Leak detector | ||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1' | ||
|
||
// Logger | ||
implementation 'com.jakewharton.timber:timber:5.0.1' | ||
|
||
implementation 'androidx.core:core-ktx:1.7.0' | ||
implementation 'androidx.appcompat:appcompat:1.4.1' | ||
implementation 'com.google.android.material:material:1.5.0' | ||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3' | ||
testImplementation 'junit:junit:4.13.2' | ||
androidTestImplementation 'androidx.test.ext:junit:1.1.3' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' | ||
} |
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,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http:https://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
app/src/androidTest/kotlin/id/shaderboi/koffie/ExampleInstrumentedTest.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,24 @@ | ||
package id.shaderboi.koffie | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http:https://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("id.shaderboi.koffie", appContext.packageName) | ||
} | ||
} |
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,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http:https://schemas.android.com/apk/res/android" | ||
package="id.shaderboi.koffie"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/Theme.Koffie"> | ||
<activity | ||
android:name=".ui.main.MainActivity" | ||
android:exported="true"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
6 changes: 6 additions & 0 deletions
6
app/src/main/kotlin/id/shaderboi/koffie/ui/auth/AuthActivity.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,6 @@ | ||
package id.shaderboi.koffie.ui.auth | ||
|
||
import androidx.core.app.ActivityCompat | ||
|
||
class AuthActivity: ActivityCompat() { | ||
} |
6 changes: 6 additions & 0 deletions
6
app/src/main/kotlin/id/shaderboi/koffie/ui/auth/SignInFragment.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,6 @@ | ||
package id.shaderboi.koffie.ui.auth | ||
|
||
import androidx.fragment.app.Fragment | ||
|
||
class SignInFragment: Fragment() { | ||
} |
6 changes: 6 additions & 0 deletions
6
app/src/main/kotlin/id/shaderboi/koffie/ui/auth/VerifyPhoneFragment.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,6 @@ | ||
package id.shaderboi.koffie.ui.auth | ||
|
||
import androidx.fragment.app.Fragment | ||
|
||
class VerifyPhoneFragment: Fragment() { | ||
} |
8 changes: 8 additions & 0 deletions
8
app/src/main/kotlin/id/shaderboi/koffie/ui/main/HomeFragment.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,8 @@ | ||
package id.shaderboi.koffie.ui.main | ||
|
||
import androidx.fragment.app.Fragment | ||
import dagger.hilt.EntryPoint | ||
|
||
@EntryPoint | ||
class HomeFragment: Fragment() { | ||
} |
35 changes: 35 additions & 0 deletions
35
app/src/main/kotlin/id/shaderboi/koffie/ui/main/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,35 @@ | ||
package id.shaderboi.koffie.ui.main | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import androidx.activity.viewModels | ||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen | ||
import dagger.hilt.EntryPoint | ||
import id.shaderboi.koffie.databinding.ActivityMainBinding | ||
import id.shaderboi.koffie.ui.main.view_model.MainViewModel | ||
|
||
@EntryPoint | ||
class MainActivity : AppCompatActivity() { | ||
private var _binding: ActivityMainBinding? = null | ||
val binding get() = _binding!! | ||
|
||
private val mainViewModel by viewModels<MainViewModel>() | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
installSplashScreen().setKeepOnScreenCondition { | ||
true | ||
} | ||
|
||
_binding = ActivityMainBinding.inflate(layoutInflater) | ||
|
||
setContentView(binding.root) | ||
} | ||
|
||
override fun onDestroy() { | ||
_binding = null | ||
|
||
super.onDestroy() | ||
} | ||
} |
Oops, something went wrong.