mirror of
https://github.com/theapache64/topcorn.git
synced 2025-05-17 21:25:53 +08:00
🌟 add StateRestorationPolicy to feed
This commit is contained in:
@ -70,7 +70,9 @@ dependencies {
|
||||
implementation "androidx.core:core-ktx:$ktx_version"
|
||||
implementation "androidx.constraintlayout:constraintlayout:$constraint_version"
|
||||
implementation "com.google.android.material:material:$material_version"
|
||||
implementation "androidx.activity:activity-ktx:1.2.0-alpha03"
|
||||
implementation "androidx.activity:activity-ktx:1.2.0-alpha04"
|
||||
implementation "androidx.recyclerview:recyclerview:1.2.0-alpha03"
|
||||
|
||||
|
||||
// Coroutines
|
||||
def coroutines_version = '1.3.5'
|
||||
@ -91,7 +93,7 @@ dependencies {
|
||||
|
||||
// Retrofit
|
||||
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:4.2.0'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:4.2.1'
|
||||
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofit_version"
|
||||
|
||||
// Moshi
|
||||
@ -132,7 +134,7 @@ dependencies {
|
||||
testImplementation "androidx.test.espresso:espresso-contrib:$espresso_version"
|
||||
testImplementation 'androidx.test:runner:1.2.0'
|
||||
testImplementation 'androidx.test:rules:1.2.0'
|
||||
testImplementation "androidx.fragment:fragment-testing:1.3.0-alpha03"
|
||||
testImplementation "androidx.fragment:fragment-testing:1.3.0-alpha04"
|
||||
testImplementation "org.robolectric:robolectric:4.3.1"
|
||||
testImplementation 'com.github.fabioCollini.daggermock:daggermock:0.8.5'
|
||||
testImplementation 'com.github.fabioCollini.daggermock:daggermock-kotlin:0.8.5'
|
||||
@ -147,9 +149,8 @@ dependencies {
|
||||
androidTestImplementation 'androidx.test:rules:1.2.0'
|
||||
androidTestImplementation "org.mockito:mockito-core:$mockito_version"
|
||||
androidTestImplementation "org.mockito:mockito-android:$mockito_version"
|
||||
androidTestImplementation "androidx.fragment:fragment-testing:1.3.0-alpha03"
|
||||
androidTestImplementation "androidx.fragment:fragment-testing:1.3.0-alpha04"
|
||||
androidTestImplementation 'com.github.fabioCollini.daggermock:daggermock:0.8.5'
|
||||
androidTestImplementation 'com.github.fabioCollini.daggermock:daggermock-kotlin:0.8.5'
|
||||
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
|
||||
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import androidx.core.app.ActivityOptionsCompat
|
||||
import androidx.core.util.Pair
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.theapache64.topcorn.R
|
||||
import com.theapache64.topcorn.data.remote.Movie
|
||||
import com.theapache64.topcorn.databinding.ActivityFeedBinding
|
||||
@ -72,6 +73,8 @@ class FeedActivity : BaseAppCompatActivity(), FeedHandler {
|
||||
goToMovieActivity(movie, poster, title)
|
||||
}.apply {
|
||||
setHasStableIds(true)
|
||||
stateRestorationPolicy =
|
||||
RecyclerView.Adapter.StateRestorationPolicy.PREVENT_WHEN_EMPTY
|
||||
}
|
||||
},
|
||||
{ position ->
|
||||
|
18
gpm.json
Normal file
18
gpm.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"added": [
|
||||
{
|
||||
"id": 1,
|
||||
"type": "implementation",
|
||||
"installed_name": "recyclerview",
|
||||
"gpm_dep": {
|
||||
"artifact_id": "recyclerview",
|
||||
"default_type": "implementation",
|
||||
"docs": "https://mvnrepository.com/artifact/androidx.recyclerview/recyclerview",
|
||||
"get_from": "Google",
|
||||
"group_id": "androidx.recyclerview",
|
||||
"name": "Android Support RecyclerView V7",
|
||||
"description": "Android Support RecyclerView v7"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user