Search now actually searches, yay

This commit is contained in:
Grishka
2022-03-31 17:49:54 +03:00
parent fa9112e117
commit c60bc253e5
27 changed files with 1046 additions and 122 deletions

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="12dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ImageView
android:id="@+id/photo"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="12dp"
tools:src="#0f0"/>
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_toEndOf="@id/photo"
android:textAppearance="@style/m3_title_medium"
android:fontFamily="sans-serif"
android:singleLine="true"
android:ellipsize="end"
tools:text="User Name"/>
<TextView
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_toEndOf="@id/photo"
android:layout_alignBottom="@id/photo"
android:layout_marginBottom="-4dp"
android:textAppearance="@style/m3_body_medium"
android:textColor="?android:textColorSecondary"
android:singleLine="true"
android:ellipsize="end"
tools:text="\@user@domain"/>
</RelativeLayout>

View File

@@ -15,29 +15,65 @@
android:paddingBottom="16dp"
android:background="?android:statusBarColor">
<EditText
android:id="@+id/search_edit"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:hint="@string/search_hint"
android:textColorHint="?colorSearchHint"
android:textColor="?android:textColorPrimary"
android:textSize="16dp"
android:singleLine="true"
android:inputType="textFilter"
android:paddingLeft="48dp"
android:paddingRight="48dp"
android:elevation="0dp"
android:background="@drawable/bg_search_field"/>
android:layout_height="wrap_content"
android:background="@drawable/bg_search_field"
android:outlineProvider="background"
android:clipToOutline="true">
<ImageButton
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="start"
android:layout_marginStart="4dp"
android:background="?android:selectableItemBackgroundBorderless"
android:tint="?colorSearchHint"
android:src="@drawable/ic_fluent_search_24_regular"/>
<EditText
android:id="@+id/search_edit"
android:layout_width="match_parent"
android:layout_height="40dp"
android:hint="@string/search_hint"
android:textColorHint="?colorSearchHint"
android:textColor="?android:textColorPrimary"
android:textSize="16dp"
android:singleLine="true"
android:inputType="textFilter"
android:imeOptions="actionSearch"
android:paddingLeft="48dp"
android:paddingRight="48dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
android:background="@null"
android:elevation="0dp"/>
<ImageButton
android:id="@+id/search_back"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="start"
android:layout_marginStart="4dp"
android:background="?android:selectableItemBackgroundBorderless"
android:tint="?colorSearchHint"
android:elevation="1dp"
android:src="@drawable/ic_fluent_search_24_regular"/>
<ImageButton
android:id="@+id/search_clear"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="end"
android:layout_marginEnd="4dp"
android:background="?android:selectableItemBackgroundBorderless"
android:tint="?colorSearchHint"
android:elevation="1dp"
android:visibility="invisible"
android:src="@drawable/ic_fluent_dismiss_24_regular"/>
<ProgressBar
android:id="@+id/search_progress"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="14dp"
android:indeterminateTint="?colorSearchHint"
style="?android:progressBarStyleSmall"
android:visibility="invisible"/>
</FrameLayout>
</FrameLayout>
@@ -59,4 +95,11 @@
android:layout_height="0dp"
android:layout_weight="1"/>
<FrameLayout
android:id="@+id/search_fragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:visibility="gone"/>
</me.grishka.appkit.views.FragmentRootLinearLayout>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<me.grishka.appkit.views.FragmentRootLinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:id="@+id/appkit_loader_root"
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="?android:windowBackground">
<org.joinmastodon.android.ui.tabs.TabLayout
android:id="@+id/tabbar"
android:layout_width="match_parent"
android:layout_height="48dp"
app:tabGravity="start"
app:tabMinWidth="120dp"
app:tabIndicator="@drawable/mtrl_tabs_default_indicator"
app:tabIndicatorAnimationMode="elastic"
app:tabIndicatorColor="?android:textColorPrimary"
app:tabMode="scrollable"
android:background="@drawable/bg_discover_tabs"/>
<FrameLayout
android:id="@+id/appkit_loader_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/loading"
android:id="@+id/loading"/>
<ViewStub android:layout="?errorViewLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/error"
android:visibility="gone"/>
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/content_stub"/>
</FrameLayout>
</me.grishka.appkit.views.FragmentRootLinearLayout>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="0dp"
android:layout_height="28dp"
android:layout_weight="1"
android:layout_marginTop="12dp"
android:layout_marginStart="16dp"
android:layout_marginBottom="8dp"
android:textAppearance="@style/m3_title_large"
android:singleLine="true"
android:ellipsize="end"
android:text="@string/recent_searches"/>
<ImageButton
android:id="@+id/clear"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="6dp"
android:tint="?android:textColorSecondary"
android:background="?android:selectableItemBackgroundBorderless"
android:src="@drawable/ic_fluent_dismiss_circle_24_filled"/>
</LinearLayout>