Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
andraantariksa committed Apr 1, 2022
0 parents commit 6d10cce
Show file tree
Hide file tree
Showing 79 changed files with 1,876 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitignore
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
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/discord.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions README.md
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)
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
97 changes: 97 additions & 0 deletions app/build.gradle
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'
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
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
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)
}
}
23 changes: 23 additions & 0 deletions app/src/main/AndroidManifest.xml
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>
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() {
}
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() {
}
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() {
}
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 app/src/main/kotlin/id/shaderboi/koffie/ui/main/MainActivity.kt
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()
}
}
Loading

0 comments on commit 6d10cce

Please sign in to comment.