本文整理汇总了Java中com.afollestad.materialdialogs.MaterialDialog.ListCallbackSingleChoice方法的典型用法代码示例。如果您正苦于以下问题:Java MaterialDialog.ListCallbackSingleChoice方法的具体用法?Java MaterialDialog.ListCallbackSingleChoice怎么用?Java MaterialDialog.ListCallbackSingleChoice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.afollestad.materialdialogs.MaterialDialog
的用法示例。
在下文中一共展示了MaterialDialog.ListCallbackSingleChoice方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDialogSelection
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public void createDialogSelection(String title , int selection, MaterialDialog.ListCallbackSingleChoice callbackSingleChoice, MaterialDialog.SingleButtonCallback positive, int index){
new MaterialDialog.Builder(mContext)
.title(title)
.items(selection)
.typeface(Typeface.SANS_SERIF,Typeface.SANS_SERIF)
.iconRes(app_prefs.isLightTheme()?R.drawable.ic_view_list_black_24dp:R.drawable.ic_view_list_white_24dp)
.buttonRippleColorRes(R.color.colorAccent)
.positiveColorRes(R.color.colorStateBlue)
.negativeColorRes(R.color.colorStateOrange)
.theme(app_prefs.isLightTheme()?Theme.LIGHT:Theme.DARK)
.itemsCallbackSingleChoice(index, callbackSingleChoice)
.positiveText(R.string.Apply)
.neutralText(R.string.Cancel)
.onPositive(positive)
.onNeutral(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
}
})
.show();
}
示例2: getChooseCardSizeDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public static MaterialDialog getChooseCardSizeDialog(Activity activity, @StringRes int dialogTitle, String currentlySelected, MaterialDialog.ListCallbackSingleChoice callbackSingleChoice) {
int indexOfPage = 0;
String[] sizeTitles = activity.getResources().getStringArray(R.array.CardSizes);
for (int i = 0; i < sizeTitles.length; i++) {
if (sizeTitles[i].equals(currentlySelected)) {
indexOfPage = i;
break;
}
}
return getBaseThemedDialog(activity)
.title(dialogTitle)
.itemsCallbackSingleChoice(indexOfPage, callbackSingleChoice)
.items(sizeTitles)
.positiveText(R.string.done)
.build();
}
示例3: getChooseStartUpPageDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public static MaterialDialog getChooseStartUpPageDialog(Activity activity, String currentlySelectedPageTitle, MaterialDialog.ListCallbackSingleChoice listCallbackSingleChoice) {
final Settings settings = new Settings(activity);
@ArrayRes int arrayRessource = settings.isLoggedIn() ? R.array.StartupPages : R.array.StartupPagesNoLogin;
int indexOfPage = 0;
String[] androidStrings = activity.getResources().getStringArray(arrayRessource);
for (int i = 0; i < androidStrings.length; i++) {
if (androidStrings[i].equals(currentlySelectedPageTitle)) {
indexOfPage = i;
break;
}
}
return getBaseThemedDialog(activity)
.title(R.string.gen_start_page)
.items(arrayRessource)
.itemsCallbackSingleChoice(indexOfPage, listCallbackSingleChoice)
.positiveText(R.string.ok)
.negativeText(R.string.cancel)
.onNegative(new MaterialDialog.SingleButtonCallback() {
@Override
public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
dialog.dismiss();
}
})
.build();
}
示例4: getChooseChatSizeDialog
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public static MaterialDialog getChooseChatSizeDialog(Activity activity, @StringRes int dialogTitle, @ArrayRes int array, int currentSize, MaterialDialog.ListCallbackSingleChoice callbackSingleChoice) {
int indexOfPage = currentSize - 1;
String[] sizeTitles = activity.getResources().getStringArray(array);
return getBaseThemedDialog(activity)
.title(dialogTitle)
.itemsCallbackSingleChoice(indexOfPage, callbackSingleChoice)
.items(sizeTitles)
.positiveText(R.string.done)
.build();
}
示例5: getListCallbackSingleChoice
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public MaterialDialog.ListCallbackSingleChoice getListCallbackSingleChoice() {
return listCallbackSingleChoice;
}
示例6: setListCallbackSingleChoice
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public void setListCallbackSingleChoice(MaterialDialog.ListCallbackSingleChoice listCallbackSingleChoice) {
this.listCallbackSingleChoice = listCallbackSingleChoice;
}