Commit b6ae5bcd authored by mengcuiguang's avatar mengcuiguang

添加九宫格代码

parent a2295980
......@@ -6,12 +6,17 @@ import android.os.Handler
import android.os.Looper
import android.text.TextUtils
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.YoYo
import com.duben.dayplaylet.R
import com.duben.dayplaylet.ad.AdManager
import com.duben.dayplaylet.ad.AdStatusListener
import com.duben.dayplaylet.ad.NoPreAdManager
import com.duben.dayplaylet.ad.half.HalfScreenManager
import com.duben.dayplaylet.ad.half.HalfScreenManagerNoPre
import com.duben.dayplaylet.common.AppConfig
import com.duben.dayplaylet.common.Constant
......@@ -61,7 +66,7 @@ class NineActivity : BaseActivity(), View.OnClickListener {
override fun initViewsAndEvents() {
initListener()
playFingerAnim(finger_view)
}
private fun initListener() {
......@@ -82,13 +87,15 @@ class NineActivity : BaseActivity(), View.OnClickListener {
finish()
}
R.id.iv_nine_next -> {
// showAd(Constant.CARRIERTYPE_SING_OVER)
adCloseNext("")
HalfScreenManager.getInstance().preLoadAd(this)
showAd(Constant.CARRIERTYPE_SING_OVER)
// adCloseNext("")
}
}
}
private fun showAd(carrierType: String) {
AdManager.instance.showAd(this@NineActivity, carrierType,
object : AdStatusListener {
var canFail = false
......@@ -163,17 +170,17 @@ class NineActivity : BaseActivity(), View.OnClickListener {
private fun showWithdrawSucDialog() {
TrackManager.getInstance().addCashoutReq(drawId)
mWithDrawSucDialog =
WithDrawSucDialog(context, 10, object : DialogListener() {
WithDrawSucDialog(context, cash, object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
when (v?.id) {
R.id.btn -> {
HalfScreenManagerNoPre.getInstance().showAd(this@NineActivity, null)
HalfScreenManager.getInstance().showAd(this@NineActivity, null)
finish()
}
R.id.ib_close -> {
HalfScreenManagerNoPre.getInstance().showAd(this@NineActivity, null)
HalfScreenManager.getInstance().showAd(this@NineActivity, null)
finish()
}
else -> {}
......@@ -183,4 +190,17 @@ class NineActivity : BaseActivity(), View.OnClickListener {
})
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 {
rl_open_cash.setOnClickListener {
mMusicBean?.let {
// if(it.completeCount>=it.turnNeedCount){
if (it.completeCount >= it.turnNeedCount) {
val bundle = Bundle()
bundle.putString(NineActivity.DRAW_ID, it.unitId)
bundle.putString(NineActivity.CASH, it.cash)
readyGo(NineActivity::class.java, bundle)
// }
}
}
}
......
......@@ -296,7 +296,7 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
HalfScreenManager.getInstance().preLoadAd(requireActivity())
mWithDrawSucDialog =
WithDrawSucDialog(requireContext(), 10, object : DialogListener() {
WithDrawSucDialog(requireContext(), "0.02", object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
......
......@@ -19,7 +19,7 @@ import com.duben.dayplaylet.utils.UIUtils
*/
class WithDrawSucDialog(
context: Context,
cash: Int,
cashStr: String,
listener: DialogListener
) :
Dialog(context, R.style.dialog) {
......@@ -58,9 +58,11 @@ class WithDrawSucDialog(
tvCash3 = findViewById(R.id.tv_cash_3)
flAd = findViewById(R.id.fl_ad)
tvCash1.text = ""
tvCash1.text = ""
tvCash1.text = ""
if (cashStr.length >= 4) {
tvCash1.text = cashStr.subSequence(0, 1)
tvCash2.text = cashStr.subSequence(2, 3)
tvCash3.text = cashStr.subSequence(3, 4)
}
ibClose.setOnClickListener(listener)
btn.setOnClickListener(listener)
......
......@@ -20,27 +20,51 @@
android:layout_gravity="right"
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
android:id="@+id/rl_lucky"
android:layout_width="315dp"
android:layout_height="315dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="14dp">
android:layout_marginTop="-20dp">
<com.duben.dayplaylet.ui.widgets.luckymonkeypanel.LuckyMonkeyPanelView2
android:id="@+id/lucky_panel2"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
<ImageView
android:id="@+id/iv_nine_next"
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:src="@mipmap/bg_draw_btn"></ImageView>
android:layout_marginTop="20dp">
<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>
</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