From 4ee4c59ea0cd543d57e905c7d6820e6d03f5832b Mon Sep 17 00:00:00 2001 From: KIHARA Hideto <deton@m1.interq.or.jp> Date: Sun, 26 Nov 2023 15:14:06 +0900 Subject: [PATCH 1/2] Fix patch miss --- app/src/main/res/xml/keys_flick_jp.xml | 73 +++++++++++----------- app/src/main/res/xml/keys_flick_number.xml | 73 +++++++++++----------- app/src/main/res/xml/keys_flick_voice.xml | 73 +++++++++++----------- 3 files changed, 111 insertions(+), 108 deletions(-) diff --git a/app/src/main/res/xml/keys_flick_jp.xml b/app/src/main/res/xml/keys_flick_jp.xml index 0f39871..e974dd3 100644 --- a/app/src/main/res/xml/keys_flick_jp.xml +++ b/app/src/main/res/xml/keys_flick_jp.xml @@ -1,36 +1,37 @@ -<?xml version="1.0" encoding="utf-8"?> -<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" - android:keyWidth="20%p" - android:horizontalGap="0dip" - android:verticalGap="0dip" - android:keyHeight="1px" - > - <Row> - <Key android:codes="-1" android:keyIcon="@drawable/sym_keyboard_shift" android:isSticky="true" /> - <Key android:codes="-201" android:keyLabel="あ" /> - <Key android:codes="-202" android:keyLabel="か" /> - <Key android:codes="-203" android:keyLabel="さ" /> - <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" android:isRepeatable="true" /> - </Row> - <Row> - <Key android:codes="-1001" android:keyLabel="←" android:isRepeatable="true" /> - <Key android:codes="-204" android:keyLabel="た" /> - <Key android:codes="-205" android:keyLabel="な" /> - <Key android:codes="-206" android:keyLabel="は" /> - <Key android:codes="-1002" android:keyLabel="→" android:isRepeatable="true" /> - </Row> - <Row> - <Key android:codes="-1005" android:keyLabel="カナ" /> - <Key android:codes="-207" android:keyLabel="ま" /> - <Key android:codes="-208" android:keyLabel="や" /> - <Key android:codes="-209" android:keyLabel="ら" /> - <Key android:codes="-1004" android:keyIcon="@drawable/sym_keyboard_space" /> - </Row> - <Row android:rowEdgeFlags="bottom"> - <Key android:codes="-1003" android:keyLabel="ABC" /> - <Key android:codes="-1006" android:keyLabel="小 ゛゜" /> - <Key android:codes="-210" android:keyLabel="わ" /> - <Key android:codes="-211" android:keyLabel="、。?!" /> - <Key android:codes="-1007" android:keyIcon="@drawable/sym_keyboard_return" /> - </Row> -</Keyboard> +<?xml version="1.0" encoding="utf-8"?> +<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + app:keyWidth="20%p" + app:horizontalGap="0dip" + app:verticalGap="0dip" + app:keyHeight="8%p" + > + <Row> + <Key app:codes="-1" app:keyIcon="@drawable/ic_keyboard_shift" app:isSticky="true" /> + <Key app:codes="-201" app:keyLabel="あ" /> + <Key app:codes="-202" app:keyLabel="か" /> + <Key app:codes="-203" app:keyLabel="さ" /> + <Key app:codes="-5" app:keyIcon="@drawable/ic_keyboard_backspace" app:isRepeatable="true" /> + </Row> + <Row> + <Key app:codes="-1001" app:keyIcon="@drawable/ic_keyboard_arrow_left" app:isRepeatable="true" /> + <Key app:codes="-204" app:keyLabel="た" /> + <Key app:codes="-205" app:keyLabel="な" /> + <Key app:codes="-206" app:keyLabel="は" /> + <Key app:codes="-1002" app:keyIcon="@drawable/ic_keyboard_arrow_right" app:isRepeatable="true" /> + </Row> + <Row> + <Key app:codes="-1005" app:keyLabel="カナ" /> + <Key app:codes="-207" app:keyLabel="ま" /> + <Key app:codes="-208" app:keyLabel="や" /> + <Key app:codes="-209" app:keyLabel="ら" /> + <Key app:codes="-1004" app:keyIcon="@drawable/ic_keyboard_spacebar" /> + </Row> + <Row app:rowEdgeFlags="bottom"> + <Key app:codes="-1003" app:keyLabel="ABC" /> + <Key app:codes="-1006" app:keyLabel="小 ゛゜" /> + <Key app:codes="-210" app:keyLabel="わ" /> + <Key app:codes="-211" app:keyLabel="、。?!" /> + <Key app:codes="-1007" app:keyIcon="@drawable/ic_keyboard_return" /> + </Row> +</Keyboard> diff --git a/app/src/main/res/xml/keys_flick_number.xml b/app/src/main/res/xml/keys_flick_number.xml index bfec5ed..1205a01 100644 --- a/app/src/main/res/xml/keys_flick_number.xml +++ b/app/src/main/res/xml/keys_flick_number.xml @@ -1,36 +1,37 @@ -<?xml version="1.0" encoding="utf-8"?> -<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" - android:keyWidth="20%p" - android:horizontalGap="0dip" - android:verticalGap="0dip" - android:keyHeight="1px" - > - <Row> - <Key android:codes="0" /> - <Key android:codes="49" android:keyLabel="1" /> - <Key android:codes="50" android:keyLabel="2" /> - <Key android:codes="51" android:keyLabel="3" /> - <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" android:isRepeatable="true" /> - </Row> - <Row> - <Key android:codes="-1001" android:keyLabel="←" android:isRepeatable="true" /> - <Key android:codes="52" android:keyLabel="4" /> - <Key android:codes="53" android:keyLabel="5" /> - <Key android:codes="54" android:keyLabel="6" /> - <Key android:codes="-1002" android:keyLabel="→" android:isRepeatable="true" /> - </Row> - <Row> - <Key android:codes="-1010" android:keyLabel="かな" /> - <Key android:codes="55" android:keyLabel="7" /> - <Key android:codes="56" android:keyLabel="8" /> - <Key android:codes="57" android:keyLabel="9" /> - <Key android:codes="-1004" android:keyIcon="@drawable/sym_keyboard_space" /> - </Row> - <Row android:rowEdgeFlags="bottom"> - <Key android:codes="-1003" android:keyLabel="ABC" /> - <Key android:codes="0" /> - <Key android:codes="48" android:keyLabel="0" /> - <Key android:codes="-213" android:keyLabel=",.−:" /> - <Key android:codes="-1007" android:keyIcon="@drawable/sym_keyboard_return" /> - </Row> -</Keyboard> +<?xml version="1.0" encoding="utf-8"?> +<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + app:keyWidth="20%p" + app:horizontalGap="0dip" + app:verticalGap="0dip" + app:keyHeight="8%p" + > + <Row> + <Key app:codes="0" /> + <Key app:codes="49" app:keyLabel="1" /> + <Key app:codes="50" app:keyLabel="2" /> + <Key app:codes="51" app:keyLabel="3" /> + <Key app:codes="-5" app:keyIcon="@drawable/ic_keyboard_backspace" app:isRepeatable="true" /> + </Row> + <Row> + <Key app:codes="-1001" app:keyIcon="@drawable/ic_keyboard_arrow_left" app:isRepeatable="true" /> + <Key app:codes="52" app:keyLabel="4" /> + <Key app:codes="53" app:keyLabel="5" /> + <Key app:codes="54" app:keyLabel="6" /> + <Key app:codes="-1002" app:keyIcon="@drawable/ic_keyboard_arrow_right" app:isRepeatable="true" /> + </Row> + <Row> + <Key app:codes="-1010" app:keyLabel="かな" /> + <Key app:codes="55" app:keyLabel="7" /> + <Key app:codes="56" app:keyLabel="8" /> + <Key app:codes="57" app:keyLabel="9" /> + <Key app:codes="-1004" app:keyIcon="@drawable/ic_keyboard_spacebar" /> + </Row> + <Row app:rowEdgeFlags="bottom"> + <Key app:codes="-1003" app:keyLabel="ABC" /> + <Key app:codes="0" /> + <Key app:codes="48" app:keyLabel="0" /> + <Key app:codes="-213" app:keyLabel=",.−:" /> + <Key app:codes="-1007" app:keyIcon="@drawable/ic_keyboard_return" /> + </Row> +</Keyboard> diff --git a/app/src/main/res/xml/keys_flick_voice.xml b/app/src/main/res/xml/keys_flick_voice.xml index d5cb5e5..9772b41 100644 --- a/app/src/main/res/xml/keys_flick_voice.xml +++ b/app/src/main/res/xml/keys_flick_voice.xml @@ -1,36 +1,37 @@ -<?xml version="1.0" encoding="utf-8"?> -<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" - android:keyWidth="20%p" - android:horizontalGap="0dip" - android:verticalGap="0dip" - android:keyHeight="1px" - > - <Row> - <Key android:codes="0" /> - <Key android:codes="0"/> - <Key android:codes="-1012" android:keyLabel="声" /> - <Key android:codes="0" /> - <Key android:codes="-5" android:keyIcon="@drawable/sym_keyboard_delete" android:isRepeatable="true" /> - </Row> - <Row> - <Key android:codes="-1001" android:keyLabel="←" android:isRepeatable="true" /> - <Key android:codes="44" android:keyLabel="、" /> - <Key android:codes="46" android:keyLabel="。" /> - <Key android:codes="0" /> - <Key android:codes="-1002" android:keyLabel="→" android:isRepeatable="true" /> - </Row> - <Row> - <Key android:codes="-1010" android:keyLabel="かな" /> - <Key android:codes="91" android:keyLabel="「" /> - <Key android:codes="93" android:keyLabel="」" /> - <Key android:codes="63" android:keyLabel="?"/> - <Key android:codes="-1004" android:keyIcon="@drawable/sym_keyboard_space" /> - </Row> - <Row android:rowEdgeFlags="bottom"> - <Key android:codes="-1003" android:keyLabel="ABC" /> - <Key android:codes="40" android:keyLabel="("/> - <Key android:codes="41" android:keyLabel=")" /> - <Key android:codes="33" android:keyLabel="!"/> - <Key android:codes="-1007" android:keyIcon="@drawable/sym_keyboard_return" /> - </Row> -</Keyboard> +<?xml version="1.0" encoding="utf-8"?> +<Keyboard xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + app:keyWidth="20%p" + app:horizontalGap="0dip" + app:verticalGap="0dip" + app:keyHeight="8%p" + > + <Row> + <Key app:codes="0" /> + <Key app:codes="0"/> + <Key app:codes="-1012" app:keyLabel="声" app:isSticky="true" /> + <Key app:codes="0" /> + <Key app:codes="-5" app:keyIcon="@drawable/ic_keyboard_backspace" app:isRepeatable="true" /> + </Row> + <Row> + <Key app:codes="-1001" app:keyIcon="@drawable/ic_keyboard_arrow_left" app:isRepeatable="true" /> + <Key app:codes="44" app:keyLabel="、" /> + <Key app:codes="46" app:keyLabel="。" /> + <Key app:codes="0" /> + <Key app:codes="-1002" app:keyIcon="@drawable/ic_keyboard_arrow_right" app:isRepeatable="true" /> + </Row> + <Row> + <Key app:codes="-1010" app:keyLabel="かな" /> + <Key app:codes="91" app:keyLabel="「" /> + <Key app:codes="93" app:keyLabel="」" /> + <Key app:codes="63" app:keyLabel="?"/> + <Key app:codes="-1004" app:keyIcon="@drawable/ic_keyboard_spacebar" /> + </Row> + <Row app:rowEdgeFlags="bottom"> + <Key app:codes="-1003" app:keyLabel="ABC" /> + <Key app:codes="40" app:keyLabel="("/> + <Key app:codes="41" app:keyLabel=")" /> + <Key app:codes="33" app:keyLabel="!"/> + <Key app:codes="-1007" app:keyIcon="@drawable/ic_keyboard_return" /> + </Row> +</Keyboard> From 8cbd3d3e9fce81acb13b11e78f96d94f9370fb83 Mon Sep 17 00:00:00 2001 From: KIHARA Hideto <deton@m1.interq.or.jp> Date: Sat, 10 Feb 2024 13:06:30 +0900 Subject: [PATCH 2/2] AndroidSKK 3.6 --- .gitignore | 26 +--- .idea/compiler.xml | 6 - .idea/copyright/profiles_settings.xml | 3 - .idea/deploymentTargetDropDown.xml | 17 --- .idea/encodings.xml | 6 - .idea/gradle.xml | 20 --- .idea/jarRepositories.xml | 35 ----- .idea/kotlinc.xml | 7 - .idea/modules.xml | 12 -- .idea/vcs.xml | 6 - .project | 17 --- .settings/org.eclipse.buildship.core.prefs | 2 - app/.classpath | 6 - app/.project | 23 --- app/build.gradle | 19 ++- app/src/main/AndroidManifest.xml | 2 +- .../jp/deadend/noname/skk/CandidateView.kt | 44 +++--- .../noname/skk/CandidateViewContainer.kt | 13 +- .../java/jp/deadend/noname/skk/Keyboard.kt | 3 +- .../jp/deadend/noname/skk/KeyboardView.kt | 9 +- .../jp/deadend/noname/skk/SKKDicManager.kt | 2 +- .../java/jp/deadend/noname/skk/SKKPrefs.kt | 8 ++ .../java/jp/deadend/noname/skk/SKKService.kt | 85 +++++++++--- .../deadend/noname/skk/SKKUserDictionary.kt | 4 +- .../jp/deadend/noname/skk/engine/SKKEngine.kt | 4 +- app/src/main/res/drawable/disabled_bg.xml | 7 - app/src/main/res/drawable/highlighted_bg.xml | 11 -- app/src/main/res/drawable/ic_arrow_left.xml | 2 +- app/src/main/res/drawable/ic_arrow_right.xml | 2 +- app/src/main/res/drawable/ic_close.xml | 2 +- .../res/drawable/ic_keyboard_arrow_left.xml | 2 +- .../res/drawable/ic_keyboard_arrow_right.xml | 2 +- .../res/drawable/ic_keyboard_backspace.xml | 2 +- .../main/res/drawable/ic_keyboard_return.xml | 2 +- .../main/res/drawable/ic_keyboard_shift.xml | 2 +- .../res/drawable/ic_keyboard_spacebar.xml | 2 +- app/src/main/res/drawable/key_bg.xml | 10 +- app/src/main/res/drawable/key_bg_inset.xml | 5 + app/src/main/res/drawable/popup_frame.xml | 4 +- app/src/main/res/drawable/popup_label.xml | 2 +- .../res/drawable/popup_label_highlighted.xml | 2 +- app/src/main/res/drawable/released_bg.xml | 7 - ...round.xml => suggest_scroll_button_bg.xml} | 24 +++- .../main/res/layout/activity_file_chooser.xml | 55 -------- app/src/main/res/layout/filechooser_row.xml | 7 - app/src/main/res/layout/popup_flickguide.xml | 55 ++++++-- app/src/main/res/layout/skkprefs.xml | 11 -- app/src/main/res/layout/view_candidates.xml | 5 +- app/src/main/res/values-night/colors.xml | 11 ++ app/src/main/res/values/array.xml | 10 ++ app/src/main/res/values/colors.xml | 6 +- app/src/main/res/values/strings.xml | 10 +- app/src/main/res/values/styles.xml | 6 +- app/src/main/res/xml/prefs_softkey.xml | 131 +++++++++++------- build.gradle | 4 +- gradle.properties | 2 + gradle/wrapper/gradle-wrapper.properties | 2 +- 57 files changed, 340 insertions(+), 444 deletions(-) delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/copyright/profiles_settings.xml delete mode 100644 .idea/deploymentTargetDropDown.xml delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/gradle.xml delete mode 100644 .idea/jarRepositories.xml delete mode 100644 .idea/kotlinc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .project delete mode 100644 .settings/org.eclipse.buildship.core.prefs delete mode 100644 app/.classpath delete mode 100644 app/.project delete mode 100644 app/src/main/res/drawable/disabled_bg.xml delete mode 100644 app/src/main/res/drawable/highlighted_bg.xml create mode 100644 app/src/main/res/drawable/key_bg_inset.xml delete mode 100644 app/src/main/res/drawable/released_bg.xml rename app/src/main/res/drawable/{ic_suggest_scroll_background.xml => suggest_scroll_button_bg.xml} (55%) delete mode 100644 app/src/main/res/layout/activity_file_chooser.xml delete mode 100644 app/src/main/res/layout/filechooser_row.xml delete mode 100644 app/src/main/res/layout/skkprefs.xml create mode 100644 app/src/main/res/values-night/colors.xml diff --git a/.gitignore b/.gitignore index 91b9556..0be35df 100644 --- a/.gitignore +++ b/.gitignore @@ -11,31 +11,17 @@ out/ !/gradle/wrapper/gradle-wrapper.jar local.properties -.idea/workspace.xml -.idea/libraries -.idea/.name -.idea/compiler.xml -.idea/copyright/profiles_settings.xml -.idea/encodings.xml -.idea/misc.xml -.idea/modules.xml -.idea/scopes/scope_settings.xml -.idea/dictionaries -.idea/vcs.xml -.idea/jsLibraryMappings.xml -.idea/datasources.xml -.idea/dataSources.ids -.idea/sqlDataSources.xml -.idea/dynamic.xml -.idea/uiDesigner.xml -.idea/caches -.idea/codeStyles -.idea/assetWizardSettings.xml +.idea/ .DS_Store /build /captures /app/release +/app/.project +/app/.classpath .externalNativeBuild +.project +.settings/ + /svg diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index fb7f4a8..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="CompilerConfiguration"> - <bytecodeTargetLevel target="11" /> - </component> -</project> \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf3..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ -<component name="CopyrightManager"> - <settings default="" /> -</component> \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml deleted file mode 100644 index 5f701b5..0000000 --- a/.idea/deploymentTargetDropDown.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="deploymentTargetDropDown"> - <targetSelectedWithDropDown> - <Target> - <type value="QUICK_BOOT_TARGET" /> - <deviceKey> - <Key> - <type value="VIRTUAL_DEVICE_PATH" /> - <value value="$USER_HOME$/.android/avd/Pixel_5_API_30.avd" /> - </Key> - </deviceKey> - </Target> - </targetSelectedWithDropDown> - <timeTargetWasSelectedWithDropDown value="2022-03-05T07:20:55.329847Z" /> - </component> -</project> \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="Encoding"> - <file url="PROJECT" charset="UTF-8" /> - </component> -</project> \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index a5bace0..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="GradleMigrationSettings" migrationVersion="1" /> - <component name="GradleSettings"> - <option name="linkedExternalProjectsSettings"> - <GradleProjectSettings> - <option name="testRunner" value="GRADLE" /> - <option name="distributionType" value="LOCAL" /> - <option name="externalProjectPath" value="$PROJECT_DIR$" /> - <option name="gradleJvm" value="JDK" /> - <option name="modules"> - <set> - <option value="$PROJECT_DIR$" /> - <option value="$PROJECT_DIR$/app" /> - </set> - </option> - </GradleProjectSettings> - </option> - </component> -</project> \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml deleted file mode 100644 index e2f4888..0000000 --- a/.idea/jarRepositories.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="RemoteRepositoriesConfiguration"> - <remote-repository> - <option name="id" value="central" /> - <option name="name" value="Maven Central repository" /> - <option name="url" value="https://repo1.maven.org/maven2" /> - </remote-repository> - <remote-repository> - <option name="id" value="jboss.community" /> - <option name="name" value="JBoss Community repository" /> - <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" /> - </remote-repository> - <remote-repository> - <option name="id" value="Google" /> - <option name="name" value="Google" /> - <option name="url" value="https://maven.google.com/" /> - </remote-repository> - <remote-repository> - <option name="id" value="BintrayJCenter" /> - <option name="name" value="BintrayJCenter" /> - <option name="url" value="https://jcenter.bintray.com/" /> - </remote-repository> - <remote-repository> - <option name="id" value="MavenRepo" /> - <option name="name" value="MavenRepo" /> - <option name="url" value="https://repo.maven.apache.org/maven2/" /> - </remote-repository> - <remote-repository> - <option name="id" value="Google" /> - <option name="name" value="Google" /> - <option name="url" value="https://dl.google.com/dl/android/maven2/" /> - </remote-repository> - </component> -</project> \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml deleted file mode 100644 index 5806fb3..0000000 --- a/.idea/kotlinc.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="Kotlin2JsCompilerArguments"> - <option name="sourceMapEmbedSources" /> - <option name="sourceMapPrefix" /> - </component> -</project> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index afc083f..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,12 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="ProjectModuleManager"> - <modules> - <module fileurl="file://$PROJECT_DIR$/AndroidSKK.iml" filepath="$PROJECT_DIR$/AndroidSKK.iml" /> - <module fileurl="file://$PROJECT_DIR$/.idea/modules/app/AndroidSKK.app.iml" filepath="$PROJECT_DIR$/.idea/modules/app/AndroidSKK.app.iml" /> - <module fileurl="file://$PROJECT_DIR$/.idea/modules/app/AndroidSKK.app.androidTest.iml" filepath="$PROJECT_DIR$/.idea/modules/app/AndroidSKK.app.androidTest.iml" /> - <module fileurl="file://$PROJECT_DIR$/.idea/modules/app/AndroidSKK.app.main.iml" filepath="$PROJECT_DIR$/.idea/modules/app/AndroidSKK.app.main.iml" /> - <module fileurl="file://$PROJECT_DIR$/.idea/modules/app/AndroidSKK.app.unitTest.iml" filepath="$PROJECT_DIR$/.idea/modules/app/AndroidSKK.app.unitTest.iml" /> - </modules> - </component> -</project> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="VcsDirectoryMappings"> - <mapping directory="$PROJECT_DIR$" vcs="Git" /> - </component> -</project> \ No newline at end of file diff --git a/.project b/.project deleted file mode 100644 index 6a0b276..0000000 --- a/.project +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>AndroidSKK</name> - <comment>Project AndroidSKK created by Buildship.</comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.buildship.core.gradleprojectbuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.buildship.core.gradleprojectnature</nature> - </natures> -</projectDescription> diff --git a/.settings/org.eclipse.buildship.core.prefs b/.settings/org.eclipse.buildship.core.prefs deleted file mode 100644 index e889521..0000000 --- a/.settings/org.eclipse.buildship.core.prefs +++ /dev/null @@ -1,2 +0,0 @@ -connection.project.dir= -eclipse.preferences.version=1 diff --git a/app/.classpath b/app/.classpath deleted file mode 100644 index 4a04201..0000000 --- a/app/.classpath +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/> - <classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/> - <classpathentry kind="output" path="bin/default"/> -</classpath> diff --git a/app/.project b/app/.project deleted file mode 100644 index ac485d7..0000000 --- a/app/.project +++ /dev/null @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>app</name> - <comment>Project app created by Buildship.</comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.buildship.core.gradleprojectbuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.jdt.core.javanature</nature> - <nature>org.eclipse.buildship.core.gradleprojectnature</nature> - </natures> -</projectDescription> diff --git a/app/build.gradle b/app/build.gradle index c461c38..193e89d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,14 +2,14 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' android { - compileSdkVersion 33 + compileSdk 34 defaultConfig { applicationId "jp.deadend.noname.skk" minSdkVersion 21 - targetSdkVersion 33 - versionCode 35 - versionName "3.5.1" + targetSdk 34 + versionCode 36 + versionName "3.6" } buildTypes { @@ -20,18 +20,27 @@ android { } buildFeatures { viewBinding true + buildConfig true } lint { abortOnError false } namespace 'jp.deadend.noname.skk' + + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + kotlinOptions { + jvmTarget = "17" + } } dependencies { implementation files('libs/jdbm-1.0.jar') /* implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01' */ implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.preference:preference-ktx:1.2.0' + implementation 'androidx.preference:preference-ktx:1.2.1' } repositories { mavenCentral() diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index fe4a0dd..2a8d312 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -3,7 +3,7 @@ <uses-permission android:name="android.permission.RECORD_AUDIO" /> <queries> <intent> - <action android:name="android.speech.action.RECOGNIZE_SPEECH"/> + <action android:name="android.speech.RecognitionService"/> </intent> <intent> <action android:name="com.adamrocker.android.simeji.ACTION_INTERCEPT" /> diff --git a/app/src/main/java/jp/deadend/noname/skk/CandidateView.kt b/app/src/main/java/jp/deadend/noname/skk/CandidateView.kt index 3e74729..2dead84 100644 --- a/app/src/main/java/jp/deadend/noname/skk/CandidateView.kt +++ b/app/src/main/java/jp/deadend/noname/skk/CandidateView.kt @@ -65,7 +65,7 @@ class CandidateView(context: Context, attrs: AttributeSet) : View(context, attrs init { val r = context.resources - mSelectionHighlight = ResourcesCompat.getDrawable(r, R.drawable.ic_suggest_scroll_background, null) + mSelectionHighlight = ResourcesCompat.getDrawable(r, R.drawable.suggest_scroll_button_bg, null) mSelectionHighlight?.state = intArrayOf( android.R.attr.state_enabled, android.R.attr.state_focused, @@ -90,7 +90,7 @@ class CandidateView(context: Context, attrs: AttributeSet) : View(context, attrs mGestureDetector = GestureDetector(context, object : GestureDetector.SimpleOnGestureListener() { override fun onScroll( - e1: MotionEvent, + e1: MotionEvent?, e2: MotionEvent, distanceX: Float, distanceY: Float @@ -177,8 +177,8 @@ class CandidateView(context: Context, attrs: AttributeSet) : View(context, attrs mTotalWidth = x } - override fun onDraw(canvas: Canvas?) { - if (canvas != null) super.onDraw(canvas) + override fun onDraw(canvas: Canvas) { + super.onDraw(canvas) val height = height val paint = mPaint @@ -198,31 +198,27 @@ class CandidateView(context: Context, attrs: AttributeSet) : View(context, attrs && touchX + scrollX < mWordX[i] + mWordWidth[i] && !scrolled ) { - if (canvas != null) { - canvas.translate(mWordX[i].toFloat(), 0f) - mSelectionHighlight?.setBounds(0, 0, mWordWidth[i], height) - mSelectionHighlight?.draw(canvas) - canvas.translate((-mWordX[i]).toFloat(), 0f) - } + canvas.translate(mWordX[i].toFloat(), 0f) + mSelectionHighlight?.setBounds(0, 0, mWordWidth[i], height) + mSelectionHighlight?.draw(canvas) + canvas.translate((-mWordX[i]).toFloat(), 0f) mSelectedIndex = i } - if (canvas != null) { - if (i == mChoosedIndex) { - paint.isFakeBoldText = true - paint.color = mColorRecommended - } else { - paint.color = mColorOther - } - canvas.drawText(mSuggestions[i], (mWordX[i] + X_GAP).toFloat(), y.toFloat(), paint) + if (i == mChoosedIndex) { + paint.isFakeBoldText = true + paint.color = mColorRecommended + } else { paint.color = mColorOther - canvas.drawLine( - mWordX[i].toFloat() + mWordWidth[i].toFloat() + 0.5f, 0f, - mWordX[i].toFloat() + mWordWidth[i].toFloat() + 0.5f, (height + 1).toFloat(), - paint - ) - paint.isFakeBoldText = false } + canvas.drawText(mSuggestions[i], (mWordX[i] + X_GAP).toFloat(), y.toFloat(), paint) + paint.color = mColorOther + canvas.drawLine( + mWordX[i].toFloat() + mWordWidth[i].toFloat() + 0.5f, 0f, + mWordX[i].toFloat() + mWordWidth[i].toFloat() + 0.5f, (height + 1).toFloat(), + paint + ) + paint.isFakeBoldText = false } if (scrolled && mTargetScrollX != getScrollX()) scrollToTarget() diff --git a/app/src/main/java/jp/deadend/noname/skk/CandidateViewContainer.kt b/app/src/main/java/jp/deadend/noname/skk/CandidateViewContainer.kt index 0ea2d5a..18136ae 100644 --- a/app/src/main/java/jp/deadend/noname/skk/CandidateViewContainer.kt +++ b/app/src/main/java/jp/deadend/noname/skk/CandidateViewContainer.kt @@ -44,7 +44,7 @@ class CandidateViewContainer(screen: Context, attrs: AttributeSet) : LinearLayou } fun setAlpha(alpha: Int) { - background.alpha = alpha + binding.candidates.background.alpha = alpha binding.candidateLeft.alpha = alpha / 255f binding.candidateRight.alpha = alpha / 255f binding.candidateLeft.background.alpha = alpha @@ -54,6 +54,12 @@ class CandidateViewContainer(screen: Context, attrs: AttributeSet) : LinearLayou fun setScrollButtonsEnabled(left: Boolean, right: Boolean) { binding.candidateLeft.isEnabled = left binding.candidateRight.isEnabled = right + val alphaLeft = if (left) ALPHA_ON else ALPHA_OFF + val alphaRight = if (right) ALPHA_ON else ALPHA_OFF + binding.candidateLeft.alpha = alphaLeft / 255f + binding.candidateRight.alpha = alphaRight / 255f + binding.candidateLeft.background.alpha = alphaLeft + binding.candidateRight.background.alpha = alphaRight } fun setSize(px: Int) { @@ -67,4 +73,9 @@ class CandidateViewContainer(screen: Context, attrs: AttributeSet) : LinearLayou mFontSize = px } + + companion object { + private const val ALPHA_OFF = 96 + private const val ALPHA_ON = 255 + } } diff --git a/app/src/main/java/jp/deadend/noname/skk/Keyboard.kt b/app/src/main/java/jp/deadend/noname/skk/Keyboard.kt index 28b34ba..df8f0c4 100644 --- a/app/src/main/java/jp/deadend/noname/skk/Keyboard.kt +++ b/app/src/main/java/jp/deadend/noname/skk/Keyboard.kt @@ -250,8 +250,7 @@ open class Keyboard { row.verticalGap = defaultVerticalGap row.rowEdgeFlags = EDGE_TOP or EDGE_BOTTOM val maxColumns = if (columns == -1) Int.MAX_VALUE else columns - for (i in 0 until characters.length) { - val c = characters[i] + for (c in characters) { if (column >= maxColumns || x + defaultKeyWidth + horizontalPadding > mDisplayWidth ) { diff --git a/app/src/main/java/jp/deadend/noname/skk/KeyboardView.kt b/app/src/main/java/jp/deadend/noname/skk/KeyboardView.kt index 18d865a..9fb9eff 100644 --- a/app/src/main/java/jp/deadend/noname/skk/KeyboardView.kt +++ b/app/src/main/java/jp/deadend/noname/skk/KeyboardView.kt @@ -193,9 +193,9 @@ open class KeyboardView @JvmOverloads constructor( if (mGestureDetector == null) { mGestureDetector = GestureDetector(context, object : SimpleOnGestureListener() { override fun onFling( - me1: MotionEvent, me2: MotionEvent, velocityX: Float, velocityY: Float + me1: MotionEvent?, me2: MotionEvent, velocityX: Float, velocityY: Float ): Boolean { - if (mPossiblePoly) return false + if (mPossiblePoly || me1 == null) return false val absX = abs(velocityX) val absY = abs(velocityY) val deltaX = me2.x - me1.x @@ -274,6 +274,10 @@ open class KeyboardView @JvmOverloads constructor( if (mPreviewPopup.isShowing) { mPreviewPopup.dismiss() } } + fun setKeyBackground(d: Drawable) { + mKeyBackground = d + } + override fun onClick(v: View) { dismissPopupKeyboard() } @@ -667,6 +671,7 @@ open class KeyboardView @JvmOverloads constructor( } override fun onTouchEvent(event: MotionEvent): Boolean { + if (!isEnabled) { return true } // Convert multi-pointer up/down events to single up/down events to // deal with the typical multi-pointer behavior of two-thumb typing val pointerCount = event.pointerCount diff --git a/app/src/main/java/jp/deadend/noname/skk/SKKDicManager.kt b/app/src/main/java/jp/deadend/noname/skk/SKKDicManager.kt index 7f07245..48344a3 100644 --- a/app/src/main/java/jp/deadend/noname/skk/SKKDicManager.kt +++ b/app/src/main/java/jp/deadend/noname/skk/SKKDicManager.kt @@ -253,7 +253,7 @@ class SKKDicManager : AppCompatActivity() { private fun containsName(s: String) = mDics.any { s == it.key } - private class TupleAdapter constructor( + private class TupleAdapter( context: Context, items: List<Tuple> ) : ArrayAdapter<Tuple>(context, 0, items) { diff --git a/app/src/main/java/jp/deadend/noname/skk/SKKPrefs.kt b/app/src/main/java/jp/deadend/noname/skk/SKKPrefs.kt index 867c05d..11506bc 100644 --- a/app/src/main/java/jp/deadend/noname/skk/SKKPrefs.kt +++ b/app/src/main/java/jp/deadend/noname/skk/SKKPrefs.kt @@ -43,6 +43,14 @@ class SKKPrefs(context: Context) { get() = prefs.getString(res.getString(R.string.prefkey_curve_sensitivity), null) ?: "high" set(value) = prefs.edit().putString(res.getString(R.string.prefkey_curve_sensitivity), value).apply() + var theme: String + get() = prefs.getString(res.getString(R.string.prefkey_theme), null) ?: "default" + set(value) = prefs.edit().putString(res.getString(R.string.prefkey_theme), value).apply() + + var useInset: Boolean + get() = prefs.getBoolean(res.getString(R.string.prefkey_use_inset), false) + set(value) = prefs.edit().putBoolean(res.getString(R.string.prefkey_use_inset), value).apply() + var useSoftKey: String get() = prefs.getString(res.getString(R.string.prefkey_use_softkey), null) ?: "auto" set(value) = prefs.edit().putString(res.getString(R.string.prefkey_use_softkey), value).apply() diff --git a/app/src/main/java/jp/deadend/noname/skk/SKKService.kt b/app/src/main/java/jp/deadend/noname/skk/SKKService.kt index 82c2ce1..b594aad 100644 --- a/app/src/main/java/jp/deadend/noname/skk/SKKService.kt +++ b/app/src/main/java/jp/deadend/noname/skk/SKKService.kt @@ -22,9 +22,12 @@ import android.text.InputType import android.util.Log import android.util.TypedValue import android.view.KeyEvent +import android.view.LayoutInflater import android.view.View import android.view.inputmethod.EditorInfo import android.widget.Toast +import androidx.core.content.ContextCompat +import androidx.core.content.res.ResourcesCompat import jp.deadend.noname.skk.engine.* import java.io.* @@ -76,7 +79,11 @@ class SKKService : InputMethodService() { dlog("commit user dictionary!") mEngine.commitUserDictChanges() } - COMMAND_READ_PREFS -> readPrefs() + COMMAND_READ_PREFS -> { + setInputView(onCreateInputView()) + setCandidatesView(onCreateCandidatesView()) + readPrefs() + } COMMAND_RELOAD_DICS -> mEngine.reopenDictionaries(openDictionaries()) COMMAND_SPEECH_RECOGNITION -> { mPendingInput = intent.getStringExtra(SKKSpeechRecognitionResultsList.RESULTS_KEY) @@ -184,14 +191,26 @@ class SKKService : InputMethodService() { val filter = IntentFilter(SKKMushroom.ACTION_BROADCAST) filter.addCategory(SKKMushroom.CATEGORY_BROADCAST) - registerReceiver(mMushroomReceiver, filter) - registerReceiver(mReloadReceiver, IntentFilter(ACTION_COMMAND)) + ContextCompat.registerReceiver(this, mMushroomReceiver, filter, ContextCompat.RECEIVER_NOT_EXPORTED) + ContextCompat.registerReceiver(this, mReloadReceiver, IntentFilter(ACTION_COMMAND), ContextCompat.RECEIVER_NOT_EXPORTED) mSpeechRecognizer.setRecognitionListener(object : RecognitionListener { + private fun restoreState() { + mFlickJPInputView?.let { + it.isEnabled = true + it.keyboard.keys[2].on = false // 「声」キー + it.invalidateKey(2) + } + mIsRecording = false + mHandler.postDelayed({ + mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, mStreamVolume, 0) + }, 500) + } + override fun onBeginningOfSpeech() {} override fun onBufferReceived(buffer: ByteArray?) {} override fun onEndOfSpeech() {} - override fun onError(error: Int) {} + override fun onError(error: Int) { restoreState() } override fun onEvent(eventType: Int, params: Bundle?) {} override fun onPartialResults(partialResults: Bundle?) {} override fun onReadyForSpeech(params: Bundle?) {} @@ -209,14 +228,7 @@ class SKKService : InputMethodService() { } } } - mFlickJPInputView?.let { - it.keyboard.keys[2].on = false // 「声」キー - it.invalidateKey(2) - } - mIsRecording = false - mHandler.postDelayed({ - mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, mStreamVolume, 0) - }, 500) + restoreState() } }) mAudioManager = getSystemService(Context.AUDIO_SERVICE) as AudioManager @@ -342,8 +354,20 @@ class SKKService : InputMethodService() { super.onConfigurationChanged(newConfig) } + private fun createNightModeContext(context: Context, isNightMode: Boolean): Context { + val uiModeFlag = if (isNightMode) Configuration.UI_MODE_NIGHT_YES else Configuration.UI_MODE_NIGHT_NO + val config = Configuration(context.resources.configuration) + config.uiMode = uiModeFlag or (config.uiMode and Configuration.UI_MODE_NIGHT_MASK.inv()) + return context.createConfigurationContext(config) + } + private fun createInputView() { - val context = applicationContext + val context = when (skkPrefs.theme) { + "light" -> createNightModeContext(applicationContext, false) + "dark" -> createNightModeContext(applicationContext, true) + else -> applicationContext + } + mFlickJPInputView = FlickJPKeyboardView(context, null) mFlickJPInputView?.setService(this) mQwertyInputView = QwertyKeyboardView(context, null) @@ -351,6 +375,14 @@ class SKKService : InputMethodService() { mAbbrevKeyboardView = AbbrevKeyboardView(context, null) mAbbrevKeyboardView?.setService(this) + if (skkPrefs.useInset) { + ResourcesCompat.getDrawable(context.resources, R.drawable.key_bg_inset, null)?.let { + mFlickJPInputView?.setKeyBackground(it) + mQwertyInputView?.setKeyBackground(it) + mAbbrevKeyboardView?.setKeyBackground(it) + } + } + readPrefsForInputView() } @@ -401,7 +433,7 @@ class SKKService : InputMethodService() { if (mUseSoftKeyboard || skkPrefs.useCandidatesView) { setCandidatesViewShown(true) - mCandidateViewContainer?.setAlpha(32) + mCandidateViewContainer?.setAlpha(96) } } @@ -410,14 +442,19 @@ class SKKService : InputMethodService() { * needs to be generated, like [.onCreateInputView]. */ override fun onCreateCandidatesView(): View { - val container = layoutInflater.inflate(R.layout.view_candidates, null) as CandidateViewContainer + val context = when (skkPrefs.theme) { + "light" -> createNightModeContext(applicationContext, false) + "dark" -> createNightModeContext(applicationContext, true) + else -> applicationContext + } + + val container = LayoutInflater.from(context).inflate(R.layout.view_candidates, null) as CandidateViewContainer container.initViews() val view = container.findViewById(R.id.candidates) as CandidateView view.setService(this) view.setContainer(container) mCandidateView = view - val context = applicationContext val sp = skkPrefs.candidatesSize val px = TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_SP, sp.toFloat(), context.resources.displayMetrics @@ -454,6 +491,7 @@ class SKKService : InputMethodService() { mEngine.commitUserDictChanges() unregisterReceiver(mMushroomReceiver) unregisterReceiver(mReloadReceiver) + mSpeechRecognizer.destroy() super.onDestroy() } @@ -712,24 +750,27 @@ class SKKService : InputMethodService() { fun recognizeSpeech() { if (mIsRecording) { - mSpeechRecognizer.stopListening() +// mSpeechRecognizer.stopListening() return } - mIsRecording = true mStreamVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC) mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0) val intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH) intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM) - intent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE, this.packageName) - intent.putExtra(RecognizerIntent.EXTRA_PARTIAL_RESULTS, false) intent.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 5) mSpeechRecognizer.startListening(intent) + mFlickJPInputView?.let { + it.keyboard.keys[2].on = true // 「声」キー + it.invalidateKey(2) + it.isEnabled = false + } + mIsRecording = true } fun setCandidates(list: List<String>?) { if (list != null) { - mCandidateView?.setContents(list) mCandidateViewContainer?.setAlpha(255) + mCandidateView?.setContents(list) } } @@ -739,7 +780,7 @@ class SKKService : InputMethodService() { fun clearCandidatesView() { mCandidateView?.setContents(listOf()) - mCandidateViewContainer?.setAlpha(32) + mCandidateViewContainer?.setAlpha(96) } // カーソル直前に引数と同じ文字列があるなら,それを消してtrue なければfalse diff --git a/app/src/main/java/jp/deadend/noname/skk/SKKUserDictionary.kt b/app/src/main/java/jp/deadend/noname/skk/SKKUserDictionary.kt index 57bc9e7..7332316 100644 --- a/app/src/main/java/jp/deadend/noname/skk/SKKUserDictionary.kt +++ b/app/src/main/java/jp/deadend/noname/skk/SKKUserDictionary.kt @@ -15,7 +15,7 @@ class SKKUserDictionary private constructor ( private var mOldKey: String = "" private var mOldValue: String = "" - class Entry(val candidates: MutableList<String>, val okuri_blocks: MutableList<Pair<String, String>>) + class Entry(val candidates: MutableList<String>, val okuriBlocks: MutableList<Pair<String, String>>) fun getEntry(key: String): Entry? { val cd = mutableListOf<String>() @@ -71,7 +71,7 @@ class SKKUserDictionary private constructor ( val okrs = mutableListOf<Pair<String, String>>() if (okuri != null) { var matched = false - for (pair in entry.okuri_blocks) { + for (pair in entry.okuriBlocks) { if (pair.first == okuri && pair.second == value) { okrs.add(0, pair) matched = true diff --git a/app/src/main/java/jp/deadend/noname/skk/engine/SKKEngine.kt b/app/src/main/java/jp/deadend/noname/skk/engine/SKKEngine.kt index 665ead6..5970ec6 100644 --- a/app/src/main/java/jp/deadend/noname/skk/engine/SKKEngine.kt +++ b/app/src/main/java/jp/deadend/noname/skk/engine/SKKEngine.kt @@ -503,7 +503,7 @@ class SKKEngine( } mUserDict.addEntry(regInfo.key, regEntryStr, regInfo.okurigana) mUserDict.commitChanges() - if (regInfo.okurigana == null || regInfo.okurigana.isEmpty()) { + if (regInfo.okurigana.isNullOrEmpty()) { commitTextSKK(regInfo.entry, 1) } else { commitTextSKK(regInfo.entry.append(regInfo.okurigana), 1) @@ -544,7 +544,7 @@ class SKKEngine( for (s in list2) { when { mOkurigana == null - || entry.okuri_blocks.any { it.first == mOkurigana && it.second == s } -> { + || entry.okuriBlocks.any { it.first == mOkurigana && it.second == s } -> { //個人辞書の候補を先頭に追加 list1.remove(s) list1.add(idx, s) diff --git a/app/src/main/res/drawable/disabled_bg.xml b/app/src/main/res/drawable/disabled_bg.xml deleted file mode 100644 index 640cfae..0000000 --- a/app/src/main/res/drawable/disabled_bg.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle" > - <corners android:radius="1dp" /> - <solid android:color="#FF909090" /> - <stroke android:width="1dp" android:color="#FF707070" /> -</shape> diff --git a/app/src/main/res/drawable/highlighted_bg.xml b/app/src/main/res/drawable/highlighted_bg.xml deleted file mode 100644 index 5ffc260..0000000 --- a/app/src/main/res/drawable/highlighted_bg.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle" > - <corners android:radius="1dp" /> - <gradient - android:angle="90" - android:startColor="#FFE8A000" - android:centerColor="#FFFFC600" - android:endColor="#FFE8A000" /> - <stroke android:width="1dp" android:color="#FFD0D0D0" /> -</shape> diff --git a/app/src/main/res/drawable/ic_arrow_left.xml b/app/src/main/res/drawable/ic_arrow_left.xml index 627c2d3..51f4536 100644 --- a/app/src/main/res/drawable/ic_arrow_left.xml +++ b/app/src/main/res/drawable/ic_arrow_left.xml @@ -1,5 +1,5 @@ <vector android:autoMirrored="true" android:height="48dp" - android:tint="#000000" android:viewportHeight="24" + android:tint="@color/key_char_color" android:viewportHeight="24" android:viewportWidth="24" android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M14,7l-5,5 5,5V7z"/> </vector> diff --git a/app/src/main/res/drawable/ic_arrow_right.xml b/app/src/main/res/drawable/ic_arrow_right.xml index 2ef8f22..ef8e02f 100644 --- a/app/src/main/res/drawable/ic_arrow_right.xml +++ b/app/src/main/res/drawable/ic_arrow_right.xml @@ -1,5 +1,5 @@ <vector android:autoMirrored="true" android:height="48dp" - android:tint="#000000" android:viewportHeight="24" + android:tint="@color/key_char_color" android:viewportHeight="24" android:viewportWidth="24" android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M10,17l5,-5 -5,-5v10z"/> </vector> diff --git a/app/src/main/res/drawable/ic_close.xml b/app/src/main/res/drawable/ic_close.xml index 844b6b6..7e56554 100644 --- a/app/src/main/res/drawable/ic_close.xml +++ b/app/src/main/res/drawable/ic_close.xml @@ -1,4 +1,4 @@ -<vector android:height="24dp" android:tint="#000000" +<vector android:height="24dp" android:tint="@color/key_char_color" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/> diff --git a/app/src/main/res/drawable/ic_keyboard_arrow_left.xml b/app/src/main/res/drawable/ic_keyboard_arrow_left.xml index 4ec3fb1..d545fab 100644 --- a/app/src/main/res/drawable/ic_keyboard_arrow_left.xml +++ b/app/src/main/res/drawable/ic_keyboard_arrow_left.xml @@ -1,5 +1,5 @@ <vector android:autoMirrored="true" android:height="36dp" - android:tint="#000000" android:viewportHeight="24" + android:tint="@color/key_char_color" android:viewportHeight="24" android:viewportWidth="24" android:width="36dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M15.41,16.59L10.83,12l4.58,-4.59L14,6l-6,6 6,6 1.41,-1.41z"/> </vector> diff --git a/app/src/main/res/drawable/ic_keyboard_arrow_right.xml b/app/src/main/res/drawable/ic_keyboard_arrow_right.xml index ee19184..fe631d6 100644 --- a/app/src/main/res/drawable/ic_keyboard_arrow_right.xml +++ b/app/src/main/res/drawable/ic_keyboard_arrow_right.xml @@ -1,5 +1,5 @@ <vector android:autoMirrored="true" android:height="36dp" - android:tint="#000000" android:viewportHeight="24" + android:tint="@color/key_char_color" android:viewportHeight="24" android:viewportWidth="24" android:width="36dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M8.59,16.59L13.17,12 8.59,7.41 10,6l6,6 -6,6 -1.41,-1.41z"/> </vector> diff --git a/app/src/main/res/drawable/ic_keyboard_backspace.xml b/app/src/main/res/drawable/ic_keyboard_backspace.xml index ab1b489..ad79ffc 100644 --- a/app/src/main/res/drawable/ic_keyboard_backspace.xml +++ b/app/src/main/res/drawable/ic_keyboard_backspace.xml @@ -1,5 +1,5 @@ <vector android:autoMirrored="true" android:height="24dp" - android:tint="#000000" android:viewportHeight="24" + android:tint="@color/key_char_color" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M22,3L7,3c-0.69,0 -1.23,0.35 -1.59,0.88L0,12l5.41,8.11c0.36,0.53 0.9,0.89 1.59,0.89h15c1.1,0 2,-0.9 2,-2L24,5c0,-1.1 -0.9,-2 -2,-2zM19,15.59L17.59,17 14,13.41 10.41,17 9,15.59 12.59,12 9,8.41 10.41,7 14,10.59 17.59,7 19,8.41 15.41,12 19,15.59z"/> </vector> diff --git a/app/src/main/res/drawable/ic_keyboard_return.xml b/app/src/main/res/drawable/ic_keyboard_return.xml index 62e3c8e..ac9d8a2 100644 --- a/app/src/main/res/drawable/ic_keyboard_return.xml +++ b/app/src/main/res/drawable/ic_keyboard_return.xml @@ -1,5 +1,5 @@ <vector android:autoMirrored="true" android:height="36dp" - android:tint="#000000" android:viewportHeight="24" + android:tint="@color/key_char_color" android:viewportHeight="24" android:viewportWidth="24" android:width="36dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M19,7v4H5.83l3.58,-3.59L8,6l-6,6 6,6 1.41,-1.41L5.83,13H21V7z"/> </vector> diff --git a/app/src/main/res/drawable/ic_keyboard_shift.xml b/app/src/main/res/drawable/ic_keyboard_shift.xml index b9950af..aa61e5d 100644 --- a/app/src/main/res/drawable/ic_keyboard_shift.xml +++ b/app/src/main/res/drawable/ic_keyboard_shift.xml @@ -1,4 +1,4 @@ -<vector android:height="24dp" android:tint="#000000" +<vector android:height="24dp" android:tint="@color/key_char_color" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8s8,3.59 8,8S16.41,20 12,20M12,22c5.52,0 10,-4.48 10,-10c0,-5.52 -4.48,-10 -10,-10C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22L12,22zM11,12l0,4h2l0,-4h3l-4,-4l-4,4H11z"/> diff --git a/app/src/main/res/drawable/ic_keyboard_spacebar.xml b/app/src/main/res/drawable/ic_keyboard_spacebar.xml index 34f1b51..1db41af 100644 --- a/app/src/main/res/drawable/ic_keyboard_spacebar.xml +++ b/app/src/main/res/drawable/ic_keyboard_spacebar.xml @@ -1,4 +1,4 @@ -<vector android:height="36dp" android:tint="#000000" +<vector android:height="36dp" android:tint="@color/key_char_color" android:viewportHeight="24" android:viewportWidth="24" android:width="36dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="@android:color/white" android:pathData="M18,9v4H6V9H4v6h16V9z"/> diff --git a/app/src/main/res/drawable/key_bg.xml b/app/src/main/res/drawable/key_bg.xml index 9021779..b319564 100644 --- a/app/src/main/res/drawable/key_bg.xml +++ b/app/src/main/res/drawable/key_bg.xml @@ -2,14 +2,16 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true"> <shape android:shape="rectangle"> - <solid android:color="#00E2FF" /> - <stroke android:width="1dp" android:color="#FFDDDDDD" /> + <corners android:radius="2dp" /> + <solid android:color="@color/key_checked_color" /> + <stroke android:width="1dp" android:color="@color/key_stroke_color" /> </shape> </item> <item> <shape android:shape="rectangle"> - <solid android:color="#FFEEEEEE" /> - <stroke android:width="1dp" android:color="#FFDDDDDD" /> + <corners android:radius="2dp" /> + <solid android:color="@color/key_background_color" /> + <stroke android:width="1dp" android:color="@color/key_stroke_color" /> </shape> </item> </selector> \ No newline at end of file diff --git a/app/src/main/res/drawable/key_bg_inset.xml b/app/src/main/res/drawable/key_bg_inset.xml new file mode 100644 index 0000000..c82277e --- /dev/null +++ b/app/src/main/res/drawable/key_bg_inset.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<inset xmlns:android="http://schemas.android.com/apk/res/android" + android:inset="3dp" + android:drawable="@drawable/key_bg" + /> diff --git a/app/src/main/res/drawable/popup_frame.xml b/app/src/main/res/drawable/popup_frame.xml index 2ab9c26..da08b22 100644 --- a/app/src/main/res/drawable/popup_frame.xml +++ b/app/src/main/res/drawable/popup_frame.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="4dp" /> - <solid android:color="#FFDDDDDD" /> - <stroke android:width="2dp" android:color="#FFB0B0B0" /> + <solid android:color="@color/key_background_color" /> + <stroke android:width="2dp" android:color="@color/key_stroke_color" /> </shape> diff --git a/app/src/main/res/drawable/popup_label.xml b/app/src/main/res/drawable/popup_label.xml index 37e7544..3f80745 100644 --- a/app/src/main/res/drawable/popup_label.xml +++ b/app/src/main/res/drawable/popup_label.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="2dp" /> - <solid android:color="#FFDDDDDD" /> + <solid android:color="@color/key_background_color" /> </shape> diff --git a/app/src/main/res/drawable/popup_label_highlighted.xml b/app/src/main/res/drawable/popup_label_highlighted.xml index 3aeadfe..188ad4b 100644 --- a/app/src/main/res/drawable/popup_label_highlighted.xml +++ b/app/src/main/res/drawable/popup_label_highlighted.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:radius="2dp" /> - <solid android:color="#FF00F0FF" /> + <solid android:color="@color/key_checked_color" /> </shape> diff --git a/app/src/main/res/drawable/released_bg.xml b/app/src/main/res/drawable/released_bg.xml deleted file mode 100644 index b9d076e..0000000 --- a/app/src/main/res/drawable/released_bg.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle" > - <corners android:radius="1dp" /> - <solid android:color="#FFEFEFEF" /> - <stroke android:width="1dp" android:color="#FFB0B0B0" /> -</shape> diff --git a/app/src/main/res/drawable/ic_suggest_scroll_background.xml b/app/src/main/res/drawable/suggest_scroll_button_bg.xml similarity index 55% rename from app/src/main/res/drawable/ic_suggest_scroll_background.xml rename to app/src/main/res/drawable/suggest_scroll_button_bg.xml index f6927c2..0df6a9f 100644 --- a/app/src/main/res/drawable/ic_suggest_scroll_background.xml +++ b/app/src/main/res/drawable/suggest_scroll_button_bg.xml @@ -15,10 +15,22 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_enabled="false" - android:drawable="@drawable/disabled_bg" /> - <item android:state_pressed="false" - android:drawable="@drawable/released_bg" /> - <item android:state_pressed="true" - android:drawable="@drawable/highlighted_bg" /> + <item android:state_pressed="false"> + <shape android:shape="rectangle" > + <corners android:radius="1dp" /> + <solid android:color="@color/key_background_color" /> + <stroke android:width="1dp" android:color="@color/key_stroke_color" /> + </shape> + </item> + <item android:state_pressed="true"> + <shape android:shape="rectangle" > + <corners android:radius="1dp" /> + <gradient + android:angle="90" + android:startColor="#FFE8A000" + android:centerColor="#FFFFC600" + android:endColor="#FFE8A000" /> + <stroke android:width="1dp" android:color="#FFD0D0D0" /> + </shape> + </item> </selector> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_file_chooser.xml b/app/src/main/res/layout/activity_file_chooser.xml deleted file mode 100644 index 9585463..0000000 --- a/app/src/main/res/layout/activity_file_chooser.xml +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:orientation="vertical" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - > - <TextView - android:id="@+id/textViewDirName" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:maxLines="1" - android:textStyle="bold" - android:layout_marginBottom="2dip" - /> - <ListView - android:id="@+id/listView" - android:layout_width="fill_parent" - android:layout_height="0dip" - android:scrollbars="vertical" - android:layout_weight="1" - android:clickable="true" - android:focusableInTouchMode="true" - /> - <EditText - android:id="@+id/editTextFileName" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:maxLines="1" - android:focusable="true" - android:inputType="text" - android:layout_marginBottom="2dip" - /> - <LinearLayout - android:orientation="horizontal" - android:layout_gravity="center_horizontal" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - > - <Button - android:id="@+id/buttonCancel" - android:layout_weight="1" - android:layout_width="0dip" - android:layout_height="wrap_content" - android:text="@android:string/cancel" - /> - <Button - android:id="@+id/buttonOK" - android:layout_weight="1" - android:layout_width="0dip" - android:layout_height="wrap_content" - android:text="@android:string/ok" - android:layout_gravity="center_horizontal" - /> - </LinearLayout> -</LinearLayout> diff --git a/app/src/main/res/layout/filechooser_row.xml b/app/src/main/res/layout/filechooser_row.xml deleted file mode 100644 index e898229..0000000 --- a/app/src/main/res/layout/filechooser_row.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<TextView xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:paddingBottom="2dp" - android:paddingTop="2dp" -/> diff --git a/app/src/main/res/layout/popup_flickguide.xml b/app/src/main/res/layout/popup_flickguide.xml index f563cb4..e8bab7c 100644 --- a/app/src/main/res/layout/popup_flickguide.xml +++ b/app/src/main/res/layout/popup_flickguide.xml @@ -6,9 +6,10 @@ android:layout_height="120dp" > <TextView android:id="@+id/labelA" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="22sp" android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="24sp" @@ -17,9 +18,10 @@ /> <TextView android:id="@+id/labelI" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="22sp" android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="24sp" @@ -29,9 +31,10 @@ /> <TextView android:id="@+id/labelU" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="22sp" android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="24sp" @@ -41,9 +44,10 @@ /> <TextView android:id="@+id/labelE" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="22sp" android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="24sp" @@ -53,9 +57,10 @@ /> <TextView android:id="@+id/labelO" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="22sp" android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="24sp" @@ -65,8 +70,10 @@ /> <TextView android:id="@+id/labelLeftA" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="12sp" + android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="16sp" @@ -76,8 +83,10 @@ /> <TextView android:id="@+id/labelRightA" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="12sp" + android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="16sp" @@ -87,8 +96,10 @@ /> <TextView android:id="@+id/labelLeftI" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="12sp" + android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="16sp" @@ -98,8 +109,10 @@ /> <TextView android:id="@+id/labelRightI" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="12sp" + android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="16sp" @@ -109,8 +122,10 @@ /> <TextView android:id="@+id/labelLeftU" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="12sp" + android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="16sp" @@ -120,8 +135,10 @@ /> <TextView android:id="@+id/labelRightU" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="12sp" + android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="16sp" @@ -131,8 +148,10 @@ /> <TextView android:id="@+id/labelLeftE" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="12sp" + android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="16sp" @@ -142,8 +161,10 @@ /> <TextView android:id="@+id/labelRightE" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="12sp" + android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="16sp" @@ -153,8 +174,10 @@ /> <TextView android:id="@+id/labelLeftO" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="12sp" + android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="16sp" @@ -164,8 +187,10 @@ /> <TextView android:id="@+id/labelRightO" - android:textColor="#FF000000" + android:textColor="@color/key_char_color" android:textSize="12sp" + android:includeFontPadding="false" + android:fallbackLineSpacing="false" android:gravity="center" android:background="@drawable/popup_label" android:layout_width="16sp" diff --git a/app/src/main/res/layout/skkprefs.xml b/app/src/main/res/layout/skkprefs.xml deleted file mode 100644 index 748116b..0000000 --- a/app/src/main/res/layout/skkprefs.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/content_frame" - android:orientation="vertical" - android:layout_width="match_parent" - android:layout_height="match_parent"> - <ListView - android:id="@android:id/list" - android:layout_width="match_parent" - android:layout_height="wrap_content" /> -</LinearLayout> diff --git a/app/src/main/res/layout/view_candidates.xml b/app/src/main/res/layout/view_candidates.xml index 331b4f9..d487a14 100644 --- a/app/src/main/res/layout/view_candidates.xml +++ b/app/src/main/res/layout/view_candidates.xml @@ -23,11 +23,10 @@ android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:background="@drawable/released_bg" > <ImageButton android:id="@+id/candidate_left" - android:background="@drawable/ic_suggest_scroll_background" + android:background="@drawable/suggest_scroll_button_bg" android:src="@drawable/ic_arrow_left" android:layout_width="@dimen/candidates_scrollbutton_width" android:layout_height="fill_parent" @@ -41,7 +40,7 @@ /> <ImageButton android:id="@+id/candidate_right" - android:background="@drawable/ic_suggest_scroll_background" + android:background="@drawable/suggest_scroll_button_bg" android:src="@drawable/ic_arrow_right" android:layout_width="@dimen/candidates_scrollbutton_width" android:layout_height="fill_parent" diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml new file mode 100644 index 0000000..fb06f59 --- /dev/null +++ b/app/src/main/res/values-night/colors.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="candidate_normal">#FF000000</color> + <color name="candidate_recommended">#F9A825</color> + <color name="candidate_other">#BBEEEEEE</color> + <color name="candidate_background">#FF6E6E6E</color> + <color name="key_background_color">#FF555555</color> + <color name="key_stroke_color">#FF222222</color> + <color name="key_checked_color">#FF283593</color> + <color name="key_char_color">#FFFFFFFF</color> +</resources> \ No newline at end of file diff --git a/app/src/main/res/values/array.xml b/app/src/main/res/values/array.xml index cd075ff..56440fd 100644 --- a/app/src/main/res/values/array.xml +++ b/app/src/main/res/values/array.xml @@ -40,4 +40,14 @@ <item>mid</item> <item>low</item> </string-array> + <string-array name="theme_entries"> + <item>システム設定</item> + <item>ライト</item> + <item>ダーク</item> + </string-array> + <string-array name="theme_values"> + <item>default</item> + <item>light</item> + <item>dark</item> + </string-array> </resources> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 1e00738..9a25ced 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -21,5 +21,9 @@ <color name="candidate_normal">#FF000000</color> <color name="candidate_recommended">#FFE35900</color> <color name="candidate_other">#ff808080</color> - <color name="candidate_background">#bbffffff</color> + <color name="candidate_background">#FFE6E6E6</color> + <color name="key_background_color">#FFEBEBEB</color> + <color name="key_stroke_color">#FFC8C8C8</color> + <color name="key_checked_color">#FF00E2FF</color> + <color name="key_char_color">#FF000000</color> </resources> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a35942a..7a67ff6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -18,13 +18,6 @@ <string name="label_dicmanager_input_name">辞書の名前を入力</string> <string name="label_dicmanager_reset">辞書を初期化</string> - <string name="label_filechooser_save_as">名前をつけて保存</string> - <string name="label_filechooser_open">ファイルを開く</string> - <string name="label_filechooser_opendir">ディレクトリを開く</string> - <string name="label_filechooser_parent_dir">⏎ 親ディレクトリ</string> - <string name="error_access_failed">アクセスできません: %1$s</string> - <string name="error_open_external_storage">外部ストレージが開けません</string> - <string name="message_confirm_remove">このエントリを削除しますか?</string> <string name="message_confirm_clear">現在のユーザー辞書の内容はすべて消去されます。よろしいですか?</string> <string name="message_confirm_clear_dics">現在の変換辞書をすべて削除し、基本の辞書だけにします。よろしいですか?</string> @@ -34,6 +27,7 @@ <string name="message_dic_extracted">変換辞書を解凍しました</string> <string name="message_main_dic">これは基本の変換辞書なので、削除できません</string> + <string name="error_access_failed">アクセスできません: %1$s</string> <string name="error_dic">辞書ファイルを開けません。設定画面から、辞書を初期化してみてください</string> <string name="error_open_dicfile">辞書ファイルを開けません</string> <string name="error_user_dic">ユーザー辞書が開けません。設定画面から、ユーザー辞書を初期化してみてください</string> @@ -54,6 +48,8 @@ <string translatable="false" name="prefkey_flick_sensitivity">PrefKeyFlickSensitivity</string> <string translatable="false" name="prefkey_flick_sensitivity2">PrefKeyFlickSensitivity2</string> <string translatable="false" name="prefkey_curve_sensitivity">PrefKeyCurveSensitivitye</string> + <string translatable="false" name="prefkey_theme">PrefKeyTheme</string> + <string translatable="false" name="prefkey_use_inset">PrefKeyInset</string> <string translatable="false" name="prefkey_use_softkey">PrefKeyUseSoftKey</string> <string translatable="false" name="prefkey_use_popup">PrefKeyUsePopup</string> <string translatable="false" name="prefkey_fixed_popup">PrefKeyFixedPopup</string> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 733b3ba..378b8bb 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> <resources> - <style name="Theme.SKK" parent="Theme.AppCompat.Light.DarkActionBar"> + <style name="Theme.SKK" parent="Theme.AppCompat.DayNight.DarkActionBar"> <item name="keyboardViewStyle">@style/KeyboardView</item> </style> <style name="KeyboardView" parent="android:Widget"> <item name="android:background">#FFAAAAAA</item> - <item name="keyBackground">@drawable/key_bg</item> <item name="keyTextSize">22sp</item> - <item name="keyTextColor">#FF000000</item> + <item name="keyTextColor">@color/key_char_color</item> + <item name="keyBackground">@drawable/key_bg</item> <item name="keyPreviewOffset">-12dp</item> <item name="keyPreviewHeight">80dp</item> <item name="labelTextSize">14sp</item> diff --git a/app/src/main/res/xml/prefs_softkey.xml b/app/src/main/res/xml/prefs_softkey.xml index 516ebcc..f0c3f6e 100644 --- a/app/src/main/res/xml/prefs_softkey.xml +++ b/app/src/main/res/xml/prefs_softkey.xml @@ -2,58 +2,91 @@ <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:title="@string/label_pref_softkeyboard"> - <ListPreference - app:key="@string/prefkey_use_softkey" - app:title="ソフトウェアキーボードの使用" - app:summary="「常に表示/非表示」が可能です" - app:entries="@array/usesoftkey_entries" - app:entryValues="@array/usesoftkey_values" - app:defaultValue="auto" + <PreferenceCategory + app:title="動作" app:iconSpaceReserved="false" - /> - <ListPreference - app:key="@string/prefkey_flick_sensitivity2" - app:title="フリック感度" - app:summary="「高」にすると反応しやすくなります" - app:entries="@array/sensitivity_entries" - app:entryValues="@array/sensitivity_values" - app:dialogTitle="フリック感度" - app:defaultValue="mid" + > + <ListPreference + app:key="@string/prefkey_use_softkey" + app:title="ソフトウェアキーボードの使用" + app:summary="「常に表示/非表示」が可能です" + app:entries="@array/usesoftkey_entries" + app:entryValues="@array/usesoftkey_values" + app:defaultValue="auto" + app:iconSpaceReserved="false" + /> + <ListPreference + app:key="@string/prefkey_flick_sensitivity2" + app:title="フリック感度" + app:summary="「高」にすると反応しやすくなります" + app:entries="@array/sensitivity_entries" + app:entryValues="@array/sensitivity_values" + app:dialogTitle="フリック感度" + app:defaultValue="mid" + app:iconSpaceReserved="false" + /> + <CheckBoxPreference + app:key="@string/prefkey_use_popup" + app:title="ポップアップの使用" + app:summary="フリック入力用のガイドを表示します" + app:disableDependentsState="false" + app:defaultValue="true" + app:iconSpaceReserved="false" + /> + <CheckBoxPreference + app:key="@string/prefkey_fixed_popup" + app:title="ポップアップの固定" + app:summary="フリック入力ガイドを,常に上部の同じ場所に表示します" + app:dependency="PrefKeyUsePopup" + app:defaultValue="true" + app:iconSpaceReserved="false" + /> + <CheckBoxPreference + app:key="@string/prefkey_use_soft_cancel_key" + app:title="キャンセルキーの使用" + app:summary="小文字キーのかわりにキャンセルキーを使います" + app:defaultValue="false" + app:iconSpaceReserved="false" + /> + </PreferenceCategory> + <PreferenceCategory + app:title="外見" app:iconSpaceReserved="false" - /> - <CheckBoxPreference - app:key="@string/prefkey_use_popup" - app:title="ポップアップの使用" - app:summary="フリック入力用のガイドを表示します" - app:disableDependentsState="false" - app:defaultValue="true" + > + <ListPreference + app:key="@string/prefkey_theme" + app:title="テーマ" + app:summary="ライト/ダークモードを強制できます" + app:entries="@array/theme_entries" + app:entryValues="@array/theme_values" + app:dialogTitle="テーマ" + app:defaultValue="default" + app:iconSpaceReserved="false" + /> + <CheckBoxPreference + app:key="@string/prefkey_use_inset" + app:title="外枠" + app:summary="キーの間に間隔をあけます" + app:disableDependentsState="false" + app:defaultValue="false" + app:iconSpaceReserved="false" + /> +<!-- <androidx.preference.SeekBarPreference--> +<!-- app:key="@string/prefkey_background_alpha"--> +<!-- app:title="背景の透明化"--> +<!-- app:summary="0で完全に透明になります"--> +<!-- app:defaultValue="100"--> +<!-- app:min="0"--> +<!-- android:max="100"--> +<!-- app:showSeekBarValue="true"--> +<!-- app:iconSpaceReserved="false"--> +<!-- />--> + </PreferenceCategory> + <PreferenceCategory + app:title="サイズと位置" app:iconSpaceReserved="false" - /> - <CheckBoxPreference - app:key="@string/prefkey_fixed_popup" - app:title="ポップアップの固定" - app:summary="フリック入力ガイドを,常に上部の同じ場所に表示します" - app:dependency="PrefKeyUsePopup" - app:defaultValue="true" - app:iconSpaceReserved="false" - /> - <CheckBoxPreference - app:key="@string/prefkey_use_soft_cancel_key" - app:title="キャンセルキーの使用" - app:summary="小文字キーのかわりにキャンセルキーを使います" - app:defaultValue="false" - app:iconSpaceReserved="false" - /> -<!-- <androidx.preference.SeekBarPreference--> -<!-- app:key="@string/prefkey_background_alpha"--> -<!-- app:title="背景の透明化"--> -<!-- app:summary="0で完全に透明になります"--> -<!-- app:defaultValue="100"--> -<!-- app:min="0"--> -<!-- android:max="100"--> -<!-- app:showSeekBarValue="true"--> -<!-- app:iconSpaceReserved="false"--> -<!-- />--> + > + </PreferenceCategory> <androidx.preference.SeekBarPreference app:key="@string/prefkey_key_height_port" app:title="キーボードの高さ(縦画面)" diff --git a/build.gradle b/build.gradle index 68a4a39..800fa0e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,12 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.8.0' + ext.kotlin_version = '1.9.0' repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.2.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/gradle.properties b/gradle.properties index bfc5365..fb0dfea 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,4 @@ android.enableJetifier=false +android.nonFinalResIds=false +android.nonTransitiveRClass=false android.useAndroidX=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 67bfcde..0001fdd 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sat Jan 29 13:15:47 JST 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME