领金币 转换现金 取现
This commit is contained in:
parent
8932c39064
commit
02bc2837bd
|
|
@ -52,7 +52,7 @@ object VidiConst {
|
|||
|
||||
const val GOLD_IN_CONFIG: String = "金币"
|
||||
|
||||
const val PER_CASH_COST_GOLD_NUM = 1000
|
||||
const val PER_01CASH_COST_GOLD_NUM = 100
|
||||
const val WATCH_AD_REWARD_GOLD = 200
|
||||
|
||||
const val ZEROBUY_SECRET: String = "1f04c57a"
|
||||
|
|
|
|||
|
|
@ -111,13 +111,13 @@ object AccountManager {
|
|||
@Synchronized
|
||||
fun convertGold2Cash(): Boolean {
|
||||
try {
|
||||
val couldCovertCashTotal = mAccount?.goldCount?.div(VidiConst.PER_CASH_COST_GOLD_NUM) ?: 0L
|
||||
val couldCovertCashTotal = mAccount?.goldCount?.div(VidiConst.PER_01CASH_COST_GOLD_NUM) ?: 0
|
||||
if (couldCovertCashTotal > 0) {
|
||||
val costGoldNum = couldCovertCashTotal * VidiConst.PER_CASH_COST_GOLD_NUM
|
||||
val costGoldNum = couldCovertCashTotal * VidiConst.PER_01CASH_COST_GOLD_NUM
|
||||
mAccount?.goldCount?.let {
|
||||
if (it > costGoldNum) {
|
||||
addGold(-1 * costGoldNum.toInt())
|
||||
adjustAccountCash(couldCovertCashTotal.toFloat())
|
||||
adjustAccountCash(couldCovertCashTotal * 0.1F)
|
||||
AndroidUtil.showToast("Has convert $costGoldNum gold to $couldCovertCashTotal cash.")
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.gamedog.vididin.main
|
||||
|
||||
import android.app.Activity
|
||||
import com.ama.core.architecture.util.SpUtil
|
||||
import com.ama.core.architecture.util.setOnClickBatch
|
||||
import com.ama.core.architecture.widget.BindingDialog
|
||||
import com.gamedog.vididin.core.login.login.AccountManager
|
||||
|
|
@ -27,8 +28,11 @@ class BeginnerGiftDialog(activity: Activity) : BindingDialog<DialogBeginnerGiftB
|
|||
if (mActivity is MainActivity) {
|
||||
(mActivity as MainActivity).switchTab(1)
|
||||
}
|
||||
|
||||
if (!SpUtil.instance().getBoolean(SpUtil.KEY_GUIDE_HAS_GOT_NEWBIE_GOLD)) {
|
||||
AccountManager.addGold(100)
|
||||
SpUtil.instance().putBoolean(SpUtil.KEY_GUIDE_HAS_GOT_NEWBIE_GOLD, true)
|
||||
}
|
||||
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import android.widget.LinearLayout
|
|||
import androidx.core.graphics.toColorInt
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.core.view.updatePadding
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
|
|
@ -147,7 +148,8 @@ class TasksFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(), OnTab
|
|||
}
|
||||
|
||||
if (needShowZerobuyGuide() < 5) {
|
||||
binding?.llTaskGame?.postDelayed({
|
||||
llTaskGame.postDelayed({
|
||||
ivAdIndi.isVisible = false
|
||||
showGuide1()
|
||||
}, 5)
|
||||
}
|
||||
|
|
@ -458,7 +460,7 @@ class TasksFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(), OnTab
|
|||
.setHighlightParameter {
|
||||
HighlightParameter.Builder()
|
||||
.setHighlightView(binding!!.goldContainer, {
|
||||
val temp = 111
|
||||
delayConvertGold2Cash()
|
||||
})
|
||||
.setTipsViewId(R.layout.guide_step_gold)
|
||||
.setHighlightShape(RectShape(10.dp, 10.dp, 10.dp))
|
||||
|
|
@ -484,6 +486,7 @@ class TasksFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(), OnTab
|
|||
|
||||
}
|
||||
.setOnDismissCallback {
|
||||
binding?.ivAdIndi?.isVisible = true
|
||||
gotoWithDraw()
|
||||
}
|
||||
.interceptBackPressed(true)
|
||||
|
|
@ -492,6 +495,12 @@ class TasksFragment : AppViewsFragment<ViewBinding, UiState, ViewModel>(), OnTab
|
|||
|
||||
}
|
||||
|
||||
private fun delayConvertGold2Cash() {
|
||||
binding?.tvCashTotal?.postDelayed({
|
||||
AccountManager.convertGold2Cash()
|
||||
}, 200)
|
||||
}
|
||||
|
||||
private fun showGuide2() {
|
||||
HighlightPro.with(this@TasksFragment)
|
||||
.setHighlightParameter {
|
||||
|
|
|
|||
|
|
@ -82,20 +82,36 @@
|
|||
</LinearLayout>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_watch_video_for_convert_gold_to_cash"
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginTop="12dp">
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center">
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_ad_indi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/task_video"
|
||||
android:layout_marginEnd="10dp"
|
||||
/>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_watch_video_for_convert_gold_to_cash"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:drawableLeft="@mipmap/task_video"
|
||||
android:drawablePadding="10dp"
|
||||
android:gravity="center"
|
||||
android:text="Resgatar"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
|
|
|||
|
|
@ -79,9 +79,11 @@ internal class HighlightProImpl : HighlightViewInteractiveAction {
|
|||
maskContainer.setOnTouchListener { v, event ->
|
||||
when (event?.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
val highlightRect: RectF? = maskContainer.highLightViewParameters[0].rect
|
||||
val curParam = maskContainer.highLightViewParameters[0]
|
||||
val highlightRect: RectF? = curParam.rect
|
||||
highlightRect?.let {
|
||||
if (it.contains(event.x, event.y)) {
|
||||
curParam.onHighViewClicked?.invoke()
|
||||
showNextHighLightView()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class HighlightParameter {
|
|||
internal var highLightViewId: Int = -1
|
||||
|
||||
internal var highLightView: View? = null
|
||||
internal var onHighViewClicked: (()->Unit)? = null
|
||||
|
||||
internal var tipsViewId: Int = -1
|
||||
|
||||
|
|
@ -64,9 +65,7 @@ class HighlightParameter {
|
|||
*/
|
||||
fun setHighlightView(highLightView: View, onHighViewClicked: ()->Unit): Builder {
|
||||
highlightParameter.highLightView = highLightView
|
||||
highlightParameter.highLightView?.setOnClickListener {
|
||||
onHighViewClicked.invoke()
|
||||
}
|
||||
highlightParameter.onHighViewClicked = onHighViewClicked
|
||||
return this
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ class SpUtil private constructor(spFileName: String) {
|
|||
const val KEY_WITHDRAW_ITEM_LIST = "KEY_WITHDRAW_ITEM_LIST"
|
||||
|
||||
|
||||
const val KEY_GUIDE_HAS_GOT_NEWBIE_GOLD = "KEY_GUIDE_HAS_GOT_NEWBIE_GOLD"
|
||||
const val KEY_GUIDE_HAS_SHOW = "KEY_GUIDE_STATE" // 1,2,3,4,5 5 stands for finish
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue