diff --git a/build.gradle b/build.gradle index a3c979e..404ac54 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { jcenter() } dependencies { - classpath "com.android.tools.build:gradle:4.0.1" + classpath 'com.android.tools.build:gradle:7.0.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/example/build.gradle b/example/build.gradle index 20f6d6e..bb1fecf 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -6,8 +6,8 @@ dependencies { androidTestImplementation "androidx.test.espresso:espresso-intents:3.2.0" androidTestImplementation "androidx.test.espresso:espresso-core:3.2.0" - implementation "androidx.annotation:annotation:$ANDROIDX_VERSION" - implementation "androidx.appcompat:appcompat:$ANDROIDX_VERSION" + implementation "androidx.annotation:annotation:1.2.0" + implementation "androidx.appcompat:appcompat:1.3.1" implementation project(":library") } diff --git a/gradle.properties b/gradle.properties index 938c5e6..e4d0f07 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,8 +18,7 @@ GROUP=com.splitwise ANDROID_BUILD_MIN_SDK_VERSION=14 ANDROID_BUILD_TARGET_SDK_VERSION=29 ANDROID_BUILD_SDK_VERSION=29 -ANDROIDX_VERSION=1.1.0 -KOTLIN_VERSION=1.5.21 +KOTLIN_VERSION=1.5.31 POM_DESCRIPTION=Android Token AutoComplete EditText POM_URL=https://github.com/splitwise/TokenAutoComplete POM_SCM_URL=https://github.com/splitwise/TokenAutoComplete diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 264801a..0ab5bc6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip diff --git a/library/build.gradle b/library/build.gradle index 9484174..3878f2a 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -16,8 +16,6 @@ android { defaultConfig { minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION) targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION) - versionCode Integer.parseInt(project.VERSION_CODE) - versionName project.VERSION_NAME } buildTypes { @@ -39,9 +37,9 @@ android { dependencies { testImplementation("junit:junit:4.13") - implementation("androidx.annotation:annotation:$ANDROIDX_VERSION") - implementation("androidx.appcompat:appcompat:$ANDROIDX_VERSION") - implementation "androidx.core:core-ktx:+" + implementation "androidx.annotation:annotation:1.2.0" + implementation "androidx.appcompat:appcompat:1.3.1" + implementation "androidx.core:core-ktx:1.6.0" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/library/src/main/java/com/tokenautocomplete/CharacterTokenizer.kt b/library/src/main/java/com/tokenautocomplete/CharacterTokenizer.kt index 549b308..7c41eed 100644 --- a/library/src/main/java/com/tokenautocomplete/CharacterTokenizer.kt +++ b/library/src/main/java/com/tokenautocomplete/CharacterTokenizer.kt @@ -1,7 +1,6 @@ package com.tokenautocomplete import android.annotation.SuppressLint -import android.os.Parcelable import android.text.SpannableString import android.text.Spanned import android.text.TextUtils diff --git a/library/src/main/java/com/tokenautocomplete/TokenCompleteTextView.kt b/library/src/main/java/com/tokenautocomplete/TokenCompleteTextView.kt index 0bed653..45d9ef8 100644 --- a/library/src/main/java/com/tokenautocomplete/TokenCompleteTextView.kt +++ b/library/src/main/java/com/tokenautocomplete/TokenCompleteTextView.kt @@ -190,15 +190,15 @@ abstract class TokenCompleteTextView : AppCompatAutoCompleteTextView, On initialized = true } - constructor(context: Context?) : super(context) { + constructor(context: Context) : super(context) { init() } - constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) { + constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) { init() } - constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super( + constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super( context, attrs, defStyle @@ -605,7 +605,7 @@ abstract class TokenCompleteTextView : AppCompatAutoCompleteTextView, On imm.hideSoftInputFromWindow(windowToken, 0) } - override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean { + override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean { val handled = super.onKeyUp(keyCode, event) if (shouldFocusNext) { shouldFocusNext = false @@ -614,10 +614,10 @@ abstract class TokenCompleteTextView : AppCompatAutoCompleteTextView, On return handled } - override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean { + override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean { var handled = false when (keyCode) { - KeyEvent.KEYCODE_TAB, KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_DPAD_CENTER -> if (event.hasNoModifiers()) { + KeyEvent.KEYCODE_TAB, KeyEvent.KEYCODE_ENTER, KeyEvent.KEYCODE_DPAD_CENTER -> if (event?.hasNoModifiers() == true) { shouldFocusNext = true handled = true } @@ -642,7 +642,7 @@ abstract class TokenCompleteTextView : AppCompatAutoCompleteTextView, On return false } - override fun onEditorAction(view: TextView, action: Int, keyEvent: KeyEvent): Boolean { + override fun onEditorAction(view: TextView, action: Int, keyEvent: KeyEvent?): Boolean { if (action == EditorInfo.IME_ACTION_DONE) { handleDone() return true @@ -1142,6 +1142,7 @@ abstract class TokenCompleteTextView : AppCompatAutoCompleteTextView, On //Make sure the selection is not in the middle of the span setSelection(text.getSpanEnd(this)) } + else -> {} } } }