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
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: KMManager.getPredictionsSuspended()
title: KMManager.getPredictionsSuspended() (Deprecated)
---

## Summary
The **getPredictionsSuspended()** method returns a flag that determines whether predictions are temporarily disabled because the currently selected text field is a hidden password text field or a numeric text field.

Expand All @@ -24,6 +23,7 @@ Use this method to check if predictions are temporarily disabled because of the

## History
Added syntax in Keyman Engine for Android 18.0.
Deprecated syntax in Keyman Engine for Android 19.0 in favor of [`setInputType`](setInputType), as it better maintains predictive-text state.

## See also
* [setPredictionsSuspended](setPredictionsSuspended)
11 changes: 7 additions & 4 deletions developer/engine/android/19.0/KMManager/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ The KMManager is the core class which provides most of the methods and constants
[`getOrientation()`](getOrientation)
: returns the device's current orientation (Portrait vs Landscape)

[`getPredictionsSuspended()`](getPredictionsSuspended)
: returns whether predictions are temporarily disabled because the currently selected text field is a hidden password text field or a numeric text field.
~~`getPredictionsSuspended()`~~ `(Deprecated)`
: returns whether predictions are temporarily disabled because the currently selected text field is a hidden password text field or a numeric text field.

[`getSpacebarText()`](getSpacebarText)
: returns the current text display pattern for the spacebar
Expand Down Expand Up @@ -254,6 +254,9 @@ The KMManager is the core class which provides most of the methods and constants
[`setHTMLBanner()`](setHTMLBanner)
: sets the contents of an HTML banner for Keyman Engine to display when suggestions aren't available

[`setInputType()`](setInputType)
: informs the engine about what type of input text is expected, allowing it to configure predictive-text accordingly

[`setKeyboard()`](setKeyboard)
: sets the keyboard to be used

Expand All @@ -269,8 +272,8 @@ The KMManager is the core class which provides most of the methods and constants
[`setMaySendCrashReport()`](setMaySendCrashReport)
: sets whether Keyman Engine can send crash reports over the network to Sentry

[`setPredictionsSuspended()`](setPredictionsSuspended)
: sets whether predictions are temporarily disabled because the currently selected text field is a hidden password text field or a numeric text field.
~~`setPredictionsSuspended()`~~ `(Deprecated)`
: sets whether predictions are temporarily disabled because the currently selected text field is a hidden password text field or a numeric text field.

[`setShouldAllowSetKeyboard()`](setShouldAllowSetKeyboard)
: sets whether Keyman Engine allows setting a keyboard other than the default keyboard
Expand Down
38 changes: 38 additions & 0 deletions developer/engine/android/19.0/KMManager/setInputType.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: KMManager.setInputType()
---

## Summary
The **setInputType()** method allows the engine to configure which predictive-text features
will be presented to the user based upon the type of input expected for an input field.

## Syntax
```java
KMManager.setInputType(KeyboardType keyboardType, int inputType)
```

### Parameters

`keyboardType`
: The keyboard type. `KEYBOARD_TYPE_INAPP` or
`KEYBOARD_TYPE_SYSTEM`.

[`inputType`](https://developer.android.com/reference/android/text/InputType)
: An integer defining the basic context type of text being edited.


## Description
Use this method to allow the engine to determine what types of suggestions may be offered to the
user. It will disable predictions for contexts that should not provide them, such as password fields.
It will prevent autocorrect for contexts where text prediction will not likely give a perfect result,
such as email fields.

### Example: Using `setInputType()`
The following script illustrates the use of `setInputType()`:

```java
KMManager.setInputType(textView.getInputType());
```

## History
Added syntax in Keyman Engine for Android 19.0.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: KMManager.setPredictionsSuspended()
title: KMManager.setPredictionsSuspended() (Deprecated)
---

## Summary
Expand All @@ -9,7 +9,6 @@ The **setPredictionsSuspended()** method sets a flag to temporarily disable pred
```java
KMManager.setPredictionsSuspended(int inputType, KeyboardType keyboardType)
```

### Parameters

[`inputType`](https://developer.android.com/reference/android/text/InputType)
Expand All @@ -31,6 +30,7 @@ Use this method to temporarily disable predictions because of the currently sele

## History
Added syntax in Keyman Engine for Android 18.0.
Deprecated syntax in Keyman Engine for Android 19.0 in favor of [`setInputType`](setInputType).

## See also
* [getPredictionsSuspended](getPredictionsSuspended)
2 changes: 2 additions & 0 deletions developer/engine/android/19.0/whatsnew.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
title: What's New in Keyman Engine 19.0 for Android
---

* Added API for selecting and controlling what types of suggestions are offered
for different `Editable` input types (#16644)
* **BREAKING** Apps that use the functionality of Keyman Engine for Android will have to add `androidx.webkit:webkit:1.14.0` as a dependency (#16146)
* **KNOWN ISSUE** `sil_euro_latin` keyboard must be included in an app if `setDefaultKeyboard()` is not called during initialization (#16215)
* Added [Intent `com.tavultesoft.kmapro.keyboard_changed`](KMAPro/) which is broadcast when Keyman system keyboard changes and includes font name (#15193)
Expand Down
Loading