Skip to content

Commit

Permalink
Enable Material theme for Android
Browse files Browse the repository at this point in the history
With this CL, Mozc for Android supports Material theme.

Note that this CL also contains a lot of other improvements and bug fixes that might not be directly related to the Material theme.  Here are some examples:
  * Floating candidate window support in Android 5.0.
  * Improved accessibility support.
  * Start bundling Key Character Map (KCM) file of Japanese 109 keyboard.

See the release note for details.

As for desktop versions, no behavior change is intended.

BUG=none
TEST=manually done with Nexus 5 / Android 5.0.1 (LRX22C)

git-svn-id: https://mozc.googlecode.com/svn/trunk@467 a6090854-d499-a067-5803-1114d4e51264
  • Loading branch information
yukawa committed Dec 22, 2014
1 parent fe635d7 commit 70aa0dd
Show file tree
Hide file tree
Showing 804 changed files with 26,507 additions and 29,570 deletions.
4 changes: 4 additions & 0 deletions src/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

vars = {
"breakpad_revision": "1391",
"fonttools_revision": "5ba7d98a4153fad57258fca23b0bcb238717aec3",
"gtest_revision": "700",
"gmock_revision": "501",
"gyp_revision": "2012",
Expand Down Expand Up @@ -82,6 +83,9 @@ deps_os = {
File("http://findbugs.googlecode.com/"
+ "svn/repos/release-repository/com/google/code/findbugs/jsr305/"
+ Var("jsr305_version") + "/jsr305-" + Var("jsr305_version") + ".jar"),
"src/third_party/fontTools":
"https://github.com/googlei18n/fonttools.git@" +
Var("fonttools_revision"),
"src/third_party/zlib/v1_2_8":
"https://src.chromium.org/chrome/trunk/src/third_party/zlib@" +
Var("zlib_revision"),
Expand Down
49 changes: 39 additions & 10 deletions src/android/AndroidManifest_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,21 @@
package="@ANDROID_APPLICATION_ID@"
android:versionCode="@ANDROID_VERSION_CODE@"
android:versionName="@MAJOR@.@MINOR@.@BUILD@.@REVISION@-@ANDROID_ARCH@">
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />

<!-- Google Japanese Input (the main code) requires the following permissions. -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />


<application android:icon="@drawable/application_icon" android:label="@string/app_full_name" >
<application android:icon="@drawable/application_icon"
android:label="@string/app_full_name"
android:allowBackup="false"
android:theme="@style/AppThemeSelector" >
<service android:name="@ANDROID_SERVICE_NAME@"
android:permission="android.permission.BIND_INPUT_METHOD"
android:label="@string/app_full_name">
Expand All @@ -51,30 +57,44 @@
<meta-data android:name="android.view.im" android:resource="@xml/method" />
</service>

<!-- Preference -->
<activity android:name="org.mozc.android.inputmethod.japanese.preference.MozcProxyPreferenceActivity"
<!-- Launcher Icon -->
<activity android:name="org.mozc.android.inputmethod.japanese.LauncherActivity"
android:enabled="@bool/show_launcher_icon"
android:label="@string/app_full_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<receiver android:name="org.mozc.android.inputmethod.japanese.LauncherIconVisibilityInitializer">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
<action android:name="android.intent.action.USER_INITIALIZE" />
</intent-filter>
</receiver>

<!-- Preference -->
<activity android:name="org.mozc.android.inputmethod.japanese.preference.MozcProxyPreferenceActivity" />
<activity android:name="org.mozc.android.inputmethod.japanese.preference.MozcFragmentPreferenceActivity"
android:launchMode="singleTask" />
android:launchMode="singleTask"
android:theme="@style/AppThemeSelectorSettings"/>
<activity android:name="org.mozc.android.inputmethod.japanese.preference.MozcFragmentSoftwareKeyboardAdvancedSettingsPreferenceActivity"
android:launchMode="singleTop" />
android:launchMode="singleTop"
android:theme="@style/AppThemeSelectorSettings"/>

<activity android:name="org.mozc.android.inputmethod.japanese.FirstTimeLaunchActivity" />
<activity android:name="org.mozc.android.inputmethod.japanese.preference.MiniBrowserActivity"
android:launchMode="singleTop" />

<!-- User dictionary tool -->
<activity android:name="org.mozc.android.inputmethod.japanese.userdictionary.UserDictionaryToolActivity"
android:enabled="@bool/enable_user_dictionary_tools_activity"
android:label="@string/user_dictionary_tool_app_name"
android:theme="@style/MozcLightTheme"
android:uiOptions="splitActionBarWhenNarrow"
android:configChanges="orientation|screenSize">
android:configChanges="orientation|screenSize"
android:theme="@style/AppThemeSelectorSettings">

<!-- Intent filters to receive a file-sending intent for importing user dictionary data.
UserDictionaryToolActivity accepts only file scheme.
-->
Expand Down Expand Up @@ -111,11 +131,20 @@
<activity android:name="org.mozc.android.inputmethod.japanese.mushroom.MushroomSelectionActivity"
android:launchMode="singleTask"
android:taskAffinity=".mushroom"
android:theme="@style/MozcMushroomDialogTheme"
android:theme="@android:style/Theme.DeviceDefault.Light.Dialog"
android:windowSoftInputMode="stateAlwaysHidden"
android:excludeFromRecents="true" />


<!-- Input device manager -->
<receiver android:name="org.mozc.android.inputmethod.japanese.InputDeviceReceiver">
<intent-filter>
<action android:name="android.hardware.input.action.QUERY_KEYBOARD_LAYOUTS" />
</intent-filter>
<meta-data android:name="android.hardware.input.metadata.KEYBOARD_LAYOUTS"
android:resource="@xml/keyboard_layouts" />
</receiver>

<!-- Following entry is for unit tests. Do not remove. -->
<!-- The activity is used for testing views. -->
<activity android:name="android.app.Activity" />
Expand Down
35 changes: 24 additions & 11 deletions src/android/android.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
'type': 'none',
'dependencies': [
'protobuf/protobuf.gyp:protobuf_java',
'resources/resources.gyp:resources',
'sdk_apk_dependencies',
'userfeedback/userfeedback.gyp:userfeedback',
],
Expand Down Expand Up @@ -153,9 +154,10 @@
'android_manifest',
'assets',
'mozc',
'gen_mozc_drawable',
'guava_library',
'userfeedback/userfeedback.gyp:userfeedback_project',
'subset_font',
'resources/resources.gyp:resources_project',
'support_libraries',
],
},
Expand Down Expand Up @@ -219,7 +221,6 @@
'files': [
# Copies the copyright and credit info.
'../data/installer/credits_en.html',
'../data/installer/credits_ja.html',
],
}],
},
Expand Down Expand Up @@ -407,7 +408,7 @@
'outputs': ['dummy_touch_stat_data'],
'action': [
'python', 'gen_touch_event_stats.py',
'--output_dir', 'assets',
'--output_dir', '<(sdk_asset_dir)',
'--stats_data', '../data/typing/touch_event_stats.csv',
'--collected_keyboards', 'collected_keyboards.csv',
],
Expand Down Expand Up @@ -528,22 +529,34 @@
],
},
{
'target_name': 'gen_mozc_drawable',
'target_name': 'subset_font',
'type': 'none',
'dependencies': [
# TODO(komatsu): Is it better to move android_base.gyp?
'resources/resources.gyp:copy_asis_svg',
'resources/resources.gyp:transform_template_svg',
],
'variables': {
'input_font': '<(font_dir)/Noto-Roboto2-Regular.otf',
'fonttools_path': '<(third_party_dir)/fontTools/Lib/fontTools',
},
'actions': [
{
'action_name': 'generate_pic_files',
'action_name': 'make_subset_font',
'inputs': [
'<(dummy_input_file)',
'gen_mozc_drawable.py',
'<(input_font)',
'gen_subset_font.py',
],
'outputs': [
'dummy_gen_mozc_drawable_output',
'<(sdk_asset_dir)/subset_font.otf',
],
'action': [
'python', 'gen_mozc_drawable.py',
'--svg_dir=../data/images/android/svg',
'--output_dir=<(resources_project_path)/res/raw',
'python',
'gen_subset_font.py',
'--svg_paths=<(shared_intermediate_mozc_dir)/data/images/android/svg/transformed.zip,<(shared_intermediate_mozc_dir)/data/images/android/svg/asis.zip',
'--input_font', '<(input_font)',
'--output_font', '<@(_outputs)',
'--fonttools_path', '<(fonttools_path)',
],
},
],
Expand Down
2 changes: 1 addition & 1 deletion src/android/android_env.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
'native_test_small_targets': [
'oss_data_manager_test',
],
'resources_project_path': 'static_resources/resources_oss',
'font_dir': '<(third_party_dir)/noto_font',
},
}],
['android_arch=="arm" and android_compiler=="gcc"', {
Expand Down
60 changes: 60 additions & 0 deletions src/android/android_resources.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Copyright 2010-2014, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

{
'variables': {
'android_translations': [
'<!@(ls -1 <(original_sdk_resources_dir)/res/values-ja/*.xml)',
],

'android_resources': [
'<@(android_translations)',

'<!@(ls -1 <(original_sdk_resources_dir)/res/drawable/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/drawable-hdpi/*.png)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/drawable-xhdpi/*.png)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/layout/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/layout-land/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/menu/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/values/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/values-h380dp-land/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/values-h500dp-land/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/values-h570dp-land/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/values-h650dp-port/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/values-h720dp-land/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/values-h800dp-port/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/values-h900dp-port/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/values-land/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/values-v16/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/values-v21/*.xml)',
'<!@(ls -1 <(original_sdk_resources_dir)/res/xml/*.xml)',
],
},
}

Loading

0 comments on commit 70aa0dd

Please sign in to comment.