Merge change I8a575e49 into eclair
* changes: Fix CustomLocale to work with soft keyboard.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
android:paddingLeft="8dip"
|
||||
android:paddingRight="8dip">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/new_locale_label" />
|
||||
<EditText
|
||||
|
||||
@@ -31,8 +31,7 @@ import android.widget.EditText;
|
||||
* "en_US") via an intent with a "locale" extra string and a "select" extra
|
||||
* boolean.
|
||||
*/
|
||||
public class NewLocaleDialog extends Activity
|
||||
implements View.OnClickListener, View.OnKeyListener {
|
||||
public class NewLocaleDialog extends Activity implements View.OnClickListener {
|
||||
|
||||
public static final String INTENT_EXTRA_LOCALE = "locale";
|
||||
public static final String INTENT_EXTRA_SELECT = "select";
|
||||
@@ -55,13 +54,9 @@ public class NewLocaleDialog extends Activity
|
||||
|
||||
mButtonAdd = (Button) findViewById(R.id.add);
|
||||
mButtonAdd.setOnClickListener(this);
|
||||
mButtonAdd.setEnabled(false);
|
||||
|
||||
mButtonAddSelect = (Button) findViewById(R.id.add_and_select);
|
||||
mButtonAddSelect.setOnClickListener(this);
|
||||
mButtonAddSelect.setEnabled(false);
|
||||
|
||||
mEditText.setOnKeyListener(this);
|
||||
}
|
||||
|
||||
public void onClick(View v) {
|
||||
@@ -79,15 +74,4 @@ public class NewLocaleDialog extends Activity
|
||||
|
||||
finish();
|
||||
}
|
||||
|
||||
public boolean onKey(View v, int keyCode, KeyEvent event) {
|
||||
boolean isEmpty = TextUtils.isEmpty(mEditText.getText());
|
||||
if (isEmpty != mWasEmpty) {
|
||||
mWasEmpty = isEmpty;
|
||||
|
||||
mButtonAdd.setEnabled(!isEmpty);
|
||||
mButtonAddSelect.setEnabled(!isEmpty);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user