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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
4 changes: 2 additions & 2 deletions example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 3 additions & 5 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ abstract class TokenCompleteTextView<T: Any> : 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
Expand Down Expand Up @@ -605,7 +605,7 @@ abstract class TokenCompleteTextView<T: Any> : 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
Expand All @@ -614,10 +614,10 @@ abstract class TokenCompleteTextView<T: Any> : 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
}
Expand All @@ -642,7 +642,7 @@ abstract class TokenCompleteTextView<T: Any> : 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
Expand Down Expand Up @@ -1142,6 +1142,7 @@ abstract class TokenCompleteTextView<T: Any> : AppCompatAutoCompleteTextView, On
//Make sure the selection is not in the middle of the span
setSelection(text.getSpanEnd(this))
}
else -> {}
}
}
}
Expand Down