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

Commit 37f87b6c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "Add search bar to SearchActivity."" into oc-dev

parents b8028f63 61353aa4
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -213,8 +213,7 @@
        <activity android:name=".search2.SearchActivity"
                  android:label="@string/search_settings"
                  android:icon="@drawable/ic_search_history"
                  android:parentActivityName="Settings"
                  android:theme="@style/Theme.Settings.NoActionBar">
                  android:parentActivityName="Settings">
        </activity>

        <!-- Top-level settings -->
+4 −3
Original line number Diff line number Diff line
@@ -20,4 +20,5 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
             android:id="@+id/main_content"
             android:layout_height="match_parent"
    android:layout_width="match_parent"/>
             android:layout_width="match_parent"
             android:background="@color/material_grey_300"/>
+46 −55
Original line number Diff line number Diff line
@@ -15,22 +15,39 @@
-->
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/search_panel"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/search_panel_list_background">

    <FrameLayout
        android:id="@+id/layout_results"
    <LinearLayout android:id="@+id/layout_recent_searches"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_gravity="center"
                  android:orientation="vertical"
                  android:layout_alignParentTop="true">

        <!-- Padding is included in the background -->
        <android.support.v7.widget.RecyclerView android:id="@+id/list_recent_searches"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  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:elevation="@dimen/search_panel_elevation"/>
    </LinearLayout>

    <LinearLayout android:id="@+id/layout_results"
                  android:layout_width="match_parent"
                  android:layout_height="fill_parent"
                  android:layout_above="@id/feedback_popup"
                  android:orientation="vertical">

        <!-- Padding is included in the background -->
        <android.support.v7.widget.RecyclerView
            android:id="@+id/list_results"
        <android.support.v7.widget.RecyclerView android:id="@+id/list_results"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:paddingStart="@dimen/dashboard_padding_start"
@@ -44,14 +61,10 @@
            android:id="@+id/no_results_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:paddingTop="96dp"
            android:paddingTop="80dp"
            android:orientation="vertical"
            android:visibility="gone">

            <Space
                android:layout_width="match_parent"
                android:layout_height="?android:attr/actionBarSize"/>

            <ImageView
            android:layout_height="160dp"
            android:layout_width="160dp"
@@ -65,30 +78,8 @@
            android:textSize="18sp"
            android:text="@string/search_settings_no_results"
            android:gravity="center"/>

        </LinearLayout>

        <android.support.v7.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:cardBackgroundColor="?android:attr/colorBackground"
            app:cardElevation="2dp">

            <SearchView
                android:id="@+id/search_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:iconifiedByDefault="false"
                android:imeOptions="actionSearch|flagNoExtractUi"
                android:theme="?android:attr/actionBarTheme"/>

        </android.support.v7.widget.CardView>

    </FrameLayout>
    </LinearLayout>

    <include layout="@layout/search_feedback"/>

</RelativeLayout>
+0 −6
Original line number Diff line number Diff line
@@ -165,12 +165,6 @@
        <item name="switchBarTheme">@style/ThemeOverlay.SwitchBar.SubSettings</item>
    </style>

    <!-- Variant of the settings theme with no action bar. -->
    <style name="Theme.Settings.NoActionBar">
        <item name="android:windowActionBar">false</item>
        <item name="android:windowNoTitle">true</item>
    </style>

    <style name="Theme.ProvisioningActivity" parent="@android:style/Theme.Translucent.NoTitleBar">
        <item name="android:windowAnimationStyle">@null</item>
        <item name="android:windowIsTranslucent">true</item>
+0 −43
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 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.
 */

package com.android.settings.search2;

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.android.settings.R;

public class HeaderDecorator extends RecyclerView.ItemDecoration {
    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent,
            RecyclerView.State state) {
        super.getItemOffsets(outRect, view, parent, state);
        if (parent.getChildAdapterPosition(view) > 0) {
            return;
        }

        Context context = view.getContext();
        TypedArray ta = context.obtainStyledAttributes(new int[]{android.R.attr.actionBarSize});
        outRect.top = ta.getDimensionPixelSize(0, 0);
        ta.recycle();

        outRect.top += 2 * context.getResources().getDimensionPixelSize(R.dimen.search_bar_margin);
    }
}
Loading