mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge pull request #649 from NativeScript/nnikolov/AndroidSecureTextBoxIssue
Fix for issue #640.
This commit is contained in:
@@ -205,20 +205,20 @@ export class EditableTextBase extends common.EditableTextBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var inputType = editableTextBase.android.getInputType();
|
var inputType = editableTextBase.android.getInputType();
|
||||||
inputType = inputType & ~28762; //28762 (0x00007000) 13,14,15bits
|
inputType = inputType & ~28672; //28672 (0x00070000) 13,14,15bits (111 0000 0000 0000)
|
||||||
|
|
||||||
switch (data.newValue) {
|
switch (data.newValue) {
|
||||||
case enums.AutocapitalizationType.none:
|
case enums.AutocapitalizationType.none:
|
||||||
//Do nothing, we have lowered the three bits above.
|
//Do nothing, we have lowered the three bits above.
|
||||||
break;
|
break;
|
||||||
case enums.AutocapitalizationType.words:
|
case enums.AutocapitalizationType.words:
|
||||||
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_CAP_WORDS; //8192 (0x00002000) 14th bit
|
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_CAP_WORDS; //8192 (0x00020000) 14th bit
|
||||||
break;
|
break;
|
||||||
case enums.AutocapitalizationType.sentences:
|
case enums.AutocapitalizationType.sentences:
|
||||||
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES; //16384(0x00004000) 15th bit
|
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES; //16384(0x00040000) 15th bit
|
||||||
break;
|
break;
|
||||||
case enums.AutocapitalizationType.allCharacters:
|
case enums.AutocapitalizationType.allCharacters:
|
||||||
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS; //4096 (0x00001000) 13th bit
|
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS; //4096 (0x00010000) 13th bit
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
|
inputType = inputType | android.text.InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function onSecurePropertyChanged(data: dependencyObservable.PropertyChangeData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Lower all autocapitalization bits, because password bits don't like them and we will receive "Unsupported input type: 16513" error for example.
|
// Lower all autocapitalization bits, because password bits don't like them and we will receive "Unsupported input type: 16513" error for example.
|
||||||
newInputType = newInputType & ~28762; //28762 (0x00007000) 13,14,15bits
|
newInputType = newInputType & ~28672; //28672 (0x0070000) 13,14,15 bits (111 0000 0000 0000)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (currentClass === android.text.InputType.TYPE_CLASS_TEXT) {
|
if (currentClass === android.text.InputType.TYPE_CLASS_TEXT) {
|
||||||
|
|||||||
Reference in New Issue
Block a user