This commit is contained in:
kehaoyuan@ghzhushou.com
2020-05-07 15:24:53 +08:00
parent 54db9fb910
commit ebafc2f98f
2 changed files with 11 additions and 3 deletions

View File

@ -284,7 +284,6 @@ class DownloadDialog : BaseDialogFragment(), View.OnTouchListener {
}
}
override fun onStart() {
super.onStart()
val width = HaloApp.getInstance().application.resources.displayMetrics.widthPixels
@ -292,6 +291,15 @@ class DownloadDialog : BaseDialogFragment(), View.OnTouchListener {
dialog?.window?.setLayout(width, height)
}
override fun onBack(): Boolean {
if (mCollectionAdapter != null && mAdapter != null) {
postBrowseMta()
mViewModel.collectionLiveData.postValue(null)
return true
}
return super.onBack()
}
// dialog drag animation
@SuppressLint("ClickableViewAccessibility")
override fun onTouch(v: View, event: MotionEvent): Boolean {
@ -398,7 +406,6 @@ class DownloadDialog : BaseDialogFragment(), View.OnTouchListener {
downloadDialog.show(fragmentActivity.supportFragmentManager, DownloadDialog::class.java.name)
}
private fun hasDownloadDialogInCurrentActivity(fragmentActivity: FragmentActivity): Boolean {
val fragments: List<Fragment> = fragmentActivity.supportFragmentManager.fragments
fragments.forEach { fragment ->