当前位置: 首页>>代码示例>>Java>>正文


Java SnackbarBuilder类代码示例

本文整理汇总了Java中com.github.andrewlord1990.snackbarbuilder.SnackbarBuilder的典型用法代码示例。如果您正苦于以下问题:Java SnackbarBuilder类的具体用法?Java SnackbarBuilder怎么用?Java SnackbarBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SnackbarBuilder类属于com.github.andrewlord1990.snackbarbuilder包,在下文中一共展示了SnackbarBuilder类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: SnackBarWrapper

import com.github.andrewlord1990.snackbarbuilder.SnackbarBuilder; //导入依赖的package包/类
public SnackBarWrapper(Activity context) {
    builder = new SnackbarBuilder(context)
            .message(R.string.sbw_nuevas_localizaciones)
            .duration(Snackbar.LENGTH_INDEFINITE)
            .actionText(R.string.sbw_actualizar)
            .actionTextColorRes(R.color.blue_200);

    setRootLayout(context);
}
 
开发者ID:cahergil,项目名称:Farmacias,代码行数:10,代码来源:SnackBarWrapper.java

示例2: showMessage

import com.github.andrewlord1990.snackbarbuilder.SnackbarBuilder; //导入依赖的package包/类
public void showMessage(String message) {
    if (snackbarShowing) {
        deferMessage(message);
    }
    else {
        snackbarShowing = true;
        new SnackbarBuilder(getRootView())
            .message(message)
            .dismissCallback((snackbar, i) -> snackbarShowing = false)
            .build()
            .show();
    }
}
 
开发者ID:ZinoKader,项目名称:SpotiQ,代码行数:14,代码来源:BaseActivity.java

示例3: deferMessage

import com.github.andrewlord1990.snackbarbuilder.SnackbarBuilder; //导入依赖的package包/类
private void deferMessage(String message) {
    new Handler().postDelayed(() -> {
        snackbarShowing = true;
        new SnackbarBuilder(getRootView())
            .message(message)
            .dismissCallback((snackbar, i) -> snackbarShowing = false)
            .build()
            .show();
    }, ApplicationConstants.DEFER_SNACKBAR_DELAY);
}
 
开发者ID:ZinoKader,项目名称:SpotiQ,代码行数:11,代码来源:BaseActivity.java

示例4: finishWithSuccess

import com.github.andrewlord1990.snackbarbuilder.SnackbarBuilder; //导入依赖的package包/类
public void finishWithSuccess(String message) {
    new SnackbarBuilder(getRootView())
        .duration(Snackbar.LENGTH_SHORT)
        .message(message)
        .dismissCallback((snackbar, i) -> finish())
        .build()
        .show();
}
 
开发者ID:ZinoKader,项目名称:SpotiQ,代码行数:9,代码来源:BaseActivity.java

示例5: showMessage

import com.github.andrewlord1990.snackbarbuilder.SnackbarBuilder; //导入依赖的package包/类
public void showMessage(String message) {
    if (snackbarShowing) {
        deferMessage(message);
    }
    else {
        snackbarShowing = true;
        new SnackbarBuilder(((BaseView) getActivity()).getRootView())
            .message(message)
            .dismissCallback((snackbar, i) -> snackbarShowing = false)
            .build()
            .show();
    }
}
 
开发者ID:ZinoKader,项目名称:SpotiQ,代码行数:14,代码来源:BaseFragment.java

示例6: deferMessage

import com.github.andrewlord1990.snackbarbuilder.SnackbarBuilder; //导入依赖的package包/类
private void deferMessage(String message) {
    new Handler().postDelayed(() -> {
        snackbarShowing = true;
        new SnackbarBuilder(((BaseView) getActivity()).getRootView())
            .message(message)
            .dismissCallback((snackbar, i) -> snackbarShowing = false)
            .build()
            .show();
    }, ApplicationConstants.DEFER_SNACKBAR_DELAY);
}
 
开发者ID:ZinoKader,项目名称:SpotiQ,代码行数:11,代码来源:BaseFragment.java

示例7: finishRequest

import com.github.andrewlord1990.snackbarbuilder.SnackbarBuilder; //导入依赖的package包/类
@Override
public void finishRequest() {
    //hide bottom sheet
    bottomSheetBehavior.setHideable(true);
    bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
    binding.addFab.setVisibility(View.INVISIBLE);

    //show snackbar and finish
    new SnackbarBuilder(getRootView())
        .duration(Snackbar.LENGTH_LONG)
        .message("Requesting songs...")
        .dismissCallback((snackbar, event) -> finish())
        .build()
        .show();
}
 
开发者ID:ZinoKader,项目名称:SpotiQ,代码行数:16,代码来源:SearchActivity.java

示例8: setupFab

import com.github.andrewlord1990.snackbarbuilder.SnackbarBuilder; //导入依赖的package包/类
private void setupFab() {
  FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
  fab.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View view) {
      new SnackbarBuilder(SampleActivity.this)
          .message("Primary action pressed")
          .duration(Snackbar.LENGTH_SHORT)
          .build()
          .show();
    }
  });
}
 
开发者ID:andrewlord1990,项目名称:SnackbarBuilder,代码行数:14,代码来源:SampleActivity.java


注:本文中的com.github.andrewlord1990.snackbarbuilder.SnackbarBuilder类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。