Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setSwipeToDismiss and setAction not applying dynamically #30

Closed
Andrey-Morenkov opened this issue Mar 18, 2020 · 2 comments
Closed

setSwipeToDismiss and setAction not applying dynamically #30

Andrey-Morenkov opened this issue Mar 18, 2020 · 2 comments

Comments

@Andrey-Morenkov
Copy link

Andrey-Morenkov commented Mar 18, 2020

I trying to implement this behaviour: show "File saving" message on snackbar and Indeterminate progress line. In that time on background file saving and when saved - i need to have possibility dismiss by swipe this message or add button "open File folder". But this not working:

SnackProgressBar(SnackProgressBar.TYPE_HORIZONTAL, "Saving file...")
.setIsIndeterminate(true)
.setSwipeToDismiss(false)

......

val currentShowing = snackProgressBarManager.getLastShown()
currentShowing?.setMessage("File saved")
?.setIsIndeterminate(false)
?.setSwipeToDismiss(true)
?.setProgressMax(1)
?.setAction("Open folder", object: SnackProgressBar.OnActionClickListener {
override fun onActionClick()
{
val savingDir: File by inject(named("journalDirectory"))
val intent = Intent(Intent.ACTION_VIEW).setDataAndType(Uri.parse(savingDir.absolutePath), "resource/folder")
startActivity(intent)
snackProgressBarManager.dismissAll()
}
})
currentShowing?.also {
runOnUiThread {
snackProgressBarManager.updateTo(it)
snackProgressBarManager.setProgress(1)
}
}

I.e action button not appears and swipe to dismiss still unavailable

@tingyik90
Copy link
Owner

I have tested and the action button does appear, but swipe to dismiss was unavailable. Are you using CoordinatorLayout?

@tingyik90
Copy link
Owner

@Andrey-Morenkov I have resolved this issue. Please give 'com.github.tingyik90:snackprogressbar:1efad63355' a try. Hope that you can reply within a few days so that I can know if it solved your problem and issue as a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants