Search in sources :

Example 86 with Snackbar

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

the class SnackbarUtils 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 87 with Snackbar

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

the class SnackbarUtils 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 88 with Snackbar

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

the class SnackbarUtils method SnackbarAddView.

/**
     * 向Snackbar中添加view
     * @param snackbar
     * @param layoutId
     * @param index 新加布局在Snackbar中的位置
     */
public static void SnackbarAddView(Snackbar snackbar, int layoutId, int index) {
    View snackbarview = snackbar.getView();
    Snackbar.SnackbarLayout snackbarLayout = (Snackbar.SnackbarLayout) snackbarview;
    View add_view = LayoutInflater.from(snackbarview.getContext()).inflate(layoutId, null);
    LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
    p.gravity = Gravity.CENTER_VERTICAL;
    snackbarLayout.addView(add_view, index, p);
}
Also used : TextView(android.widget.TextView) View(android.view.View) LinearLayout(android.widget.LinearLayout) Snackbar(android.support.design.widget.Snackbar)

Example 89 with Snackbar

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

the class SnackbarUtils method SnackbarAddView.

/**
     * 向Snackbar中添加view
     * @param snackbar
     * @param layoutId
     * @param index 新加布局在Snackbar中的位置
     */
public static void SnackbarAddView(Snackbar snackbar, int layoutId, int index) {
    View snackbarview = snackbar.getView();
    Snackbar.SnackbarLayout snackbarLayout = (Snackbar.SnackbarLayout) snackbarview;
    View add_view = LayoutInflater.from(snackbarview.getContext()).inflate(layoutId, null);
    LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
    p.gravity = Gravity.CENTER_VERTICAL;
    snackbarLayout.addView(add_view, index, p);
}
Also used : TextView(android.widget.TextView) View(android.view.View) LinearLayout(android.widget.LinearLayout) Snackbar(android.support.design.widget.Snackbar)

Example 90 with Snackbar

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

the class SnackbarUtils method LongSnackbar.

/**
     * 长显示Snackbar,自定义颜色
     * @param view
     * @param message
     * @param messageColor
     * @param backgroundColor
     * @return
     */
public static Snackbar LongSnackbar(View view, String message, int messageColor, int backgroundColor) {
    Snackbar snackbar = Snackbar.make(view, message, Snackbar.LENGTH_LONG);
    setSnackbarColor(snackbar, messageColor, backgroundColor);
    return snackbar;
}
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