Search in sources :

Example 21 with Snackbar

use of android.support.design.widget.Snackbar in project YourAppIdea by Michenux.

the class SnackbarHelper method showErrorLongMessageWithAction.

public static void showErrorLongMessageWithAction(View view, @StringRes int message, @StringRes int actionMessage, View.OnClickListener actionOnClickListener) {
    Snackbar snackbar = Snackbar.make(view, message, Snackbar.LENGTH_LONG).setAction(actionMessage, actionOnClickListener);
    snackbar.setActionTextColor(Color.RED);
    View sbView = snackbar.getView();
    TextView textView = (TextView) sbView.findViewById(org.michenux.drodrolib.R.id.snackbar_text);
    textView.setTextColor(Color.YELLOW);
    snackbar.show();
}
Also used : TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View) Snackbar(android.support.design.widget.Snackbar)

Example 22 with Snackbar

use of android.support.design.widget.Snackbar in project Weather by Sparker0i.

the class WeatherFragment method updateWeatherData.

private void updateWeatherData(final String city, final String lat, final String lon) {
    wt = new FetchWeather(getContext());
    new Thread() {

        public void run() {
            try {
                if (lat == null && lon == null) {
                    json = wt.execute(city).get();
                } else if (city == null) {
                    json = wt.execute(lat, lon).get();
                }
            } catch (InterruptedException iex) {
                Log.e("InterruptedException", "iex");
            } catch (ExecutionException eex) {
                Log.e("ExecutionException", "eex");
            }
            pd.dismiss();
            if (swipeView != null && swipeView.isRefreshing())
                swipeView.post(new Runnable() {

                    @Override
                    public void run() {
                        swipeView.setRefreshing(false);
                    }
                });
            if (json == null) {
                preferences.setCity(preferences.getLastCity());
                handler.post(new Runnable() {

                    public void run() {
                        Toast.makeText(getActivity(), getActivity().getString(R.string.place_not_found), Toast.LENGTH_LONG).show();
                        GlobalActivity.i = 1;
                        if (!preferences.getLaunched()) {
                            FirstStart();
                        } else {
                            cc = new CheckConnection(getContext());
                            if (!cc.isNetworkAvailable()) {
                                showNoInternet();
                            } else {
                                pd.dismiss();
                                showInputDialog();
                            }
                        }
                    }
                });
            } else {
                handler.post(new Runnable() {

                    public void run() {
                        preferences.setLaunched();
                        renderWeather(json);
                        Snackbar snackbar = Snackbar.make(rootView, "Loaded Weather Data", 500);
                        snackbar.show();
                        //function();
                        if (!preferences.getv3TargetShown())
                            showTargets();
                        pd.dismiss();
                        preferences.setLastCity(json.day.getName());
                        ((WeatherActivity) getActivity()).createShortcuts();
                    }
                });
            }
        }
    }.start();
}
Also used : FetchWeather(com.a5corp.weather.internet.FetchWeather) WeatherActivity(com.a5corp.weather.activity.WeatherActivity) ExecutionException(java.util.concurrent.ExecutionException) CheckConnection(com.a5corp.weather.internet.CheckConnection) Snackbar(android.support.design.widget.Snackbar)

Example 23 with Snackbar

use of android.support.design.widget.Snackbar in project Tusky by Vavassor.

the class ViewMediaFragment method doErrorDialog.

private void doErrorDialog(@StringRes int descriptionId, @StringRes int actionId, View.OnClickListener listener) {
    if (getView() != null) {
        Snackbar bar = Snackbar.make(getView(), getString(descriptionId), Snackbar.LENGTH_SHORT);
        bar.setAction(actionId, listener);
        bar.show();
    }
}
Also used : Snackbar(android.support.design.widget.Snackbar)

Example 24 with Snackbar

use of android.support.design.widget.Snackbar in project Tusky by Vavassor.

the class ComposeActivity method doErrorDialog.

private void doErrorDialog(@StringRes int descriptionId, @StringRes int actionId, View.OnClickListener listener) {
    Snackbar bar = Snackbar.make(findViewById(R.id.activity_compose), getString(descriptionId), Snackbar.LENGTH_SHORT);
    bar.setAction(actionId, listener);
    bar.show();
}
Also used : Snackbar(android.support.design.widget.Snackbar)

Example 25 with Snackbar

use of android.support.design.widget.Snackbar in project Tusky by Vavassor.

the class ReportActivity method onSendSuccess.

private void onSendSuccess() {
    Snackbar bar = Snackbar.make(anyView, getString(R.string.confirmation_reported), Snackbar.LENGTH_SHORT);
    bar.show();
    finish();
}
Also used : Snackbar(android.support.design.widget.Snackbar)

Aggregations

Snackbar (android.support.design.widget.Snackbar)94 View (android.view.View)50 TextView (android.widget.TextView)23 RecyclerView (android.support.v7.widget.RecyclerView)14 Intent (android.content.Intent)13 BaseTransientBottomBar (android.support.design.widget.BaseTransientBottomBar)9 ListView (android.widget.ListView)8 DialogInterface (android.content.DialogInterface)7 ImageView (android.widget.ImageView)7 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)5 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)5 ViewGroup (android.view.ViewGroup)5 AdapterView (android.widget.AdapterView)5 LinearLayout (android.widget.LinearLayout)5 File (java.io.File)5 ArrayList (java.util.ArrayList)5 Bitmap (android.graphics.Bitmap)4 Nullable (android.support.annotation.Nullable)4 LayoutInflater (android.view.LayoutInflater)4 RemindyDAO (ve.com.abicelis.remindy.database.RemindyDAO)4