Merge pull request #11644 from nextcloud/rotateBottomSheet

Prevent having double entries after rotate
This commit is contained in:
Tobias Kaminsky 2023-06-01 12:31:48 +02:00 committed by GitHub
commit d32b014cec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -35,6 +35,7 @@ import android.widget.Toast
import androidx.annotation.IdRes
import androidx.appcompat.content.res.AppCompatResources
import androidx.core.os.bundleOf
import androidx.core.view.isEmpty
import androidx.core.view.isVisible
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.setFragmentResult
@ -199,9 +200,11 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable {
private fun displayActions(
actions: List<FileAction>
) {
actions.forEach { action ->
val view = inflateActionView(action)
binding.fileActionsList.addView(view)
if (binding.fileActionsList.isEmpty()) {
actions.forEach { action ->
val view = inflateActionView(action)
binding.fileActionsList.addView(view)
}
}
}