Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Compose from 1.0.0-alpha09 to 1.0.0-alpha12 #4

Merged
merged 1 commit into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
ext.lifecycle_version = '2.3.0'
ext.activity_version = '1.2.0'
ext.fragment_version = '1.3.0'
ext.compose_version = '1.0.0-alpha09'
ext.compose_version = '1.0.0-alpha12'
repositories {
google()
jcenter()
Expand Down
6 changes: 5 additions & 1 deletion compose/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ dependencies {

implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha01"

implementation "androidx.navigation:navigation-compose:1.0.0-alpha06"
implementation "androidx.navigation:navigation-compose:1.0.0-alpha07"

implementation "androidx.activity:activity-ktx:$activity_version"
implementation "androidx.fragment:fragment-ktx:$fragment_version"

// Unit Testing
testImplementation 'junit:junit:4.13.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package dev.marcellogalhardo.retained.compose
import android.app.Activity
import android.os.Bundle
import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.AmbientLifecycleOwner
import androidx.compose.ui.platform.AmbientSavedStateRegistryOwner
import androidx.compose.ui.platform.AmbientViewModelStoreOwner
import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.platform.LocalSavedStateRegistryOwner
import androidx.core.os.bundleOf
import androidx.fragment.app.Fragment
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelStoreOwner
import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner
import androidx.navigation.NavBackStackEntry
import androidx.savedstate.SavedStateRegistryOwner
import dev.marcellogalhardo.retained.core.InternalRetainedApi
Expand Down Expand Up @@ -38,9 +38,9 @@ import dev.marcellogalhardo.retained.core.createRetainedObject
@Composable
inline fun <reified T : Any> retain(
key: String = T::class.java.name,
viewModelStoreOwner: ViewModelStoreOwner = AmbientViewModelStoreOwner.current,
savedStateRegistryOwner: SavedStateRegistryOwner = AmbientSavedStateRegistryOwner.current,
defaultArgs: Bundle = AmbientLifecycleOwner.current.defaultArgs,
viewModelStoreOwner: ViewModelStoreOwner = LocalViewModelStoreOwner.current,
savedStateRegistryOwner: SavedStateRegistryOwner = LocalSavedStateRegistryOwner.current,
defaultArgs: Bundle = LocalLifecycleOwner.current.defaultArgs,
noinline createRetainedObject: (RetainedEntry) -> T
): T = createRetainedObject(key, viewModelStoreOwner, savedStateRegistryOwner, defaultArgs, createRetainedObject)

Expand Down