本文整理汇总了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);
}
示例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();
}
}
示例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);
}
示例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();
}
示例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();
}
}
示例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);
}
示例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();
}
示例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();
}
});
}