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

Commit 733cbd58 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

SearchView API

Implements the basic requirements for in-app search. More work to be done.
parent 1acd5203
Loading
Loading
Loading
Loading
+233 −0
Original line number Diff line number Diff line
@@ -4926,6 +4926,17 @@
 visibility="public"
>
</field>
<field name="iconifiedByDefault"
 type="int"
 transient="false"
 volatile="false"
 value="16843579"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="id"
 type="int"
 transient="false"
@@ -233481,6 +233492,228 @@
>
</method>
</class>
<class name="SearchView"
 extends="android.widget.LinearLayout"
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<constructor name="SearchView"
 type="android.widget.SearchView"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="context" type="android.content.Context">
</parameter>
</constructor>
<constructor name="SearchView"
 type="android.widget.SearchView"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="context" type="android.content.Context">
</parameter>
<parameter name="attrs" type="android.util.AttributeSet">
</parameter>
</constructor>
<method name="getSuggestionsAdapter"
 return="android.widget.CursorAdapter"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="isIconfiedByDefault"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="isSubmitButtonEnabled"
 return="boolean"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
<method name="setIconifiedByDefault"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="iconified" type="boolean">
</parameter>
</method>
<method name="setOnQueryChangeListener"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="listener" type="android.widget.SearchView.OnQueryChangeListener">
</parameter>
</method>
<method name="setQuery"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="query" type="java.lang.CharSequence">
</parameter>
<parameter name="submit" type="boolean">
</parameter>
</method>
<method name="setQueryHint"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="hint" type="java.lang.CharSequence">
</parameter>
</method>
<method name="setSearchableInfo"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="searchable" type="android.app.SearchableInfo">
</parameter>
</method>
<method name="setSubmitButtonEnabled"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="enabled" type="boolean">
</parameter>
</method>
<method name="setSuggestionsAdapter"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="adapter" type="android.widget.CursorAdapter">
</parameter>
</method>
</class>
<interface name="SearchView.FilterableListAdapter"
 abstract="true"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<implements name="android.widget.Filterable">
</implements>
<implements name="android.widget.ListAdapter">
</implements>
</interface>
<interface name="SearchView.OnCloseListener"
 abstract="true"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<method name="onClose"
 return="boolean"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</method>
</interface>
<interface name="SearchView.OnQueryChangeListener"
 abstract="true"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<method name="onQueryTextChanged"
 return="boolean"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="newText" type="java.lang.String">
</parameter>
</method>
<method name="onSubmitQuery"
 return="boolean"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="query" type="java.lang.String">
</parameter>
</method>
</interface>
<interface name="SectionIndexer"
 abstract="true"
 static="false"
+645 −0

File added.

Preview size limit exceeded, changes collapsed.

+705 −0

File added.

Preview size limit exceeded, changes collapsed.

+119 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
 * Copyright (C) 2010 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.
 */

-->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/search_bar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:focusable="true"
    android:descendantFocusability="afterDescendants">

    <!-- This is actually used for the badge icon *or* the badge label (or neither) -->
    <TextView
        android:id="@+id/search_badge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="2dip"
        android:drawablePadding="0dip"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:textColor="?android:attr/textColorPrimaryInverse"
        android:visibility="gone"
    />

    <ImageView
        android:id="@+id/search_button"
        android:layout_height="36dip"
        android:layout_width="36dip"
        android:layout_marginRight="7dip"
        android:layout_gravity="center_vertical"
        android:src="@android:drawable/ic_btn_search"
    />

    <!-- Inner layout contains the app icon, button(s) and EditText -->
    <LinearLayout
        android:id="@+id/search_edit_frame"
        android:layout_width="300dp"
        android:layout_height="wrap_content"
        android:visibility="gone"
        android:orientation="horizontal"
        android:background="?android:attr/editTextBackground">

        <ImageView
            android:id="@+id/search_app_icon"
            android:layout_height="24dip"
            android:layout_width="24dip"
            android:layout_marginRight="7dip"
            android:layout_gravity="bottom"
            android:src="@android:drawable/ic_btn_search"
        />

        <AutoCompleteTextView
            android:id="@+id/search_src_text"
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:layout_weight="1"
            android:paddingLeft="8dip"
            android:paddingRight="6dip"
            android:drawablePadding="2dip"
            android:singleLine="true"
            android:ellipsize="end"
            android:background="@null"
            android:inputType="text|textAutoComplete"
            android:imeOptions="actionSearch"
            android:dropDownWidth="300dp"
            android:dropDownHeight="wrap_content"
            android:dropDownAnchor="@id/search_edit_frame"
            android:dropDownVerticalOffset="0dip"
            android:dropDownHorizontalOffset="0dip"
            android:popupBackground="@android:drawable/search_dropdown_background"
        />

        <ImageView
            android:id="@+id/search_close_btn"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_gravity="bottom"
            android:src="@android:drawable/btn_close"
        />
    </LinearLayout>

    <ImageView
        android:id="@+id/search_go_btn"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_marginLeft="4dip"
        android:layout_marginRight="4dip"
        android:src="@android:drawable/ic_btn_find_next"
    />

    <ImageButton
        android:id="@+id/search_voice_btn"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_marginLeft="0dip"
        android:layout_marginTop="-6.5dip"
        android:layout_marginBottom="-7dip"
        android:layout_marginRight="-5dip"
        android:background="@drawable/btn_search_dialog_voice"
        android:src="@android:drawable/ic_btn_speak_now"
        android:visibility="gone"
    />
</LinearLayout>
+5 −0
Original line number Diff line number Diff line
@@ -4094,4 +4094,9 @@
        <attr name="closeButtonStyle" format="reference" />
    </declare-styleable>

    <declare-styleable name="SearchView">
        <!-- The default state of the SearchView. If true, it will be iconified when not in
             use and expanded when clicked. -->
        <attr name="iconifiedByDefault" format="boolean"/>
    </declare-styleable>
</resources>
Loading