chore: eliminate overlap layouts

This commit is contained in:
TwistedUmbrellaX 2024-03-22 16:45:47 -04:00
parent 27743e3427
commit 08bf1a2336
5 changed files with 168 additions and 256 deletions

View file

@ -22,6 +22,7 @@ import ani.dantotsu.R
import ani.dantotsu.connections.anilist.Anilist import ani.dantotsu.connections.anilist.Anilist
import ani.dantotsu.currContext import ani.dantotsu.currContext
import ani.dantotsu.databinding.ItemAnimePageBinding import ani.dantotsu.databinding.ItemAnimePageBinding
import ani.dantotsu.databinding.LayoutTrendingBinding
import ani.dantotsu.loadImage import ani.dantotsu.loadImage
import ani.dantotsu.media.CalendarActivity import ani.dantotsu.media.CalendarActivity
import ani.dantotsu.media.GenreActivity import ani.dantotsu.media.GenreActivity
@ -42,6 +43,7 @@ import com.google.android.material.textfield.TextInputLayout
class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHolder>() { class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHolder>() {
val ready = MutableLiveData(false) val ready = MutableLiveData(false)
lateinit var binding: ItemAnimePageBinding lateinit var binding: ItemAnimePageBinding
private lateinit var trendingBinding: LayoutTrendingBinding
private var trendHandler: Handler? = null private var trendHandler: Handler? = null
private lateinit var trendRun: Runnable private lateinit var trendRun: Runnable
var trendingViewPager: ViewPager2? = null var trendingViewPager: ViewPager2? = null
@ -54,14 +56,15 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
override fun onBindViewHolder(holder: AnimePageViewHolder, position: Int) { override fun onBindViewHolder(holder: AnimePageViewHolder, position: Int) {
binding = holder.binding binding = holder.binding
trendingViewPager = binding.animeTrendingViewPager trendingBinding = LayoutTrendingBinding.bind(binding.root)
trendingViewPager = trendingBinding.trendingViewPager
val textInputLayout = holder.itemView.findViewById<TextInputLayout>(R.id.animeSearchBar) val textInputLayout = holder.itemView.findViewById<TextInputLayout>(R.id.searchBar)
val currentColor = textInputLayout.boxBackgroundColor val currentColor = textInputLayout.boxBackgroundColor
val semiTransparentColor = (currentColor and 0x00FFFFFF) or 0xA8000000.toInt() val semiTransparentColor = (currentColor and 0x00FFFFFF) or 0xA8000000.toInt()
textInputLayout.boxBackgroundColor = semiTransparentColor textInputLayout.boxBackgroundColor = semiTransparentColor
val materialCardView = val materialCardView =
holder.itemView.findViewById<MaterialCardView>(R.id.animeUserAvatarContainer) holder.itemView.findViewById<MaterialCardView>(R.id.userAvatarContainer)
materialCardView.setCardBackgroundColor(semiTransparentColor) materialCardView.setCardBackgroundColor(semiTransparentColor)
val typedValue = TypedValue() val typedValue = TypedValue()
currContext()?.theme?.resolveAttribute(android.R.attr.windowBackground, typedValue, true) currContext()?.theme?.resolveAttribute(android.R.attr.windowBackground, typedValue, true)
@ -70,33 +73,29 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
textInputLayout.boxBackgroundColor = (color and 0x00FFFFFF) or 0x28000000 textInputLayout.boxBackgroundColor = (color and 0x00FFFFFF) or 0x28000000
materialCardView.setCardBackgroundColor((color and 0x00FFFFFF) or 0x28000000) materialCardView.setCardBackgroundColor((color and 0x00FFFFFF) or 0x28000000)
binding.animeTitleContainer.updatePadding(top = statusBarHeight) trendingBinding.titleContainer.updatePadding(top = statusBarHeight)
if (PrefManager.getVal(PrefName.SmallView)) binding.animeTrendingContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> { if (PrefManager.getVal(PrefName.SmallView)) trendingBinding.trendingContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
bottomMargin = (-108f).px bottomMargin = (-108f).px
} }
updateAvatar() updateAvatar()
binding.animeSearchBar.hint = "ANIME" trendingBinding.searchBar.hint = "ANIME"
binding.animeSearchBarText.setOnClickListener { trendingBinding.searchBarText.setOnClickListener {
ContextCompat.startActivity( ContextCompat.startActivity(
it.context, it.context,
Intent(it.context, SearchActivity::class.java).putExtra("type", "ANIME"), Intent(it.context, SearchActivity::class.java).putExtra("type", "MANGA"),
null null
) )
} }
binding.animeSearchBar.setEndIconOnClickListener { trendingBinding.userAvatar.setSafeOnClickListener {
binding.animeSearchBarText.performClick()
}
binding.animeUserAvatar.setSafeOnClickListener {
val dialogFragment = val dialogFragment =
SettingsDialogFragment.newInstance(SettingsDialogFragment.Companion.PageType.ANIME) SettingsDialogFragment.newInstance(SettingsDialogFragment.Companion.PageType.ANIME)
dialogFragment.show((it.context as AppCompatActivity).supportFragmentManager, "dialog") dialogFragment.show((it.context as AppCompatActivity).supportFragmentManager, "dialog")
} }
binding.animeUserAvatar.setOnLongClickListener { view -> trendingBinding.userAvatar.setOnLongClickListener { view ->
ContextCompat.startActivity( ContextCompat.startActivity(
view.context, view.context,
Intent(view.context, ProfileActivity::class.java) Intent(view.context, ProfileActivity::class.java)
@ -105,8 +104,12 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
false false
} }
binding.animeNotificationCount.visibility = if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE trendingBinding.searchBar.setEndIconOnClickListener {
binding.animeNotificationCount.text = Anilist.unreadNotificationCount.toString() trendingBinding.searchBar.performClick()
}
trendingBinding.notificationCount.visibility = if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE
trendingBinding.notificationCount.text = Anilist.unreadNotificationCount.toString()
listOf( listOf(
binding.animePreviousSeason, binding.animePreviousSeason,
@ -159,17 +162,17 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
} }
fun updateTrending(adaptor: MediaAdaptor) { fun updateTrending(adaptor: MediaAdaptor) {
binding.animeTrendingProgressBar.visibility = View.GONE trendingBinding.trendingProgressBar.visibility = View.GONE
binding.animeTrendingViewPager.adapter = adaptor trendingBinding.trendingViewPager.adapter = adaptor
binding.animeTrendingViewPager.offscreenPageLimit = 3 trendingBinding.trendingViewPager.offscreenPageLimit = 3
binding.animeTrendingViewPager.getChildAt(0).overScrollMode = RecyclerView.OVER_SCROLL_NEVER trendingBinding.trendingViewPager.getChildAt(0).overScrollMode = RecyclerView.OVER_SCROLL_NEVER
binding.animeTrendingViewPager.setPageTransformer(MediaPageTransformer()) trendingBinding.trendingViewPager.setPageTransformer(MediaPageTransformer())
trendHandler = Handler(Looper.getMainLooper()) trendHandler = Handler(Looper.getMainLooper())
trendRun = Runnable { trendRun = Runnable {
binding.animeTrendingViewPager.currentItem += 1 trendingBinding.trendingViewPager.currentItem += 1
} }
binding.animeTrendingViewPager.registerOnPageChangeCallback( trendingBinding.trendingViewPager.registerOnPageChangeCallback(
object : ViewPager2.OnPageChangeCallback() { object : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) { override fun onPageSelected(position: Int) {
super.onPageSelected(position) super.onPageSelected(position)
@ -179,9 +182,9 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
} }
) )
binding.animeTrendingViewPager.layoutAnimation = trendingBinding.trendingViewPager.layoutAnimation =
LayoutAnimationController(setSlideIn(), 0.25f) LayoutAnimationController(setSlideIn(), 0.25f)
binding.animeTitleContainer.startAnimation(setSlideUp()) trendingBinding.titleContainer.startAnimation(setSlideUp())
binding.animeListContainer.layoutAnimation = binding.animeListContainer.layoutAnimation =
LayoutAnimationController(setSlideIn(), 0.25f) LayoutAnimationController(setSlideIn(), 0.25f)
binding.animeSeasonsCont.layoutAnimation = binding.animeSeasonsCont.layoutAnimation =
@ -209,16 +212,16 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
fun updateAvatar() { fun updateAvatar() {
if (Anilist.avatar != null && ready.value == true) { if (Anilist.avatar != null && ready.value == true) {
binding.animeUserAvatar.loadImage(Anilist.avatar) trendingBinding.userAvatar.loadImage(Anilist.avatar)
binding.animeUserAvatar.imageTintList = null trendingBinding.userAvatar.imageTintList = null
} }
} }
fun updateNotificationCount() { fun updateNotificationCount() {
if (this::binding.isInitialized) { if (this::binding.isInitialized) {
binding.animeNotificationCount.visibility = trendingBinding.notificationCount.visibility =
if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE
binding.animeNotificationCount.text = Anilist.unreadNotificationCount.toString() trendingBinding.notificationCount.text = Anilist.unreadNotificationCount.toString()
} }
} }

View file

@ -22,6 +22,7 @@ import ani.dantotsu.R
import ani.dantotsu.connections.anilist.Anilist import ani.dantotsu.connections.anilist.Anilist
import ani.dantotsu.currContext import ani.dantotsu.currContext
import ani.dantotsu.databinding.ItemMangaPageBinding import ani.dantotsu.databinding.ItemMangaPageBinding
import ani.dantotsu.databinding.LayoutTrendingBinding
import ani.dantotsu.loadImage import ani.dantotsu.loadImage
import ani.dantotsu.media.GenreActivity import ani.dantotsu.media.GenreActivity
import ani.dantotsu.media.MediaAdaptor import ani.dantotsu.media.MediaAdaptor
@ -41,6 +42,7 @@ import com.google.android.material.textfield.TextInputLayout
class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHolder>() { class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHolder>() {
val ready = MutableLiveData(false) val ready = MutableLiveData(false)
lateinit var binding: ItemMangaPageBinding lateinit var binding: ItemMangaPageBinding
private lateinit var trendingBinding: LayoutTrendingBinding
private var trendHandler: Handler? = null private var trendHandler: Handler? = null
private lateinit var trendRun: Runnable private lateinit var trendRun: Runnable
var trendingViewPager: ViewPager2? = null var trendingViewPager: ViewPager2? = null
@ -53,14 +55,15 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold
override fun onBindViewHolder(holder: MangaPageViewHolder, position: Int) { override fun onBindViewHolder(holder: MangaPageViewHolder, position: Int) {
binding = holder.binding binding = holder.binding
trendingViewPager = binding.mangaTrendingViewPager trendingBinding = LayoutTrendingBinding.bind(binding.root)
trendingViewPager = trendingBinding.trendingViewPager
val textInputLayout = holder.itemView.findViewById<TextInputLayout>(R.id.mangaSearchBar) val textInputLayout = holder.itemView.findViewById<TextInputLayout>(R.id.searchBar)
val currentColor = textInputLayout.boxBackgroundColor val currentColor = textInputLayout.boxBackgroundColor
val semiTransparentColor = (currentColor and 0x00FFFFFF) or 0xA8000000.toInt() val semiTransparentColor = (currentColor and 0x00FFFFFF) or 0xA8000000.toInt()
textInputLayout.boxBackgroundColor = semiTransparentColor textInputLayout.boxBackgroundColor = semiTransparentColor
val materialCardView = val materialCardView =
holder.itemView.findViewById<MaterialCardView>(R.id.mangaUserAvatarContainer) holder.itemView.findViewById<MaterialCardView>(R.id.userAvatarContainer)
materialCardView.setCardBackgroundColor(semiTransparentColor) materialCardView.setCardBackgroundColor(semiTransparentColor)
val typedValue = TypedValue() val typedValue = TypedValue()
currContext()?.theme?.resolveAttribute(android.R.attr.windowBackground, typedValue, true) currContext()?.theme?.resolveAttribute(android.R.attr.windowBackground, typedValue, true)
@ -69,17 +72,17 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold
textInputLayout.boxBackgroundColor = (color and 0x00FFFFFF) or 0x28000000 textInputLayout.boxBackgroundColor = (color and 0x00FFFFFF) or 0x28000000
materialCardView.setCardBackgroundColor((color and 0x00FFFFFF) or 0x28000000) materialCardView.setCardBackgroundColor((color and 0x00FFFFFF) or 0x28000000)
binding.mangaTitleContainer.updatePadding(top = statusBarHeight) trendingBinding.titleContainer.updatePadding(top = statusBarHeight)
if (PrefManager.getVal(PrefName.SmallView)) binding.mangaTrendingContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> { if (PrefManager.getVal(PrefName.SmallView)) trendingBinding.trendingContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
bottomMargin = (-108f).px bottomMargin = (-108f).px
} }
updateAvatar() updateAvatar()
binding.mangaNotificationCount.isVisible = Anilist.unreadNotificationCount > 0 trendingBinding.notificationCount.isVisible = Anilist.unreadNotificationCount > 0
binding.mangaNotificationCount.text = Anilist.unreadNotificationCount.toString() trendingBinding.notificationCount.text = Anilist.unreadNotificationCount.toString()
binding.mangaSearchBar.hint = "MANGA" trendingBinding.searchBar.hint = "MANGA"
binding.mangaSearchBarText.setOnClickListener { trendingBinding.searchBarText.setOnClickListener {
ContextCompat.startActivity( ContextCompat.startActivity(
it.context, it.context,
Intent(it.context, SearchActivity::class.java).putExtra("type", "MANGA"), Intent(it.context, SearchActivity::class.java).putExtra("type", "MANGA"),
@ -87,12 +90,12 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold
) )
} }
binding.mangaUserAvatar.setSafeOnClickListener { trendingBinding.userAvatar.setSafeOnClickListener {
val dialogFragment = val dialogFragment =
SettingsDialogFragment.newInstance(SettingsDialogFragment.Companion.PageType.MANGA) SettingsDialogFragment.newInstance(SettingsDialogFragment.Companion.PageType.MANGA)
dialogFragment.show((it.context as AppCompatActivity).supportFragmentManager, "dialog") dialogFragment.show((it.context as AppCompatActivity).supportFragmentManager, "dialog")
} }
binding.mangaUserAvatar.setOnLongClickListener { view -> trendingBinding.userAvatar.setOnLongClickListener { view ->
ContextCompat.startActivity( ContextCompat.startActivity(
view.context, view.context,
Intent(view.context, ProfileActivity::class.java) Intent(view.context, ProfileActivity::class.java)
@ -101,8 +104,8 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold
false false
} }
binding.mangaSearchBar.setEndIconOnClickListener { trendingBinding.searchBar.setEndIconOnClickListener {
binding.mangaSearchBarText.performClick() trendingBinding.searchBarText.performClick()
} }
binding.mangaGenreImage.loadImage("https://s4.anilist.co/file/anilistcdn/media/manga/banner/105778-wk5qQ7zAaTGl.jpg") binding.mangaGenreImage.loadImage("https://s4.anilist.co/file/anilistcdn/media/manga/banner/105778-wk5qQ7zAaTGl.jpg")
@ -148,16 +151,16 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold
} }
fun updateTrending(adaptor: MediaAdaptor) { fun updateTrending(adaptor: MediaAdaptor) {
binding.mangaTrendingProgressBar.visibility = View.GONE trendingBinding.trendingProgressBar.visibility = View.GONE
binding.mangaTrendingViewPager.adapter = adaptor trendingBinding.trendingViewPager.adapter = adaptor
binding.mangaTrendingViewPager.offscreenPageLimit = 3 trendingBinding.trendingViewPager.offscreenPageLimit = 3
binding.mangaTrendingViewPager.getChildAt(0).overScrollMode = RecyclerView.OVER_SCROLL_NEVER trendingBinding.trendingViewPager.getChildAt(0).overScrollMode = RecyclerView.OVER_SCROLL_NEVER
binding.mangaTrendingViewPager.setPageTransformer(MediaPageTransformer()) trendingBinding.trendingViewPager.setPageTransformer(MediaPageTransformer())
trendHandler = Handler(Looper.getMainLooper()) trendHandler = Handler(Looper.getMainLooper())
trendRun = Runnable { trendRun = Runnable {
binding.mangaTrendingViewPager.currentItem += 1 trendingBinding.trendingViewPager.currentItem += 1
} }
binding.mangaTrendingViewPager.registerOnPageChangeCallback( trendingBinding.trendingViewPager.registerOnPageChangeCallback(
object : ViewPager2.OnPageChangeCallback() { object : ViewPager2.OnPageChangeCallback() {
override fun onPageSelected(position: Int) { override fun onPageSelected(position: Int) {
super.onPageSelected(position) super.onPageSelected(position)
@ -167,9 +170,9 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold
} }
) )
binding.mangaTrendingViewPager.layoutAnimation = trendingBinding.trendingViewPager.layoutAnimation =
LayoutAnimationController(setSlideIn(), 0.25f) LayoutAnimationController(setSlideIn(), 0.25f)
binding.mangaTitleContainer.startAnimation(setSlideUp()) trendingBinding.titleContainer.startAnimation(setSlideUp())
binding.mangaListContainer.layoutAnimation = binding.mangaListContainer.layoutAnimation =
LayoutAnimationController(setSlideIn(), 0.25f) LayoutAnimationController(setSlideIn(), 0.25f)
} }
@ -195,16 +198,16 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold
fun updateAvatar() { fun updateAvatar() {
if (Anilist.avatar != null && ready.value == true) { if (Anilist.avatar != null && ready.value == true) {
binding.mangaUserAvatar.loadImage(Anilist.avatar) trendingBinding.userAvatar.loadImage(Anilist.avatar)
binding.mangaUserAvatar.imageTintList = null trendingBinding.userAvatar.imageTintList = null
} }
} }
fun updateNotificationCount() { fun updateNotificationCount() {
if (this::binding.isInitialized) { if (this::binding.isInitialized) {
binding.mangaNotificationCount.visibility = trendingBinding.notificationCount.visibility =
if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE if (Anilist.unreadNotificationCount > 0) View.VISIBLE else View.GONE
binding.mangaNotificationCount.text = Anilist.unreadNotificationCount.toString() trendingBinding.notificationCount.text = Anilist.unreadNotificationCount.toString()
} }
} }

View file

@ -9,105 +9,7 @@
android:layout_marginEnd="-16dp" android:layout_marginEnd="-16dp"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <include layout="@layout/layout_trending" />
android:id="@+id/animeTrendingContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/animeTrendingViewPager"
android:layout_width="match_parent"
android:layout_height="464dp" />
<LinearLayout
android:id="@+id/animeTitleContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="32dp"
android:orientation="horizontal"
android:baselineAligned="false">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/animeSearchBar"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:hint="@string/anime"
android:textColorHint="@color/bg_opp"
android:transitionName="@string/search"
app:boxBackgroundColor="?attr/colorPrimaryContainer"
app:boxCornerRadiusBottomEnd="28dp"
app:boxCornerRadiusBottomStart="28dp"
app:boxCornerRadiusTopEnd="28dp"
app:boxCornerRadiusTopStart="28dp"
app:boxStrokeColor="@color/text_input_layout_stroke_color"
app:endIconDrawable="@drawable/ic_round_search_24"
app:endIconTint="@color/bg_opp"
app:hintAnimationEnabled="true">
<AutoCompleteTextView
android:id="@+id/animeSearchBarText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="false"
android:fontFamily="@font/poppins_bold"
android:inputType="none"
android:padding="8dp"
android:textSize="14sp"
tools:ignore="LabelFor,TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.google.android.material.card.MaterialCardView
android:id="@+id/animeUserAvatarContainer"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_marginTop="4dp"
android:backgroundTint="@color/nav_bg_inv"
app:cardCornerRadius="26dp">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/animeUserAvatar"
android:layout_width="52dp"
android:layout_height="52dp"
android:scaleType="center"
app:srcCompat="@drawable/ic_round_settings_24"
tools:ignore="ContentDescription,ImageContrastCheck" />
</com.google.android.material.card.MaterialCardView>
<TextView
android:id="@+id/animeNotificationCount"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="end|bottom"
android:background="@drawable/notification_circle"
android:fontFamily="@font/poppins_semi_bold"
android:gravity="center"
android:textColor="#F3F3F3"
android:textSize="12sp"
android:visibility="gone"
tools:ignore="SmallSp"
tools:text="1"
tools:visibility="visible" />
</FrameLayout>
</LinearLayout>
<ProgressBar
android:id="@+id/animeTrendingProgressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="64dp" />
</FrameLayout>
<HorizontalScrollView <HorizontalScrollView
android:id="@+id/animeSeasons" android:id="@+id/animeSeasons"

View file

@ -9,108 +9,7 @@
android:layout_marginEnd="-16dp" android:layout_marginEnd="-16dp"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <include layout="@layout/layout_trending" />
android:id="@+id/mangaTrendingContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/mangaTrendingViewPager"
android:layout_width="match_parent"
android:layout_height="464dp" />
<LinearLayout
android:id="@+id/mangaTitleContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="32dp"
android:orientation="horizontal"
android:baselineAligned="false">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/mangaSearchBar"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:hint="@string/manga"
android:textColorHint="@color/bg_opp"
android:transitionName="@string/search"
app:boxBackgroundColor="?attr/colorPrimaryContainer"
app:boxCornerRadiusBottomEnd="28dp"
app:boxCornerRadiusBottomStart="28dp"
app:boxCornerRadiusTopEnd="28dp"
app:boxCornerRadiusTopStart="28dp"
app:boxStrokeColor="@color/text_input_layout_stroke_color"
app:endIconDrawable="@drawable/ic_round_search_24"
app:endIconTint="@color/bg_opp"
app:hintAnimationEnabled="true">
<AutoCompleteTextView
android:id="@+id/mangaSearchBarText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="false"
android:fontFamily="@font/poppins_bold"
android:inputType="none"
android:padding="8dp"
android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"
tools:ignore="LabelFor,TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.google.android.material.card.MaterialCardView
android:id="@+id/mangaUserAvatarContainer"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_marginTop="4dp"
android:backgroundTint="@color/nav_bg_inv"
app:cardCornerRadius="26dp">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/mangaUserAvatar"
android:layout_width="52dp"
android:layout_height="52dp"
android:scaleType="center"
app:srcCompat="@drawable/ic_round_settings_24"
tools:ignore="ContentDescription,ImageContrastCheck" />
</com.google.android.material.card.MaterialCardView>
<TextView
android:id="@+id/mangaNotificationCount"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="end|bottom"
android:background="@drawable/notification_circle"
android:fontFamily="@font/poppins_semi_bold"
android:gravity="center"
android:textColor="#F3F3F3"
android:textSize="12sp"
android:visibility="gone"
tools:ignore="SmallSp"
tools:text="1"
tools:visibility="visible" />
</FrameLayout>
</LinearLayout>
<ProgressBar
android:id="@+id/mangaTrendingProgressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="64dp" />
</FrameLayout>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/mangaListContainer" android:id="@+id/mangaListContainer"

View file

@ -0,0 +1,105 @@
<merge 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">
<FrameLayout
android:id="@+id/trendingContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp">
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/trendingViewPager"
android:layout_width="match_parent"
android:layout_height="464dp" />
<LinearLayout
android:id="@+id/titleContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="32dp"
android:orientation="horizontal"
android:baselineAligned="false">
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/searchBar"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="0dp"
android:layout_height="56dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:textColorHint="@color/bg_opp"
android:transitionName="@string/search"
app:boxBackgroundColor="?attr/colorPrimaryContainer"
app:boxCornerRadiusBottomEnd="28dp"
app:boxCornerRadiusBottomStart="28dp"
app:boxCornerRadiusTopEnd="28dp"
app:boxCornerRadiusTopStart="28dp"
app:boxStrokeColor="@color/text_input_layout_stroke_color"
app:endIconDrawable="@drawable/ic_round_search_24"
app:endIconTint="@color/bg_opp"
app:hintAnimationEnabled="true">
<AutoCompleteTextView
android:id="@+id/searchBarText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:focusable="false"
android:fontFamily="@font/poppins_bold"
android:inputType="none"
android:padding="8dp"
android:textColor="?android:attr/textColorSecondary"
android:textSize="14sp"
tools:ignore="LabelFor,TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.google.android.material.card.MaterialCardView
android:id="@+id/userAvatarContainer"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_marginTop="4dp"
android:backgroundTint="@color/nav_bg_inv"
app:cardCornerRadius="26dp">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/userAvatar"
android:layout_width="52dp"
android:layout_height="52dp"
android:scaleType="center"
app:srcCompat="@drawable/ic_round_settings_24"
tools:ignore="ContentDescription,ImageContrastCheck" />
</com.google.android.material.card.MaterialCardView>
<TextView
android:id="@+id/notificationCount"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="end|bottom"
android:background="@drawable/notification_circle"
android:fontFamily="@font/poppins_semi_bold"
android:gravity="center"
android:textColor="#F3F3F3"
android:textSize="12sp"
android:visibility="gone"
tools:ignore="SmallSp"
tools:text="1"
tools:visibility="visible" />
</FrameLayout>
</LinearLayout>
<ProgressBar
android:id="@+id/trendingProgressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="64dp" />
</FrameLayout>
</merge>