fix: strings

This commit is contained in:
aayush262 2024-05-01 01:29:46 +05:30
parent 0ea1ec1c35
commit 74fcd581b0
4 changed files with 55 additions and 37 deletions

View file

@ -211,7 +211,8 @@ class HomeFragment : Fragment() {
progress: View,
empty: View,
title: View,
more: View
more: View,
string: String
) {
container.visibility = View.VISIBLE
progress.visibility = View.VISIBLE
@ -235,7 +236,7 @@ class HomeFragment : Fragment() {
MediaListViewActivity.mediaList = it
ContextCompat.startActivity(
requireActivity(), Intent(requireActivity(), MediaListViewActivity::class.java)
.putExtra("title", getString(R.string.continue_watching)),
.putExtra("title", string),
null
)
}
@ -246,7 +247,7 @@ class HomeFragment : Fragment() {
} else {
empty.visibility = View.VISIBLE
}
more?.visibility = View.VISIBLE
more.visibility = View.VISIBLE
title.visibility = View.VISIBLE
title.startAnimation(setSlideUp())
progress.visibility = View.GONE
@ -263,7 +264,8 @@ class HomeFragment : Fragment() {
binding.homeWatchingProgressBar,
binding.homeWatchingEmpty,
binding.homeContinueWatch,
binding.homeContinueWatchMore
binding.homeContinueWatchMore,
getString(R.string.continue_watching)
)
binding.homeWatchingBrowseButton.setOnClickListener {
bottomBar.selectTabAt(0)
@ -276,7 +278,8 @@ class HomeFragment : Fragment() {
binding.homeFavAnimeProgressBar,
binding.homeFavAnimeEmpty,
binding.homeFavAnime,
binding.homeFavAnimeMore
binding.homeFavAnimeMore,
getString(R.string.fav_anime)
)
@ -287,7 +290,8 @@ class HomeFragment : Fragment() {
binding.homePlannedAnimeProgressBar,
binding.homePlannedAnimeEmpty,
binding.homePlannedAnime,
binding.homePlannedAnimeMore
binding.homePlannedAnimeMore,
getString(R.string.planned_anime)
)
binding.homePlannedAnimeBrowseButton.setOnClickListener {
bottomBar.selectTabAt(0)
@ -300,7 +304,8 @@ class HomeFragment : Fragment() {
binding.homeReadingProgressBar,
binding.homeReadingEmpty,
binding.homeContinueRead,
binding.homeContinueReadMore
binding.homeContinueReadMore,
getString(R.string.continue_reading)
)
binding.homeReadingBrowseButton.setOnClickListener {
bottomBar.selectTabAt(2)
@ -313,7 +318,8 @@ class HomeFragment : Fragment() {
binding.homeFavMangaProgressBar,
binding.homeFavMangaEmpty,
binding.homeFavManga,
binding.homeFavMangaMore
binding.homeFavMangaMore,
getString(R.string.fav_manga)
)
initRecyclerView(
@ -323,7 +329,8 @@ class HomeFragment : Fragment() {
binding.homePlannedMangaProgressBar,
binding.homePlannedMangaEmpty,
binding.homePlannedManga,
binding.homePlannedMangaMore
binding.homePlannedMangaMore,
getString(R.string.planned_manga)
)
binding.homePlannedMangaBrowseButton.setOnClickListener {
bottomBar.selectTabAt(2)
@ -336,7 +343,8 @@ class HomeFragment : Fragment() {
binding.homeRecommendedProgressBar,
binding.homeRecommendedEmpty,
binding.homeRecommended,
binding.homeRecommendedMore
binding.homeRecommendedMore,
getString(R.string.recommended)
)
binding.homeUserStatusContainer.visibility = View.VISIBLE
binding.homeUserStatusProgressBar.visibility = View.VISIBLE

View file

@ -3,13 +3,19 @@ package ani.dantotsu.media
import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import android.view.Window
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.core.view.updateLayoutParams
import androidx.recyclerview.widget.GridLayoutManager
import ani.dantotsu.R
import ani.dantotsu.databinding.ActivityMediaListViewBinding
import ani.dantotsu.getThemeColor
import ani.dantotsu.hideSystemBarsExtendView
import ani.dantotsu.initActivity
import ani.dantotsu.navBarHeight
import ani.dantotsu.settings.saving.PrefManager
import ani.dantotsu.settings.saving.PrefName
import ani.dantotsu.statusBarHeight
import ani.dantotsu.themes.ThemeManager
import java.util.ArrayList
@ -31,9 +37,18 @@ class MediaListViewActivity: AppCompatActivity() {
window.navigationBarColor = primaryColor
binding.listAppBar.setBackgroundColor(primaryColor)
binding.listTitle.setTextColor(primaryTextColor)
binding.root.updateLayoutParams<ViewGroup.MarginLayoutParams> {
topMargin = statusBarHeight
bottomMargin = navBarHeight
if (!PrefManager.getVal<Boolean>(PrefName.ImmersiveMode)) {
this.window.statusBarColor =
ContextCompat.getColor(this, R.color.nav_bg_inv)
binding.root.fitsSystemWindows = true
} else {
binding.root.fitsSystemWindows = false
requestWindowFeature(Window.FEATURE_NO_TITLE)
hideSystemBarsExtendView()
binding.settingsContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
topMargin = statusBarHeight
}
}
val screenWidth = resources.displayMetrics.run { widthPixels / density }
binding.listTitle.text = intent.getStringExtra("title")