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)
This commit is contained in:
Phil Ringnalda 2016-01-22 23:06:55 -08:00
parent ddef27179c
commit 6e4e0e8d51
3 changed files with 34 additions and 66 deletions

View File

@ -5,6 +5,8 @@
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;
@ -43,8 +45,8 @@ 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;
@ -58,7 +60,6 @@ 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;
@ -72,7 +73,6 @@ 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;
@ -87,7 +87,6 @@ import android.widget.ListAdapter;
import android.widget.ListView;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@ -1290,18 +1289,14 @@ OnSharedPreferenceChangeListener
});
}
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 {
@ -1365,13 +1360,10 @@ OnSharedPreferenceChangeListener
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)
@ -1415,9 +1407,8 @@ OnSharedPreferenceChangeListener
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)

View File

@ -13,10 +13,10 @@ 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;
@ -67,7 +67,7 @@ public class PromptInput {
@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);
@ -87,10 +87,7 @@ public class PromptInput {
input.requestFocus();
}
TextInputLayout inputLayout = new TextInputLayout(context);
inputLayout.addView(input);
mView = (View) inputLayout;
mView = (View)input;
return mView;
}

View File

@ -5,50 +5,30 @@
<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">
<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_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>
<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_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.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>