Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 2d1f70c6 authored by Danny Lin's avatar Danny Lin Committed by Michael Bestas
Browse files

Style search bar to match new Settings UI



- Rounded pill shape
- No shadow
- Height

Co-authored-by: default avatarLuca Stefani <luca.stefani.ge1@gmail.com>
Co-authored-by: default avatarMichael Bestas <mkbestas@lineageos.org>
Change-Id: I24d4725f3d759ea633768640995de16f9bdf2c55
parent c161fe7f
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -24,20 +24,19 @@
    <FrameLayout
        android:id="@+id/search_bar_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="4dp">
        android:layout_height="wrap_content">
        <androidx.cardview.widget.CardView
            android:id="@+id/search_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/search_bar_margin"
            app:cardCornerRadius="2dp"
            app:cardElevation="2dp">
            app:cardCornerRadius="@dimen/search_bar_corner_radius"
            app:cardElevation="0dp">
            <Toolbar
                android:id="@+id/search_toolbar"
                android:layout_width="match_parent"
                android:layout_height="@dimen/search_bar_height"
                android:background="?android:attr/selectableItemBackground"
                android:background="@drawable/search_bar_selected_background"
                android:contentInsetStart="0dp"
                android:contentInsetStartWithNavigation="0dp"
                android:theme="?android:attr/actionBarTheme">
+1 −1
Original line number Diff line number Diff line
@@ -18,6 +18,6 @@
<resources
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">

    <color name="search_bar_background">?androidprv:attr/colorSurfaceVariant</color>
    <color name="search_bar_background">?androidprv:attr/materialColorSurfaceContainerHigh</color>

</resources>
+5 −2
Original line number Diff line number Diff line
@@ -15,8 +15,11 @@
  limitations under the License.
  -->

<resources>
<resources
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">

    <color name="launcher_background_color">#ff008577</color>

    <color name="search_bar_background">?android:attr/colorBackground</color>
    <color name="search_bar_background">?androidprv:attr/materialColorSurfaceBright</color>

</resources>
+5 −4
Original line number Diff line number Diff line
@@ -26,11 +26,12 @@
    <!-- The following two margins need to match, with the caveat that
     the second should be negative. The second one ensures that the icons and text
     align despite the additional padding caused by the search bar's card background. -->
    <dimen name="search_bar_margin">8dp</dimen>
    <dimen name="search_bar_negative_margin">-8dp</dimen>
    <dimen name="search_bar_margin">16dp</dimen>
    <dimen name="search_bar_negative_margin">-16dp</dimen>

    <dimen name="search_bar_height">48dp</dimen>
    <dimen name="search_bar_text_size">16dp</dimen>
    <dimen name="search_bar_height">52dp</dimen>
    <dimen name="search_bar_text_size">20sp</dimen>
    <dimen name="search_bar_corner_radius">28dp</dimen>

    <!-- Dashboard image tile size -->
    <dimen name="dashboard_tile_image_size">24dp</dimen>
+0 −4
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import androidx.annotation.VisibleForTesting;
import androidx.cardview.widget.CardView;
import androidx.loader.content.Loader;
import androidx.loader.app.LoaderManager;
import androidx.recyclerview.widget.LinearLayoutManager;
@@ -150,9 +149,6 @@ public class SearchFragment extends Fragment implements SearchView.OnQueryTextLi

        mNoResultsView = view.findViewById(R.id.no_results_layout);

        final CardView cardView = view.findViewById(R.id.search_bar);
        cardView.setBackgroundResource(R.drawable.search_bar_selected_background);

        final Toolbar toolbar = view.findViewById(R.id.search_toolbar);
        activity.setActionBar(toolbar);
        activity.getActionBar().setDisplayHomeAsUpEnabled(true);