|
|
@@ -1,32 +1,24 @@
|
|
|
-package com.adealink.weparty.profile.me.data
|
|
|
+package com.adealink.weparty.profile.me.view
|
|
|
|
|
|
import android.net.Uri
|
|
|
import android.os.Handler
|
|
|
import android.os.Looper
|
|
|
-import android.view.Gravity
|
|
|
import android.view.View
|
|
|
import androidx.lifecycle.LifecycleOwner
|
|
|
import com.adealink.frame.aab.util.getCompatString
|
|
|
import com.adealink.frame.base.Rlt
|
|
|
import com.adealink.frame.base.fastLazy
|
|
|
-import com.adealink.frame.guide.core.GuidePage
|
|
|
-import com.adealink.frame.guide.core.NewbieGuide
|
|
|
-import com.adealink.frame.guide.core.highlight.HighLight
|
|
|
-import com.adealink.frame.guide.core.highlight.MarginInfo
|
|
|
-import com.adealink.frame.guide.core.highlight.Offset
|
|
|
-import com.adealink.frame.guide.core.highlight.RelativeGuide
|
|
|
+import com.adealink.frame.guide.GuideCenter
|
|
|
import com.adealink.frame.mvvm.view.ViewComponent
|
|
|
import com.adealink.frame.mvvm.viewmodel.viewModels
|
|
|
import com.adealink.frame.router.Router
|
|
|
import com.adealink.frame.share.IShareCallback
|
|
|
import com.adealink.frame.share.data.SHARE_FAIL_CODE_NO_INSTALL
|
|
|
import com.adealink.frame.share.data.ShareChannel
|
|
|
-import com.adealink.frame.util.DisplayUtil
|
|
|
import com.adealink.frame.util.runOnUiThread
|
|
|
import com.adealink.weparty.AppModule
|
|
|
import com.adealink.weparty.commonui.BaseActivity
|
|
|
import com.adealink.weparty.commonui.toast.util.showToast
|
|
|
-import com.adealink.weparty.module.profile.ProfileModule
|
|
|
import com.adealink.weparty.module.share.ShareModule
|
|
|
import com.adealink.weparty.module.share.data.ShareLinkSource
|
|
|
import com.adealink.weparty.module.share.dialog.BottomShareDialogBuilder
|
|
|
@@ -51,6 +43,7 @@ class InviteEntranceViewComp(
|
|
|
) : ViewComponent(lifecycleOwner) {
|
|
|
private val viewModel by viewModels<InviteEntranceViewModel> { ProfileViewModelFactory() }
|
|
|
private val shareViewModel by fastLazy { ShareModule.getShareViewModel(requireActivity()) }
|
|
|
+ private val inviteEntranceGuide by fastLazy { InviteEntranceGuide() }
|
|
|
|
|
|
private val handler by lazy {
|
|
|
Handler(Looper.getMainLooper())
|
|
|
@@ -92,9 +85,11 @@ class InviteEntranceViewComp(
|
|
|
override fun onDestroy() {
|
|
|
super.onDestroy()
|
|
|
handler.removeCallbacks(runnable)
|
|
|
+ inviteEntranceGuide.unregister()
|
|
|
}
|
|
|
|
|
|
private fun initView() {
|
|
|
+ inviteEntranceGuide.register(fragment)
|
|
|
binding.root.setOnClickListener {
|
|
|
onInviteEntranceClick()
|
|
|
}
|
|
|
@@ -150,32 +145,7 @@ class InviteEntranceViewComp(
|
|
|
if (binding.entranceSwitcher.visibility != View.VISIBLE) {
|
|
|
return
|
|
|
}
|
|
|
- val guidePage = GuidePage().apply {
|
|
|
- setLabel("${LABEL_INVITE_GUIDE}_${ProfileModule.getMyUid()}")
|
|
|
- addHighLight(
|
|
|
- R.string.profile_me_tag_invite,
|
|
|
- object : RelativeGuide(
|
|
|
- R.layout.layout_me_invite_guide,
|
|
|
- Gravity.TOP or Gravity.CENTER_HORIZONTAL,
|
|
|
- false
|
|
|
- ) {
|
|
|
- override fun onMarginInfo(
|
|
|
- relativeView: View,
|
|
|
- marginInfo: MarginInfo,
|
|
|
- outOffset: Offset
|
|
|
- ) {
|
|
|
- super.onMarginInfo(relativeView, marginInfo, outOffset)
|
|
|
- outOffset.top += -DisplayUtil.dp2px(12f)
|
|
|
- outOffset.start += -DisplayUtil.dp2px(30f)
|
|
|
- }
|
|
|
- },
|
|
|
- shape = HighLight.Shape.CIRCLE
|
|
|
- )
|
|
|
- }
|
|
|
- NewbieGuide.with(fragment)
|
|
|
- .addGuidePage(guidePage)
|
|
|
- .build()
|
|
|
- .show()
|
|
|
+ GuideCenter.activeGuide(InviteEntranceGuide.GUIDE_TYPE_INVITE_ENTRANCE)
|
|
|
}
|
|
|
|
|
|
// 分享结果回调
|
|
|
@@ -258,7 +228,6 @@ class InviteEntranceViewComp(
|
|
|
}
|
|
|
|
|
|
companion object {
|
|
|
- const val LABEL_INVITE_GUIDE = "label_invite_guide"
|
|
|
const val SWITCH_INTERVAL_MILLS = 4000L // 入口轮播的时间间隔
|
|
|
}
|
|
|
|