Bug 1227325 - Part 2: Upgrade PromptInput to use TextInputLayout r=mcomella
--- a/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java
+++ b/mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java
@@ -8,20 +8,20 @@ package org.mozilla.gecko.prompts;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import org.json.JSONObject;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.widget.AllCapsTextView;
import org.mozilla.gecko.widget.DateTimePicker;
-import org.mozilla.gecko.widget.FloatingHintEditText;
import android.content.Context;
import android.content.res.Configuration;
+import android.support.design.widget.TextInputLayout;
import android.support.v7.widget.AppCompatCheckBox;
import android.text.Html;
import android.text.InputType;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
@@ -62,17 +62,17 @@ public class PromptInput {
public EditInput(JSONObject object) {
super(object);
mHint = object.optString("hint");
mAutofocus = object.optBoolean("autofocus");
}
@Override
public View getView(final Context context) throws UnsupportedOperationException {
- EditText input = new FloatingHintEditText(context);
+ EditText input = new EditText(context);
input.setInputType(InputType.TYPE_CLASS_TEXT);
input.setText(mValue);
if (!TextUtils.isEmpty(mHint)) {
input.setHint(mHint);
}
if (mAutofocus) {
@@ -82,17 +82,20 @@ public class PromptInput {
if (hasFocus) {
((InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(v, 0);
}
}
});
input.requestFocus();
}
- mView = (View)input;
+ TextInputLayout inputLayout = new TextInputLayout(context);
+ inputLayout.addView(input);
+
+ mView = (View) inputLayout;
return mView;
}
@Override
public Object getValue() {
EditText edit = (EditText)mView;
return edit.getText();
}