Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ local.properties
.DS_Store
/build
/captures
/app/release/output.json
/app/release
.externalNativeBuild

/svg
/svg
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 31
compileSdkVersion 33

defaultConfig {
applicationId "io.github.deton.androidtutcode"
minSdkVersion 14
targetSdkVersion 30
versionCode 5
versionName "1.2.0"
minSdkVersion 21
targetSdkVersion 33
versionCode 6
versionName "1.3.0"
}

buildTypes {
Expand All @@ -24,12 +24,13 @@ android {
lint {
abortOnError false
}
namespace 'jp.deadend.noname.skk'
}

dependencies {
implementation files('libs/jdbm-1.0.jar')
/* implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01' */
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.preference:preference-ktx:1.2.0'
}
repositories {
Expand Down
18 changes: 12 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="jp.deadend.noname.skk">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<queries>
<intent>
<action android:name="android.speech.action.RECOGNIZE_SPEECH"/>
</intent>
<intent>
<action android:name="com.adamrocker.android.simeji.ACTION_INTERCEPT" />
<category android:name="com.adamrocker.android.simeji.REPLACE"/>
</intent>
</queries>
<application android:label="@string/ime_name"
android:allowBackup="true"
android:name=".SKKApplication"
>
<service android:name=".SKKService"
android:permission="android.permission.BIND_INPUT_METHOD" >
android:permission="android.permission.BIND_INPUT_METHOD"
android:exported="false" >
<intent-filter>
<action android:name="android.view.InputMethod" />
</intent-filter>
Expand All @@ -26,9 +35,6 @@
android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
android:label="@string/label_dicmanager_activity" >
</activity>
<activity android:name=".FileChooser"
android:theme="@style/Theme.AppCompat.Light.DarkActionBar" >
</activity>
<activity android:name=".SKKMushroom"
android:label="@string/label_mushroom"
android:theme="@style/Theme.AppCompat.Light.Dialog">
Expand Down
10 changes: 2 additions & 8 deletions app/src/main/java/jp/deadend/noname/skk/AbbrevKeyboardView.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package jp.deadend.noname.skk

import android.content.Context
import android.inputmethodservice.Keyboard
import android.inputmethodservice.KeyboardView
import android.view.KeyEvent
import android.util.AttributeSet

class AbbrevKeyboardView : KeyboardView, KeyboardView.OnKeyboardActionListener {
private lateinit var mService: SKKService
private val mKeyboard = SKKKeyboard(context, R.xml.abbrev, 5)
private val mKeyboard = Keyboard(context, R.xml.abbrev)

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

fun changeKeyHeight(px: Int) {
mKeyboard.changeKeyHeight(px)
}

override fun onKey(primaryCode: Int, keyCodes: IntArray) {
override fun onKey(primaryCode: Int) {
when (primaryCode) {
Keyboard.KEYCODE_SHIFT -> isShifted = !isShifted
Keyboard.KEYCODE_DELETE -> {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/jp/deadend/noname/skk/CandidateView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import android.view.GestureDetector
import android.view.MotionEvent
import android.view.View
import androidx.core.content.res.ResourcesCompat
import kotlin.math.min

/**
* Construct a CandidateView for showing suggested words for completion.
Expand Down Expand Up @@ -307,7 +308,7 @@ class CandidateView(context: Context, attrs: AttributeSet) : View(context, attrs
val rightEdge = mScrollX + width
while (i < count) {
if (mWordX[i] <= rightEdge && mWordX[i] + mWordWidth[i] >= rightEdge) {
targetX = Math.min(mWordX[i], mTotalWidth - width)
targetX = min(mWordX[i], mTotalWidth - width)
break
}
i++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ class CandidateViewContainer(screen: Context, attrs: AttributeSet) : LinearLayou
}
}

fun setAlpha(alpha: Int) {
background.alpha = alpha
binding.candidateLeft.alpha = alpha / 255f
binding.candidateRight.alpha = alpha / 255f
binding.candidateLeft.background.alpha = alpha
binding.candidateRight.background.alpha = alpha
}

fun setScrollButtonsEnabled(left: Boolean, right: Boolean) {
binding.candidateLeft.isEnabled = left
binding.candidateRight.isEnabled = right
Expand Down
Loading