本文整理汇总了Java中com.afollestad.materialdialogs.MaterialDialog.setItems方法的典型用法代码示例。如果您正苦于以下问题:Java MaterialDialog.setItems方法的具体用法?Java MaterialDialog.setItems怎么用?Java MaterialDialog.setItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.afollestad.materialdialogs.MaterialDialog
的用法示例。
在下文中一共展示了MaterialDialog.setItems方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSelection
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
@Override
public void onSelection(MaterialDialog materialDialog, View view, int i, CharSequence s) {
if (canGoUp && i == 0) {
parentFolder = parentFolder.getParentFile();
if (parentFolder.getAbsolutePath().equals("/storage/emulated"))
parentFolder = parentFolder.getParentFile();
canGoUp = parentFolder.getParent() != null;
} else {
parentFolder = parentContents[canGoUp ? i - 1 : i];
canGoUp = true;
if (parentFolder.getAbsolutePath().equals("/storage/emulated"))
parentFolder = Environment.getExternalStorageDirectory();
}
if (parentFolder.isFile()) {
callback.onFileSelection(this, parentFolder);
dismiss();
} else {
parentContents = listFiles(getBuilder().mimeType, getBuilder().extensions);
MaterialDialog dialog = (MaterialDialog) getDialog();
dialog.setTitle(parentFolder.getAbsolutePath());
getArguments().putString("current_path", parentFolder.getAbsolutePath());
dialog.setItems(getContentsArray());
}
}
示例2: reload
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
private void reload() {
parentContents = listFiles();
MaterialDialog dialog = (MaterialDialog) getDialog();
dialog.setTitle(parentFolder.getAbsolutePath());
getArguments().putString("current_path", parentFolder.getAbsolutePath());
dialog.setItems((CharSequence[]) getContentsArray());
}
示例3: refreshBlacklistData
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
private void refreshBlacklistData() {
paths = BlacklistStore.getInstance(getContext()).getPaths();
MaterialDialog dialog = (MaterialDialog) getDialog();
if (dialog != null) {
String[] pathArray = new String[paths.size()];
pathArray = paths.toArray(pathArray);
dialog.setItems((CharSequence[]) pathArray);
}
}
示例4: reload
import com.afollestad.materialdialogs.MaterialDialog; //导入方法依赖的package包/类
private void reload() {
parentContents = listFiles();
MaterialDialog dialog = (MaterialDialog) getDialog();
dialog.setTitle(parentFolder.getAbsolutePath());
dialog.setItems((CharSequence[]) getContentsArray());
}