Skip to content

Commit b6ff823

Browse files
committed
Version 1.16.3 release
1 parent 84bfcac commit b6ff823

File tree

10 files changed

+31
-23
lines changed

10 files changed

+31
-23
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ You can import `mongol-library` into your project from jCenter by adding the fol
4242

4343
```java
4444
dependencies {
45-
implementation 'net.studymongolian:mongol-library:1.16.2'
45+
implementation 'net.studymongolian:mongol-library:1.16.3'
4646
}
4747
```
4848

@@ -676,6 +676,7 @@ The keyboards are embedded in the keyboard container, which acts as a controller
676676

677677
#### Version changes
678678

679+
* `1.16.3`: Make hooked Y the default when entering [Vowel + Y + I] using the `ImeContainer`
679680
* `1.16.2`: Shadow, text view, and edit text bug fixes
680681
* `1.16.1`: Added ability to set text shadow
681682
* `1.16.0`: Added ability to stroke text in `MongolTextView` and `MongolLayout`
@@ -746,6 +747,7 @@ The keyboards are embedded in the keyboard container, which acts as a controller
746747
## Apps that use this library
747748

748749
* [Demo app](https://github.com/suragch/mongol-library/tree/master/demo-app)
750+
* [Chimee](https://github.com/suragch/Chimee)
749751
* [Suryaa](https://github.com/suragch/Suryaa)
750752
* [Todo Keyboard](https://github.com/suragch/TodoKeyboard)
751753

README.zh-Hans.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
```java
4343
dependencies {
44-
implementation 'net.studymongolian:mongol-library:1.16.2'
44+
implementation 'net.studymongolian:mongol-library:1.16.3'
4545
}
4646
```
4747

@@ -464,6 +464,7 @@ String iyerSuffix = MongolCode.Suffix.IYER; // "\u202F\u1822
464464
## 使用此库的应用
465465

466466
- [Demo app 演示应用](https://github.com/suragch/mongol-library/tree/master/demo-app)
467-
- [Suryaa 外语记忆卡篇](https://github.com/suragch/Suryaa)
467+
- [Chimee 输入法,文字工具](https://github.com/suragch/Chimee)
468+
- [Suryaa 蒙外语记忆卡篇](https://github.com/suragch/Suryaa)
468469
- [Todo 托忒输入法](https://github.com/suragch/TodoKeyboard)
469470
- *加你的应用。。。*

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
jcenter()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.2.0'
9+
classpath 'com.android.tools.build:gradle:3.2.1'
1010
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
1111
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
1212
// NOTE: Do not place your application dependencies here; they belong

demo-app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android {
66
applicationId "net.studymongolian.mongollibrarydemo"
77
minSdkVersion rootProject.ext.minSdkVersion
88
targetSdkVersion rootProject.ext.targetSdkVersion
9-
versionCode 31
10-
versionName "1.16.2"
9+
versionCode 32
10+
versionName "1.16.3"
1111
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1212
}
1313
buildTypes {

demo-app/release/demo-app-release.apk

180 Bytes
Binary file not shown.

demo-app/release/output.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":31,"versionName":"1.16.2","enabled":true,"outputFile":"demo-app-release.apk","fullName":"release","baseName":"release"},"path":"demo-app-release.apk","properties":{}}]
1+
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":32,"versionName":"1.16.3","enabled":true,"outputFile":"demo-app-release.apk","fullName":"release","baseName":"release"},"path":"demo-app-release.apk","properties":{}}]

mongol-library/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ext {
1313
siteUrl = 'https://github.com/suragch/mongol-library'
1414
gitUrl = 'https://github.com/suragch/mongol-library.git'
1515

16-
libraryVersion = '1.16.2'
16+
libraryVersion = '1.16.3'
1717

1818
developerId = 'suragch'
1919
developerName = 'Suragch'
@@ -29,8 +29,8 @@ android {
2929
defaultConfig {
3030
minSdkVersion rootProject.ext.minSdkVersion
3131
targetSdkVersion rootProject.ext.targetSdkVersion
32-
versionCode 48
33-
versionName "1.16.2"
32+
versionCode 49
33+
versionName "1.16.3"
3434

3535
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
3636

mongol-library/src/main/java/net/studymongolian/mongollibrary/ImeContainer.java

+18-1
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ private void checkForFinishedWord(String textToBeAdded) {
693693
}
694694
}
695695

696-
private void commitText(String text) {
696+
protected void commitText(String text) {
697697
InputConnection ic = getInputConnection();
698698
if (ic == null) return;
699699
ic.beginBatchEdit();
@@ -714,12 +714,29 @@ private void commitText(String text) {
714714
addSpacedPunctuation(ic, text, previousChar);
715715
} else if (isSingleZwjThatSplitsWord(ic, text)) {
716716
ic.commitText("" + MongolCode.Uni.ZWJ + SPACE + MongolCode.Uni.ZWJ, 1);
717+
} else if (needsHookedYForVowelYI(ic, text)) {
718+
ic.commitText("" + MongolCode.Uni.FVS1 + text, 1);
717719
} else {
718720
ic.commitText(text, 1);
719721
}
720722
ic.endBatchEdit();
721723
}
722724

725+
private boolean needsHookedYForVowelYI(InputConnection ic, String text) {
726+
// XXX: Note that this makes it practically impossible for users to enter
727+
// spellings like BAYINA for the double long tooth rendering
728+
// XXX: Developers can override this by subclassing ImeContainer
729+
// and overriding commitText()
730+
if (text.length() != 1
731+
|| text.charAt(0) != MongolCode.Uni.I)
732+
return false;
733+
CharSequence previous = ic.getTextBeforeCursor(2, 0);
734+
if (TextUtils.isEmpty(previous) || previous.length() != 2)
735+
return false;
736+
return (MongolCode.isVowel(previous.charAt(0))
737+
&& previous.charAt(1) == MongolCode.Uni.YA);
738+
}
739+
723740
private boolean isSingleZwjThatSplitsWord(InputConnection ic, String text) {
724741
if (text.length() != 1
725742
|| text.charAt(0) != MongolCode.Uni.ZWJ)

mongol-library/src/main/java/net/studymongolian/mongollibrary/KeyboardAeiou.java

-6
Original file line numberDiff line numberDiff line change
@@ -1029,12 +1029,6 @@ private List<PopupKeyCandidate> getCandidatesForYA() {
10291029
return candidates;
10301030
}
10311031

1032-
PopupKeyCandidate medial_YA_FVS1 = new PopupKeyCandidate(
1033-
"" + MongolCode.Uni.YA + MongolCode.Uni.FVS1,
1034-
"" + MongolCode.Uni.ZWJ + MongolCode.Uni.YA + MongolCode.Uni.FVS1 + MongolCode.Uni.ZWJ,
1035-
"" + MongolCode.Uni.YA + MongolCode.Uni.FVS1 + MongolCode.Uni.ZWJ);
1036-
candidates.add(medial_YA_FVS1);
1037-
10381032
return candidates;
10391033
}
10401034

mongol-library/src/main/java/net/studymongolian/mongollibrary/KeyboardQwerty.java

-6
Original file line numberDiff line numberDiff line change
@@ -796,12 +796,6 @@ private List<PopupKeyCandidate> getCandidatesForY() {
796796
return candidates;
797797
}
798798

799-
PopupKeyCandidate medial_YA_FVS1 = new PopupKeyCandidate(
800-
"" + MongolCode.Uni.YA + MongolCode.Uni.FVS1,
801-
"" + MongolCode.Uni.ZWJ + MongolCode.Uni.YA + MongolCode.Uni.FVS1 + MongolCode.Uni.ZWJ,
802-
"" + MongolCode.Uni.YA + MongolCode.Uni.FVS1 + MongolCode.Uni.ZWJ);
803-
candidates.add(medial_YA_FVS1);
804-
805799
return candidates;
806800
}
807801

0 commit comments

Comments
 (0)