Skip to content

sort_files_options_array recommand #641

@max32002

Description

@max32002

String resource From:

    <string-array name="sort_files_options_array">
        <item>Name</item>
        <item>Name (Desc)</item>
        <item>Last Modified Time</item>
        <item>Last Modified Time (Desc)</item>
    </string-array>

To:

    <string-array name="sort_files_options_array">
        <item>A - Z</item>
        <item>New - Old</item>
    </string-array>

for zh-rCN:

  <string-array name="sort_files_options_array">
    <item>A - Z</item>
    <item>最新 - 最旧</item>
  </string-array>

in SortFilesDialogFragment:

    private int calculateCheckedItem() {
        switch (SettingsManager.instance().getSortFilesTypePref()) {
            case SeafItemAdapter.SORT_BY_NAME:
                if (SettingsManager.instance().getSortFilesOrderPref() == SeafItemAdapter.SORT_ORDER_ASCENDING)
                    return 0;
                break;
            case SeafItemAdapter.SORT_BY_LAST_MODIFIED_TIME:
                if (SettingsManager.instance().getSortFilesOrderPref() == SeafItemAdapter.SORT_ORDER_DESCENDING)
                    return 1;
                break;
        }
        return 0;
    }

In browserAcitivty:

    @Override
    public void onSortFileItemClick(DialogFragment dialog, int position) {
        switch (position) {
            case 0: // sort by name, ascending
                sortFiles(SeafItemAdapter.SORT_BY_NAME, SeafItemAdapter.SORT_ORDER_ASCENDING);
                break;
            case 1: // sort by name, descending
                sortFiles(SeafItemAdapter.SORT_BY_LAST_MODIFIED_TIME, SeafItemAdapter.SORT_ORDER_DESCENDING);
                break;
            default:
                return;
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions