small changes (#102)

This commit is contained in:
aayush262 2023-12-28 15:45:10 +05:30 committed by GitHub
parent 7684a15e94
commit bbc986784b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 12 additions and 70 deletions

View file

@ -14,6 +14,8 @@ import android.util.TypedValue
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.animation.AlphaAnimation
import android.view.animation.LayoutAnimationController
import android.view.animation.OvershootInterpolator import android.view.animation.OvershootInterpolator
import android.widget.AbsListView import android.widget.AbsListView
import android.widget.AutoCompleteTextView import android.widget.AutoCompleteTextView
@ -145,6 +147,7 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
gridView.visibility = View.GONE gridView.visibility = View.GONE
gridView = view.findViewById(R.id.gridView1) gridView = view.findViewById(R.id.gridView1)
gridView.adapter = adapter gridView.adapter = adapter
gridView.scheduleLayoutAnimation()
gridView.visibility = View.VISIBLE gridView.visibility = View.VISIBLE
adapter.notifyNewGrid() adapter.notifyNewGrid()
} }
@ -152,8 +155,15 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
gridView = if(style == 0) view.findViewById(R.id.gridView) else view.findViewById(R.id.gridView1) gridView = if(style == 0) view.findViewById(R.id.gridView) else view.findViewById(R.id.gridView1)
gridView.visibility = View.VISIBLE gridView.visibility = View.VISIBLE
getDownloads() getDownloads()
val fadeIn = AlphaAnimation(0f, 1f)
fadeIn.duration = 200 // animations pog
val animation = LayoutAnimationController(fadeIn)
gridView.layoutAnimation = animation
adapter = OfflineMangaAdapter(requireContext(), downloads, this) adapter = OfflineMangaAdapter(requireContext(), downloads, this)
gridView.adapter = adapter gridView.adapter = adapter
gridView.scheduleLayoutAnimation()
gridView.setOnItemClickListener { parent, view, position, id -> gridView.setOnItemClickListener { parent, view, position, id ->
// Get the OfflineMangaModel that was clicked // Get the OfflineMangaModel that was clicked
val item = adapter.getItem(position) as OfflineMangaModel val item = adapter.getItem(position) as OfflineMangaModel

View file

@ -77,12 +77,6 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
} }
val incognito = currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE) val incognito = currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
?.getBoolean("incognito", false) ?: false ?.getBoolean("incognito", false) ?: false
if(incognito) {
binding.incognitoTextView.visibility = View.VISIBLE
if (!uiSettings.immersiveMode) {
binding.root.fitsSystemWindows = true
}
}
binding.animeTitleContainer.updatePadding(top = statusBarHeight) binding.animeTitleContainer.updatePadding(top = statusBarHeight)

View file

@ -116,14 +116,6 @@ class HomeFragment : Fragment() {
snackString(currContext()?.getString(R.string.please_reload)) snackString(currContext()?.getString(R.string.please_reload))
} }
} }
val incognito = currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
?.getBoolean("incognito", false) ?: false
if(incognito) {
binding.incognitoTextView.visibility = View.VISIBLE
if (!uiSettings.immersiveMode) {
binding.root.fitsSystemWindows = true
}
}
binding.homeUserAvatarContainer.setSafeOnClickListener { binding.homeUserAvatarContainer.setSafeOnClickListener {
val dialogFragment = val dialogFragment =
SettingsDialogFragment.newInstance(SettingsDialogFragment.Companion.PageType.HOME) SettingsDialogFragment.newInstance(SettingsDialogFragment.Companion.PageType.HOME)

View file

@ -77,12 +77,6 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold
val incognito = currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE) val incognito = currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
?.getBoolean("incognito", false) ?: false ?.getBoolean("incognito", false) ?: false
if(incognito) {
binding.incognitoTextView.visibility = View.VISIBLE
if (!uiSettings.immersiveMode) {
binding.root.fitsSystemWindows = true
}
}
binding.mangaTitleContainer.updatePadding(top = statusBarHeight) binding.mangaTitleContainer.updatePadding(top = statusBarHeight)

View file

@ -62,7 +62,7 @@ class ListActivity : AppCompatActivity() {
binding.listTabLayout.setTabTextColors(secondaryTextColor, primaryTextColor) binding.listTabLayout.setTabTextColors(secondaryTextColor, primaryTextColor)
binding.listTabLayout.setSelectedTabIndicatorColor(primaryTextColor) binding.listTabLayout.setSelectedTabIndicatorColor(primaryTextColor)
val uiSettings = loadData<UserInterfaceSettings>("ui_settings") ?: UserInterfaceSettings() val uiSettings = loadData<UserInterfaceSettings>("ui_settings") ?: UserInterfaceSettings()
if (!uiSettings.immersiveModeList) { if (!uiSettings.immersiveMode) {
this.window.statusBarColor = this.window.statusBarColor =
ContextCompat.getColor(this, R.color.nav_bg_inv) ContextCompat.getColor(this, R.color.nav_bg_inv)
binding.root.fitsSystemWindows = true binding.root.fitsSystemWindows = true
@ -78,8 +78,7 @@ class ListActivity : AppCompatActivity() {
setContentView(binding.root) setContentView(binding.root)
val anime = intent.getBooleanExtra("anime", true) val anime = intent.getBooleanExtra("anime", true)
binding.listTitle.text = binding.listTitle.text = (if (anime) "Anime" else "Manga") + " List"
intent.getStringExtra("username") + "'s " + (if (anime) "Anime" else "Manga") + " List"
binding.listTabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener { binding.listTabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
override fun onTabSelected(tab: TabLayout.Tab?) { override fun onTabSelected(tab: TabLayout.Tab?) {

View file

@ -10,7 +10,6 @@ data class UserInterfaceSettings(
//App //App
var immersiveMode: Boolean = false, var immersiveMode: Boolean = false,
var immersiveModeList: Boolean = false,
var smallView: Boolean = true, var smallView: Boolean = true,
var defaultStartUpTab: Int = 1, var defaultStartUpTab: Int = 1,
var homeLayoutShow: MutableList<Boolean> = mutableListOf( var homeLayoutShow: MutableList<Boolean> = mutableListOf(

View file

@ -68,13 +68,6 @@ class UserInterfaceSettingsActivity : AppCompatActivity() {
saveData(ui, settings) saveData(ui, settings)
restartApp() restartApp()
} }
binding.uiSettingsImmersiveList.isChecked = settings.immersiveModeList
binding.uiSettingsImmersiveList.setOnCheckedChangeListener { _, isChecked ->
settings.immersiveModeList = isChecked
saveData(ui, settings)
restartApp()
}
binding.uiSettingsBannerAnimation.isChecked = settings.bannerAnimations binding.uiSettingsBannerAnimation.isChecked = settings.bannerAnimations
binding.uiSettingsBannerAnimation.setOnCheckedChangeListener { _, isChecked -> binding.uiSettingsBannerAnimation.setOnCheckedChangeListener { _, isChecked ->
settings.bannerAnimations = isChecked settings.bannerAnimations = isChecked

View file

@ -81,23 +81,6 @@
app:tabPaddingStart="16dp" app:tabPaddingStart="16dp"
app:tabTextAppearance="@style/NavBarText" app:tabTextAppearance="@style/NavBarText"
app:tabGravity="fill"> app:tabGravity="fill">
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/installed_anime"/>
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/available_anime"/>
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/installed_manga"/>
<com.google.android.material.tabs.TabItem
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Available Manga"
tools:ignore="HardcodedText" />
</com.google.android.material.tabs.TabLayout> </com.google.android.material.tabs.TabLayout>
<com.google.android.material.textfield.TextInputLayout <com.google.android.material.textfield.TextInputLayout

View file

@ -121,28 +121,6 @@
</com.google.android.material.materialswitch.MaterialSwitch> </com.google.android.material.materialswitch.MaterialSwitch>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/uiSettingsImmersiveList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:checked="true"
android:drawableStart="@drawable/ic_round_fullscreen_24"
android:drawablePadding="16dp"
app:drawableTint="?attr/colorPrimary"
android:elegantTextHeight="true"
android:fontFamily="@font/poppins_bold"
android:minHeight="64dp"
android:paddingStart="32dp"
android:paddingEnd="32dp"
android:text="@string/immersive_modelist"
android:textAlignment="viewStart"
android:textColor="?attr/colorOnBackground"
app:cornerRadius="0dp"
app:showText="false"
app:thumbTint="@color/button_switch_track">
</com.google.android.material.materialswitch.MaterialSwitch>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"