mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
use a layout instead of a raw text widgit.
This commit is contained in:
parent
1cc2717d50
commit
d058e3fd4b
3 changed files with 18 additions and 1 deletions
9
xwords4/android/XWords4/res/layout/dflt_name.xml
Normal file
9
xwords4/android/XWords4/res/layout/dflt_name.xml
Normal file
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<EditText xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:autoText="false"
|
||||
android:capitalize="words"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
/>
|
|
@ -161,7 +161,8 @@ public class GamesList extends XWListActivity
|
|||
});
|
||||
break;
|
||||
case GET_NAME:
|
||||
final EditText etext = new EditText( this );
|
||||
final EditText etext =
|
||||
(EditText)Utils.inflate( this, R.layout.dflt_name );
|
||||
etext.setText( CommonPrefs.getDefaultPlayerName( this, 0,
|
||||
true ) );
|
||||
dialog = new AlertDialog.Builder( this )
|
||||
|
|
|
@ -32,6 +32,7 @@ import android.app.Activity;
|
|||
import android.app.Dialog;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.text.format.Time;
|
||||
import java.util.Formatter;
|
||||
|
@ -104,6 +105,12 @@ public class Utils {
|
|||
Toast.makeText( context, text, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
public static View inflate( Context context, int layoutId )
|
||||
{
|
||||
LayoutInflater factory = LayoutInflater.from( context );
|
||||
return factory.inflate( layoutId, null );
|
||||
}
|
||||
|
||||
public static void setChecked( Activity activity, int id, boolean value )
|
||||
{
|
||||
CheckBox cbx = (CheckBox)activity.findViewById( id );
|
||||
|
|
Loading…
Reference in a new issue