Search in sources :

Example 41 with Snackbar

use of android.support.design.widget.Snackbar in project teaTime by ancfdy.

the class SnackbarUtils method IndefiniteSnackbar.

/**
     * 自定义时常显示Snackbar,可选预设类型
     * @param view
     * @param message
     * @param type
     * @return
     */
public static Snackbar IndefiniteSnackbar(View view, String message, int duration, int type) {
    Snackbar snackbar = Snackbar.make(view, message, Snackbar.LENGTH_INDEFINITE).setDuration(duration);
    switchType(snackbar, type);
    return snackbar;
}
Also used : Snackbar(android.support.design.widget.Snackbar)

Example 42 with Snackbar

use of android.support.design.widget.Snackbar in project JustAndroid by chinaltz.

the class AbSnackbarUtil method ShortSnackbar.

/**
     * 短显示Snackbar,自定义颜色
     *
     * @param view
     * @param message
     * @param messageColor
     * @param backgroundColor
     * @return
     */
public static Snackbar ShortSnackbar(View view, String message, int messageColor, int backgroundColor) {
    Snackbar snackbar = Snackbar.make(view, message, Snackbar.LENGTH_SHORT);
    setSnackbarColor(snackbar, messageColor, backgroundColor);
    return snackbar;
}
Also used : Snackbar(android.support.design.widget.Snackbar)

Example 43 with Snackbar

use of android.support.design.widget.Snackbar in project JustAndroid by chinaltz.

the class AbSnackbarUtil method IndefiniteSnackbar.

/**
     * 自定义时常显示Snackbar,可选预设类型
     *
     * @param view
     * @param message
     * @param type
     * @return
     */
public static Snackbar IndefiniteSnackbar(View view, String message, int duration, int type) {
    Snackbar snackbar = Snackbar.make(view, message, Snackbar.LENGTH_INDEFINITE).setDuration(duration);
    switchType(snackbar, type);
    return snackbar;
}
Also used : Snackbar(android.support.design.widget.Snackbar)

Example 44 with Snackbar

use of android.support.design.widget.Snackbar in project JustAndroid by chinaltz.

the class AbSnackbarUtil method LongSnackbar.

/**
     * 长显示Snackbar,可选预设类型
     *
     * @param view
     * @param message
     * @param type
     * @return
     */
public static Snackbar LongSnackbar(View view, String message, int type) {
    Snackbar snackbar = Snackbar.make(view, message, Snackbar.LENGTH_LONG);
    switchType(snackbar, type);
    return snackbar;
}
Also used : Snackbar(android.support.design.widget.Snackbar)

Example 45 with Snackbar

use of android.support.design.widget.Snackbar in project AgentWeb by Justson.

the class AgentWebUtils method show.

public static void show(View parent, CharSequence text, int duration, @ColorInt int textColor, @ColorInt int bgColor, CharSequence actionText, @ColorInt int actionTextColor, View.OnClickListener listener) {
    SpannableString spannableString = new SpannableString(text);
    ForegroundColorSpan colorSpan = new ForegroundColorSpan(textColor);
    spannableString.setSpan(colorSpan, 0, spannableString.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
    snackbarWeakReference = new WeakReference<>(Snackbar.make(parent, spannableString, duration));
    Snackbar snackbar = snackbarWeakReference.get();
    View view = snackbar.getView();
    view.setBackgroundColor(bgColor);
    if (actionText != null && actionText.length() > 0 && listener != null) {
        snackbar.setActionTextColor(actionTextColor);
        snackbar.setAction(actionText, listener);
    }
    snackbar.show();
}
Also used : SpannableString(android.text.SpannableString) ForegroundColorSpan(android.text.style.ForegroundColorSpan) View(android.view.View) WebView(android.webkit.WebView) 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