Skip to content

feat: sort Chinese app labels by pinyin#1053

Merged
CreativeCodeCat merged 2 commits into
CodeWorksCreativeHub:mainfrom
AstronW:feat/chinese-app-list-sorting
May 25, 2026
Merged

feat: sort Chinese app labels by pinyin#1053
CreativeCodeCat merged 2 commits into
CodeWorksCreativeHub:mainfrom
AstronW:feat/chinese-app-list-sorting

Conversation

@AstronW
Copy link
Copy Markdown
Contributor

@AstronW AstronW commented May 25, 2026

Type of Change

  • Feature

Pre-Submission Checklist

  • No existing Pull Request for this change
  • Descriptive commit message
  • Self-reviewed the code
  • Comments added where necessary
  • No new warnings or errors introduced
  • Changes made in a separate branch
  • Branch named using prefix (e.g., bug/, feat/, clean/, release/)
  • All user-facing text supports localization (if applicable)
  • Updated documentation or relevant README sections (if applicable)
  • Added screenshots or demo for UI changes (if applicable)

Before Submitting Your Pull Request

  • Clear and descriptive PR title
  • Detailed summary of the changes made
  • Linked relevant issue(s) using Closes #XXXX or Fixes #XXXX (if applicable)

Summary of Changes

Adds pinyin-based sorting and section indexing for Chinese app labels only when the launcher language is Chinese, or when it follows a Chinese system language.

Key Changes

  1. Added ChineseSortHelper to centralize Chinese-specific sorting behavior.

    • Chinese sorting is only enabled when the app language is set to Chinese, or when the app follows the system language and the system language is Chinese.
    • Other app language settings keep the existing sorting behavior unchanged.
    • The helper returns null outside this narrow Chinese-language scope, so callers naturally fall back to the original label-based sorting.
  2. Updated app list sorting to use pinyin keys only in Chinese-language contexts.

    • MainViewModel.normalizeForSort() asks ChineseSortHelper.sortKey(...) for a pinyin sort key.
    • A pinyin key is only produced for Chinese-leading labels in a Chinese-language context.
    • Non-Chinese language contexts and non-Chinese-leading labels continue through the existing normalization path.
  3. Updated App Drawer section indexing to use pinyin initials only in Chinese-language contexts.

    • App list scroll mapping and the A-Z sidebar ask ChineseSortHelper.sectionKey(...) for a pinyin initial.
    • Chinese app names can appear under their pinyin initials, such as 微信 under W.
    • Pinned apps still use the existing section, and all labels outside the Chinese-language scope keep the previous first-character section behavior.

Test Information

  • MultiLauncher Version: b947f47
  • Device Name: Android Emulator
  • Android Version: Android 17 and Android 9 / API 28
  • Other Notes: Android 17 uses pinyin sorting correctly for Chinese app names. Android 9 / API 28 falls back to the existing sorting behavior correctly because ICU transliteration is only used on API 29+.

@CreativeCodeCat CreativeCodeCat merged commit 06215b2 into CodeWorksCreativeHub:main May 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants