Merge branch 'dev' of https://github.com/rebelonion/Dantotsu into dev
This commit is contained in:
commit
f03af6856a
10 changed files with 365 additions and 126 deletions
|
@ -1,7 +1,6 @@
|
|||
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
|
||||
|
@ -13,7 +12,7 @@ import ani.dantotsu.databinding.ActivityMediaListViewBinding
|
|||
import ani.dantotsu.getThemeColor
|
||||
import ani.dantotsu.hideSystemBarsExtendView
|
||||
import ani.dantotsu.initActivity
|
||||
import ani.dantotsu.navBarHeight
|
||||
import ani.dantotsu.others.getSerialized
|
||||
import ani.dantotsu.settings.saving.PrefManager
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.statusBarHeight
|
||||
|
@ -40,6 +39,7 @@ class MediaListViewActivity: AppCompatActivity() {
|
|||
topMargin = statusBarHeight
|
||||
}
|
||||
}
|
||||
|
||||
setContentView(binding.root)
|
||||
|
||||
val primaryColor = getThemeColor(com.google.android.material.R.attr.colorSurface)
|
||||
|
@ -51,6 +51,7 @@ class MediaListViewActivity: AppCompatActivity() {
|
|||
binding.listAppBar.setBackgroundColor(primaryColor)
|
||||
binding.listTitle.setTextColor(primaryTextColor)
|
||||
val screenWidth = resources.displayMetrics.run { widthPixels / density }
|
||||
val mediaList = intent.getSerialized("media") as? ArrayList<Media> ?: ArrayList()
|
||||
binding.listTitle.text = intent.getStringExtra("title")
|
||||
binding.mediaRecyclerView.adapter = MediaAdaptor(0, mediaList, this)
|
||||
binding.mediaRecyclerView.layoutManager = GridLayoutManager(
|
||||
|
@ -58,7 +59,4 @@ class MediaListViewActivity: AppCompatActivity() {
|
|||
(screenWidth / 120f).toInt()
|
||||
)
|
||||
}
|
||||
companion object{
|
||||
var mediaList: ArrayList<Media> = arrayListOf()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue