mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Fix: Safe binding usage in MediaDetailFragment
This commit is contained in:
parent
6ee63e800c
commit
1fb9783039
1 changed files with 5 additions and 3 deletions
|
|
@ -248,7 +248,9 @@ class MediaDetailFragment : CommonsDaggerSupportFragment(), CategoryEditHelper.C
|
||||||
|
|
||||||
private val scrollPosition: Unit
|
private val scrollPosition: Unit
|
||||||
get() {
|
get() {
|
||||||
initialListTop = binding.mediaDetailScrollView.scrollY
|
bindingOrNull?.let {
|
||||||
|
initialListTop = it.mediaDetailScrollView.scrollY
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
|
|
@ -736,7 +738,7 @@ class MediaDetailFragment : CommonsDaggerSupportFragment(), CategoryEditHelper.C
|
||||||
object : BaseControllerListener<ImageInfo?>() {
|
object : BaseControllerListener<ImageInfo?>() {
|
||||||
override fun onIntermediateImageSet(id: String, imageInfo: ImageInfo?) {
|
override fun onIntermediateImageSet(id: String, imageInfo: ImageInfo?) {
|
||||||
imageInfoCache = imageInfo
|
imageInfoCache = imageInfo
|
||||||
updateAspectRatio(binding.mediaDetailScrollView.width)
|
bindingOrNull?.let { updateAspectRatio(it.mediaDetailScrollView.width) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFinalImageSet(
|
override fun onFinalImageSet(
|
||||||
|
|
@ -745,7 +747,7 @@ class MediaDetailFragment : CommonsDaggerSupportFragment(), CategoryEditHelper.C
|
||||||
animatable: Animatable?
|
animatable: Animatable?
|
||||||
) {
|
) {
|
||||||
imageInfoCache = imageInfo
|
imageInfoCache = imageInfo
|
||||||
updateAspectRatio(binding.mediaDetailScrollView.width)
|
bindingOrNull?.let { updateAspectRatio(it.mediaDetailScrollView.width) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue