Localize ok/cancel

This commit is contained in:
Moxie Marlinspike 2013-02-09 17:38:33 -08:00
parent 471ef16a5b
commit 2277dbd572

View File

@ -16,9 +16,6 @@
*/ */
package org.thoughtcrime.securesms.preferences; package org.thoughtcrime.securesms.preferences;
import org.thoughtcrime.securesms.ApplicationPreferencesActivity;
import org.thoughtcrime.securesms.R;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.preference.DialogPreference; import android.preference.DialogPreference;
@ -29,6 +26,9 @@ import android.widget.SeekBar;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
import org.thoughtcrime.securesms.ApplicationPreferencesActivity;
import org.thoughtcrime.securesms.R;
/** /**
* Dialog preference for encryption passphrase timeout. * Dialog preference for encryption passphrase timeout.
* *
@ -44,8 +44,8 @@ public class PassphraseTimeoutPreference extends DialogPreference {
public PassphraseTimeoutPreference(Context context, AttributeSet attrs) { public PassphraseTimeoutPreference(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
this.setDialogLayoutResource(R.layout.passphrase_timeout_dialog); this.setDialogLayoutResource(R.layout.passphrase_timeout_dialog);
this.setPositiveButtonText("Ok"); this.setPositiveButtonText(android.R.string.ok);
this.setNegativeButtonText("Cancel"); this.setNegativeButtonText(android.R.string.cancel);
} }
@Override @Override
@ -100,6 +100,7 @@ public class PassphraseTimeoutPreference extends DialogPreference {
} }
private class ScaleSelectedListener implements AdapterView.OnItemSelectedListener { private class ScaleSelectedListener implements AdapterView.OnItemSelectedListener {
@Override
public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long selected) { public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long selected) {
if (selected == 0) { if (selected == 0) {
seekBar.setMax(60); seekBar.setMax(60);
@ -108,12 +109,14 @@ public class PassphraseTimeoutPreference extends DialogPreference {
} }
} }
@Override
public void onNothingSelected(AdapterView<?> arg0) { public void onNothingSelected(AdapterView<?> arg0) {
} }
} }
private class SeekbarChangedListener implements SeekBar.OnSeekBarChangeListener { private class SeekbarChangedListener implements SeekBar.OnSeekBarChangeListener {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (progress < 1) if (progress < 1)
progress = 1; progress = 1;
@ -121,9 +124,11 @@ public class PassphraseTimeoutPreference extends DialogPreference {
timeoutText.setText(progress +""); timeoutText.setText(progress +"");
} }
@Override
public void onStartTrackingTouch(SeekBar seekBar) { public void onStartTrackingTouch(SeekBar seekBar) {
} }
@Override
public void onStopTrackingTouch(SeekBar seekBar) { public void onStopTrackingTouch(SeekBar seekBar) {
} }