Bug 1060496 - Make search activity locale-aware. r=margaret

This commit is contained in:
Richard Newman 2014-09-02 15:31:24 -07:00
Родитель deea8c1c11
Коммит 750f0835c7
2 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -20,6 +20,7 @@ import com.nineoldandroids.animation.Animator;
import com.nineoldandroids.animation.AnimatorSet; import com.nineoldandroids.animation.AnimatorSet;
import com.nineoldandroids.animation.ObjectAnimator; import com.nineoldandroids.animation.ObjectAnimator;
import org.mozilla.gecko.LocaleAware;
import org.mozilla.gecko.Telemetry; import org.mozilla.gecko.Telemetry;
import org.mozilla.gecko.TelemetryContract; import org.mozilla.gecko.TelemetryContract;
import org.mozilla.gecko.db.BrowserContract.SearchHistory; import org.mozilla.gecko.db.BrowserContract.SearchHistory;
@ -32,7 +33,7 @@ import org.mozilla.search.autocomplete.SuggestionsFragment;
* State management is delegated to child fragments. Fragments communicate * State management is delegated to child fragments. Fragments communicate
* with each other by passing messages through this activity. * with each other by passing messages through this activity.
*/ */
public class MainActivity extends FragmentActivity implements AcceptsSearchQuery { public class MainActivity extends LocaleAware.LocaleAwareFragmentActivity implements AcceptsSearchQuery {
private static final String KEY_SEARCH_STATE = "search_state"; private static final String KEY_SEARCH_STATE = "search_state";
private static final String KEY_EDIT_STATE = "edit_state"; private static final String KEY_EDIT_STATE = "edit_state";

Просмотреть файл

@ -18,6 +18,7 @@ import android.util.Log;
import android.widget.Toast; import android.widget.Toast;
import org.mozilla.gecko.GeckoSharedPrefs; import org.mozilla.gecko.GeckoSharedPrefs;
import org.mozilla.gecko.LocaleAware;
import org.mozilla.gecko.Telemetry; import org.mozilla.gecko.Telemetry;
import org.mozilla.gecko.TelemetryContract; import org.mozilla.gecko.TelemetryContract;
import org.mozilla.gecko.db.BrowserContract; import org.mozilla.gecko.db.BrowserContract;
@ -49,6 +50,7 @@ public class SearchPreferenceActivity extends PreferenceActivity
@Override @Override
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
LocaleAware.initializeLocale(getApplicationContext());
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getPreferenceManager().setSharedPreferencesName(GeckoSharedPrefs.APP_PREFS_NAME); getPreferenceManager().setSharedPreferencesName(GeckoSharedPrefs.APP_PREFS_NAME);