From Documentation: parameter duration - either be one of the predefined lengths: LENGTH_SHORT, LENGTH_LONG, or a custom duration in milliseconds. But I can
Set the initial duration to LENGTH_INDEFINITE then set your custom duration afterwards:
Snackbar
.make(parentLayout, "Feed cat?", Snackbar.LENGTH_INDEFINITE)
.setAction("Yes", snackOnClickListener)
.setActionTextColor(Color.MAGENTA)
.setDuration(8000)
.show();
EDIT
Setting a period directly in milliseconds now works;
Snackbar
.make(parentLayout, "Feed cat?", 8000)
.setAction("Yes", snackOnClickListener)
.setActionTextColor(Color.MAGENTA)
.show();