-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from rainbowcake/dev
Release 1.5.0
- Loading branch information
Showing
60 changed files
with
979 additions
and
382 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
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
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
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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,46 @@ | ||
apply plugin: 'com.android.application' | ||
apply plugin: 'dagger.hilt.android.plugin' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-android-extensions' | ||
apply plugin: 'kotlin-kapt' | ||
|
||
android { | ||
compileSdkVersion compile_sdk | ||
defaultConfig { | ||
applicationId "co.zsmb.rainbowcake.hiltdemo" | ||
minSdkVersion min_sdk | ||
targetSdkVersion target_sdk | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt') | ||
} | ||
} | ||
buildFeatures { | ||
viewBinding true | ||
} | ||
} | ||
|
||
dependencies { | ||
// Architecture | ||
implementation project(':rainbow-cake-core') | ||
implementation project(':rainbow-cake-hilt') | ||
implementation project(':rainbow-cake-navigation') | ||
implementation project(':rainbow-cake-timber') | ||
|
||
// Google libraries | ||
implementation 'androidx.appcompat:appcompat:1.3.1' | ||
implementation 'com.google.android.material:material:1.4.0' | ||
implementation 'androidx.constraintlayout:constraintlayout:2.1.0' | ||
|
||
// Dagger Hilt | ||
implementation "com.google.dagger:hilt-android:$dagger_version" | ||
kapt "com.google.dagger:hilt-compiler:$dagger_version" | ||
|
||
// Kotlin | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
} |
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 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="co.zsmb.rainbowcake.hiltdemo"> | ||
|
||
<application | ||
android:name=".HiltDemoApplication" | ||
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.Rainbowcake"> | ||
<activity | ||
android:name=".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> |
24 changes: 24 additions & 0 deletions
24
hilt-demo/src/main/java/co/zsmb/rainbowcake/hiltdemo/HiltDemoApplication.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 co.zsmb.rainbowcake.hiltdemo | ||
|
||
import android.app.Application | ||
import co.zsmb.rainbowcake.config.Loggers | ||
import co.zsmb.rainbowcake.config.rainbowCake | ||
import co.zsmb.rainbowcake.timber.TIMBER | ||
import dagger.hilt.android.HiltAndroidApp | ||
import timber.log.Timber | ||
|
||
@HiltAndroidApp | ||
class HiltDemoApplication : Application() { | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
|
||
rainbowCake { | ||
logger = Loggers.TIMBER | ||
isDebug = BuildConfig.DEBUG | ||
consumeExecuteExceptions = !BuildConfig.DEBUG | ||
} | ||
|
||
if (BuildConfig.DEBUG) Timber.plant(Timber.DebugTree()) | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
hilt-demo/src/main/java/co/zsmb/rainbowcake/hiltdemo/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,17 @@ | ||
package co.zsmb.rainbowcake.hiltdemo | ||
|
||
import android.os.Bundle | ||
import co.zsmb.rainbowcake.hiltdemo.blank.BlankFragment | ||
import co.zsmb.rainbowcake.navigation.SimpleNavActivity | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class MainActivity : SimpleNavActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
if (savedInstanceState == null) { | ||
navigator.add(BlankFragment()) | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
hilt-demo/src/main/java/co/zsmb/rainbowcake/hiltdemo/blank/BlankFragment.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,23 @@ | ||
package co.zsmb.rainbowcake.hiltdemo.blank | ||
|
||
import android.os.Bundle | ||
import android.view.View | ||
import co.zsmb.rainbowcake.base.RainbowCakeFragment | ||
import co.zsmb.rainbowcake.hilt.getViewModelFromFactory | ||
import co.zsmb.rainbowcake.hiltdemo.R | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@AndroidEntryPoint | ||
class BlankFragment : RainbowCakeFragment<BlankViewState, BlankViewModel>() { | ||
|
||
override fun provideViewModel() = getViewModelFromFactory() | ||
override fun getViewResource() = R.layout.fragment_blank | ||
|
||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
super.onViewCreated(view, savedInstanceState) | ||
|
||
viewModel.load() | ||
} | ||
|
||
override fun render(viewState: BlankViewState) = Unit | ||
} |
12 changes: 12 additions & 0 deletions
12
hilt-demo/src/main/java/co/zsmb/rainbowcake/hiltdemo/blank/BlankPresenter.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,12 @@ | ||
package co.zsmb.rainbowcake.hiltdemo.blank | ||
|
||
import co.zsmb.rainbowcake.withIOContext | ||
import javax.inject.Inject | ||
|
||
class BlankPresenter @Inject constructor( | ||
) { | ||
|
||
suspend fun getData(): String = withIOContext { | ||
"" | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
hilt-demo/src/main/java/co/zsmb/rainbowcake/hiltdemo/blank/BlankViewModel.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,15 @@ | ||
package co.zsmb.rainbowcake.hiltdemo.blank | ||
|
||
import co.zsmb.rainbowcake.base.RainbowCakeViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class BlankViewModel @Inject constructor( | ||
private val presenter: BlankPresenter, | ||
) : RainbowCakeViewModel<BlankViewState>(Initial) { | ||
|
||
fun load() = execute { | ||
viewState = BlankReady(presenter.getData()) | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
hilt-demo/src/main/java/co/zsmb/rainbowcake/hiltdemo/blank/BlankViewState.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,7 @@ | ||
package co.zsmb.rainbowcake.hiltdemo.blank | ||
|
||
sealed class BlankViewState | ||
|
||
object Initial : BlankViewState() | ||
|
||
data class BlankReady(val data: String = "") : BlankViewState() |
30 changes: 30 additions & 0 deletions
30
hilt-demo/src/main/res/drawable-v24/ic_launcher_foreground.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,30 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:aapt="http://schemas.android.com/aapt" | ||
android:width="108dp" | ||
android:height="108dp" | ||
android:viewportWidth="108" | ||
android:viewportHeight="108"> | ||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z"> | ||
<aapt:attr name="android:fillColor"> | ||
<gradient | ||
android:endX="85.84757" | ||
android:endY="92.4963" | ||
android:startX="42.9492" | ||
android:startY="49.59793" | ||
android:type="linear"> | ||
<item | ||
android:color="#44000000" | ||
android:offset="0.0" /> | ||
<item | ||
android:color="#00000000" | ||
android:offset="1.0" /> | ||
</gradient> | ||
</aapt:attr> | ||
</path> | ||
<path | ||
android:fillColor="#FFFFFF" | ||
android:fillType="nonZero" | ||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z" | ||
android:strokeWidth="1" | ||
android:strokeColor="#00000000" /> | ||
</vector> |
Oops, something went wrong.