mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 08:30:44 +00:00
Created a button in SubscriptionFragment.kt that reads whether button is clicked
This commit is contained in:
parent
8482bf9fed
commit
29e56b9f2d
@ -221,6 +221,10 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
|||||||
FeedGroupReorderDialog().show(parentFragmentManager, null)
|
FeedGroupReorderDialog().show(parentFragmentManager, null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun temp() {
|
||||||
|
println("This button is clicked")
|
||||||
|
}
|
||||||
|
|
||||||
private fun requestExportResult(result: ActivityResult) {
|
private fun requestExportResult(result: ActivityResult) {
|
||||||
if (result.data != null && result.resultCode == Activity.RESULT_OK) {
|
if (result.data != null && result.resultCode == Activity.RESULT_OK) {
|
||||||
activity.startService(
|
activity.startService(
|
||||||
@ -271,6 +275,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
|||||||
getString(R.string.feed_groups_header_title),
|
getString(R.string.feed_groups_header_title),
|
||||||
R.drawable.ic_list,
|
R.drawable.ic_list,
|
||||||
R.drawable.ic_sort,
|
R.drawable.ic_sort,
|
||||||
|
listViewOnClickListener = ::temp,
|
||||||
menuItemOnClickListener = ::openReorderDialog
|
menuItemOnClickListener = ::openReorderDialog
|
||||||
)
|
)
|
||||||
add(Section(feedGroupsSortMenuItem, listOf(feedGroupsCarousel)))
|
add(Section(feedGroupsSortMenuItem, listOf(feedGroupsCarousel)))
|
||||||
|
@ -14,7 +14,7 @@ class HeaderWithMenuItem(
|
|||||||
@DrawableRes val itemIconListView: Int = 0,
|
@DrawableRes val itemIconListView: Int = 0,
|
||||||
var showMenuItem: Boolean = true,
|
var showMenuItem: Boolean = true,
|
||||||
private val onClickListener: (() -> Unit)? = null,
|
private val onClickListener: (() -> Unit)? = null,
|
||||||
private val onClickListenerListView: (() -> Unit)? = null,
|
private val listViewOnClickListener: (() -> Unit)? = null,
|
||||||
private val menuItemOnClickListener: (() -> Unit)? = null
|
private val menuItemOnClickListener: (() -> Unit)? = null
|
||||||
) : BindableItem<HeaderWithMenuItemBinding>() {
|
) : BindableItem<HeaderWithMenuItemBinding>() {
|
||||||
companion object {
|
companion object {
|
||||||
@ -40,8 +40,8 @@ class HeaderWithMenuItem(
|
|||||||
val listener = onClickListener?.let { OnClickListener { onClickListener.invoke() } }
|
val listener = onClickListener?.let { OnClickListener { onClickListener.invoke() } }
|
||||||
viewBinding.root.setOnClickListener(listener)
|
viewBinding.root.setOnClickListener(listener)
|
||||||
|
|
||||||
val listenerListView = onClickListenerListView?.let { OnClickListener { onClickListenerListView.invoke() } }
|
val listViewListener = listViewOnClickListener?.let { OnClickListener { listViewOnClickListener.invoke() } }
|
||||||
viewBinding.root.setOnClickListener(listenerListView)
|
viewBinding.headerMenuItem2.setOnClickListener(listViewListener)
|
||||||
|
|
||||||
val menuItemListener = menuItemOnClickListener?.let { OnClickListener { menuItemOnClickListener.invoke() } }
|
val menuItemListener = menuItemOnClickListener?.let { OnClickListener { menuItemOnClickListener.invoke() } }
|
||||||
viewBinding.headerMenuItem.setOnClickListener(menuItemListener)
|
viewBinding.headerMenuItem.setOnClickListener(menuItemListener)
|
||||||
|
Loading…
Reference in New Issue
Block a user