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