Skip to content

Commit a7536f5

Browse files
authored
Merge pull request #6 from deton/merge351
Merge AndroidSKK 3.5.1
2 parents 7d14bd5 + 25adcc3 commit a7536f5

File tree

82 files changed

+2430
-1001
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+2430
-1001
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ local.properties
3535
.DS_Store
3636
/build
3737
/captures
38-
/app/release/output.json
38+
/app/release
3939
.externalNativeBuild
4040

41-
/svg
41+
/svg

.idea/compiler.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/kotlinc.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+4-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
33

44
android {
5-
compileSdkVersion 31
5+
compileSdkVersion 33
66

77
defaultConfig {
88
applicationId "io.github.deton.androidtutcode"
9-
minSdkVersion 14
10-
targetSdkVersion 30
11-
versionCode 5
12-
versionName "1.2.0"
9+
minSdkVersion 21
10+
targetSdkVersion 33
11+
versionCode 6
12+
versionName "1.3.0"
1313
}
1414

1515
buildTypes {
@@ -24,12 +24,13 @@ android {
2424
lint {
2525
abortOnError false
2626
}
27+
namespace 'jp.deadend.noname.skk'
2728
}
2829

2930
dependencies {
3031
implementation files('libs/jdbm-1.0.jar')
3132
/* implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01' */
32-
implementation 'androidx.appcompat:appcompat:1.4.1'
33+
implementation 'androidx.appcompat:appcompat:1.6.1'
3334
implementation 'androidx.preference:preference-ktx:1.2.0'
3435
}
3536
repositories {

app/src/main/AndroidManifest.xml

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="jp.deadend.noname.skk">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
43
<uses-permission android:name="android.permission.RECORD_AUDIO" />
4+
<queries>
5+
<intent>
6+
<action android:name="android.speech.action.RECOGNIZE_SPEECH"/>
7+
</intent>
8+
<intent>
9+
<action android:name="com.adamrocker.android.simeji.ACTION_INTERCEPT" />
10+
<category android:name="com.adamrocker.android.simeji.REPLACE"/>
11+
</intent>
12+
</queries>
513
<application android:label="@string/ime_name"
614
android:allowBackup="true"
715
android:name=".SKKApplication"
816
>
917
<service android:name=".SKKService"
10-
android:permission="android.permission.BIND_INPUT_METHOD" >
18+
android:permission="android.permission.BIND_INPUT_METHOD"
19+
android:exported="false" >
1120
<intent-filter>
1221
<action android:name="android.view.InputMethod" />
1322
</intent-filter>
@@ -26,9 +35,6 @@
2635
android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
2736
android:label="@string/label_dicmanager_activity" >
2837
</activity>
29-
<activity android:name=".FileChooser"
30-
android:theme="@style/Theme.AppCompat.Light.DarkActionBar" >
31-
</activity>
3238
<activity android:name=".SKKMushroom"
3339
android:label="@string/label_mushroom"
3440
android:theme="@style/Theme.AppCompat.Light.Dialog">

app/src/main/java/jp/deadend/noname/skk/AbbrevKeyboardView.kt

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package jp.deadend.noname.skk
22

33
import android.content.Context
4-
import android.inputmethodservice.Keyboard
5-
import android.inputmethodservice.KeyboardView
64
import android.view.KeyEvent
75
import android.util.AttributeSet
86

97
class AbbrevKeyboardView : KeyboardView, KeyboardView.OnKeyboardActionListener {
108
private lateinit var mService: SKKService
11-
private val mKeyboard = SKKKeyboard(context, R.xml.abbrev, 5)
9+
private val mKeyboard = Keyboard(context, R.xml.abbrev)
1210

1311
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
1412
constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle)
@@ -27,11 +25,7 @@ class AbbrevKeyboardView : KeyboardView, KeyboardView.OnKeyboardActionListener {
2725
mService = listener
2826
}
2927

30-
fun changeKeyHeight(px: Int) {
31-
mKeyboard.changeKeyHeight(px)
32-
}
33-
34-
override fun onKey(primaryCode: Int, keyCodes: IntArray) {
28+
override fun onKey(primaryCode: Int) {
3529
when (primaryCode) {
3630
Keyboard.KEYCODE_SHIFT -> isShifted = !isShifted
3731
Keyboard.KEYCODE_DELETE -> {

app/src/main/java/jp/deadend/noname/skk/CandidateView.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import android.view.GestureDetector
2525
import android.view.MotionEvent
2626
import android.view.View
2727
import androidx.core.content.res.ResourcesCompat
28+
import kotlin.math.min
2829

2930
/**
3031
* Construct a CandidateView for showing suggested words for completion.
@@ -307,7 +308,7 @@ class CandidateView(context: Context, attrs: AttributeSet) : View(context, attrs
307308
val rightEdge = mScrollX + width
308309
while (i < count) {
309310
if (mWordX[i] <= rightEdge && mWordX[i] + mWordWidth[i] >= rightEdge) {
310-
targetX = Math.min(mWordX[i], mTotalWidth - width)
311+
targetX = min(mWordX[i], mTotalWidth - width)
311312
break
312313
}
313314
i++

app/src/main/java/jp/deadend/noname/skk/CandidateViewContainer.kt

+8
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ class CandidateViewContainer(screen: Context, attrs: AttributeSet) : LinearLayou
4343
}
4444
}
4545

46+
fun setAlpha(alpha: Int) {
47+
background.alpha = alpha
48+
binding.candidateLeft.alpha = alpha / 255f
49+
binding.candidateRight.alpha = alpha / 255f
50+
binding.candidateLeft.background.alpha = alpha
51+
binding.candidateRight.background.alpha = alpha
52+
}
53+
4654
fun setScrollButtonsEnabled(left: Boolean, right: Boolean) {
4755
binding.candidateLeft.isEnabled = left
4856
binding.candidateRight.isEnabled = right

0 commit comments

Comments
 (0)