fix(comments): hide "search by image" when chips are active

This commit is contained in:
aayush262 2024-03-05 20:07:50 +05:30
parent ad82faba3f
commit 120e63ea8a
2 changed files with 10 additions and 3 deletions

View file

@ -95,6 +95,7 @@ class SearchAdapter(private val activity: SearchActivity, private val type: Stri
binding.searchChipRecycler.adapter = SearchChipAdapter(activity).also {
activity.updateChips = { it.update() }
}
binding.searchChipRecycler.layoutManager =
LinearLayoutManager(binding.root.context, HORIZONTAL, false)
@ -213,13 +214,16 @@ class SearchAdapter(private val activity: SearchActivity, private val type: Stri
binding.searchHistoryList.startAnimation(fadeInAnimation())
binding.searchResultLayout.visibility = View.GONE
binding.searchHistoryList.visibility = View.VISIBLE
binding.searchByImage.visibility = View.VISIBLE
} else {
if (binding.searchResultLayout.visibility != View.VISIBLE) {
binding.searchResultLayout.startAnimation(fadeInAnimation())
binding.searchHistoryList.startAnimation(fadeOutAnimation())
}
binding.searchResultLayout.visibility = View.VISIBLE
binding.searchHistoryList.visibility = View.GONE
binding.searchByImage.visibility = View.GONE
}
}

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/extensionCardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -18,9 +19,10 @@
android:id="@+id/searchHistoryTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_semi_bold"
android:fontFamily="@font/poppins_bold"
android:text="HENTAI?????"
android:textSize="15sp" />
android:textSize="15sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<ImageView
@ -30,5 +32,6 @@
android:layout_gravity="center_vertical"
android:src="@drawable/ic_circle_cancel"
android:textSize="14sp"
app:tint="?attr/colorOnBackground" />
app:tint="?attr/colorOnBackground"
tools:ignore="ContentDescription" />
</LinearLayout>