Skip to content

Commit

Permalink
Burmese soft keyboard.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansche committed Sep 8, 2016
1 parent 9c4cc4b commit 11a0bd1
Show file tree
Hide file tree
Showing 9 changed files with 335 additions and 186 deletions.
14 changes: 13 additions & 1 deletion Mymr/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http:https://schemas.android.com/apk/res/android"
package="com.google.languageresources.mymr">
<!-- API level 16 required for QUERY_KEYBOARD_LAYOUTS. -->
<!-- API level 16 required for QUERY_KEYBOARD_LAYOUTS.
Almost everything else that is needed here is available in API Level 3,
but some required functionality is only available in API Level 11. -->
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="24"/>

<application android:label="@string/ime_name">
<receiver android:name=".InputDeviceReceiver"
android:label="@string/keyboard_layouts_label">
Expand All @@ -12,5 +15,14 @@
<meta-data android:name="android.hardware.input.metadata.KEYBOARD_LAYOUTS"
android:resource="@xml/keyboard_layouts"/>
</receiver>

<service android:name="MyanmarUnicodeKeyboard"
android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
<action android:name="android.view.InputMethod"/>
</intent-filter>
<meta-data android:name="android.view.im"
android:resource="@xml/method"/>
</service>
</application>
</manifest>
6 changes: 5 additions & 1 deletion Mymr/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ licenses(["notice"]) # Apache 2.0

android_binary(
name = "MyanmarUnicodeKeyboard",
srcs = [],
srcs = [
"src/main/java/com/google/languageresources/mymr/CandidateView.java",
"src/main/java/com/google/languageresources/mymr/MyanmarUnicodeKeyboard.java",
],
custom_package = "com.google.languageresources.mymr",
manifest = "AndroidManifest.xml",
resource_files = glob(["res/**"]),
deps = ["//my:java-utils"],
)
8 changes: 8 additions & 0 deletions Mymr/res/layout/input.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<android.inputmethodservice.KeyboardView
xmlns:android="http:https://schemas.android.com/apk/res/android"
android:id="@+id/keyboard"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
7 changes: 4 additions & 3 deletions Mymr/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
-->

<resources>
<dimen name="key_height">50dip</dimen>
<dimen name="candidate_font_height">16sp</dimen>
<dimen name="key_height">46dip</dimen>
<dimen name="key_text_size">24sp</dimen>
<dimen name="candidate_font_height">20sp</dimen>
<dimen name="candidate_vertical_padding">6sp</dimen>
</resources>
</resources>
3 changes: 3 additions & 0 deletions Mymr/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="ime_name">Myanmar Unicode Keyboard</string>

<!-- Labels for subtype -->
<string name="label_subtype_burmese">Burmese</string>

<!-- Keyboard layouts -->
<string name="keyboard_layouts_label">Myanmar Unicode Keyboard</string>
<string name="keyboard_layout_burmese_label">Burmese</string>
Expand Down
94 changes: 94 additions & 0 deletions Mymr/res/xml/burmese_keyboard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 Google, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http:https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Keyboard xmlns:android="http:https://schemas.android.com/apk/res/android"
android:keyWidth="10%p"
android:horizontalGap="0px"
android:verticalGap="0px"
android:keyHeight="42dip">
<Row>
<Key android:codes="4161" android:keyLabel=""
android:keyEdgeFlags="left"/>
<Key android:codes="4162" android:keyLabel=""/>
<Key android:codes="4163" android:keyLabel=""/>
<Key android:codes="4164" android:keyLabel=""/>
<Key android:codes="4165" android:keyLabel=""/>
<Key android:codes="4166" android:keyLabel=""/>
<Key android:codes="4167" android:keyLabel=""/>
<Key android:codes="4168" android:keyLabel=""/>
<Key android:codes="4169" android:keyLabel=""/>
<Key android:codes="4160" android:keyLabel=""
android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key android:codes="4102" android:keyLabel=""
android:keyEdgeFlags="left"/>
<Key android:codes="4112" android:keyLabel=""/>
<Key android:codes="4116" android:keyLabel=""/>
<Key android:codes="4121" android:keyLabel=""/>
<Key android:codes="4129" android:keyLabel=""/>
<Key android:codes="4117" android:keyLabel=""/>
<Key android:codes="4096" android:keyLabel="က"/>
<Key android:codes="4100" android:keyLabel=""/>
<Key android:codes="4126" android:keyLabel=""/>
<Key android:codes="4101" android:keyLabel=""
android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key android:codes="4145" android:keyLabel="\u1031"
android:keyEdgeFlags="left"/>
<Key android:codes="4155" android:keyLabel="\u103B"/>
<Key android:codes="4141" android:keyLabel="\u102D"/>
<Key android:codes="4154" android:keyLabel="\u103A"/>
<Key android:codes="4139" android:keyLabel="\u102B"/>
<Key android:codes="4151" android:keyLabel="\u1037"/>
<Key android:codes="4156" android:keyLabel="\u103C"/>
<Key android:codes="4143" android:keyLabel="\u102F"/>
<Key android:codes="4144" android:keyLabel="\u1030"/>
<Key android:codes="4152" android:keyLabel="\u1038"
android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key android:codes="4118" android:keyLabel=""
android:keyEdgeFlags="left"/>
<Key android:codes="4113" android:keyLabel=""/>
<Key android:codes="4097" android:keyLabel=""/>
<Key android:codes="4124" android:keyLabel=""/>
<Key android:codes="4122" android:keyLabel=""/>
<Key android:codes="4106" android:keyLabel=""
android:keyWidth="12%p"/>
<Key android:codes="4140" android:keyLabel="\u102C"/>
<!--
<Key android:codes="4152" android:keyLabel="\u1038"
android:keyWidth="8%p"/>
-->
<Key android:codes="4170,4171" android:keyLabel=""
android:keyWidth="8%p"/>
<Key android:codes="-5" android:keyLabel="\u232B"
android:keyWidth="20%p" android:keyEdgeFlags="right"
android:isRepeatable="true"/>
</Row>
<Row android:rowEdgeFlags="bottom" android:keyHeight="36dip">
<Key android:codes="-1" android:keyLabel="\u21E7"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:codes="-100" android:keyLabel="\u2398"/>
<Key android:codes="-101" android:keyLabel="\u2328"/>
<Key android:codes="32" android:keyLabel="\u2423"
android:keyWidth="32%p" android:isRepeatable="true"/>
<Key android:codes="10" android:keyLabel="\u23CE"
android:keyWidth="28%p" android:keyEdgeFlags="right"/>
</Row>
</Keyboard>
106 changes: 106 additions & 0 deletions Mymr/res/xml/burmese_shifted_keyboard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 Google, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http:https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Keyboard xmlns:android="http:https://schemas.android.com/apk/res/android"
android:keyWidth="10%p"
android:horizontalGap="0px"
android:verticalGap="0px"
android:keyHeight="42dip">
<Row>
<Key android:codes="4109" android:keyLabel=""
android:keyWidth="8%p" android:keyEdgeFlags="left"/>
<Key android:codes="4110" android:keyLabel=""
android:keyWidth="8%p"/>
<Key android:codes="4107" android:keyLabel=""
android:keyWidth="8%p"/>
<Key android:codes="4135" android:keyLabel=""
android:keyWidth="8%p"/>
<Key android:codes="4175" android:keyLabel=""
android:keyWidth="10%p"/>
<Key android:codes="4127" android:keyLabel=""
android:keyWidth="10%p"/>
<Key android:codes="4123" android:keyLabel=""
android:keyWidth="8%p"/>
<Key android:codes="4137" android:keyLabel=""
android:keyWidth="12%p"/>
<Key android:codes="4138" android:keyLabel=""
android:keyWidth="20%p"/>
<Key android:codes="57348" android:keyLabel="င်\u1039"
android:keyWidth="8%p" android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key android:codes="4104" android:keyLabel=""
android:keyWidth="10%p" android:keyEdgeFlags="left"/>
<Key android:codes="4125" android:keyLabel=""
android:keyWidth="8%p"/>
<Key android:codes="4131" android:keyLabel=""
android:keyWidth="11%p"/>
<Key android:codes="4174" android:keyLabel=""
android:keyWidth="8%p"/>
<Key android:codes="4132" android:keyLabel=""
android:keyWidth="11%p"/>
<Key android:codes="4172" android:keyLabel=""
android:keyWidth="8%p"/>
<Key android:codes="4133" android:keyLabel=""
android:keyWidth="8%p"/>
<Key android:codes="4173" android:keyLabel=""
android:keyWidth="10%p"/>
<Key android:codes="4159" android:keyLabel=""
android:keyWidth="14%p"/>
<Key android:codes="4111" android:keyLabel=""
android:keyWidth="12%p" android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key android:codes="4119" android:keyLabel=""
android:keyEdgeFlags="left"/>
<Key android:codes="4158" android:keyLabel="\u103E"/>
<Key android:codes="4142" android:keyLabel="\u102E"/>
<Key android:codes="4153" android:keyLabel="\u1039"/>
<Key android:codes="4157" android:keyLabel="\u103D"/>
<Key android:codes="4150" android:keyLabel="\u1036"/>
<Key android:codes="4146" android:keyLabel="\u1032"/>
<Key android:codes="4114" android:keyLabel=""/>
<Key android:codes="4115" android:keyLabel=""/>
<Key android:codes="4098" android:keyLabel=""
android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key android:codes="4103" android:keyLabel=""
android:keyEdgeFlags="left"/>
<Key android:codes="4108" android:keyLabel=""/>
<Key android:codes="4099" android:keyLabel=""/>
<Key android:codes="4128" android:keyLabel=""/>
<Key android:codes="4120" android:keyLabel=""/>
<Key android:codes="4105" android:keyLabel=""
android:keyWidth="12%p"/>
<Key android:codes="4134" android:keyLabel=""/>
<Key android:codes="4171" android:keyLabel=""
android:keyWidth="8%p"/>
<Key android:codes="-5" android:keyLabel="\u232B"
android:keyWidth="20%p" android:keyEdgeFlags="right"
android:isRepeatable="true"/>
</Row>
<Row android:rowEdgeFlags="bottom" android:keyHeight="36dip">
<Key android:codes="-1" android:keyLabel="\u21E7"
android:keyWidth="20%p" android:keyEdgeFlags="left"/>
<Key android:codes="-100" android:keyLabel="\u2398"/>
<Key android:codes="-101" android:keyLabel="\u2328"/>
<Key android:codes="32" android:keyLabel="\u2423"
android:keyWidth="32%p" android:isRepeatable="true"/>
<Key android:codes="10" android:keyLabel="\u23CE"
android:keyWidth="28%p" android:keyEdgeFlags="right"/>
</Row>
</Keyboard>
11 changes: 11 additions & 0 deletions Mymr/res/xml/method.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<input-method
xmlns:android="http:https://schemas.android.com/apk/res/android"
android:supportsSwitchingToNextInputMethod="true">
<subtype
android:label="@string/label_subtype_burmese"
android:languageTag="my"
android:imeSubtypeLocale="my_MM"
android:imeSubtypeMode="keyboard"
android:isAsciiCapable="false"/>
</input-method>
Loading

0 comments on commit 11a0bd1

Please sign in to comment.