small changes (#102)
This commit is contained in:
parent
7684a15e94
commit
bbc986784b
9 changed files with 12 additions and 70 deletions
|
@ -14,6 +14,8 @@ import android.util.TypedValue
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.AlphaAnimation
|
||||
import android.view.animation.LayoutAnimationController
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import android.widget.AbsListView
|
||||
import android.widget.AutoCompleteTextView
|
||||
|
@ -145,6 +147,7 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
|
|||
gridView.visibility = View.GONE
|
||||
gridView = view.findViewById(R.id.gridView1)
|
||||
gridView.adapter = adapter
|
||||
gridView.scheduleLayoutAnimation()
|
||||
gridView.visibility = View.VISIBLE
|
||||
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.visibility = View.VISIBLE
|
||||
getDownloads()
|
||||
|
||||
val fadeIn = AlphaAnimation(0f, 1f)
|
||||
fadeIn.duration = 200 // animations pog
|
||||
val animation = LayoutAnimationController(fadeIn)
|
||||
|
||||
gridView.layoutAnimation = animation
|
||||
adapter = OfflineMangaAdapter(requireContext(), downloads, this)
|
||||
gridView.adapter = adapter
|
||||
gridView.scheduleLayoutAnimation()
|
||||
gridView.setOnItemClickListener { parent, view, position, id ->
|
||||
// Get the OfflineMangaModel that was clicked
|
||||
val item = adapter.getItem(position) as OfflineMangaModel
|
||||
|
|
|
@ -77,12 +77,6 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
|
|||
}
|
||||
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.animeTitleContainer.updatePadding(top = statusBarHeight)
|
||||
|
||||
|
|
|
@ -116,14 +116,6 @@ class HomeFragment : Fragment() {
|
|||
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 {
|
||||
val dialogFragment =
|
||||
SettingsDialogFragment.newInstance(SettingsDialogFragment.Companion.PageType.HOME)
|
||||
|
|
|
@ -77,12 +77,6 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold
|
|||
|
||||
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.mangaTitleContainer.updatePadding(top = statusBarHeight)
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ class ListActivity : AppCompatActivity() {
|
|||
binding.listTabLayout.setTabTextColors(secondaryTextColor, primaryTextColor)
|
||||
binding.listTabLayout.setSelectedTabIndicatorColor(primaryTextColor)
|
||||
val uiSettings = loadData<UserInterfaceSettings>("ui_settings") ?: UserInterfaceSettings()
|
||||
if (!uiSettings.immersiveModeList) {
|
||||
if (!uiSettings.immersiveMode) {
|
||||
this.window.statusBarColor =
|
||||
ContextCompat.getColor(this, R.color.nav_bg_inv)
|
||||
binding.root.fitsSystemWindows = true
|
||||
|
@ -78,8 +78,7 @@ class ListActivity : AppCompatActivity() {
|
|||
setContentView(binding.root)
|
||||
|
||||
val anime = intent.getBooleanExtra("anime", true)
|
||||
binding.listTitle.text =
|
||||
intent.getStringExtra("username") + "'s " + (if (anime) "Anime" else "Manga") + " List"
|
||||
binding.listTitle.text = (if (anime) "Anime" else "Manga") + " List"
|
||||
|
||||
binding.listTabLayout.addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener {
|
||||
override fun onTabSelected(tab: TabLayout.Tab?) {
|
||||
|
|
|
@ -10,7 +10,6 @@ data class UserInterfaceSettings(
|
|||
|
||||
//App
|
||||
var immersiveMode: Boolean = false,
|
||||
var immersiveModeList: Boolean = false,
|
||||
var smallView: Boolean = true,
|
||||
var defaultStartUpTab: Int = 1,
|
||||
var homeLayoutShow: MutableList<Boolean> = mutableListOf(
|
||||
|
|
|
@ -68,13 +68,6 @@ class UserInterfaceSettingsActivity : AppCompatActivity() {
|
|||
saveData(ui, settings)
|
||||
restartApp()
|
||||
}
|
||||
binding.uiSettingsImmersiveList.isChecked = settings.immersiveModeList
|
||||
binding.uiSettingsImmersiveList.setOnCheckedChangeListener { _, isChecked ->
|
||||
settings.immersiveModeList = isChecked
|
||||
saveData(ui, settings)
|
||||
restartApp()
|
||||
}
|
||||
|
||||
binding.uiSettingsBannerAnimation.isChecked = settings.bannerAnimations
|
||||
binding.uiSettingsBannerAnimation.setOnCheckedChangeListener { _, isChecked ->
|
||||
settings.bannerAnimations = isChecked
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue