Enable multi line snackbar option

This commit is contained in:
Dominik Schürmann 2015-02-27 23:47:15 +01:00
parent 200d4a6bb6
commit f2a9a41840
2 changed files with 6 additions and 2 deletions

View File

@ -28,7 +28,7 @@ dependencies {
compile 'com.google.zxing:core:3.0.1'
compile 'com.jpardogo.materialtabstrip:library:1.0.9'
compile 'it.neokree:MaterialNavigationDrawer:1.3.1'
compile 'com.nispok:snackbar:2.7.4'
compile 'com.nispok:snackbar:2.9.1'
compile 'com.getbase:floatingactionbutton:1.8.0'
}

View File

@ -24,6 +24,7 @@ import android.graphics.Color;
import com.nispok.snackbar.Snackbar;
import com.nispok.snackbar.Snackbar.SnackbarDuration;
import com.nispok.snackbar.SnackbarManager;
import com.nispok.snackbar.enums.SnackbarType;
import com.nispok.snackbar.listeners.ActionClickListener;
import org.sufficientlysecure.keychain.R;
@ -48,6 +49,7 @@ public class Notify {
Snackbar bar = Snackbar.with(activity)
.text(text)
.type(SnackbarType.MULTI_LINE)
.duration(SnackbarDuration.LENGTH_LONG);
switch (style) {
@ -67,7 +69,8 @@ public class Notify {
public static Showable createNotify (Activity activity, int resId, int duration, Style style) {
final Snackbar bar = Snackbar.with(activity)
.text(resId);
.text(resId)
.type(SnackbarType.MULTI_LINE);
if (duration == LENGTH_INDEFINITE) {
bar.duration(SnackbarDuration.LENGTH_INDEFINITE);
} else {
@ -104,6 +107,7 @@ public class Notify {
final Snackbar bar = Snackbar.with(activity)
.text(msg)
.actionLabel(resIdAction)
.type(SnackbarType.MULTI_LINE)
.actionListener(new ActionClickListener() {
@Override
public void onActionClicked(Snackbar snackbar) {