This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
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
76 changed files
with
676 additions
and
330 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
14 changes: 4 additions & 10 deletions
14
app/src/main/java/de/trbnb/apptemplate/second/SecondController.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 |
---|---|---|
@@ -1,18 +1,12 @@ | ||
package de.trbnb.apptemplate.second | ||
|
||
import androidx.lifecycle.AbstractSavedStateViewModelFactory | ||
import androidx.lifecycle.SavedStateHandle | ||
import androidx.lifecycle.ViewModel | ||
import de.trbnb.apptemplate.R | ||
import de.trbnb.apptemplate.resource.ResourceProviderImpl | ||
import de.trbnb.mvvmbase.conductor.MvvmController | ||
import de.trbnb.mvvmbase.conductor.viewModelProviderFactory | ||
|
||
class SecondController : MvvmController<SecondViewModel>() { | ||
override val layoutId: Int = R.layout.fragment_second | ||
|
||
override val defaultViewModelProviderFactory = object : AbstractSavedStateViewModelFactory(this, defaultViewModelArgs) { | ||
override fun <T : ViewModel?> create(key: String, modelClass: Class<T>, handle: SavedStateHandle): T { | ||
return SecondViewModel(handle, ResourceProviderImpl(activity ?: throw IllegalStateException())) as T | ||
} | ||
class SecondController : MvvmController<SecondViewModel>(layoutId = R.layout.fragment_second) { | ||
override fun getDefaultViewModelProviderFactory() = viewModelProviderFactory { handle -> | ||
SecondViewModel(handle, ResourceProviderImpl(activity ?: throw IllegalStateException())) | ||
} | ||
} |
16 changes: 5 additions & 11 deletions
16
app/src/main/java/de/trbnb/apptemplate/second/SecondFragment.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 |
---|---|---|
@@ -1,21 +1,15 @@ | ||
package de.trbnb.apptemplate.second | ||
|
||
import androidx.fragment.app.activityViewModels | ||
import androidx.lifecycle.AbstractSavedStateViewModelFactory | ||
import androidx.lifecycle.SavedStateHandle | ||
import androidx.lifecycle.ViewModel | ||
import de.trbnb.apptemplate.R | ||
import de.trbnb.apptemplate.resource.ResourceProviderImpl | ||
import de.trbnb.mvvmbase.MvvmFragment | ||
import de.trbnb.mvvmbase.viewmodel.viewModelProviderFactory | ||
|
||
class SecondFragment : MvvmFragment<SecondViewModel>() { | ||
override val layoutId: Int = R.layout.fragment_second | ||
class SecondFragment : MvvmFragment<SecondViewModel>(R.layout.fragment_second) { | ||
override val viewModelDelegate = activityViewModels<SecondViewModel> { defaultViewModelProviderFactory } | ||
|
||
override val viewModelDelegate = activityViewModels<SecondViewModel>() | ||
|
||
override fun getDefaultViewModelProviderFactory() = object : AbstractSavedStateViewModelFactory(this, arguments) { | ||
override fun <T : ViewModel?> create(key: String, modelClass: Class<T>, handle: SavedStateHandle): T { | ||
return SecondViewModel(handle, ResourceProviderImpl(context ?: throw IllegalStateException())) as T | ||
} | ||
override fun getDefaultViewModelProviderFactory() = viewModelProviderFactory { handle -> | ||
SecondViewModel(handle, ResourceProviderImpl(context ?: throw IllegalStateException())) | ||
} | ||
} |
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,6 +1,6 @@ | ||
#Tue May 26 18:07:17 CEST 2020 | ||
#Tue Feb 16 14:42:44 CET 2021 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip |
Oops, something went wrong.