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


Java MaterialDialog.ListCallbackSingleChoice方法代码示例

本文整理汇总了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();
}
 
开发者ID:wax911,项目名称:anitrend-app,代码行数:23,代码来源:DialogManager.java

示例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();
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:18,代码来源:DialogService.java

示例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();
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:28,代码来源:DialogService.java

示例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();
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:12,代码来源:DialogService.java

示例5: getListCallbackSingleChoice

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public MaterialDialog.ListCallbackSingleChoice getListCallbackSingleChoice() {
    return listCallbackSingleChoice;
}
 
开发者ID:FranciscoJavierPRamos,项目名称:Android-FilterView,代码行数:4,代码来源:ExtraList.java

示例6: setListCallbackSingleChoice

import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
public void setListCallbackSingleChoice(MaterialDialog.ListCallbackSingleChoice listCallbackSingleChoice) {
    this.listCallbackSingleChoice = listCallbackSingleChoice;
}
 
开发者ID:FranciscoJavierPRamos,项目名称:Android-FilterView,代码行数:4,代码来源:ExtraList.java


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