Add a header view to show the country in RegionZonePicker

Extra fixes in this CL
- Minor string update in time zone picker.
  Use date_time_search_region string in search bar,
  and date_time_set_timezone_title string for lower case "zone".
- Fixed b/76893139. Remove the unnecessary top padding in RecyclerView.
  Create a new layout file time_zone_items_list.xml without the padding.
- Add missing return statement when region ISO code
  is invalid in RegionZonePicker#getAllTimeZoneInfos

Bug: 76209571
Bug: 76893139
Test: m RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.datetime.timezone
Test: Verified that the strings are updated in the UI
Change-Id: I1fb3e2abf80da3cb53cfbc3363bbe46e40a6ac22
This commit is contained in:
Victor Chang
2018-03-27 17:34:53 +01:00
parent 201c629fcc
commit 65f09f3091
11 changed files with 161 additions and 32 deletions

View File

@@ -44,7 +44,7 @@ import java.util.Locale;
* The search matches the prefix of words in the search text.
*/
public abstract class BaseTimeZonePicker extends InstrumentedFragment
implements SearchView.OnQueryTextListener{
implements SearchView.OnQueryTextListener {
public static final String EXTRA_RESULT_REGION_ID =
"com.android.settings.datetime.timezone.result_region_id";
@@ -84,7 +84,7 @@ public abstract class BaseTimeZonePicker extends InstrumentedFragment
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.recycler_view, container, false);
final View view = inflater.inflate(R.layout.time_zone_items_list, container, false);
mRecyclerView = view.findViewById(R.id.recycler_view);
mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext(),
LinearLayoutManager.VERTICAL, /* reverseLayout */ false));