Fixed event duplication

This commit is contained in:
Viktor De Pasquale 2019-10-17 15:47:11 +02:00
parent 38019f7f42
commit d8338f0b48
3 changed files with 1 additions and 7 deletions

View File

@ -4,7 +4,6 @@ import android.os.Bundle
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 androidx.annotation.CallSuper
import androidx.databinding.DataBindingUtil import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding import androidx.databinding.ViewDataBinding
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
@ -39,7 +38,6 @@ abstract class BaseFragment<ViewModel : BaseViewModel, Binding : ViewDataBinding
return binding.root return binding.root
} }
@CallSuper
override fun onEventDispatched(event: ViewEvent) { override fun onEventDispatched(event: ViewEvent) {
super.onEventDispatched(event) super.onEventDispatched(event)
activity.onEventDispatched(event) activity.onEventDispatched(event)

View File

@ -43,8 +43,6 @@ abstract class CompatActivity<ViewModel : CompatViewModel, Binding : ViewDataBin
} }
override fun onEventDispatched(event: ViewEvent) { override fun onEventDispatched(event: ViewEvent) {
super.onEventDispatched(event)
delegate.onEventExecute(event, this) delegate.onEventExecute(event, this)
} }
@ -54,7 +52,7 @@ abstract class CompatActivity<ViewModel : CompatViewModel, Binding : ViewDataBin
} }
} }
@Deprecated("The event is self handled.") @Deprecated("The event is self handled.", level = DeprecationLevel.ERROR)
override fun navigateTo(event: MagiskNavigationEvent) = Unit override fun navigateTo(event: MagiskNavigationEvent) = Unit
protected fun ViewEvent.dispatchOnSelf() = onEventDispatched(this) protected fun ViewEvent.dispatchOnSelf() = onEventDispatched(this)

View File

@ -29,8 +29,6 @@ abstract class CompatFragment<ViewModel : CompatViewModel, Binding : ViewDataBin
} }
override fun onEventDispatched(event: ViewEvent) { override fun onEventDispatched(event: ViewEvent) {
super.onEventDispatched(event)
delegate.onEventExecute(event, this) delegate.onEventExecute(event, this)
} }