From e7b7f0808fc124fa2baa260bcc9278210b464d43 Mon Sep 17 00:00:00 2001 From: Fahim Date: Fri, 10 Dec 2021 21:35:45 +0600 Subject: [PATCH] 4366-P-UI_revamp issue: https://gitlab.e.foundation/e/backlog/-/issues/4366 --- Android.mk | 5 +- res/drawable/ic_back.xml | 24 ++++++++ res/drawable/ic_close_24dp.xml | 5 +- res/drawable/ic_overflow.xml | 24 ++++++++ res/drawable/ic_search_24dp.xml | 5 +- res/layout/search_intent_item.xml | 1 - res/layout/search_panel.xml | 6 +- res/layout/search_saved_query_item.xml | 1 - res/values-night/bools.xml | 20 +++++++ res/values/bools.xml | 20 +++++++ res/values/colors.xml | 11 +++- res/values/themes.xml | 57 ++++++++++++++++++- .../intelligence/search/SearchFragment.java | 7 +++ 13 files changed, 169 insertions(+), 17 deletions(-) create mode 100644 res/drawable/ic_back.xml create mode 100644 res/drawable/ic_overflow.xml create mode 100644 res/values-night/bools.xml create mode 100644 res/values/bools.xml diff --git a/Android.mk b/Android.mk index b565774..3b1b18d 100644 --- a/Android.mk +++ b/Android.mk @@ -20,9 +20,12 @@ LOCAL_PACKAGE_NAME := SettingsIntelligence LOCAL_MODULE_TAGS := optional LOCAL_PROGUARD_FLAG_FILES := proguard.cfg -LOCAL_SDK_VERSION := system_current LOCAL_PRIVILEGED_MODULE := true +LOCAL_PRIVATE_PLATFORM_APIS := true + +LOCAL_STATIC_JAVA_LIBRARIES += org.lineageos.platform.sdk + LOCAL_STATIC_ANDROID_LIBRARIES := \ android-support-v4 \ android-support-v13 \ diff --git a/res/drawable/ic_back.xml b/res/drawable/ic_back.xml new file mode 100644 index 0000000..a7cf3a8 --- /dev/null +++ b/res/drawable/ic_back.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/res/drawable/ic_close_24dp.xml b/res/drawable/ic_close_24dp.xml index 17451d3..c66e976 100644 --- a/res/drawable/ic_close_24dp.xml +++ b/res/drawable/ic_close_24dp.xml @@ -20,9 +20,8 @@ android:width="24dp" android:height="24dp" android:viewportHeight="24.0" - android:viewportWidth="24.0" - android:tint="?android:attr/colorControlNormal"> + android:viewportWidth="24.0"> diff --git a/res/drawable/ic_overflow.xml b/res/drawable/ic_overflow.xml new file mode 100644 index 0000000..28720a6 --- /dev/null +++ b/res/drawable/ic_overflow.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/res/drawable/ic_search_24dp.xml b/res/drawable/ic_search_24dp.xml index 8f14e88..b898287 100644 --- a/res/drawable/ic_search_24dp.xml +++ b/res/drawable/ic_search_24dp.xml @@ -19,11 +19,10 @@ android:width="24dp" android:height="24dp" android:viewportWidth="24" - android:viewportHeight="24" - android:tint="?android:attr/colorControlNormal"> + android:viewportHeight="24"> diff --git a/res/layout/search_intent_item.xml b/res/layout/search_intent_item.xml index 6bc00ad..e188182 100644 --- a/res/layout/search_intent_item.xml +++ b/res/layout/search_intent_item.xml @@ -22,7 +22,6 @@ android:paddingTop="16dp" android:paddingBottom="16dp" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" - android:background="?android:attr/selectableItemBackground" android:clipToPadding="false"> diff --git a/res/layout/search_panel.xml b/res/layout/search_panel.xml index 8abc2bd..9fa2823 100644 --- a/res/layout/search_panel.xml +++ b/res/layout/search_panel.xml @@ -25,7 +25,7 @@ android:id="@+id/search_bar_container" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="?android:attr/colorPrimary" + android:background="?android:attr/colorPrimaryDark" android:elevation="4dp"> @@ -49,7 +48,8 @@ android:layout_height="match_parent" android:iconifiedByDefault="false" android:imeOptions="actionSearch|flagNoExtractUi" - android:searchIcon="@null"/> + android:searchIcon="@null" + app:theme="@style/AppSearchView"/> diff --git a/res/layout/search_saved_query_item.xml b/res/layout/search_saved_query_item.xml index f8c239a..44d46e0 100644 --- a/res/layout/search_saved_query_item.xml +++ b/res/layout/search_saved_query_item.xml @@ -21,7 +21,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" - android:background="?android:attr/selectableItemBackground" android:minHeight="?android:attr/listPreferredItemHeight" android:gravity="center_vertical"> diff --git a/res/values-night/bools.xml b/res/values-night/bools.xml new file mode 100644 index 0000000..69f56b1 --- /dev/null +++ b/res/values-night/bools.xml @@ -0,0 +1,20 @@ + + + + + false + \ No newline at end of file diff --git a/res/values/bools.xml b/res/values/bools.xml new file mode 100644 index 0000000..4ea9457 --- /dev/null +++ b/res/values/bools.xml @@ -0,0 +1,20 @@ + + + + + true + \ No newline at end of file diff --git a/res/values/colors.xml b/res/values/colors.xml index a2105f0..6f28967 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -16,7 +16,14 @@ --> - #ff008577 + @lineageos.platform:color/color_default_primary + @lineageos.platform:color/color_default_primary_dark + @lineageos.platform:color/color_default_accent + @lineageos.platform:color/color_default_background + @lineageos.platform:color/color_default_primary_text + @lineageos.platform:color/color_default_secondary_text - #f2f2f2 + @color/color_default_accent + + @color/color_default_background diff --git a/res/values/themes.xml b/res/values/themes.xml index 4e8ae4e..bda7b3c 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -1,5 +1,4 @@ - - - + + + + + \ No newline at end of file diff --git a/src/com/android/settings/intelligence/search/SearchFragment.java b/src/com/android/settings/intelligence/search/SearchFragment.java index 1f6a6c8..04c647d 100644 --- a/src/com/android/settings/intelligence/search/SearchFragment.java +++ b/src/com/android/settings/intelligence/search/SearchFragment.java @@ -24,6 +24,7 @@ import android.app.Fragment; import android.app.LoaderManager; import android.content.Context; import android.content.Loader; +import android.content.res.Resources; import android.os.Bundle; import android.support.annotation.VisibleForTesting; import android.support.v7.widget.LinearLayoutManager; @@ -37,6 +38,7 @@ import android.view.MenuInflater; import android.view.View; import android.view.ViewGroup; import android.view.inputmethod.InputMethodManager; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.SearchView; import android.widget.Toolbar; @@ -169,6 +171,11 @@ public class SearchFragment extends Fragment implements SearchView.OnQueryTextLi activity.getActionBar().setDisplayHomeAsUpEnabled(true); mSearchView = toolbar.findViewById(R.id.search_view); + + int id = Resources.getSystem().getIdentifier("search_close_btn", "id", "android"); + ImageView closeIcon = mSearchView.findViewById(id); + closeIcon.setImageResource(R.drawable.ic_close_24dp); + mSearchView.setQuery(mQuery, false /* submitQuery */); mSearchView.setOnQueryTextListener(this); mSearchView.requestFocus(); -- GitLab