Good work on search box

Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2020-01-16 00:54:01 +01:00
parent 0d663fc2d5
commit ea758940de
No known key found for this signature in database
GPG Key ID: CDE0BBD2738C4CC0
3 changed files with 35 additions and 41 deletions

View File

@ -25,25 +25,23 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".activities.MainActivity" tools:context=".activities.MainActivity"
android:animateLayoutChanges="true"> android:animateLayoutChanges="true"
android:background="@color/transparent">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/appBar" android:id="@+id/appBar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="56dp" android:layout_height="48dp"
android:background="@color/transparent" android:background="@color/transparent"
app:elevation="0dp"> app:elevation="0dp">
<com.google.android.material.appbar.MaterialToolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar" android:theme="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar"
app:contentInsetEnd="12dp" android:background="@color/transparent"
app:contentInsetStart="12dp"
app:contentInsetStartWithNavigation="0dp" app:contentInsetStartWithNavigation="0dp"
app:elevation="0dp"
app:layout_scrollFlags="scroll|enterAlways|snap" app:layout_scrollFlags="scroll|enterAlways|snap"
app:popupTheme="@style/appActionBarPopupMenu"> app:popupTheme="@style/appActionBarPopupMenu">

View File

@ -40,7 +40,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:listitem="@layout/rv_item_conversation_with_last_message" /> tools:listitem="@layout/rv_item_conversation_with_last_message" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -22,31 +22,28 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android" <merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false">
<androidx.cardview.widget.CardView <com.google.android.material.card.MaterialCardView
android:id="@+id/searchCardView" android:id="@+id/searchCardView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_marginHorizontal="12dp" android:layout_marginHorizontal="12dp"
app:contentPaddingLeft="16dp"
app:contentPaddingRight="16dp"
android:background="@color/transparent" android:background="@color/transparent"
android:clickable="true"
android:elevation="0dp"
android:focusable="true"
app:cardBackgroundColor="@color/transparent" app:cardBackgroundColor="@color/transparent"
app:cardCornerRadius="4dp" android:elevation="4dp"
app:cardElevation="0dp" app:cardElevation="4dp"
app:cardUseCompatPadding="false" android:visibility="gone">
tools:cardCornerRadius="4dp"
tools:cardElevation="0dp"
>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:background="@color/colorPrimary"
android:clipToPadding="true">
<FrameLayout <FrameLayout
android:id="@+id/leftContainer" android:id="@+id/leftContainer"
@ -54,7 +51,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginStart="16dp"
android:visibility="gone"> android:visibility="gone">
<ImageButton <ImageButton
@ -85,16 +81,17 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignWithParentIfMissing="true" android:layout_alignWithParentIfMissing="true"
android:layout_centerVertical="true"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:layout_toStartOf="@id/rightContainer" android:layout_toStartOf="@id/rightContainer"
android:layout_toEndOf="@id/leftContainer" android:layout_toEndOf="@id/leftContainer"
android:background="@null" android:background="@null"
android:layout_centerVertical="true"
android:imeOptions="actionSearch|flagNoExtractUi" android:imeOptions="actionSearch|flagNoExtractUi"
android:inputType="textNoSuggestions" android:inputType="textNoSuggestions"
android:lines="1" android:lines="1"
android:maxLines="1" android:maxLines="1"
android:singleLine="true"
android:textCursorDrawable="@null" android:textCursorDrawable="@null"
android:textSize="16sp" android:textSize="16sp"
tools:hint="Search" /> tools:hint="Search" />
@ -105,8 +102,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true" android:layout_centerVertical="true">
android:layout_marginEnd="16dp">
<ImageView <ImageView
android:id="@+id/clearButton" android:id="@+id/clearButton"
@ -136,4 +132,5 @@
</FrameLayout> </FrameLayout>
</RelativeLayout> </RelativeLayout>
</androidx.cardview.widget.CardView></merge> </com.google.android.material.card.MaterialCardView>
</merge>