Axe482
Axe482

Reputation: 45

Is there a way to disable the Samsung keyboard toolbar programmatically?

I know how to disable the keyboard toolbar through the settings but was curious if anyone knew of a way to disable it through programming? Thanks

Upvotes: 4

Views: 1626

Answers (2)

Dragan N
Dragan N

Reputation: 61

In Jetpack Compose, in BasicTextField, one of the parameters could be keyboardOptions, which could contain platformImeOptions, like this:

keyboardOptions = KeyboardOptions.Default.copy(
      keyboardType = KeyboardType.Password,
      autoCorrect = false,
      capitalization = KeyboardCapitalization.Characters,
      platformImeOptions = AndroidImeOptions(privateImeOptions = "disableToolbar=true")
),

Upvotes: 1

Thomas Sunderland
Thomas Sunderland

Reputation: 462

I was messing around with this quite a bit today because our app runs in kiosk mode and the Samsung keyboard toolbar effectively provides a backdoor into the Android OS Settings which is obviously not ideal for an app running in kiosk mode.

Anyhow, adding the following properties is what finally did the trick for me. I hope this helps someone out.

android:inputType="textPassword|textVisiblePassword"
android:privateImeOptions="disableToolbar=true"

Upvotes: 7

Related Questions