Skip to content

Commit

Permalink
chore: adjust the resource attribution
Browse files Browse the repository at this point in the history
- no reserved icon space in each preference item in the sub-preference page
- adjust the width of preference-widget-seekbar
  • Loading branch information
WhiredPlanck committed Jun 24, 2021
1 parent cac8efd commit aee3a4d
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 41 deletions.
2 changes: 1 addition & 1 deletion app/src/main/res/layout/preference_widget_seekbar.xml
Expand Up @@ -34,7 +34,7 @@

<SeekBar
android:id="@+id/seekbar"
android:minWidth="180dp"
android:minWidth="100dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
Expand Down
27 changes: 18 additions & 9 deletions app/src/main/res/xml/about_preference.xml
@@ -1,31 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<Preference android:key="pref_changelog" android:title="@string/pref_changelog">
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<Preference android:key="pref_changelog" android:title="@string/pref_changelog"
app:iconSpaceReserved="false">
<intent android:action="android.intent.action.VIEW"
android:data="https://github.com/osfans/trime" />
</Preference>
<Preference android:key="pref_librime_ver" android:title="@string/pref_librime_ver">
<Preference android:key="pref_librime_ver" android:title="@string/pref_librime_ver"
app:iconSpaceReserved="false">
<intent android:action="android.intent.action.VIEW"
android:data="https://github.com/rime/librime" />
</Preference>
<Preference android:key="pref_opencc_ver" android:title="@string/pref_opencc_ver">
<Preference android:key="pref_opencc_ver" android:title="@string/pref_opencc_ver"
app:iconSpaceReserved="false">
<intent android:action="android.intent.action.VIEW"
android:data="https://github.com/BYVoid/OpenCC" />
</Preference>
<Preference android:key="pref_licensing" android:title="@string/pref_licensing" android:summary="@string/pref_licensing_summary"/>
<Preference android:key="pref_pravcy" android:title="@string/pref_privacy">
<Preference android:key="pref_licensing" android:title="@string/pref_licensing" android:summary="@string/pref_licensing_summary"
app:iconSpaceReserved="false"/>
<Preference android:key="pref_pravcy" android:title="@string/pref_privacy"
app:iconSpaceReserved="false">
<intent android:action="android.intent.action.VIEW"
android:data="https://github.com/osfans/trime/blob/develop/PRIVACY.md" />
</Preference>
<Preference android:key="pref_pime" android:title="@string/pref_pime">
<Preference android:key="pref_pime" android:title="@string/pref_pime"
app:iconSpaceReserved="false">
<intent android:action="android.intent.action.VIEW"
android:data="https://github.com/osfans/PIME/releases" />
</Preference>
<Preference android:key="pref_donate" android:title="@string/pref_donate" android:summary="@string/pref_donate_summary">
<Preference android:key="pref_donate" android:title="@string/pref_donate" android:summary="@string/pref_donate_summary"
app:iconSpaceReserved="false">
<intent android:action="android.intent.action.VIEW"
android:data="https://qr.alipay.com/tsx03439zwna78hloqtm6bc" />
</Preference>
<Preference android:key="pref_credits" android:title="@string/pref_credits">
<Preference android:key="pref_credits" android:title="@string/pref_credits"
app:iconSpaceReserved="false">
<intent android:action="android.intent.action.VIEW"
android:data="https://github.com/osfans/trime/releases" />
</Preference>
Expand Down
36 changes: 26 additions & 10 deletions app/src/main/res/xml/help_preference.xml
Expand Up @@ -4,40 +4,56 @@
android:key="pref_help"
android:title="@string/pref_help">

<PreferenceCategory app:title="@string/pref_help__general_channel" app:key="pref_help__general_channel" >
<Preference android:key="pref_wiki" android:title="@string/pref_wiki">
<PreferenceCategory app:iconSpaceReserved="false"
app:title="@string/pref_help__general_channel"
app:key="pref_help__general_channel" >
<Preference android:key="pref_wiki" android:title="@string/pref_wiki"
app:iconSpaceReserved="false">
<intent android:action="android.intent.action.VIEW"
android:data="https://github.com/osfans/trime/wiki/UserGuide" />
</Preference>
<Preference android:key="pref_issues" android:title="@string/pref_issues">
<Preference android:key="pref_issues" android:title="@string/pref_issues"
app:iconSpaceReserved="false">
<intent android:action="android.intent.action.VIEW"
android:data="https://github.com/osfans/trime/issues" />
</Preference>
</PreferenceCategory>

<PreferenceCategory app:title="@string/pref_help__marketplace" app:key="pref_help__marketplace">
<Preference android:key="pref_market" android:title="@string/pref_market">
<PreferenceCategory app:iconSpaceReserved="false"
app:title="@string/pref_help__marketplace"
app:key="pref_help__marketplace">
<Preference android:key="pref_market" android:title="@string/pref_market"
app:iconSpaceReserved="false">
<intent android:action="android.intent.action.VIEW"
android:data="https://play.google.com/store/apps/details?id=com.osfans.trime" />
</Preference>
<Preference android:key="pref_coolmarket" android:title="@string/pref_coolmarket">
<Preference android:key="pref_coolmarket" android:title="@string/pref_coolmarket"
app:iconSpaceReserved="false">
<intent android:action="android.intent.action.VIEW"
android:data="https://www.coolapk.com/apk/com.osfans.trime" />
</Preference>
</PreferenceCategory>

<PreferenceCategory app:title="@string/pref_help__user_community" app:key="pref_help__user_community" >
<Preference android:key="pref_trime_qq" android:title="@string/pref_trime_qq"
<PreferenceCategory app:iconSpaceReserved="false"
app:title="@string/pref_help__user_community"
app:key="pref_help__user_community" >
<Preference android:key="pref_trime_qq"
app:iconSpaceReserved="false"
android:title="@string/pref_trime_qq"
android:summary="@string/pref_trime_qq_summary">
<intent android:action="android.intent.action.VIEW"
android:data="mqqopensdkapi://bizAgent/qm/qr?url=http%3A%2F%2Fqm.qq.com%2Fcgi-bin%2Fqm%2Fqr%3Ffrom%3Dapp%26p%3Dandroid%26k%3DzifdI0iaEYjATwYkvVzP1cjsUEWSa9Ha" />
</Preference>
<Preference android:key="pref_trime_qq2" android:title="@string/pref_trime_qq2"
<Preference android:key="pref_trime_qq2"
app:iconSpaceReserved="false"
android:title="@string/pref_trime_qq2"
android:summary="@string/pref_trime_qq2_summary">
<intent android:action="android.intent.action.VIEW"
android:data="mqqopensdkapi://bizAgent/qm/qr?url=http%3A%2F%2Fqm.qq.com%2Fcgi-bin%2Fqm%2Fqr%3Ffrom%3Dapp%26p%3Dandroid%26k%3D46XegYX4TQW366gVRKAUhTgtFYmYw7G3" />
</Preference>
<Preference android:key="pref_rime_qq" android:title="@string/pref_rime_qq"
<Preference android:key="pref_rime_qq"
app:iconSpaceReserved="false"
android:title="@string/pref_rime_qq"
android:summary="@string/pref_rime_qq_summary">
<intent android:action="android.intent.action.VIEW"
android:data="mqqopensdkapi://bizAgent/qm/qr?url=http%3A%2F%2Fqm.qq.com%2Fcgi-bin%2Fqm%2Fqr%3Ffrom%3Dapp%26p%3Dandroid%26k%3Dm505aYSeLZjOwWeMNAViWylZZDYqMrxV" />
Expand Down
43 changes: 36 additions & 7 deletions app/src/main/res/xml/input_preference.xml
@@ -1,10 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="pref_input" android:title="@string/pref_input">
<EditTextPreference android:key="shared_data_dir" android:title="@string/shared_data_dir" android:defaultValue="@string/default_shared_data_dir" />
<EditTextPreference android:key="user_data_dir" android:title="@string/user_data_dir" android:defaultValue="@string/default_user_data_dir"/>
<Preference android:key="pref_schemas" android:title="@string/pref_schemas" android:summary="@string/pref_schemas_summary"/>
<Preference android:key="pref_sync" android:title="@string/pref_sync" android:summary="@string/pref_sync_summary"/>
<SwitchPreference android:key="pref_sync_bg" android:title="@string/pref_sync_bg" android:summary="@string/pref_sync_bg_tip" android:persistent="true" />
<Preference android:key="pref_reset" android:title="@string/pref_reset" android:summary="@string/pref_reset_summary"/>
xmlns:app="http://schemas.android.com/apk/res-auto"
android:key="pref_input"
android:title="@string/pref_input">

<EditTextPreference android:key="shared_data_dir"
app:iconSpaceReserved="false"
android:title="@string/shared_data_dir"
android:defaultValue="@string/default_shared_data_dir"
app:useSimpleSummaryProvider="true"/>

<EditTextPreference android:key="user_data_dir"
app:iconSpaceReserved="false"
android:title="@string/user_data_dir"
android:defaultValue="@string/default_user_data_dir"
app:useSimpleSummaryProvider="true"/>

<Preference android:key="pref_schemas"
app:iconSpaceReserved="false"
android:title="@string/pref_schemas"
android:summary="@string/pref_schemas_summary"/>

<Preference android:key="pref_sync"
app:iconSpaceReserved="false"
android:title="@string/pref_sync"
android:summary="@string/pref_sync_summary"/>

<SwitchPreference android:key="pref_sync_bg"
app:iconSpaceReserved="false"
android:title="@string/pref_sync_bg"
android:summary="@string/pref_sync_bg_tip"
android:persistent="true" />

<Preference android:key="pref_reset"
app:iconSpaceReserved="false"
android:title="@string/pref_reset"
android:summary="@string/pref_reset_summary"/>
</PreferenceScreen>
62 changes: 50 additions & 12 deletions app/src/main/res/xml/keyboard_preference.xml
Expand Up @@ -3,59 +3,97 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:key="pref_keyboard"
android:title="@string/pref_keyboard">
<PreferenceCategory app:title="@string/pref_keyboard__appearance" app:key="pref_keyboard__appearance" >
<PreferenceCategory app:iconSpaceReserved="false"
app:title="@string/pref_keyboard__appearance"
app:key="pref_keyboard__appearance" >
<Preference android:key="pref_themes"
app:iconSpaceReserved="false"
android:title="@string/pref_themes"
android:summary="@string/pref_themes_summary" />
<Preference android:key="pref_colors"
app:iconSpaceReserved="false"
android:title="@string/pref_colors"
android:summary="@string/pref_colors_summary" />
</PreferenceCategory>

<PreferenceCategory app:title="@string/pref_keyboard__function" app:key="pref_keyboard__function" >
<ListPreference android:key="inline_preedit" android:title="@string/inline_preedit" android:entries="@array/inline_entries" android:entryValues="@array/inline_values" android:defaultValue="preview"/>
<SwitchPreference android:key="soft_cursor" android:title="@string/soft_cursor" android:defaultValue="true"/>
<SwitchPreference android:key="show_window" android:title="@string/show_window" android:defaultValue="true"/>
<SwitchPreference android:key="show_preview" android:title="@string/show_preview" android:defaultValue="false"/>
<SwitchPreference android:key="show_switches" android:title="@string/show_switches" android:defaultValue="true" />
<PreferenceCategory app:iconSpaceReserved="false"
app:title="@string/pref_keyboard__function"
app:key="pref_keyboard__function" >
<ListPreference android:key="inline_preedit"
app:iconSpaceReserved="false"
android:title="@string/inline_preedit"
android:entries="@array/inline_entries"
android:entryValues="@array/inline_values"
android:defaultValue="preview"/>
<SwitchPreference android:key="soft_cursor"
app:iconSpaceReserved="false"
android:title="@string/soft_cursor"
android:defaultValue="true"/>
<SwitchPreference android:key="show_window"
app:iconSpaceReserved="false"
android:title="@string/show_window"
android:defaultValue="true"/>
<SwitchPreference android:key="show_preview"
app:iconSpaceReserved="false"
android:title="@string/show_preview"
android:defaultValue="false"/>
<SwitchPreference android:key="show_switches"
app:iconSpaceReserved="false"
android:title="@string/show_switches"
android:defaultValue="true" />
</PreferenceCategory>

<PreferenceCategory app:title="@string/pref_keyboard__effect" app:key="pref_keyboard__effect" >
<SwitchPreference android:key="key_sound" android:title="@string/key_sound"/>
<PreferenceCategory app:iconSpaceReserved="false"
app:title="@string/pref_keyboard__effect"
app:key="pref_keyboard__effect" >
<SwitchPreference android:key="key_sound"
app:iconSpaceReserved="false"
android:title="@string/key_sound"/>
<com.osfans.trime.settings.components.SeekBarPreference
android:widgetLayout="@layout/preference_widget_seekbar"
android:key="key_sound_volume"
app:iconSpaceReserved="false"
android:title="@string/key_sound_volume"
android:max="100"
android:defaultValue="100"
android:dependency="key_sound"/>
<SwitchPreference android:key="key_vibrate" android:title="@string/key_vibrate"/>
<SwitchPreference android:key="key_vibrate"
app:iconSpaceReserved="false"
android:title="@string/key_vibrate"/>
<com.osfans.trime.settings.components.SeekBarPreference
android:widgetLayout="@layout/preference_widget_seekbar"
android:key="key_vibrate_duration"
app:iconSpaceReserved="false"
android:title="@string/key_vibrate_duration"
android:max="100"
android:defaultValue="10"
android:dependency="key_vibrate"/>
<com.osfans.trime.settings.components.SeekBarPreference
android:widgetLayout="@layout/preference_widget_seekbar"
android:key="key_vibrate_amplitude"
app:iconSpaceReserved="false"
android:title="@string/key_vibrate_amplitude"
android:max="255"
android:defaultValue="0"
android:dependency="key_vibrate"/>
<!-- <SwitchPreference android:key="key_vibrate_default_amplitude" android:title="@string/key_vibrate_default_amplitude"/>-->
<SwitchPreference android:key="speak_key" android:title="@string/speak_key"/>
<SwitchPreference android:key="speak_commit" android:title="@string/speak_commit"/>
<SwitchPreference android:key="speak_key"
app:iconSpaceReserved="false"
android:title="@string/speak_key"/>
<SwitchPreference android:key="speak_commit"
app:iconSpaceReserved="false"
android:title="@string/speak_commit"/>
<com.osfans.trime.settings.components.SeekBarPreference
android:widgetLayout="@layout/preference_widget_seekbar"
android:key="longpress_timeout"
app:iconSpaceReserved="false"
android:title="@string/longpress_timeout"
android:max="60"
android:defaultValue="20" />
<com.osfans.trime.settings.components.SeekBarPreference
android:widgetLayout="@layout/preference_widget_seekbar"
android:key="repeat_interval"
app:iconSpaceReserved="false"
android:title="@string/repeat_interval"
android:max="9"
android:defaultValue="4" />
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/res/xml/other_preference.xml
Expand Up @@ -3,12 +3,17 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<ListPreference
android:defaultValue="auto"
app:iconSpaceReserved="false"
app:entries="@array/settings_theme__entries"
app:entryValues="@array/settings_theme__values"
app:key="pref__settings_theme"
app:title="@string/pref_ui"
app:useSimpleSummaryProvider="true" />

<SwitchPreference android:key="pref_notification_icon" android:title="@string/pref_notification_icon" />
<SwitchPreference android:key="pref_destroy_on_quit" android:title="@string/pref_destroy_on_quit" />
<SwitchPreference android:key="pref_notification_icon"
app:iconSpaceReserved="false"
android:title="@string/pref_notification_icon" />
<SwitchPreference android:key="pref_destroy_on_quit"
app:iconSpaceReserved="false"
android:title="@string/pref_destroy_on_quit" />
</PreferenceScreen>

0 comments on commit aee3a4d

Please sign in to comment.