1
0
Fork 0

For #673 - Dismiss bottom sheet on archive. Remove boolean logic

master
Jeff Boek 2019-03-01 00:06:40 -08:00 committed by Colin Lee
parent f1ad83d404
commit 27c5570b43
2 changed files with 4 additions and 6 deletions

View File

@ -339,8 +339,6 @@ class HomeFragment : Fragment() {
}
requireComponents.core.sessionStorage.remove(archivedSession.bundle)
true
}
}.show(requireActivity().supportFragmentManager, SessionBottomSheetFragment.overflowFragmentTag)
}

View File

@ -19,7 +19,7 @@ class SessionBottomSheetFragment : BottomSheetDialogFragment(), LayoutContainer
var archivedSession: ArchivedSession? = null
var isCurrentSession: Boolean = false
private lateinit var tabTitles: String
var onDelete: ((ArchivedSession) -> Boolean)? = null
var onDelete: ((ArchivedSession) -> Unit)? = null
var onArchive: (() -> Unit)? = null
override val containerView: View?
@ -51,13 +51,13 @@ class SessionBottomSheetFragment : BottomSheetDialogFragment(), LayoutContainer
visibility = if (isCurrentSession) View.VISIBLE else View.GONE
setOnClickListener {
onArchive?.invoke()
dismiss()
}
}
view.delete_session_button.setOnClickListener {
if (onDelete?.invoke(archivedSession!!) == true) {
dismiss()
}
onDelete?.invoke(archivedSession!!)
dismiss()
}
return view