File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
app/src/main/java/com/skydoves/pokedex/extensions Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 16
16
17
17
package com.skydoves.pokedex.extensions
18
18
19
- import androidx.appcompat.app.AppCompatActivity
19
+ import android.os.Parcelable
20
+ import androidx.activity.ComponentActivity
21
+ import com.skydoves.transformationlayout.TransformationLayout
20
22
import com.skydoves.transformationlayout.onTransformationEndContainer
21
23
22
- fun AppCompatActivity.onTransformationEndContainerApplyParams () {
24
+ /* * apply [TransformationLayout.Params] to an activity. */
25
+ fun ComponentActivity.onTransformationEndContainerApplyParams () {
23
26
onTransformationEndContainer(intent.getParcelableExtra(" com.skydoves.transformationlayout" ))
24
27
}
28
+
29
+ /* * initialize a parcelable argument lazily. */
30
+ fun <T : Parcelable > ComponentActivity.argument (key : String ): Lazy <T > {
31
+ return lazy { requireNotNull(intent.getParcelableExtra<T >(key)) }
32
+ }
You can’t perform that action at this time.
0 commit comments