diff --git a/Android.mk b/Android.mk index b5657741fa3219c8e747f0c41d5e11aae28bb2b3..3b1b18df84678cb1dbecb5394b445bd842b39865 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 0000000000000000000000000000000000000000..a7cf3a8ca48ad2dd562973783ab2c5bf5470f20e --- /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 17451d398a755d232a08b1350aff48d4fd0d75bd..c66e97689da3d6ac286c86c9bd48a20e3fecd335 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 0000000000000000000000000000000000000000..28720a6beae53c97f4dabb2e1fd52442a922f5ff --- /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 8f14e888f717fbbc3c47cb5499466df71ff39096..b8982870cd9df652c7f1bbee40ac8e1a931ae759 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 6bc00ad06b9100da72d21ba1f927041745714331..e188182ad48ac128045c36823a66abcb690f05a1 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 8abc2bda4e15d6889c356fea496f32aa0823ce07..9fa282392e5ba97f5f3adaf9e973fefdd7b6ce50 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 f8c239a9f04f170be38159b10a1815b8c57b0fef..44d46e0de5ce8a9bc1e7204c5dd0c38b3a8d81f7 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 0000000000000000000000000000000000000000..69f56b11402826b2e2a7027bdce883a788da1ae0 --- /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 0000000000000000000000000000000000000000..4ea9457bc273446b22744f8f4e508247c232b645 --- /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 a2105f0339b47cc7028fd944e2015d3a0c829a3a..6f28967a4ce60a00f2ccf36bb8a2d1278098e293 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 4e8ae4e0e8f2ff48c677c47b9f3449f4cdd917f1..bda7b3c2058596b187789be3fa3aa7bff8ad6a8c 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 1f6a6c8c2e6558154d96a6d05425895b21b09111..04c647d86b42e04c4be5307374f5f71e9e787caf 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();