本文整理汇总了Java中ru.bartwell.exfilepicker.ExFilePicker.SortingType方法的典型用法代码示例。如果您正苦于以下问题:Java ExFilePicker.SortingType方法的具体用法?Java ExFilePicker.SortingType怎么用?Java ExFilePicker.SortingType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ru.bartwell.exfilepicker.ExFilePicker
的用法示例。
在下文中一共展示了ExFilePicker.SortingType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getComparator
import ru.bartwell.exfilepicker.ExFilePicker; //导入方法依赖的package包/类
@NonNull
public static FilesListComparator getComparator(ExFilePicker.SortingType sortingType) {
switch (sortingType) {
case NAME_DESC:
return new FilesListNameDescComparator();
case SIZE_ASC:
return new FilesListSizeAscComparator();
case SIZE_DESC:
return new FilesListSizeDescComparator();
case DATE_ASC:
return new FilesListDateAscComparator();
case DATE_DESC:
return new FilesListDateDescComparator();
default:
return new FilesListNameAscComparator();
}
}
示例2: onClick
import ru.bartwell.exfilepicker.ExFilePicker; //导入方法依赖的package包/类
@Override
public void onClick(DialogInterface dialogInterface, int which) {
ExFilePicker.SortingType sortingType = ExFilePicker.SortingType.NAME_ASC;
switch (which) {
case 1:
sortingType = ExFilePicker.SortingType.NAME_DESC;
break;
case 2:
sortingType = ExFilePicker.SortingType.SIZE_ASC;
break;
case 3:
sortingType = ExFilePicker.SortingType.SIZE_DESC;
break;
case 4:
sortingType = ExFilePicker.SortingType.DATE_ASC;
break;
case 5:
sortingType = ExFilePicker.SortingType.DATE_DESC;
break;
}
mOnSortingSelectedListener.onSortingSelected(sortingType);
}
示例3: handleIntent
import ru.bartwell.exfilepicker.ExFilePicker; //导入方法依赖的package包/类
private void handleIntent() {
Intent intent = getIntent();
mCanChooseOnlyOneItem = intent.getBooleanExtra(EXTRA_CAN_CHOOSE_ONLY_ONE_ITEM, false);
mShowOnlyExtensions = intent.getStringArrayExtra(EXTRA_SHOW_ONLY_EXTENSIONS);
mExceptExtensions = intent.getStringArrayExtra(EXTRA_EXCEPT_EXTENSIONS);
mIsNewFolderButtonDisabled = intent.getBooleanExtra(EXTRA_IS_NEW_FOLDER_BUTTON_DISABLED, false);
mIsSortButtonDisabled = intent.getBooleanExtra(EXTRA_IS_SORT_BUTTON_DISABLED, false);
mIsQuitButtonEnabled = intent.getBooleanExtra(EXTRA_IS_QUIT_BUTTON_ENABLED, false);
mChoiceType = (ExFilePicker.ChoiceType) intent.getSerializableExtra(EXTRA_CHOICE_TYPE);
mSortingType = (ExFilePicker.SortingType) intent.getSerializableExtra(EXTRA_SORTING_TYPE);
mCurrentDirectory = getStartDirectory(intent);
mUseFirstItemAsUpEnabled = intent.getBooleanExtra(EXTRA_USE_FIRST_ITEM_AS_UP_ENABLED, false);
mHideHiddenFiles = intent.getBooleanExtra(EXTRA_HIDE_HIDDEN_FILES, false);
}
示例4: setItems
import ru.bartwell.exfilepicker.ExFilePicker; //导入方法依赖的package包/类
public void setItems(@NonNull List<File> items, @NonNull ExFilePicker.SortingType sortingType) {
mSelectedItems.clear();
mItems.clear();
mItems.addAll(items);
sort(sortingType);
}
示例5: sort
import ru.bartwell.exfilepicker.ExFilePicker; //导入方法依赖的package包/类
public void sort(@NonNull ExFilePicker.SortingType sortingType) {
Collections.sort(mItems, FilesListComparatorHelper.getComparator(sortingType));
notifyDataSetChanged();
}
示例6: onSortingSelected
import ru.bartwell.exfilepicker.ExFilePicker; //导入方法依赖的package包/类
@Override
public void onSortingSelected(@NonNull ExFilePicker.SortingType sortingType) {
mSortingType = sortingType;
mAdapter.sort(mSortingType);
}
示例7: onSortingSelected
import ru.bartwell.exfilepicker.ExFilePicker; //导入方法依赖的package包/类
void onSortingSelected(ExFilePicker.SortingType sortingType);