Update Search Suggestions and Results Panel
- fix overdraw use as less backgrounds as possible - make it look like the Dashboard with padding left and right See bug: #15384992 Setting Dashboard - padding updates Change-Id: I30ff33e51bc3c73e888d45f0ce6e16784eb6721c
This commit is contained in:
@@ -16,6 +16,6 @@
|
|||||||
|
|
||||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:color="?android:attr/colorControlHighlight">
|
android:color="?android:attr/colorControlHighlight">
|
||||||
<item android:drawable="@android:color/white" />
|
<item android:id="@android:id/mask"
|
||||||
|
android:drawable="@android:color/white" />
|
||||||
</ripple>
|
</ripple>
|
||||||
|
|
||||||
|
29
res/drawable/search_panel_list_background.xml
Normal file
29
res/drawable/search_panel_list_background.xml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2014 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<inset xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:insetLeft="@dimen/dashboard_padding_start"
|
||||||
|
android:insetTop="@dimen/dashboard_padding_top"
|
||||||
|
android:insetRight="@dimen/dashboard_padding_end"
|
||||||
|
android:insetBottom="@dimen/dashboard_padding_bottom">
|
||||||
|
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
|
||||||
|
<solid android:color="@android:color/white" />
|
||||||
|
|
||||||
|
</shape>
|
||||||
|
|
||||||
|
</inset>
|
@@ -19,8 +19,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scrollbarStyle="outsideOverlay"
|
android:scrollbarStyle="outsideOverlay"
|
||||||
android:clipToPadding="false"
|
android:clipToPadding="false">
|
||||||
android:background="@color/dashboard_background_color">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/dashboard_container"
|
android:id="@+id/dashboard_container"
|
||||||
|
@@ -17,10 +17,7 @@
|
|||||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/dashboard"
|
android:id="@+id/dashboard"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:paddingStart="@dimen/search_panel_padding_start"
|
|
||||||
android:paddingEnd="@dimen/search_panel_padding_end"
|
|
||||||
android:background="@color/dashboard_background_color">
|
|
||||||
|
|
||||||
<LinearLayout android:layout_width="match_parent"
|
<LinearLayout android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@@ -31,14 +28,20 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:elevation="@dimen/search_panel_elevation">
|
|
||||||
|
|
||||||
|
<!-- Padding is included in the background -->
|
||||||
<ListView android:id="@+id/list_suggestions"
|
<ListView android:id="@+id/list_suggestions"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/white"
|
android:paddingStart="@dimen/dashboard_padding_start"
|
||||||
|
android:paddingEnd="@dimen/dashboard_padding_end"
|
||||||
|
android:paddingTop="@dimen/dashboard_padding_top"
|
||||||
|
android:paddingBottom="@dimen/dashboard_padding_bottom"
|
||||||
|
android:scrollbarStyle="outsideOverlay"
|
||||||
android:headerDividersEnabled="false"
|
android:headerDividersEnabled="false"
|
||||||
|
android:background="@drawable/search_panel_list_background"
|
||||||
|
android:elevation="@dimen/search_panel_elevation"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -50,11 +53,18 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<!-- Padding is included in the background -->
|
||||||
<ListView android:id="@+id/list_results"
|
<ListView android:id="@+id/list_results"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/white"
|
android:paddingStart="@dimen/dashboard_padding_start"
|
||||||
|
android:paddingEnd="@dimen/dashboard_padding_end"
|
||||||
|
android:paddingTop="@dimen/dashboard_padding_top"
|
||||||
|
android:paddingBottom="@dimen/dashboard_padding_bottom"
|
||||||
|
android:scrollbarStyle="outsideOverlay"
|
||||||
android:headerDividersEnabled="false"
|
android:headerDividersEnabled="false"
|
||||||
|
android:background="@drawable/search_panel_list_background"
|
||||||
|
android:elevation="@dimen/search_panel_elevation"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@@ -40,7 +40,6 @@
|
|||||||
android:id="@+id/prefs"
|
android:id="@+id/prefs"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/white"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@@ -45,8 +45,4 @@
|
|||||||
<!-- Dashboard tile image margin start / end -->
|
<!-- Dashboard tile image margin start / end -->
|
||||||
<dimen name="dashboard_tile_image_margin_start">12dp</dimen>
|
<dimen name="dashboard_tile_image_margin_start">12dp</dimen>
|
||||||
|
|
||||||
<!-- Search Results padding in its container -->
|
|
||||||
<dimen name="search_panel_padding_start">4dp</dimen>
|
|
||||||
<dimen name="search_panel_padding_end">4dp</dimen>
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -141,10 +141,6 @@
|
|||||||
<!-- Search Panel elevation -->
|
<!-- Search Panel elevation -->
|
||||||
<dimen name="search_panel_elevation">4dp</dimen>
|
<dimen name="search_panel_elevation">4dp</dimen>
|
||||||
|
|
||||||
<!-- Search Panel padding in its container -->
|
|
||||||
<dimen name="search_panel_padding_start">4dp</dimen>
|
|
||||||
<dimen name="search_panel_padding_end">4dp</dimen>
|
|
||||||
|
|
||||||
<!-- Search title (recent / results) padding start -->
|
<!-- Search title (recent / results) padding start -->
|
||||||
<dimen name="search_title_padding_start">12dp</dimen>
|
<dimen name="search_title_padding_start">12dp</dimen>
|
||||||
|
|
||||||
|
@@ -473,8 +473,6 @@ public class SearchResultsSummary extends Fragment {
|
|||||||
SuggestionItem item = (SuggestionItem) getItem(position);
|
SuggestionItem item = (SuggestionItem) getItem(position);
|
||||||
query.setText(item.query);
|
query.setText(item.query);
|
||||||
|
|
||||||
view.setBackgroundResource(R.drawable.dashboard_tile_background);
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -625,8 +623,6 @@ public class SearchResultsSummary extends Fragment {
|
|||||||
imageView.setBackgroundResource(R.drawable.empty_icon);
|
imageView.setBackgroundResource(R.drawable.empty_icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
view.setBackgroundResource(R.drawable.dashboard_tile_background);
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user