Fix(folder provider): display pojav version

This allows the sort to be stable when listing pojav versions in the file app.
This commit is contained in:
Mathias-Boulay 2024-12-11 10:52:14 +01:00
parent f1cb9e60cf
commit e71be1ed64
2 changed files with 8 additions and 1 deletions

View File

@ -16,6 +16,7 @@ import android.webkit.MimeTypeMap;
import androidx.annotation.Nullable;
import net.kdt.pojavlaunch.BuildConfig;
import net.kdt.pojavlaunch.R;
import net.kdt.pojavlaunch.Tools;
@ -76,10 +77,15 @@ public class FolderProvider extends DocumentsProvider {
final MatrixCursor result = new MatrixCursor(projection != null ? projection : DEFAULT_ROOT_PROJECTION);
final String applicationName = getContext().getString(R.string.app_short_name);
String summary = BuildConfig.VERSION_NAME;
if (BuildConfig.DEBUG) {
summary = "(" + getContext().getString(R.string.generic_debug) + ") " + summary;
}
final MatrixCursor.RowBuilder row = result.newRow();
row.add(Root.COLUMN_ROOT_ID, getDocIdForFile(BASE_DIR));
row.add(Root.COLUMN_DOCUMENT_ID, getDocIdForFile(BASE_DIR));
row.add(Root.COLUMN_SUMMARY, null);
row.add(Root.COLUMN_SUMMARY, summary);
row.add(Root.COLUMN_FLAGS, Root.FLAG_SUPPORTS_CREATE | Root.FLAG_SUPPORTS_SEARCH | Root.FLAG_SUPPORTS_IS_CHILD);
row.add(Root.COLUMN_TITLE, applicationName);
row.add(Root.COLUMN_MIME_TYPES, ALL_MIME_TYPES);

View File

@ -323,6 +323,7 @@
<string name="generic_install">Install</string>
<string name="generic_apply">Apply</string>
<string name="generic_debug">Debug</string>
<string name="search_modpack_no_result">No modpacks found</string>
<string name="search_modpack_error">Failed to find modpacks</string>