Search in sources :

Example 66 with Snackbar

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;
}
Also used : Snackbar(android.support.design.widget.Snackbar)

Example 67 with Snackbar

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;
}
Also used : Snackbar(android.support.design.widget.Snackbar)

Example 68 with Snackbar

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;
}
Also used : Intent(android.content.Intent) CloudSetupActivity(com.battlelancer.seriesguide.backend.CloudSetupActivity) View(android.view.View) Snackbar(android.support.design.widget.Snackbar)

Example 69 with Snackbar

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();
}
Also used : TextView(android.widget.TextView) ImageView(android.widget.ImageView) View(android.view.View) CardView(android.support.v7.widget.CardView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) ListView(android.widget.ListView) Snackbar(android.support.design.widget.Snackbar)

Example 70 with Snackbar

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();
    }
}
Also used : ViewGroup(android.view.ViewGroup) Intent(android.content.Intent) View(android.view.View) WebView(android.webkit.WebView) TextView(android.widget.TextView) SuppressLint(android.annotation.SuppressLint) Snackbar(android.support.design.widget.Snackbar)

Aggregations

Snackbar (android.support.design.widget.Snackbar)102 View (android.view.View)56 TextView (android.widget.TextView)25 Intent (android.content.Intent)13 RecyclerView (android.support.v7.widget.RecyclerView)13 BaseTransientBottomBar (android.support.design.widget.BaseTransientBottomBar)10 ImageView (android.widget.ImageView)10 ViewGroup (android.view.ViewGroup)8 DialogInterface (android.content.DialogInterface)7 LayoutInflater (android.view.LayoutInflater)6 AdapterView (android.widget.AdapterView)6 LinearLayout (android.widget.LinearLayout)6 ListView (android.widget.ListView)6 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)5 AlertDialog (android.app.AlertDialog)4 Context (android.content.Context)4 Nullable (android.support.annotation.Nullable)4 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)4 File (java.io.File)4 RemindyDAO (ve.com.abicelis.remindy.database.RemindyDAO)4