Use 24-hour settings for time formatting
Test: m RunSettingsRoboTests Bug: 72311296 Change-Id: I7c1458dbc2e4e15765f703c35a0113341b912a2b
This commit is contained in:
@@ -35,6 +35,7 @@ import com.android.settings.R;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Adapter for showing {@link TimeZoneInfo} objects in a recycler view.
|
||||
@@ -55,7 +56,11 @@ class TimeZoneAdapter extends RecyclerView.Adapter {
|
||||
TimeZoneAdapter(View.OnClickListener onClickListener, Context context) {
|
||||
mOnClickListener = onClickListener;
|
||||
mContext = context;
|
||||
mTimeFormat = DateFormat.getTimeInstance(SimpleDateFormat.SHORT);
|
||||
// Use android.text.format.DateFormat to observe 24-hour settings and find the best pattern
|
||||
// using ICU with skeleton.
|
||||
mTimeFormat = new SimpleDateFormat(
|
||||
android.text.format.DateFormat.getTimeFormatString(context),
|
||||
Locale.getDefault());
|
||||
mDateFormat = DateFormat.getDateInstance(SimpleDateFormat.MEDIUM);
|
||||
mDateFormat.setContext(DisplayContext.CAPITALIZATION_NONE);
|
||||
mCurrentTimeZone = TimeZone.getDefault().getID();
|
||||
|
Reference in New Issue
Block a user