mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
translate color setting pref dialog
This commit is contained in:
parent
3a7111c098
commit
22a9fbdb3e
1 changed files with 15 additions and 1 deletions
|
@ -35,6 +35,8 @@ import android.text.TextWatcher;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import junit.framework.Assert;
|
import junit.framework.Assert;
|
||||||
|
|
||||||
|
import org.eehouse.android.xw4.loc.LocUtils;
|
||||||
|
|
||||||
public class EditColorPreference extends DialogPreference {
|
public class EditColorPreference extends DialogPreference {
|
||||||
|
|
||||||
private Context m_context;
|
private Context m_context;
|
||||||
|
@ -111,6 +113,14 @@ public class EditColorPreference extends DialogPreference {
|
||||||
|
|
||||||
setWidgetLayoutResource( R.layout.color_display );
|
setWidgetLayoutResource( R.layout.color_display );
|
||||||
setDialogLayoutResource( R.layout.color_edit );
|
setDialogLayoutResource( R.layout.color_edit );
|
||||||
|
|
||||||
|
String title = getDialogTitle().toString();
|
||||||
|
String newTitle = LocUtils.xlateString( m_context, title );
|
||||||
|
if ( null != newTitle ) {
|
||||||
|
setDialogTitle( newTitle );
|
||||||
|
}
|
||||||
|
|
||||||
|
setNegativeButtonText( LocUtils.getString( context, R.string.button_cancel ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -136,6 +146,8 @@ public class EditColorPreference extends DialogPreference {
|
||||||
@Override
|
@Override
|
||||||
protected void onBindDialogView( View view )
|
protected void onBindDialogView( View view )
|
||||||
{
|
{
|
||||||
|
LocUtils.xlateView( m_context, view );
|
||||||
|
|
||||||
m_curColor = getPersistedColor();
|
m_curColor = getPersistedColor();
|
||||||
setOneByte( view, 0 );
|
setOneByte( view, 0 );
|
||||||
setOneByte( view, 1 );
|
setOneByte( view, 1 );
|
||||||
|
@ -161,7 +173,9 @@ public class EditColorPreference extends DialogPreference {
|
||||||
notifyChanged();
|
notifyChanged();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
builder.setPositiveButton( R.string.button_ok, lstnr );
|
|
||||||
|
String okText = LocUtils.getString( m_context, R.string.button_ok );
|
||||||
|
builder.setPositiveButton( okText, lstnr );
|
||||||
super.onPrepareDialogBuilder( builder );
|
super.onPrepareDialogBuilder( builder );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue