diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml
new file mode 100644
index 0000000..0e9600d
--- /dev/null
+++ b/.idea/deploymentTargetDropDown.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index e34606c..4dcbce1 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -26,5 +26,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Gradle__com_github_suragch_mongol_library_2_1_0_aar.xml b/.idea/libraries/Gradle__com_github_suragch_mongol_library_2_1_0_aar.xml
new file mode 100644
index 0000000..9f32c0a
--- /dev/null
+++ b/.idea/libraries/Gradle__com_github_suragch_mongol_library_2_1_0_aar.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index c157775..ba9b63f 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -43,7 +43,7 @@
-
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 298ffa7..7b22244 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -37,100 +37,24 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
+
@@ -148,7 +72,6 @@
-
@@ -165,6 +88,8 @@
@@ -296,46 +226,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 8a4a9bb..cdf0268 100755
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -27,5 +27,5 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
- implementation 'net.studymongolian:mongol-library:2.1.0'
+ implementation 'com.github.suragch:mongol-library:2.1.0'
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 0d6920e..7a7bdce 100755
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -13,8 +13,8 @@
android:theme="@style/AppTheme">
+ android:windowSoftInputMode="stateHidden|adjustResize"
+ android:exported="true">
@@ -38,7 +38,8 @@
+ android:noHistory="true"
+ android:exported="true">
@@ -66,7 +67,8 @@
+ android:permission="android.permission.BIND_INPUT_METHOD"
+ android:exported="true">
diff --git a/app/src/main/java/net/studymongolian/chimee/AddEditFavoritesActivity.java b/app/src/main/java/net/studymongolian/chimee/AddEditFavoritesActivity.java
index 19536c6..c7a1a38 100755
--- a/app/src/main/java/net/studymongolian/chimee/AddEditFavoritesActivity.java
+++ b/app/src/main/java/net/studymongolian/chimee/AddEditFavoritesActivity.java
@@ -109,6 +109,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
@Override
public void onBackPressed() {
+ super.onBackPressed();
handleUserFinishing();
}
diff --git a/app/src/main/java/net/studymongolian/chimee/SaveActivity.java b/app/src/main/java/net/studymongolian/chimee/SaveActivity.java
index 0a4e3df..324bfb5 100755
--- a/app/src/main/java/net/studymongolian/chimee/SaveActivity.java
+++ b/app/src/main/java/net/studymongolian/chimee/SaveActivity.java
@@ -172,6 +172,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
@Override
public void onBackPressed() {
+ super.onBackPressed();
handleUserFinishing();
}
diff --git a/app/src/main/java/net/studymongolian/chimee/UserDictionary.java b/app/src/main/java/net/studymongolian/chimee/UserDictionary.java
index 1537dc5..3092660 100755
--- a/app/src/main/java/net/studymongolian/chimee/UserDictionary.java
+++ b/app/src/main/java/net/studymongolian/chimee/UserDictionary.java
@@ -1,5 +1,6 @@
package net.studymongolian.chimee;
+import android.annotation.SuppressLint;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
@@ -280,6 +281,7 @@ static int importWordAndFollowingList(Context context, ArrayList t
* @param word the word whose following list needs updating
* @param followingWord the following word to add
*/
+ @SuppressLint("Range")
static void addFollowing(Context context, String word, String followingWord) {
// do error checking on input params
@@ -294,16 +296,16 @@ static void addFollowing(Context context, String word, String followingWord) {
String[] projection = new String[]{_ID, FOLLOWING};
String selection = WORD + "=?";
String[] selectionArgs = {word};
- try (Cursor cursor = resolver.query(CONTENT_URI, projection, selection,
- selectionArgs, null)) {
- if (cursor != null && cursor.moveToNext()) {
- wordId = cursor.getLong(cursor.getColumnIndex(_ID));
- followingString = cursor.getString(cursor
- .getColumnIndex(FOLLOWING));
+ try (Cursor cursor = resolver.query(CONTENT_URI, projection, selection,
+ selectionArgs, null)) {
+ if (cursor != null && cursor.moveToNext()) {
+ wordId = cursor.getLong(cursor.getColumnIndex(_ID));
+ followingString = cursor.getString(cursor
+ .getColumnIndex(FOLLOWING));
+ }
+ } catch (Exception e) {
+ Log.e("UserDictionary", e.toString());
}
- } catch (Exception e) {
- Log.e("UserDictionary", e.toString());
- }
if (wordId == -1) {
return;
}
@@ -366,8 +368,8 @@ static int incrementFrequency(Context context, String word) {
return -1;
}
- long id = cursor.getLong(cursor.getColumnIndex(UserDictionary.Words._ID));
- int frequency = cursor.getInt(cursor.getColumnIndex(UserDictionary.Words.FREQUENCY));
+ @SuppressLint("Range") long id = cursor.getLong(cursor.getColumnIndex(UserDictionary.Words._ID));
+ @SuppressLint("Range") int frequency = cursor.getInt(cursor.getColumnIndex(UserDictionary.Words.FREQUENCY));
cursor.close();
frequency++;
@@ -415,7 +417,7 @@ static void deleteFollowingWord(Context context, String word, String followingWo
return;
}
- String followingString = cursor.getString(cursor.getColumnIndex(Words.FOLLOWING));
+ @SuppressLint("Range") String followingString = cursor.getString(cursor.getColumnIndex(Words.FOLLOWING));
cursor.close();
followingString = removeWordFromFollowingString(followingString, followingWord);
diff --git a/build.gradle b/build.gradle
index 0fbee44..5d6c780 100755
--- a/build.gradle
+++ b/build.gradle
@@ -19,6 +19,7 @@ allprojects {
repositories {
google()
mavenCentral()
+ maven { url 'https://jitpack.io' }
}
}