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();
}
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();
}
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();
}
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();
}
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();
}
}
Aggregations