update AndroidX lifecycle to 2.6.0, fix deprecation (#3443)
This commit is contained in:
parent
d839f18267
commit
bab178166d
2 changed files with 17 additions and 10 deletions
|
@ -28,6 +28,7 @@ import androidx.core.view.MenuProvider
|
||||||
import androidx.fragment.app.viewModels
|
import androidx.fragment.app.viewModels
|
||||||
import androidx.lifecycle.Lifecycle
|
import androidx.lifecycle.Lifecycle
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import androidx.lifecycle.repeatOnLifecycle
|
||||||
import androidx.paging.LoadState
|
import androidx.paging.LoadState
|
||||||
import androidx.preference.PreferenceManager
|
import androidx.preference.PreferenceManager
|
||||||
import androidx.recyclerview.widget.DividerItemDecoration
|
import androidx.recyclerview.widget.DividerItemDecoration
|
||||||
|
@ -189,11 +190,17 @@ class ConversationsFragment :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lifecycleScope.launchWhenResumed {
|
viewLifecycleOwner.lifecycleScope.launch {
|
||||||
val useAbsoluteTime = preferences.getBoolean(PrefKeys.ABSOLUTE_TIME_VIEW, false)
|
repeatOnLifecycle(Lifecycle.State.RESUMED) {
|
||||||
while (!useAbsoluteTime) {
|
val useAbsoluteTime = preferences.getBoolean(PrefKeys.ABSOLUTE_TIME_VIEW, false)
|
||||||
adapter.notifyItemRangeChanged(0, adapter.itemCount, listOf(StatusBaseViewHolder.Key.KEY_CREATED))
|
while (!useAbsoluteTime) {
|
||||||
delay(1.toDuration(DurationUnit.MINUTES))
|
adapter.notifyItemRangeChanged(
|
||||||
|
0,
|
||||||
|
adapter.itemCount,
|
||||||
|
listOf(StatusBaseViewHolder.Key.KEY_CREATED)
|
||||||
|
)
|
||||||
|
delay(1.toDuration(DurationUnit.MINUTES))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ androidx-core = "1.9.0"
|
||||||
androidx-exifinterface = "1.3.6"
|
androidx-exifinterface = "1.3.6"
|
||||||
androidx-fragment = "1.5.5"
|
androidx-fragment = "1.5.5"
|
||||||
androidx-junit = "1.1.5"
|
androidx-junit = "1.1.5"
|
||||||
|
androidx-lifecycle = "2.6.0"
|
||||||
androidx-paging = "3.1.1"
|
androidx-paging = "3.1.1"
|
||||||
androidx-preference = "1.2.0"
|
androidx-preference = "1.2.0"
|
||||||
androidx-recyclerview = "1.2.1"
|
androidx-recyclerview = "1.2.1"
|
||||||
|
@ -33,7 +34,6 @@ glide-animation-plugin = "2.24.0"
|
||||||
gson = "2.10.1"
|
gson = "2.10.1"
|
||||||
kotlin = "1.8.10"
|
kotlin = "1.8.10"
|
||||||
image-cropper = "4.3.2"
|
image-cropper = "4.3.2"
|
||||||
lifecycle = "2.5.1"
|
|
||||||
material = "1.8.0"
|
material = "1.8.0"
|
||||||
material-drawer = "8.4.5"
|
material-drawer = "8.4.5"
|
||||||
material-typeface = "4.0.0.2-kotlin"
|
material-typeface = "4.0.0.2-kotlin"
|
||||||
|
@ -75,10 +75,10 @@ androidx-emoji2-views-core = { module = "androidx.emoji2:emoji2-views", version.
|
||||||
androidx-emoji2-view-helper = { module = "androidx.emoji2:emoji2-views-helper", version.ref = "emoji2" }
|
androidx-emoji2-view-helper = { module = "androidx.emoji2:emoji2-views-helper", version.ref = "emoji2" }
|
||||||
androidx-exifinterface = { module = "androidx.exifinterface:exifinterface", version.ref = "androidx-exifinterface" }
|
androidx-exifinterface = { module = "androidx.exifinterface:exifinterface", version.ref = "androidx-exifinterface" }
|
||||||
androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment" }
|
androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "androidx-fragment" }
|
||||||
androidx-lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "lifecycle" }
|
androidx-lifecycle-common-java8 = { module = "androidx.lifecycle:lifecycle-common-java8", version.ref = "androidx-lifecycle" }
|
||||||
androidx-lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "lifecycle" }
|
androidx-lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "androidx-lifecycle" }
|
||||||
androidx-lifecycle-reactivestreams-ktx = { module = "androidx.lifecycle:lifecycle-reactivestreams-ktx", version.ref = "lifecycle" }
|
androidx-lifecycle-reactivestreams-ktx = { module = "androidx.lifecycle:lifecycle-reactivestreams-ktx", version.ref = "androidx-lifecycle" }
|
||||||
androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle" }
|
androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
|
||||||
androidx-paging-runtime-ktx = { module = "androidx.paging:paging-runtime-ktx", version.ref = "androidx-paging" }
|
androidx-paging-runtime-ktx = { module = "androidx.paging:paging-runtime-ktx", version.ref = "androidx-paging" }
|
||||||
androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "androidx-preference" }
|
androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "androidx-preference" }
|
||||||
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "androidx-room" }
|
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "androidx-room" }
|
||||||
|
|
Loading…
Reference in a new issue