Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support showing keyboard programmatically #104

Merged
merged 6 commits into from
Apr 24, 2024
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 .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: ./gradlew testDebugUnitTest

acceptance:
runs-on: macos-latest
runs-on: macos-13

strategy:
matrix:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class SocialSecurityNumberFragment : Fragment() {
return binding.root
}

private fun autofill() {
binding.socialSecurityNumber.setText("234567890")
private fun autofill() {
binding.socialSecurityNumber.setText("234567890")
}

private fun tokenize() =
Expand Down
8 changes: 7 additions & 1 deletion lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ dependencies {
implementation 'com.google.code.gson:gson:2.10.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'pl.pragmatists:JUnitParams:1.1.1'
testImplementation 'org.robolectric:robolectric:4.10.3'
testImplementation 'org.robolectric:robolectric:4.12.1'
testImplementation 'io.strikt:strikt-core:0.34.1'
testImplementation 'io.mockk:mockk:1.13.8'
testImplementation("com.squareup.okhttp3:mockwebserver:4.11.0")
Expand All @@ -95,5 +95,11 @@ configurations.configureEach {
}
details.useVersion("2.2")
}
if (details.requested.module.toString() == 'org.bouncycastle:bcprov-jdk18on') {
details.artifactSelection {
it.selectArtifact(DependencyArtifact.DEFAULT_TYPE, null, null)
}
details.useVersion("1.78")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ import android.view.View.OnTouchListener
import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputConnection
import android.view.inputmethod.InputMethodManager
import android.widget.FrameLayout
import androidx.annotation.RequiresApi
import androidx.appcompat.widget.AppCompatEditText
import androidx.core.content.getSystemService
import androidx.core.content.res.ResourcesCompat
import androidx.core.os.bundleOf
import com.basistheory.android.R
Expand Down Expand Up @@ -156,6 +158,11 @@ open class TextElement @JvmOverloads constructor(
)
}

fun showKeyboard(flags: Int) {
val imm = context.getSystemService<InputMethodManager>()
imm!!.showSoftInput(_editText, flags)
}

fun getDrawables(): Array<Drawable?> {
return _editText.compoundDrawables
}
Expand Down
Loading