use of android.support.design.widget.Snackbar in project SeriesGuide by UweTrottmann.
the class BaseTopActivity method onShowAutoBackupMissingFilesWarning.
@Override
protected void onShowAutoBackupMissingFilesWarning() {
if (snackbar != null && snackbar.isShown()) {
Timber.d("NOT showing backup files warning: existing snackbar.");
return;
}
Snackbar newSnackbar = Snackbar.make(getSnackbarParentView(), R.string.autobackup_files_missing, Snackbar.LENGTH_LONG);
setUpAutoBackupSnackbar(newSnackbar);
newSnackbar.show();
snackbar = newSnackbar;
}
use of android.support.design.widget.Snackbar in project SeriesGuide by UweTrottmann.
the class BaseTopActivity method onShowAutoBackupPermissionWarning.
@Override
protected void onShowAutoBackupPermissionWarning() {
if (snackbar != null && snackbar.isShown()) {
Timber.d("NOT showing backup permission warning: existing snackbar.");
return;
}
Snackbar newSnackbar = Snackbar.make(getSnackbarParentView(), R.string.autobackup_permission_missing, Snackbar.LENGTH_INDEFINITE);
setUpAutoBackupSnackbar(newSnackbar);
newSnackbar.show();
snackbar = newSnackbar;
}
use of android.support.design.widget.Snackbar in project SeriesGuide by UweTrottmann.
the class BaseTopActivity method onShowCloudAccountWarning.
@Override
protected void onShowCloudAccountWarning() {
if (snackbar != null && snackbar.isShown()) {
Timber.d("NOT showing Cloud account warning: existing snackbar.");
return;
}
Snackbar newSnackbar = Snackbar.make(getSnackbarParentView(), R.string.hexagon_signed_out, Snackbar.LENGTH_INDEFINITE);
newSnackbar.addCallback(new Snackbar.Callback() {
@Override
public void onDismissed(Snackbar snackbar, int event) {
if (event == Snackbar.Callback.DISMISS_EVENT_SWIPE) {
// user has dismissed warning, so disable Cloud
SgApp.from(BaseTopActivity.this).getHexagonTools().setDisabled();
}
}
}).setAction(R.string.hexagon_signin, new View.OnClickListener() {
@Override
public void onClick(View v) {
// forward to cloud setup which can help fix the account issue
startActivity(new Intent(BaseTopActivity.this, CloudSetupActivity.class));
}
}).show();
snackbar = newSnackbar;
}
use of android.support.design.widget.Snackbar in project Gadgetbridge by Freeyourgadget.
the class GBDeviceAdapterv2 method showTransientSnackbar.
private void showTransientSnackbar(int resource) {
Snackbar snackbar = Snackbar.make(parent, resource, Snackbar.LENGTH_SHORT);
View snackbarView = snackbar.getView();
// change snackbar text color
int snackbarTextId = android.support.design.R.id.snackbar_text;
TextView textView = (TextView) snackbarView.findViewById(snackbarTextId);
//textView.setTextColor();
//snackbarView.setBackgroundColor(Color.MAGENTA);
snackbar.show();
}
use of android.support.design.widget.Snackbar in project FinestWebView-Android by TheFinestArtist.
the class FinestWebViewActivity method onClick.
@Override
public void onClick(View v) {
int viewId = v.getId();
if (viewId == R.id.close) {
if (rtl) {
showMenu();
} else {
exitActivity();
}
} else if (viewId == R.id.back) {
if (rtl) {
webView.goForward();
} else {
webView.goBack();
}
} else if (viewId == R.id.forward) {
if (rtl) {
webView.goBack();
} else {
webView.goForward();
}
} else if (viewId == R.id.more) {
if (rtl) {
exitActivity();
} else {
showMenu();
}
} else if (viewId == R.id.menuLayout) {
hideMenu();
} else if (viewId == R.id.menuRefresh) {
webView.reload();
hideMenu();
} else if (viewId == R.id.menuFind) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
webView.showFindDialog("", true);
hideMenu();
} else if (viewId == R.id.menuShareVia) {
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, webView.getUrl());
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, getResources().getString(stringResShareVia)));
hideMenu();
} else if (viewId == R.id.menuCopyLink) {
ClipboardManagerUtil.setText(webView.getUrl());
Snackbar snackbar = Snackbar.make(coordinatorLayout, getString(stringResCopiedToClipboard), Snackbar.LENGTH_LONG);
View snackbarView = snackbar.getView();
snackbarView.setBackgroundColor(toolbarColor);
if (snackbarView instanceof ViewGroup)
updateChildTextView((ViewGroup) snackbarView);
snackbar.show();
hideMenu();
} else if (viewId == R.id.menuOpenWith) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(webView.getUrl()));
startActivity(browserIntent);
hideMenu();
}
}
Aggregations