mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-26 17:21:03 +00:00
random option
This commit is contained in:
@@ -162,5 +162,15 @@ class ListActivity : AppCompatActivity() {
|
||||
popup.inflate(R.menu.list_sort_menu)
|
||||
popup.show()
|
||||
}
|
||||
|
||||
binding.random.setOnClickListener {
|
||||
//get the current tab
|
||||
val currentTab =
|
||||
binding.listTabLayout.getTabAt(binding.listTabLayout.selectedTabPosition)
|
||||
val currentViewePager = binding.listViewPager.getChildAt(0)
|
||||
val currentFragment =
|
||||
supportFragmentManager.findFragmentByTag("f" + currentTab?.position.toString()) as? ListFragment
|
||||
currentFragment?.randomOptionClick()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +76,11 @@ class ListFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
|
||||
fun randomOptionClick() {
|
||||
val adapter = binding.listRecyclerView.adapter as MediaAdaptor
|
||||
adapter.randomOptionClick()
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance(pos: Int, calendar: Boolean = false): ListFragment =
|
||||
ListFragment().apply {
|
||||
|
||||
Reference in New Issue
Block a user