Commit b6ae5bcd authored by mengcuiguang's avatar mengcuiguang

添加九宫格代码

parent a2295980
...@@ -6,12 +6,17 @@ import android.os.Handler ...@@ -6,12 +6,17 @@ import android.os.Handler
import android.os.Looper import android.os.Looper
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import com.airbnb.lottie.LottieAnimationView
import com.airbnb.lottie.LottieComposition
import com.airbnb.lottie.LottieCompositionFactory
import com.airbnb.lottie.LottieDrawable
import com.daimajia.androidanimations.library.Techniques import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo import com.daimajia.androidanimations.library.YoYo
import com.duben.dayplaylet.R import com.duben.dayplaylet.R
import com.duben.dayplaylet.ad.AdManager import com.duben.dayplaylet.ad.AdManager
import com.duben.dayplaylet.ad.AdStatusListener import com.duben.dayplaylet.ad.AdStatusListener
import com.duben.dayplaylet.ad.NoPreAdManager import com.duben.dayplaylet.ad.NoPreAdManager
import com.duben.dayplaylet.ad.half.HalfScreenManager
import com.duben.dayplaylet.ad.half.HalfScreenManagerNoPre import com.duben.dayplaylet.ad.half.HalfScreenManagerNoPre
import com.duben.dayplaylet.common.AppConfig import com.duben.dayplaylet.common.AppConfig
import com.duben.dayplaylet.common.Constant import com.duben.dayplaylet.common.Constant
...@@ -61,7 +66,7 @@ class NineActivity : BaseActivity(), View.OnClickListener { ...@@ -61,7 +66,7 @@ class NineActivity : BaseActivity(), View.OnClickListener {
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
initListener() initListener()
playFingerAnim(finger_view)
} }
private fun initListener() { private fun initListener() {
...@@ -82,13 +87,15 @@ class NineActivity : BaseActivity(), View.OnClickListener { ...@@ -82,13 +87,15 @@ class NineActivity : BaseActivity(), View.OnClickListener {
finish() finish()
} }
R.id.iv_nine_next -> { R.id.iv_nine_next -> {
// showAd(Constant.CARRIERTYPE_SING_OVER) HalfScreenManager.getInstance().preLoadAd(this)
adCloseNext("") showAd(Constant.CARRIERTYPE_SING_OVER)
// adCloseNext("")
} }
} }
} }
private fun showAd(carrierType: String) { private fun showAd(carrierType: String) {
AdManager.instance.showAd(this@NineActivity, carrierType, AdManager.instance.showAd(this@NineActivity, carrierType,
object : AdStatusListener { object : AdStatusListener {
var canFail = false var canFail = false
...@@ -163,17 +170,17 @@ class NineActivity : BaseActivity(), View.OnClickListener { ...@@ -163,17 +170,17 @@ class NineActivity : BaseActivity(), View.OnClickListener {
private fun showWithdrawSucDialog() { private fun showWithdrawSucDialog() {
TrackManager.getInstance().addCashoutReq(drawId) TrackManager.getInstance().addCashoutReq(drawId)
mWithDrawSucDialog = mWithDrawSucDialog =
WithDrawSucDialog(context, 10, object : DialogListener() { WithDrawSucDialog(context, cash, object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) { override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v) super.onClick(dialog, v)
dialog?.dismiss() dialog?.dismiss()
when (v?.id) { when (v?.id) {
R.id.btn -> { R.id.btn -> {
HalfScreenManagerNoPre.getInstance().showAd(this@NineActivity, null) HalfScreenManager.getInstance().showAd(this@NineActivity, null)
finish() finish()
} }
R.id.ib_close -> { R.id.ib_close -> {
HalfScreenManagerNoPre.getInstance().showAd(this@NineActivity, null) HalfScreenManager.getInstance().showAd(this@NineActivity, null)
finish() finish()
} }
else -> {} else -> {}
...@@ -183,4 +190,17 @@ class NineActivity : BaseActivity(), View.OnClickListener { ...@@ -183,4 +190,17 @@ class NineActivity : BaseActivity(), View.OnClickListener {
}) })
mWithDrawSucDialog?.show() mWithDrawSucDialog?.show()
} }
private fun playFingerAnim(view: LottieAnimationView) {
view.visibility = View.VISIBLE
val lottieDrawable = LottieDrawable()
LottieCompositionFactory.fromAsset(context, "home_shouzhi.json")
.addListener { result: LottieComposition? ->
lottieDrawable.setImagesAssetsFolder("home_shouzhi/")
lottieDrawable.composition = result
lottieDrawable.loop(true)
lottieDrawable.playAnimation()
}
view.setImageDrawable(lottieDrawable)
}
} }
\ No newline at end of file
...@@ -89,12 +89,12 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener { ...@@ -89,12 +89,12 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
rl_open_cash.setOnClickListener { rl_open_cash.setOnClickListener {
mMusicBean?.let { mMusicBean?.let {
// if(it.completeCount>=it.turnNeedCount){ if (it.completeCount >= it.turnNeedCount) {
val bundle = Bundle() val bundle = Bundle()
bundle.putString(NineActivity.DRAW_ID, it.unitId) bundle.putString(NineActivity.DRAW_ID, it.unitId)
bundle.putString(NineActivity.CASH, it.cash) bundle.putString(NineActivity.CASH, it.cash)
readyGo(NineActivity::class.java, bundle) readyGo(NineActivity::class.java, bundle)
// } }
} }
} }
......
...@@ -296,7 +296,7 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView ...@@ -296,7 +296,7 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
HalfScreenManager.getInstance().preLoadAd(requireActivity()) HalfScreenManager.getInstance().preLoadAd(requireActivity())
mWithDrawSucDialog = mWithDrawSucDialog =
WithDrawSucDialog(requireContext(), 10, object : DialogListener() { WithDrawSucDialog(requireContext(), "0.02", object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) { override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v) super.onClick(dialog, v)
dialog?.dismiss() dialog?.dismiss()
......
...@@ -19,7 +19,7 @@ import com.duben.dayplaylet.utils.UIUtils ...@@ -19,7 +19,7 @@ import com.duben.dayplaylet.utils.UIUtils
*/ */
class WithDrawSucDialog( class WithDrawSucDialog(
context: Context, context: Context,
cash: Int, cashStr: String,
listener: DialogListener listener: DialogListener
) : ) :
Dialog(context, R.style.dialog) { Dialog(context, R.style.dialog) {
...@@ -58,9 +58,11 @@ class WithDrawSucDialog( ...@@ -58,9 +58,11 @@ class WithDrawSucDialog(
tvCash3 = findViewById(R.id.tv_cash_3) tvCash3 = findViewById(R.id.tv_cash_3)
flAd = findViewById(R.id.fl_ad) flAd = findViewById(R.id.fl_ad)
tvCash1.text = "" if (cashStr.length >= 4) {
tvCash1.text = "" tvCash1.text = cashStr.subSequence(0, 1)
tvCash1.text = "" tvCash2.text = cashStr.subSequence(2, 3)
tvCash3.text = cashStr.subSequence(3, 4)
}
ibClose.setOnClickListener(listener) ibClose.setOnClickListener(listener)
btn.setOnClickListener(listener) btn.setOnClickListener(listener)
......
...@@ -20,27 +20,51 @@ ...@@ -20,27 +20,51 @@
android:layout_gravity="right" android:layout_gravity="right"
android:src="@mipmap/ic_draw_quit" /> android:src="@mipmap/ic_draw_quit" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-20dp"
android:src="@mipmap/ic_nine_top"></ImageView>
<RelativeLayout <RelativeLayout
android:id="@+id/rl_lucky" android:id="@+id/rl_lucky"
android:layout_width="315dp" android:layout_width="315dp"
android:layout_height="315dp" android:layout_height="315dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="14dp"> android:layout_marginTop="-20dp">
<com.duben.dayplaylet.ui.widgets.luckymonkeypanel.LuckyMonkeyPanelView2 <com.duben.dayplaylet.ui.widgets.luckymonkeypanel.LuckyMonkeyPanelView2
android:id="@+id/lucky_panel2" android:id="@+id/lucky_panel2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</RelativeLayout> </RelativeLayout>
<ImageView <FrameLayout
android:id="@+id/iv_nine_next"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp" android:layout_marginTop="20dp">
android:src="@mipmap/bg_draw_btn"></ImageView>
<ImageView
android:id="@+id/iv_nine_next"
android:layout_width="240dp"
android:layout_height="70dp"
android:scaleType="fitXY"
android:src="@mipmap/ic_nine_btn"></ImageView>
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/finger_view"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_alignTop="@id/rl_option1"
android:layout_gravity="right"
android:layout_marginTop="26dp"
android:layout_marginEnd="18dp" />
</FrameLayout>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment