本文整理汇总了Java中com.github.javiersantos.bottomdialogs.BottomDialog类的典型用法代码示例。如果您正苦于以下问题:Java BottomDialog类的具体用法?Java BottomDialog怎么用?Java BottomDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BottomDialog类属于com.github.javiersantos.bottomdialogs包,在下文中一共展示了BottomDialog类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPostExecute
import com.github.javiersantos.bottomdialogs.BottomDialog; //导入依赖的package包/类
@Override
protected void onPostExecute(Pair<Boolean, Boolean> connectionPair) {
Context context = contextReference.get();
if (connectionPair == null || context == null)
return;
String message = null;
String title = null;
if (connectionPair.first) {
if (!connectionPair.second) {
message = context.getResources().getString(R.string.no_afh_desc);
title = context.getResources().getString(R.string.no_afh_title);
}
} else if (!connectionPair.second) {
message = context.getResources().getString(R.string.no_internet_desc);
title = context.getResources().getString(R.string.no_internet_title);
}
if (!((Activity) context).isFinishing() && message != null) {
new BottomDialog.Builder(context)
.setTitle(title)
.setContent(message)
.setPositiveText(R.string.bottom_dialog_positive_text)
.setNegativeTextColorResource(R.color.colorAccent)
.onPositive(BottomDialog::dismiss)
.show();
}
}
示例2: sample
import com.github.javiersantos.bottomdialogs.BottomDialog; //导入依赖的package包/类
public void sample(View view) {
new BottomDialog.Builder(this)
.setTitle("Awesome!")
.setContent("Glad to see you like BottomDialogs! If you're up for it, we would really appreciate you reviewing us.")
.setPositiveText("Google Play")
.setNegativeText("Close")
.show();
}
示例3: sampleCustomView
import com.github.javiersantos.bottomdialogs.BottomDialog; //导入依赖的package包/类
public void sampleCustomView(View view) {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View customView = inflater.inflate(R.layout.bottomdialog_layout, null);
new BottomDialog.Builder(this)
.setTitle("Awesome!")
.setContent("Glad to see you like BottomDialogs! If you're up for it, we would really appreciate you reviewing us.")
.setCustomView(customView)
.setPositiveText("Google Play")
.setNegativeText("Close")
.show();
}