am 657bdd7d: Merge change I8a575e49 into eclair

Merge commit '657bdd7d2851cd3b09f156c4abd085614efdc593' into eclair-plus-aosp

* commit '657bdd7d2851cd3b09f156c4abd085614efdc593':
  Fix CustomLocale to work with soft keyboard.
This commit is contained in:
Raphael
2009-10-07 11:32:26 -07:00
committed by Android Git Automerger
2 changed files with 2 additions and 18 deletions

View File

@@ -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

View File

@@ -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;
}
}