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