Back out 3 (more) changesets (bug 1227325) because B2GDroid is why Fennec can't have nice things
authorPhil Ringnalda <philringnalda@gmail.com>
Fri, 22 Jan 2016 23:06:55 -0800
changeset 281389 d5330fa5e4cae235932123c392a29df1b1678f8b
parent 281388 49f7dd0ab773b2e929466d3acae8efaed38e552d
child 281390 ab602ecfad88669fdf4d2174a8d74324eb1cf5d6
push id29935
push userphilringnalda@gmail.com
push dateSun, 24 Jan 2016 02:12:02 +0000
treeherdermozilla-central@a2e81822194a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1227325
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Back out 3 (more) changesets (bug 1227325) because B2GDroid is why Fennec can't have nice things CLOSED TREE Backed out changeset d50bbdbc596b (bug 1227325) Backed out changeset d868de0c4779 (bug 1227325) Backed out changeset a26c5c9ab77d (bug 1227325)
mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
mobile/android/base/java/org/mozilla/gecko/prompts/PromptInput.java
mobile/android/base/resources/layout/bookmark_edit.xml
--- a/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
+++ b/mobile/android/base/java/org/mozilla/gecko/preferences/GeckoPreferences.java
@@ -1,15 +1,17 @@
 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.preferences;
 
+import android.Manifest;
+import android.annotation.TargetApi;
 import org.mozilla.gecko.AboutPages;
 import org.mozilla.gecko.AdjustConstants;
 import org.mozilla.gecko.AppConstants;
 import org.mozilla.gecko.AppConstants.Versions;
 import org.mozilla.gecko.BrowserApp;
 import org.mozilla.gecko.BrowserLocaleManager;
 import org.mozilla.gecko.DataReportingNotification;
 import org.mozilla.gecko.EventDispatcher;
@@ -38,61 +40,58 @@ import org.mozilla.gecko.updater.UpdateS
 import org.mozilla.gecko.updater.UpdateServiceHelper;
 import org.mozilla.gecko.util.EventCallback;
 import org.mozilla.gecko.util.GeckoEventListener;
 import org.mozilla.gecko.util.HardwareUtils;
 import org.mozilla.gecko.util.InputOptionsUtils;
 import org.mozilla.gecko.util.NativeEventListener;
 import org.mozilla.gecko.util.NativeJSObject;
 import org.mozilla.gecko.util.ThreadUtils;
+import org.mozilla.gecko.widget.FloatingHintEditText;
 
-import android.annotation.TargetApi;
 import android.app.ActionBar;
 import android.app.AlertDialog;
 import android.app.Dialog;
 import android.app.Fragment;
 import android.app.FragmentManager;
 import android.app.NotificationManager;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
 import android.content.res.Configuration;
-import android.Manifest;
 import android.os.Build;
 import android.os.Bundle;
 import android.preference.CheckBoxPreference;
 import android.preference.EditTextPreference;
 import android.preference.ListPreference;
 import android.preference.Preference;
 import android.preference.Preference.OnPreferenceChangeListener;
 import android.preference.Preference.OnPreferenceClickListener;
 import android.preference.PreferenceActivity;
 import android.preference.PreferenceGroup;
 import android.preference.PreferenceScreen;
 import android.preference.TwoStatePreference;
 import android.support.design.widget.Snackbar;
-import android.support.design.widget.TextInputLayout;
 import android.text.Editable;
 import android.text.InputType;
 import android.text.TextUtils;
 import android.text.TextWatcher;
 import android.util.Log;
 import android.view.MenuItem;
 import android.view.View;
 import android.widget.AdapterView;
 import android.widget.EditText;
 import android.widget.LinearLayout;
 import android.widget.ListAdapter;
 import android.widget.ListView;
 
 import org.json.JSONObject;
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 
 public class GeckoPreferences
@@ -1285,28 +1284,24 @@ OnSharedPreferenceChangeListener
                     @Override
                     public void run() {
                         preference.setChecked(true);
                         broadcastStumblerPref(GeckoPreferences.this, true);
                     }
                 });
     }
 
-    private TextInputLayout getTextBox(int aHintText) {
-        final EditText input = new EditText(this);
+    private EditText getTextBox(int aHintText) {
+        EditText input = new FloatingHintEditText(this);
         int inputtype = InputType.TYPE_CLASS_TEXT;
         inputtype |= InputType.TYPE_TEXT_VARIATION_PASSWORD | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
         input.setInputType(inputtype);
 
         input.setHint(aHintText);
-
-        final TextInputLayout layout = new TextInputLayout(this);
-        layout.addView(input);
-
-        return layout;
+        return input;
     }
 
     private class PasswordTextWatcher implements TextWatcher {
         EditText input1;
         EditText input2;
         AlertDialog dialog;
 
         PasswordTextWatcher(EditText aInput1, EditText aInput2, AlertDialog aDialog) {
@@ -1360,23 +1355,20 @@ OnSharedPreferenceChangeListener
     @Override
     protected Dialog onCreateDialog(int id) {
         AlertDialog.Builder builder = new AlertDialog.Builder(this);
         LinearLayout linearLayout = new LinearLayout(this);
         linearLayout.setOrientation(LinearLayout.VERTICAL);
         AlertDialog dialog;
         switch(id) {
             case DIALOG_CREATE_MASTER_PASSWORD:
-                final TextInputLayout inputLayout1 = getTextBox(R.string.masterpassword_password);
-                final TextInputLayout inputLayout2 = getTextBox(R.string.masterpassword_confirm);
-                linearLayout.addView(inputLayout1);
-                linearLayout.addView(inputLayout2);
-
-                final EditText input1 = inputLayout1.getEditText();
-                final EditText input2 = inputLayout2.getEditText();
+                final EditText input1 = getTextBox(R.string.masterpassword_password);
+                final EditText input2 = getTextBox(R.string.masterpassword_confirm);
+                linearLayout.addView(input1);
+                linearLayout.addView(input2);
 
                 builder.setTitle(R.string.masterpassword_create_title)
                        .setView((View) linearLayout)
                        .setPositiveButton(R.string.button_ok, new DialogInterface.OnClickListener() {
                             @Override
                             public void onClick(DialogInterface dialog, int which) {
                                 JSONObject jsonPref = new JSONObject();
                                 try {
@@ -1410,19 +1402,18 @@ OnSharedPreferenceChangeListener
                         });
 
                         PasswordTextWatcher watcher = new PasswordTextWatcher(input1, input2, dialog);
                         input1.addTextChangedListener((TextWatcher) watcher);
                         input2.addTextChangedListener((TextWatcher) watcher);
 
                 break;
             case DIALOG_REMOVE_MASTER_PASSWORD:
-                final TextInputLayout inputLayout = getTextBox(R.string.masterpassword_password);
-                linearLayout.addView(inputLayout);
-                final EditText input = inputLayout.getEditText();
+                final EditText input = getTextBox(R.string.masterpassword_password);
+                linearLayout.addView(input);
 
                 builder.setTitle(R.string.masterpassword_remove_title)
                        .setView((View) linearLayout)
                        .setPositiveButton(R.string.button_ok, new DialogInterface.OnClickListener() {
                             @Override
                             public void onClick(DialogInterface dialog, int which) {
                                 PrefsHelper.setPref(PREFS_MP_ENABLED, input.getText().toString());
                             }
--- 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 EditText(context);
+            EditText input = new FloatingHintEditText(context);
             input.setInputType(InputType.TYPE_CLASS_TEXT);
             input.setText(mValue);
 
             if (!TextUtils.isEmpty(mHint)) {
                 input.setHint(mHint);
             }
 
             if (mAutofocus) {
@@ -82,20 +82,17 @@ public class PromptInput {
                         if (hasFocus) {
                             ((InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE)).showSoftInput(v, 0);
                         }
                     }
                 });
                 input.requestFocus();
             }
 
-            TextInputLayout inputLayout = new TextInputLayout(context);
-            inputLayout.addView(input);
-
-            mView = (View) inputLayout;
+            mView = (View)input;
             return mView;
         }
 
         @Override
         public Object getValue() {
             EditText edit = (EditText)mView;
             return edit.getText();
         }
--- a/mobile/android/base/resources/layout/bookmark_edit.xml
+++ b/mobile/android/base/resources/layout/bookmark_edit.xml
@@ -1,54 +1,34 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              xmlns:app="http://schemas.android.com/apk/res-auto"
               android:layout_width="match_parent"
               android:orientation="vertical"
               android:layout_height="match_parent">
 
-    <android.support.design.widget.TextInputLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            app:hintAnimationEnabled="true">
-
-        <EditText
-                android:id="@+id/edit_bookmark_name"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:singleLine="true"
-                android:hint="@string/bookmark_edit_name"
-                />
-    </android.support.design.widget.TextInputLayout>
-
-    <android.support.design.widget.TextInputLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            app:hintAnimationEnabled="true">
+    <org.mozilla.gecko.widget.FloatingHintEditText
+              android:id="@+id/edit_bookmark_name"
+              android:layout_width="match_parent"
+              android:layout_height="wrap_content"
+              android:singleLine="true"
+              android:hint="@string/bookmark_edit_name"/>
 
-        <EditText
-                android:id="@+id/edit_bookmark_location"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:singleLine="true"
-                android:hint="@string/bookmark_edit_location"
-                android:inputType="textNoSuggestions"/>
-    </android.support.design.widget.TextInputLayout>
+    <org.mozilla.gecko.widget.FloatingHintEditText
+              android:id="@+id/edit_bookmark_location"
+              android:layout_width="match_parent"
+              android:layout_height="wrap_content"
+              android:singleLine="true"
+              android:hint="@string/bookmark_edit_location"
+              android:inputType="textNoSuggestions"/>
 
-    <android.support.design.widget.TextInputLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            app:hintAnimationEnabled="true">
-
-        <EditText
-                android:id="@+id/edit_bookmark_keyword"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:singleLine="true"
-                android:hint="@string/bookmark_edit_keyword"/>
-    </android.support.design.widget.TextInputLayout>
+    <org.mozilla.gecko.widget.FloatingHintEditText
+              android:id="@+id/edit_bookmark_keyword"
+              android:layout_width="match_parent"
+              android:layout_height="wrap_content"
+              android:singleLine="true"
+              android:hint="@string/bookmark_edit_keyword"/>
 
 </LinearLayout>