Search in sources :

Example 21 with Snackbar

use of com.google.android.material.snackbar.Snackbar in project android-client by GenesisVision.

the class BaseFragment method showSnackbar.

public void showSnackbar(String message, View view) {
    Snackbar snack = Snackbar.make(view, message, Snackbar.LENGTH_LONG);
    ((TextView) snack.getView().findViewById(com.google.android.material.R.id.snackbar_text)).setTextColor(ThemeUtil.getColorByAttrId(getContext(), R.attr.colorTextPrimary));
    snack.getView().setBackgroundColor(ThemeUtil.getColorByAttrId(getContext(), R.attr.colorCard));
    snack.show();
}
Also used : TextView(android.widget.TextView) Snackbar(com.google.android.material.snackbar.Snackbar)

Example 22 with Snackbar

use of com.google.android.material.snackbar.Snackbar in project android-client by GenesisVision.

the class SearchActivity method showSnackbarMessage.

@Override
public void showSnackbarMessage(String message) {
    Snackbar snack = Snackbar.make(background, message, Snackbar.LENGTH_LONG);
    ((TextView) snack.getView().findViewById(com.google.android.material.R.id.snackbar_text)).setTextColor(Color.WHITE);
    snack.show();
}
Also used : TextView(android.widget.TextView) RxTextView(com.jakewharton.rxbinding.widget.RxTextView) Snackbar(com.google.android.material.snackbar.Snackbar)

Example 23 with Snackbar

use of com.google.android.material.snackbar.Snackbar in project android by nextcloud.

the class SendShareDialog method showResharingNotAllowedSnackbar.

private void showResharingNotAllowedSnackbar() {
    Snackbar snackbar = Snackbar.make(view, R.string.resharing_is_not_allowed, Snackbar.LENGTH_LONG);
    snackbar.addCallback(new Snackbar.Callback() {

        @Override
        public void onDismissed(Snackbar transientBottomBar, int event) {
            super.onDismissed(transientBottomBar, event);
            if (file.isFolder()) {
                dismiss();
            }
        }
    });
    snackbar.show();
}
Also used : Snackbar(com.google.android.material.snackbar.Snackbar)

Example 24 with Snackbar

use of com.google.android.material.snackbar.Snackbar in project android by nextcloud.

the class FileActivity method copyAndShareFileLink.

public static void copyAndShareFileLink(FileActivity activity, OCFile file, String link) {
    ClipboardUtil.copyToClipboard(activity, link, false);
    Snackbar snackbar = Snackbar.make(activity.findViewById(android.R.id.content), R.string.clipboard_text_copied, Snackbar.LENGTH_LONG).setAction(R.string.share, v -> showShareLinkDialog(activity, file, link));
    ThemeSnackbarUtils.colorSnackbar(activity, snackbar);
    snackbar.show();
}
Also used : Snackbar(com.google.android.material.snackbar.Snackbar)

Example 25 with Snackbar

use of com.google.android.material.snackbar.Snackbar in project android by nextcloud.

the class EditorWebView method onUrlLoaded.

public void onUrlLoaded(String loadedUrl) {
    this.url = loadedUrl;
    if (!url.isEmpty()) {
        this.getWebView().loadUrl(url);
        new Handler().postDelayed(() -> {
            if (this.getWebView().getVisibility() != View.VISIBLE) {
                Snackbar snackbar = DisplayUtils.createSnackbar(findViewById(android.R.id.content), R.string.timeout_richDocuments, Snackbar.LENGTH_INDEFINITE).setAction(R.string.common_back, v -> closeView());
                ThemeSnackbarUtils.colorSnackbar(getApplicationContext(), snackbar);
                setLoadingSnackbar(snackbar);
                snackbar.show();
            }
        }, 10 * 1000);
    } else {
        Toast.makeText(getApplicationContext(), R.string.richdocuments_failed_to_load_document, Toast.LENGTH_LONG).show();
        finish();
    }
}
Also used : Handler(android.os.Handler) Snackbar(com.google.android.material.snackbar.Snackbar)

Aggregations

Snackbar (com.google.android.material.snackbar.Snackbar)110 View (android.view.View)61 Intent (android.content.Intent)46 TextView (android.widget.TextView)41 AlertDialog (androidx.appcompat.app.AlertDialog)29 Context (android.content.Context)28 ImageView (android.widget.ImageView)28 LayoutInflater (android.view.LayoutInflater)24 ArrayList (java.util.ArrayList)23 RecyclerView (androidx.recyclerview.widget.RecyclerView)22 Bundle (android.os.Bundle)20 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)20 DialogInterface (android.content.DialogInterface)19 List (java.util.List)19 CreateCardView (me.ccrama.redditslide.Views.CreateCardView)18 Submission (net.dean.jraw.models.Submission)18 SubredditView (me.ccrama.redditslide.Activities.SubredditView)17 ApiException (net.dean.jraw.ApiException)17 Activity (android.app.Activity)16 OnSingleClickListener (me.ccrama.redditslide.util.OnSingleClickListener)16