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

View file

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

View file

@ -20,31 +20,27 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <TextView
android:layout_width="match_parent" android:id="@+id/listTitle"
android:layout_height="match_parent" android:layout_width="wrap_content"
android:orientation="horizontal"> android:layout_height="48dp"
android:layout_marginStart="32dp"
android:ellipsize="end"
android:fontFamily="@font/poppins_bold"
android:gravity="center|start"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.Widget.AppCompat.Toolbar.Title"
android:textColor="?attr/colorOnBackground"
android:textSize="16sp"
tools:text="@string/app_name" />
<TextView
android:id="@+id/listTitle"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_marginStart="32dp"
android:layout_weight="1"
android:ellipsize="end"
android:fontFamily="@font/poppins_bold"
android:gravity="center|start"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.Widget.AppCompat.Toolbar.Title"
android:textColor="?attr/colorOnBackground"
android:textSize="16sp"
tools:text="@string/app_name" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<ani.dantotsu.FadingEdgeRecyclerView <ani.dantotsu.FadingEdgeRecyclerView
android:id="@+id/mediaRecyclerView" android:id="@+id/mediaRecyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:paddingStart="20dp" android:paddingStart="20dp"
android:paddingEnd="20dp" android:paddingEnd="20dp"
android:requiresFadingEdge="horizontal" android:requiresFadingEdge="horizontal"
@ -52,10 +48,8 @@
tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_media_compact" tools:listitem="@layout/item_media_compact"
tools:orientation="horizontal" /> tools:orientation="horizontal" />
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -830,8 +830,9 @@
<TextView <TextView
android:id="@+id/homePlannedManga" android:id="@+id/homePlannedManga"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="24dp" android:layout_marginStart="24dp"
android:fontFamily="@font/poppins_bold" android:fontFamily="@font/poppins_bold"
android:padding="8dp" android:padding="8dp"