File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
app/src/main/java/com/appcontrolx/ui Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -208,17 +208,17 @@ class AppListFragment : Fragment() {
208208 }
209209
210210 private fun showAppDetail (app : AppInfo ) {
211- val bottomSheet = AppDetailBottomSheet .newInstance(app)
212- bottomSheet.onActionCompleted = {
213- // Will refresh when sheet is dismissed
211+ // Prevent multiple sheets - dismiss existing one first
212+ val existingSheet = childFragmentManager.findFragmentByTag(AppDetailBottomSheet .TAG )
213+ if (existingSheet != null ) {
214+ (existingSheet as ? AppDetailBottomSheet )?.dismissAllowingStateLoss()
214215 }
215- bottomSheet.show(childFragmentManager, AppDetailBottomSheet .TAG )
216216
217- // Refresh list when sheet is dismissed (after any action)
218- childFragmentManager.executePendingTransactions()
219- bottomSheet.dialog?.setOnDismissListener {
217+ val bottomSheet = AppDetailBottomSheet .newInstance(app)
218+ bottomSheet.onActionCompleted = {
220219 refreshAppList()
221220 }
221+ bottomSheet.show(childFragmentManager, AppDetailBottomSheet .TAG )
222222 }
223223
224224 private fun setupChips () {
You can’t perform that action at this time.
0 commit comments