Loading res/layout/time_zone_search_header.xml 0 → 100644 +28 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2019 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- similar to preference_material.xml but textview for emoji country flag instead of an ImageView --> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+android:id/title" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="16dp" android:layout_marginTop="16dp" android:textAppearance="@style/TextAppearance.CategoryTitle" android:textColor="?android:attr/colorAccent" android:paddingStart="@dimen/preference_no_icon_padding_start"/> src/com/android/settings/datetime/timezone/BaseTimeZoneAdapter.java +9 −3 Original line number Diff line number Diff line Loading @@ -79,7 +79,8 @@ public class BaseTimeZoneAdapter<T extends BaseTimeZoneAdapter.AdapterItem> LayoutInflater inflater = LayoutInflater.from(parent.getContext()); switch (viewType) { case TYPE_HEADER: { final View view = inflater.inflate(R.layout.preference_category_material, final View view = inflater.inflate( R.layout.time_zone_search_header, parent, false); return new HeaderViewHolder(view); } Loading Loading @@ -136,7 +137,8 @@ public class BaseTimeZoneAdapter<T extends BaseTimeZoneAdapter.AdapterItem> return mShowHeader && position == 0; } public @NonNull ArrayFilter getFilter() { @NonNull public ArrayFilter getFilter() { if (mFilter == null) { mFilter = new ArrayFilter(); } Loading @@ -153,14 +155,18 @@ public class BaseTimeZoneAdapter<T extends BaseTimeZoneAdapter.AdapterItem> public interface AdapterItem { CharSequence getTitle(); CharSequence getSummary(); String getIconText(); String getCurrentTime(); /** * @return unique non-negative number */ long getItemId(); String[] getSearchKeys(); } Loading Loading
res/layout/time_zone_search_header.xml 0 → 100644 +28 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2019 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- similar to preference_material.xml but textview for emoji country flag instead of an ImageView --> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+android:id/title" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="16dp" android:layout_marginTop="16dp" android:textAppearance="@style/TextAppearance.CategoryTitle" android:textColor="?android:attr/colorAccent" android:paddingStart="@dimen/preference_no_icon_padding_start"/>
src/com/android/settings/datetime/timezone/BaseTimeZoneAdapter.java +9 −3 Original line number Diff line number Diff line Loading @@ -79,7 +79,8 @@ public class BaseTimeZoneAdapter<T extends BaseTimeZoneAdapter.AdapterItem> LayoutInflater inflater = LayoutInflater.from(parent.getContext()); switch (viewType) { case TYPE_HEADER: { final View view = inflater.inflate(R.layout.preference_category_material, final View view = inflater.inflate( R.layout.time_zone_search_header, parent, false); return new HeaderViewHolder(view); } Loading Loading @@ -136,7 +137,8 @@ public class BaseTimeZoneAdapter<T extends BaseTimeZoneAdapter.AdapterItem> return mShowHeader && position == 0; } public @NonNull ArrayFilter getFilter() { @NonNull public ArrayFilter getFilter() { if (mFilter == null) { mFilter = new ArrayFilter(); } Loading @@ -153,14 +155,18 @@ public class BaseTimeZoneAdapter<T extends BaseTimeZoneAdapter.AdapterItem> public interface AdapterItem { CharSequence getTitle(); CharSequence getSummary(); String getIconText(); String getCurrentTime(); /** * @return unique non-negative number */ long getItemId(); String[] getSearchKeys(); } Loading