diff --git a/app/build.gradle b/app/build.gradle index 4aba0f4..fbee615 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'kotlin-kapt' apply plugin: 'realm-android' android { - compileSdkVersion 30 + compileSdkVersion 34 buildToolsVersion '30.0.2' compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -20,7 +20,7 @@ android { defaultConfig { applicationId "com.rathanak.khmerroman" minSdkVersion 21 - targetSdkVersion 30 + targetSdkVersion 34 versionCode 2 versionName '2.0' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 994e7fc..5b447bc 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,20 +13,25 @@ + android:label="@string/title_activity_profile_settings" + android:exported="true"> + android:label="@string/title_activity_custom_mapping" + android:exported="true"/> + android:label="@string/title_activity_roman_mapping" + android:exported="true"/> diff --git a/app/src/main/java/com/rathanak/khmerroman/view/inputmethodview/CustomInputMethodView.kt b/app/src/main/java/com/rathanak/khmerroman/view/inputmethodview/CustomInputMethodView.kt index 5212445..ccb45d7 100644 --- a/app/src/main/java/com/rathanak/khmerroman/view/inputmethodview/CustomInputMethodView.kt +++ b/app/src/main/java/com/rathanak/khmerroman/view/inputmethodview/CustomInputMethodView.kt @@ -205,7 +205,7 @@ class CustomInputMethodView @JvmOverloads constructor( context, object : GestureDetector.SimpleOnGestureListener() { override fun onFling( - e1: MotionEvent, + e1: MotionEvent?, e2: MotionEvent, velocityX: Float, velocityY: Float @@ -213,8 +213,7 @@ class CustomInputMethodView @JvmOverloads constructor( var isChangeLanguageSwipe = 0x000 var direction = 0 var swipeThreshold = width / 2 - - val e1PointerId = e1.getPointerId(e1.actionIndex) + val e1PointerId = e1?.getPointerId(e1.actionIndex) val e2PointerId = e2.getPointerId(e2.actionIndex) if (e1PointerId != e2PointerId) return false // Check if the swipe is within the area of the language switch key. @@ -226,6 +225,7 @@ class CustomInputMethodView @JvmOverloads constructor( isChangeLanguageSwipe = 0x001 // 0x001 for being inside the key view. swipeThreshold = e1Key.width / 4 } + var result = false val distanceY = e2.y - e1.y val distanceX = e2.x - e1.x @@ -456,8 +456,8 @@ class CustomInputMethodView @JvmOverloads constructor( val keyRight = key.right.toFloat() val keyTop = key.top.toFloat() val keyBottom = key.bottom.toFloat() - if (x - left in keyLeft..keyRight && - y - top in keyTop..keyBottom) { + if (x - layoutLeft in keyLeft..keyRight && + y - layoutTop in keyTop..keyBottom) { return key } }