整理代码
This commit is contained in:
parent
16efb504e3
commit
9d8fc70c10
|
|
@ -99,9 +99,9 @@
|
|||
"target_action": "用户累计观看短视频",
|
||||
"reward_type": "金币",
|
||||
"reward_details": [
|
||||
{"target_count": 10, "value": 100},
|
||||
{"target_count": 20, "value": 150},
|
||||
{"target_count": 30, "value": 200}
|
||||
{"target_count": 2, "value": 100},
|
||||
{"target_count": 3, "value": 150},
|
||||
{"target_count": 4, "value": 200}
|
||||
],
|
||||
"reward_stackable": true,
|
||||
"is_one_time": false,
|
||||
|
|
@ -115,8 +115,8 @@
|
|||
"reward_type": "金币",
|
||||
"reward_details": [
|
||||
{"target_count": 1, "value": 100},
|
||||
{"target_count": 5, "value": 150},
|
||||
{"target_count": 10, "value": 200}
|
||||
{"target_count": 3, "value": 150},
|
||||
{"target_count": 5, "value": 200}
|
||||
],
|
||||
"daily_limit": 10,
|
||||
"reward_stackable": true,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,130 @@
|
|||
{
|
||||
"task_module_config": {
|
||||
"basic_info": {
|
||||
"module_name": "任务中心",
|
||||
"page_path": "底部第二个页签",
|
||||
"layout_style": "上下滑动长页面",
|
||||
"currency_display": ["金币账户", "巴西雷亚尔现金账户"]
|
||||
},
|
||||
"task_categories": [
|
||||
{
|
||||
"category_id": "newbie_task",
|
||||
"category_name": "新手任务(Missão Para Iniciantes)",
|
||||
"valid_period": "注册后7天内",
|
||||
"display_priority": 1,
|
||||
"tasks": [
|
||||
{
|
||||
"task_id": "newbie_first_withdraw",
|
||||
"task_name": "完成第一次提现",
|
||||
"task_desc": "完成首次提现操作(0.1 BRL门槛),即可获得100金币奖励",
|
||||
"target_action": "用户完成首次提现流程(含绑定Pix账户、观看广告)",
|
||||
"reward_type": "金币",
|
||||
"reward_value": 100,
|
||||
"is_one_time": true,
|
||||
"status": "active"
|
||||
},
|
||||
{
|
||||
"task_id": "newbie_push_notify",
|
||||
"task_name": "开启消息推送",
|
||||
"task_desc": "启用APP消息推送权限,实时获取任务更新与奖励通知",
|
||||
"target_action": "用户授权APP系统推送通知",
|
||||
"reward_type": "金币",
|
||||
"reward_value": 300,
|
||||
"is_one_time": true,
|
||||
"status": "active"
|
||||
},
|
||||
{
|
||||
"task_id": "newbie_join_discord",
|
||||
"task_name": "加入Discord社区",
|
||||
"task_desc": "通过APP内链接加入官方Discord社区,获取专属活动与客服支持",
|
||||
"target_action": "用户通过指定链接成功加入Discord社区",
|
||||
"reward_type": "金币",
|
||||
"reward_value": 200,
|
||||
"is_one_time": true,
|
||||
"status": "active"
|
||||
},
|
||||
{
|
||||
"task_id": "newbie_7day_checkin",
|
||||
"task_name": "7日连续签到",
|
||||
"task_desc": "连续7天完成签到,奖励逐级递增,第7天最高可得800金币",
|
||||
"target_action": "用户每日完成签到操作(支持广告补签)",
|
||||
"reward_type": "金币",
|
||||
"reward_details": [
|
||||
{"day": 1, "value": 100},
|
||||
{"day": 2, "value": 300},
|
||||
{"day": 3, "value": 300},
|
||||
{"day": 4, "value": 500},
|
||||
{"day": 5, "value": 300},
|
||||
{"day": 6, "value": 300},
|
||||
{"day": 7, "value": 800}
|
||||
],
|
||||
"support_makeup": true,
|
||||
"makeup_method": "观看15-30秒激励视频",
|
||||
"is_one_time": true,
|
||||
"status": "active"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"category_id": "daily_task",
|
||||
"category_name": "日常任务(Missão Diária)",
|
||||
"valid_period": "每日凌晨00:00重置",
|
||||
"display_priority": 2,
|
||||
"tasks": [
|
||||
{
|
||||
"task_id": "daily_checkin",
|
||||
"task_name": "每日签到",
|
||||
"task_desc": "每日签到可获金币,7天为一周期,奖励循环递增(支持双倍广告奖励)",
|
||||
"target_action": "用户当日完成签到操作",
|
||||
"reward_type": "金币",
|
||||
"reward_details": [
|
||||
{"day": 1, "value": 100},
|
||||
{"day": 2, "value": 300},
|
||||
{"day": 3, "value": 300},
|
||||
{"day": 4, "value": 500},
|
||||
{"day": 5, "value": 300},
|
||||
{"day": 6, "value": 300},
|
||||
{"day": 7, "value": 500}
|
||||
],
|
||||
"double_reward_method": "观看15-30秒激励视频",
|
||||
"support_makeup": true,
|
||||
"makeup_method": "观看15-30秒激励视频",
|
||||
"is_one_time": false,
|
||||
"status": "active"
|
||||
},
|
||||
{
|
||||
"task_id": "daily_video_ladder",
|
||||
"task_name": "阶梯观看视频",
|
||||
"task_desc": "累计观看指定数量短视频,分3档领取奖励(与基础观看收益叠加)",
|
||||
"target_action": "用户累计观看短视频",
|
||||
"reward_type": "金币",
|
||||
"reward_details": [
|
||||
{"target_count": 10, "value": 100},
|
||||
{"target_count": 20, "value": 150},
|
||||
{"target_count": 30, "value": 200}
|
||||
],
|
||||
"reward_stackable": true,
|
||||
"is_one_time": false,
|
||||
"status": "active"
|
||||
},
|
||||
{
|
||||
"task_id": "daily_ad_ladder",
|
||||
"task_name": "阶梯观看激励视频",
|
||||
"task_desc": "累计观看指定数量激励视频,分3档领取奖励(每日上限10次)",
|
||||
"target_action": "用户累计观看激励视频",
|
||||
"reward_type": "金币",
|
||||
"reward_details": [
|
||||
{"target_count": 1, "value": 100},
|
||||
{"target_count": 5, "value": 150},
|
||||
{"target_count": 10, "value": 200}
|
||||
],
|
||||
"daily_limit": 10,
|
||||
"reward_stackable": true,
|
||||
"is_one_time": false,
|
||||
"status": "active"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -103,10 +103,10 @@ class MainTabsAdapter(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private fun ViewBinding.onTabClickAgainHandle(index: Int) {
|
||||
val currentFragment = mainFragmentStateAdapter.getFragmentByIndex(index)
|
||||
if (currentFragment is OnTabClickRefreshListener) {
|
||||
// 刷新 - 展示Loading
|
||||
currentFragment.onTabClickRefresh(object : OnTabClickRefreshFinishListener {
|
||||
override fun onTabClickRefreshFinish() {
|
||||
setTabStyle(1)
|
||||
|
|
|
|||
|
|
@ -122,4 +122,5 @@ class MainActivity : AppViewsActivity<ViewBinding, UiState, ViewModel>(), OnTabS
|
|||
binding.viewPager2.setCurrentItem(itemIndex, false)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -23,7 +23,6 @@ import com.gamedog.vididin.main.interfaces.OnSwitchTabListener
|
|||
import com.gamedog.vididin.main.interfaces.OnTabStyleListener
|
||||
import com.gamedog.vididin.youtubestatistic.RewardConst
|
||||
import com.gamedog.vididin.youtubestatistic.RewardConst.Companion.Check_Interval_MS
|
||||
import com.gamedog.vididin.youtubestatistic.TickerTimer
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlin.getValue
|
||||
|
|
@ -115,7 +114,6 @@ class HomeFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(), OnSwit
|
|||
|
||||
override fun ViewBinding.onUiStateCollect(uiState: UiState) {
|
||||
mViewPagerAdapter.submitList(uiState.playLists)
|
||||
//viewPager2.setDataOrAdapter(uiState.playLists, 1) { mViewPagerAdapter }
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
|
|
|||
|
|
@ -41,12 +41,9 @@ fun MagicIndicator.bindViewPager2(
|
|||
override fun onPageSelected(position: Int) {
|
||||
super.onPageSelected(position)
|
||||
if (!useFragmentContainerHelper) {
|
||||
// 用ViewPagerHelper的处理
|
||||
this@bindViewPager2.onPageSelected(position)
|
||||
// -兼容ViewPager2.setCurrentItem(index, false)不快速切换时,没有ViewPager那样触发onPageScrolled。
|
||||
this@bindViewPager2.onPageScrolled(position, 0f, 0)
|
||||
} else {
|
||||
// 用FragmentContainerHelper的处理
|
||||
fragmentContainerHelper?.handlePageSelected(position)
|
||||
}
|
||||
}
|
||||
|
|
@ -54,17 +51,13 @@ fun MagicIndicator.bindViewPager2(
|
|||
override fun onPageScrollStateChanged(state: Int) {
|
||||
super.onPageScrollStateChanged(state)
|
||||
if (!useFragmentContainerHelper) {
|
||||
// 用ViewPagerHelper的处理
|
||||
this@bindViewPager2.onPageScrollStateChanged(state)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置CommonNavigator,用于给MagicIndicator设置特定的CommonNavigator,如果设置默认的,可以直接使用[setDataOrAdapter]。
|
||||
* [commonNavigatorInit]用于初始化CommonNavigator。
|
||||
*/
|
||||
|
||||
fun MagicIndicator.setCommonNavigator(
|
||||
commonNavigatorInit: (CommonNavigator.() -> Unit)? = null,
|
||||
) =
|
||||
|
|
@ -73,11 +66,7 @@ fun MagicIndicator.setCommonNavigator(
|
|||
setNavigator(this)
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置[list]数据、[createNavigatorAdapter]创建的Adapter。
|
||||
* 说明:MagicIndicator内部没实现因为配置变更而导致的页面销毁后的还原操作,但是通过和ViewPager2的绑定,则也能间接性的进行还原操作。
|
||||
* 此实现仿ViewPager2,可以统一调用。
|
||||
*/
|
||||
|
||||
fun <T> MagicIndicator.setDataOrAdapter(
|
||||
list: List<T>?,
|
||||
createNavigatorAdapter: () -> AppNavigatorAdapter<T>,
|
||||
|
|
|
|||
Loading…
Reference in New Issue