|
|
@ -23,7 +23,7 @@ import androidx.lifecycle.lifecycleScope
|
|
|
|
import androidx.navigation.NavDirections
|
|
|
|
import androidx.navigation.NavDirections
|
|
|
|
import androidx.navigation.fragment.findNavController
|
|
|
|
import androidx.navigation.fragment.findNavController
|
|
|
|
import com.google.android.material.snackbar.Snackbar
|
|
|
|
import com.google.android.material.snackbar.Snackbar
|
|
|
|
import kotlinx.android.synthetic.main.component_search.toolbar
|
|
|
|
import kotlinx.android.synthetic.main.component_search.*
|
|
|
|
import kotlinx.android.synthetic.main.fragment_browser.*
|
|
|
|
import kotlinx.android.synthetic.main.fragment_browser.*
|
|
|
|
import kotlinx.android.synthetic.main.fragment_browser.view.*
|
|
|
|
import kotlinx.android.synthetic.main.fragment_browser.view.*
|
|
|
|
import kotlinx.coroutines.Dispatchers.IO
|
|
|
|
import kotlinx.coroutines.Dispatchers.IO
|
|
|
@ -264,6 +264,9 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
downloadFeature.onDownloadCompleted = { download, _, downloadJobStatus ->
|
|
|
|
downloadFeature.onDownloadCompleted = { download, _, downloadJobStatus ->
|
|
|
|
|
|
|
|
// If the download is just paused, don't show any in-app notification
|
|
|
|
|
|
|
|
if (downloadJobStatus == AbstractFetchDownloadService.DownloadJobStatus.COMPLETED ||
|
|
|
|
|
|
|
|
downloadJobStatus == AbstractFetchDownloadService.DownloadJobStatus.FAILED) {
|
|
|
|
val dialog = DownloadNotificationBottomSheetDialog(
|
|
|
|
val dialog = DownloadNotificationBottomSheetDialog(
|
|
|
|
context = context,
|
|
|
|
context = context,
|
|
|
|
didFail = downloadJobStatus == AbstractFetchDownloadService.DownloadJobStatus.FAILED,
|
|
|
|
didFail = downloadJobStatus == AbstractFetchDownloadService.DownloadJobStatus.FAILED,
|
|
|
@ -272,6 +275,7 @@ abstract class BaseBrowserFragment : Fragment(), BackHandler, SessionManager.Obs
|
|
|
|
)
|
|
|
|
)
|
|
|
|
dialog.show()
|
|
|
|
dialog.show()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
downloadsFeature.set(
|
|
|
|
downloadsFeature.set(
|
|
|
|
downloadFeature,
|
|
|
|
downloadFeature,
|
|
|
|