List of usage examples for android.os LocaleList setDefault
public static void setDefault(@NonNull @Size(min = 1) LocaleList locales)
From source file:com.android.settings.localepicker.LocaleDragAndDropAdapter.java
public void updateLocalesWhenAnimationStops(final LocaleList localeList) { if (localeList.equals(mLocalesToSetNext)) { return;/*from www . j a v a 2 s . c o m*/ } // This will only update the Settings application to make things feel more responsive, // the system will be updated later, when animation stopped. LocaleList.setDefault(localeList); mLocalesToSetNext = localeList; final RecyclerView.ItemAnimator itemAnimator = mParentView.getItemAnimator(); itemAnimator.isRunning(new RecyclerView.ItemAnimator.ItemAnimatorFinishedListener() { @Override public void onAnimationsFinished() { if (mLocalesToSetNext == null || mLocalesToSetNext.equals(mLocalesSetLast)) { // All animations finished, but the locale list did not change return; } LocalePicker.updateLocales(mLocalesToSetNext); mLocalesSetLast = mLocalesToSetNext; mLocalesToSetNext = null; mNumberFormatter = NumberFormat.getNumberInstance(Locale.getDefault()); } }); }