Skip to content

Commit 1b36ef4

Browse files
authored
refactor: polish app UI (#1840)
* refactor(drawable): not set default color tint, alpha and auto mirrored property - Update copyright - Name some icons with their default file name when created - Remove duplicate icons * refactor(ui): rename PrefMainActivty and PrefFragment to MainActivity and MainFragment * refacor(ui): reorganize code tree - Update copyright * refactor(ui): polish user interface - Rename ToolkitFragment to DeveloperFragment and navigate to it via toolbar menu - Rename OtherFragment to AdvancedSettingsFragment * refactor(ui): migrate navigation graph xml to kotlin DSL Ref: https://developer.android.com/guide/navigation/design/kotlin-dsl * refactor(ui): build app ui programmatically - Setup toolbar menu programmatically - Setup fragments via preference delegate or build manually - Rename ProfileFragment and KeyboardFragment to ProfileSettingsFragment and KeyboardSettingsFragment - Update copyright * refactor(res): remove unused resources
1 parent 5b311d2 commit 1b36ef4

File tree

99 files changed

+1731
-2280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1731
-2280
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
5959

6060
<!-- Settings activity -->
6161
<activity
62-
android:name=".ui.main.PrefMainActivity"
62+
android:name=".ui.main.MainActivity"
6363
android:exported="true"
6464
android:launchMode="singleTask" />
6565

@@ -71,7 +71,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
7171
android:name=".ui.main.LogActivity"
7272
android:exported="false"
7373
android:launchMode="singleTask"
74-
android:parentActivityName=".ui.main.PrefMainActivity" />
74+
android:parentActivityName=".ui.main.MainActivity" />
7575

7676
<activity
7777
android:name=".ui.main.ClipEditActivity"
@@ -85,11 +85,11 @@ SPDX-License-Identifier: GPL-3.0-or-later
8585

8686
<!-- Using an activity alias to disable/enable the app icon in the launcher -->
8787
<activity-alias
88-
android:name="com.osfans.trime.PrefLauncherAlias"
88+
android:name="com.osfans.trime.MainLauncherAlias"
8989
android:exported="true"
9090
android:label="@string/trime_app_name"
9191
android:launchMode="singleTask"
92-
android:targetActivity=".ui.main.PrefMainActivity">
92+
android:targetActivity=".ui.main.MainActivity">
9393
<intent-filter>
9494
<action android:name="android.intent.action.MAIN" />
9595

app/src/main/assets/shared/tongwenfeng.trime.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4044,7 +4044,7 @@ preset_keys:
40444044
Date: {label: 日期, send: function, command: date, option: " yyyy-MM-dd "}
40454045
Time: {label: 時間, send: function, command: date, option: "HH:mm:ss"} #時間: date 格式
40464046
TrimeApp: {label: 同文, send: function, command: run, option: "com.osfans.trime"} #運行程序: run 包名
4047-
TrimeCmp: {label: 同文組件, send: function, command: run, option: "com.osfans.trime/.ui.main.PrefMainActivity"} #運行程序指定組件: run 包名/組件名
4047+
TrimeCmp: {label: 同文組件, send: function, command: run, option: "com.osfans.trime/.ui.main.MainActivity"} #運行程序指定組件: run 包名/組件名
40484048
Homepage: {label: 同文主頁, send: function, command: run, option: "https://github.com/osfans/trime"} #查看網頁: run 網址
40494049
TrimeWiki: {label: Wiki, send: function, command: run, option: "https://github.com/osfans/trime/wiki/trime.yaml-詳解"}
40504050
Wiki: {label: 維基, send: function, command: run, option: "https://zh.wikipedia.org/wiki/%s"} #搜索網頁: %s或者%1$s爲當前字符

app/src/main/assets/shared/trime.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ preset_keys:
942942
ChineseDate: {label: 農曆, command: date, option: "zh_CN@calendar=chinese"} #農曆等日期(>=Android 7.0):date 語言@calendar=曆法 格式。具體參見https://developer.android.com/reference/android/icu/util/Calendar.html
943943
Time: {label: 時間, command: date, option: "HH:mm:ss"} #時間: date 格式
944944
TrimeApp: {label: 同文, command: run, option: "com.osfans.trime"} #運行程序: run 包名
945-
TrimeCmp: {label: 同文組件, command: run, option: "com.osfans.trime/.ui.main.PrefMainActivity"} #運行程序指定組件: run 包名/組件名
945+
TrimeCmp: {label: 同文組件, command: run, option: "com.osfans.trime/.ui.main.MainActivity"} #運行程序指定組件: run 包名/組件名
946946
Homepage: {label: 同文主頁, command: run, option: "https://github.com/osfans/trime"} #查看網頁: run 網址
947947
CommitHomepage: {label: 同文網址, commit: https://github.com/osfans/trime} #直接上屏
948948
Wiki: {label: 維基, command: run, option: "https://zh.wikipedia.org/wiki/%s"} #搜索網頁: %s或者%1$s爲當前字符

app/src/main/java/com/osfans/trime/TrimeApplication.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// SPDX-FileCopyrightText: 2015 - 2024 Rime community
2-
//
3-
// SPDX-License-Identifier: GPL-3.0-or-later
1+
/*
2+
* SPDX-FileCopyrightText: 2015 - 2025 Rime community
3+
* SPDX-License-Identifier: GPL-3.0-or-later
4+
*/
45

56
package com.osfans.trime
67

@@ -126,7 +127,6 @@ class TrimeApplication : Application() {
126127
}
127128
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(applicationContext)
128129
val appPrefs = AppPrefs.initDefault(sharedPreferences)
129-
appPrefs.initDefaultPreferences()
130130
// record last pid for crash logs
131131
appPrefs.internal.pid.apply {
132132
val currentPid = Process.myPid()

0 commit comments

Comments
 (0)