Bug 1243354 - Part 1: Correctly handle TextInputLayout in PromptInput r=mcomella

--HG--
extra : commitid : 4qDwuU4XQ2l
This commit is contained in:
Andrzej Hunt 2016-01-29 15:33:18 -08:00
Родитель da73fa0a49
Коммит 820eb69647
1 изменённых файлов: 7 добавлений и 12 удалений

Просмотреть файл

@ -96,8 +96,8 @@ public class PromptInput {
@Override
public Object getValue() {
EditText edit = (EditText)mView;
return edit.getText();
final TextInputLayout inputLayout = (TextInputLayout) mView;
return inputLayout.getEditText().getText();
}
}
@ -109,7 +109,8 @@ public class PromptInput {
@Override
public View getView(final Context context) throws UnsupportedOperationException {
EditText input = (EditText) super.getView(context);
final TextInputLayout inputLayout = (TextInputLayout) super.getView(context);
final EditText input = inputLayout.getEditText();
input.setRawInputType(Configuration.KEYBOARD_12KEY);
input.setInputType(InputType.TYPE_CLASS_NUMBER |
InputType.TYPE_NUMBER_FLAG_SIGNED);
@ -125,17 +126,11 @@ public class PromptInput {
@Override
public View getView(Context context) throws UnsupportedOperationException {
EditText input = (EditText) super.getView(context);
input.setInputType(InputType.TYPE_CLASS_TEXT |
final TextInputLayout inputLayout = (TextInputLayout) super.getView(context);
inputLayout.getEditText().setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_VARIATION_PASSWORD |
InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
return input;
}
@Override
public Object getValue() {
EditText edit = (EditText)mView;
return edit.getText();
return inputLayout;
}
}