mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
refactor: avoid checking fragment is currentSelectedPosition is out of bounds
This commit is contained in:
parent
9002978292
commit
3842ba952f
1 changed files with 4 additions and 1 deletions
|
|
@ -388,7 +388,10 @@ class UploadActivity : BaseActivity(), UploadContract.View, UploadBaseFragment.C
|
|||
fragments!!.removeAt(index) //Remove the corresponding fragment
|
||||
uploadableFiles.removeAt(index) //Remove the files from the list
|
||||
|
||||
if(fragments!![currentSelectedPosition] !is UploadMediaDetailFragment) {
|
||||
val isMediaDetailFragment = fragments!!.getOrNull(currentSelectedPosition)?.let {
|
||||
it is UploadMediaDetailFragment
|
||||
} ?: false
|
||||
if(!isMediaDetailFragment) {
|
||||
// Should hide the top card current fragment is not the media detail fragment
|
||||
showHideTopCard(false)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue