action
This commit is contained in:
parent
0ae94cb4fd
commit
245870b96c
|
|
@ -56,6 +56,34 @@ class TasksFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(), OnTab
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
beginnerTaskWithdraw.setActionFun {
|
||||
gotoWithDraw()
|
||||
}
|
||||
beginnerTaskDiscord.setActionFun {
|
||||
gotoDiscord()
|
||||
}
|
||||
beginnerTaskEnableNotify.setActionFun {
|
||||
gotoNotification()
|
||||
}
|
||||
dailyTaskWatch1.setActionFun {
|
||||
gotoWithVideo()
|
||||
}
|
||||
dailyTaskWatch5.setActionFun {
|
||||
gotoWithVideo()
|
||||
}
|
||||
dailyTaskWatch10.setActionFun {
|
||||
gotoWithVideo()
|
||||
}
|
||||
dailyTaskWatch20.setActionFun {
|
||||
gotoWithVideo()
|
||||
}
|
||||
dailyTaskWatch30.setActionFun {
|
||||
gotoWithVideo()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
lifecycleScope.launch {
|
||||
|
|
@ -84,4 +112,22 @@ class TasksFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(), OnTab
|
|||
companion object {
|
||||
internal fun newInstance() = TasksFragment()
|
||||
}
|
||||
|
||||
private fun gotoWithDraw() {
|
||||
//TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
private fun gotoDiscord() {
|
||||
//TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
private fun gotoNotification() {
|
||||
//TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
private fun gotoWithVideo() {
|
||||
//TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
|||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import com.ama.core.architecture.util.setOnClickBatch
|
||||
import com.gamedog.vididin.databinding.BeginnerTaskItemViewBinding
|
||||
|
||||
|
||||
|
|
@ -12,13 +13,20 @@ class BeginnerTaskItemView @JvmOverloads constructor(
|
|||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr) {
|
||||
private lateinit var mAction: () -> Unit
|
||||
private lateinit var mBinding: BeginnerTaskItemViewBinding
|
||||
|
||||
|
||||
init {
|
||||
mBinding = BeginnerTaskItemViewBinding.inflate(LayoutInflater.from(context), this, true)
|
||||
mBinding.run {
|
||||
|
||||
setOnClickBatch(tvAction) {
|
||||
when (this) {
|
||||
tvAction-> {
|
||||
mAction.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -35,5 +43,9 @@ class BeginnerTaskItemView @JvmOverloads constructor(
|
|||
mBinding.ivRewardIcon.setImageResource(rewardIconRes)
|
||||
}
|
||||
|
||||
fun setActionFun(action: ()->Unit) {
|
||||
mAction = action
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import android.content.Context
|
|||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import com.ama.core.architecture.util.setOnClickBatch
|
||||
import com.gamedog.vididin.databinding.DailyTaskItemViewBinding
|
||||
|
||||
|
||||
|
|
@ -12,13 +13,20 @@ class DailyTaskItemView @JvmOverloads constructor(
|
|||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr) {
|
||||
private lateinit var mAction: () -> Unit
|
||||
private lateinit var mBinding: DailyTaskItemViewBinding
|
||||
|
||||
|
||||
init {
|
||||
mBinding = DailyTaskItemViewBinding.inflate(LayoutInflater.from(context), this, true)
|
||||
mBinding.run {
|
||||
|
||||
setOnClickBatch(tvAction) {
|
||||
when (this) {
|
||||
tvAction-> {
|
||||
mAction.invoke()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -40,5 +48,11 @@ class DailyTaskItemView @JvmOverloads constructor(
|
|||
mBinding.ivRewardIcon.setImageResource(rewardIconRes)
|
||||
}
|
||||
|
||||
fun setActionFun(action: ()->Unit) {
|
||||
mAction = action
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue