mirror of
https://github.com/KokaKiwi/BarInsta
synced 2026-03-14 08:21:35 +00:00
Add search fragment with recent searches
This commit is contained in:
parent
99431fd077
commit
c859669ac1
39 changed files with 2455 additions and 386 deletions
|
|
@ -32,7 +32,29 @@
|
|||
android:background="?attr/colorSurface"
|
||||
app:layout_collapseMode="pin"
|
||||
app:title="@string/app_name"
|
||||
tools:menu="@menu/main_menu" />
|
||||
tools:menu="@menu/main_menu">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/search_input_layout"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:boxStrokeColor="@null"
|
||||
app:boxStrokeWidth="0dp"
|
||||
app:boxStrokeWidthFocused="0dp"
|
||||
app:endIconContentDescription="@string/clear"
|
||||
app:endIconDrawable="@drawable/ic_close_24"
|
||||
app:endIconMode="custom"
|
||||
app:hintEnabled="false"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/search" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</com.google.android.material.appbar.MaterialToolbar>
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,4 +4,4 @@
|
|||
android:id="@+id/favorite_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:listitem="@layout/item_suggestion" />
|
||||
tools:listitem="@layout/item_search_result" />
|
||||
18
app/src/main/res/layout/fragment_search.xml
Normal file
18
app/src/main/res/layout/fragment_search.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tab_layout"
|
||||
style="@style/Widget.MaterialComponents.TabLayout.RegularCaps"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/pager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
41
app/src/main/res/layout/item_suggestion.xml → app/src/main/res/layout/item_search_result.xml
Executable file → Normal file
41
app/src/main/res/layout/item_suggestion.xml → app/src/main/res/layout/item_search_result.xml
Executable file → Normal file
|
|
@ -13,7 +13,7 @@
|
|||
android:paddingBottom="8dp">
|
||||
|
||||
<com.facebook.drawee.view.SimpleDraweeView
|
||||
android:id="@+id/ivProfilePic"
|
||||
android:id="@+id/profile_pic"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
app:actualImageScaleType="centerCrop"
|
||||
|
|
@ -23,46 +23,61 @@
|
|||
tools:background="@mipmap/ic_launcher" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvUsername"
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvFullName"
|
||||
app:layout_constraintEnd_toStartOf="@id/isVerified"
|
||||
app:layout_constraintStart_toEndOf="@id/ivProfilePic"
|
||||
app:layout_constraintBottom_toTopOf="@id/subtitle"
|
||||
app:layout_constraintEnd_toStartOf="@id/verified"
|
||||
app:layout_constraintStart_toEndOf="@id/profile_pic"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="username" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvFullName"
|
||||
android:id="@+id/subtitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivProfilePic"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvUsername"
|
||||
app:layout_constraintEnd_toStartOf="@id/delete"
|
||||
app:layout_constraintStart_toEndOf="@id/profile_pic"
|
||||
app:layout_constraintTop_toBottomOf="@id/title"
|
||||
tools:text="full name"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/isVerified"
|
||||
android:id="@+id/verified"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="end"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/tvUsername"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvFullName"
|
||||
app:layout_constraintStart_toEndOf="@id/tvUsername"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/title"
|
||||
app:layout_constraintBottom_toTopOf="@id/subtitle"
|
||||
app:layout_constraintStart_toEndOf="@id/title"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/verified"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/delete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_close_24"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Loading…
Add table
Add a link
Reference in a new issue