Commit 3164499e authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 52415afc
......@@ -23,8 +23,10 @@ import com.mints.library.utils.CommonUtils
import com.mints.library.utils.json.JsonUtil
import kotlinx.android.synthetic.main.activity_drawcash.*
import kotlinx.android.synthetic.main.header_layout.*
import kotlinx.android.synthetic.main.item_fragment_main_my_title.*
import kotlinx.android.synthetic.main.view_title.*
import net.grandcentrix.tray.AppPreferences
import java.math.BigDecimal
import java.util.*
/**
......@@ -160,6 +162,10 @@ class DrawcashActivity : BaseActivity(),
priceList = data.cashOutMoneyArr
initRvView()
}
val allcoinBig = BigDecimal(data.coin.toString())
val rateBig = BigDecimal("10000")
val cashStr: String = allcoinBig.divide(rateBig).setScale(2, BigDecimal.ROUND_DOWN).toString()
tvDrawcashGoldabout.setText("约" + cashStr + "元")
}
override fun editUserMsgSuc() {
......
package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import com.mints.goodmoney.R
......@@ -32,6 +33,7 @@ class MorningClockActivity : BaseActivity()
private lateinit var vedioAdingManager: VedioAdingManager
private var loadVedioFailCount = 0
private var morningClockBean: MorningClockBean? = null
override fun getContentViewLayoutID() = R.layout.activity_morning_clock
......@@ -67,6 +69,7 @@ class MorningClockActivity : BaseActivity()
}
override fun getUpEarlySignMsgSuc(data: MorningClockBean) {
morningClockBean = data
morningClockList = data.targetList
if (data.isCanClick) {
......@@ -152,6 +155,22 @@ class MorningClockActivity : BaseActivity()
}
private fun vedioAdingSuccess(adType: String) {
try {
if (morningClockList != null && morningClockList!!.size > 0) {
for (morningBean in morningClockList!!) {
if (morningBean.needDays == morningClockBean?.continuityDays) {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, morningBean.coin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_MORNING_CLOCK)
readyGo(AwardActivity::class.java, bundle)
break
}
}
}
} catch (e: Exception) {
e.printStackTrace()
}
morningClockPresenter.getUpEarlyClickButton(adType)
}
......
......@@ -47,6 +47,7 @@ import kotlinx.android.synthetic.main.item_fragment_main_my_clock.*
import kotlinx.android.synthetic.main.item_fragment_main_my_promotions.*
import kotlinx.android.synthetic.main.item_fragment_main_my_title.*
import kotlinx.android.synthetic.main.view_title.*
import java.math.BigDecimal
import java.util.*
/**
......@@ -390,6 +391,11 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
// 金币
item_title_gold_count.text = userGold
val allcoinBig = BigDecimal(userConfig!!.userMsg.coin.toString())
val rateBig = BigDecimal("10000")
val cashStr: String = allcoinBig.divide(rateBig).setScale(2, BigDecimal.ROUND_DOWN).toString()
item_title_gold_about.setText("约" + cashStr + "元")
}
/**
......@@ -674,6 +680,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
private fun vedioAdingSuccess(adType: String) {
val bundle = Bundle()
if (TextUtils.equals(carrierType, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD)) {
bundle.putInt(Constant.MAIN_CUR_COIN, curSignCoin * 2)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD)
readyGo(AwardActivity::class.java, bundle)
return
......
......@@ -17,7 +17,6 @@ import com.mints.goodmoney.mvp.presenters.PanPresenter
import com.mints.goodmoney.mvp.views.PanView
import com.mints.goodmoney.ui.activitys.AwardActivity
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.library.net.netstatus.NetUtils
import com.mints.library.utils.json.JsonUtil
import kotlinx.android.synthetic.main.fragment_main_pan.*
......@@ -56,9 +55,7 @@ class PanFragment : BaseFragment(), PanView {
// 游客登录
panPresenter.userLogin()
} else {
if (!isLoadPanSuc && NetUtils.isNetworkConnected(getContext())) {
loadTurnUrl()
}
loadTurnUrl()
}
}
}
......@@ -69,9 +66,7 @@ class PanFragment : BaseFragment(), PanView {
}
override fun loginSuc() {
if (!isLoadPanSuc && NetUtils.isNetworkConnected(getContext())) {
loadTurnUrl()
}
loadTurnUrl()
}
/**
......@@ -80,7 +75,7 @@ class PanFragment : BaseFragment(), PanView {
private fun loadTurnUrl() {
getTurnUrl()
blTurntableWebview.setOnTouchListener(object : View.OnTouchListener {
override fun onTouch(v: View?, event: MotionEvent): Boolean {
override fun onTouch(v: View?, event: MotionEvent): Boolean {
return event.action == MotionEvent.ACTION_MOVE
}
})
......@@ -114,8 +109,6 @@ class PanFragment : BaseFragment(), PanView {
val tokenID = userManager.tokenID
val url: String = BuildConfig.MainIp + "turn/turn.html?carrierType=" + carrierType + "&token=" + tokenID
blTurntableWebview.loadUrl(url)
isLoadPanSuc = true
}
/**
......@@ -127,13 +120,4 @@ class PanFragment : BaseFragment(), PanView {
}
}
/**
* 用户主动取消js调用
*/
private fun androidCallJsCancel() {
// 调用js中的方法(必须和js中的handlerName想同)
blTurntableWebview.callHandler("cancelTurnTable", "") {}
}
}
\ No newline at end of file
......@@ -35,16 +35,36 @@
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvDrawcashGold"
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center_vertical"
android:text="0"
android:textColor="@color/main_mints"
android:textSize="22sp"
android:textStyle="bold" />
android:layout_height="60dp"
android:layout_alignParentRight="true">
<TextView
android:id="@+id/tvDrawcashGold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="0"
android:textColor="@color/main_mints"
android:textSize="22sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tvDrawcashGoldabout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="-10dp"
android:layout_toRightOf="@+id/tvDrawcashGold"
android:background="@mipmap/ic_goldtry_about"
android:gravity="center"
android:paddingLeft="1dp"
android:paddingRight="1dp"
android:text="约0.00元"
android:textColor="@color/white"
android:textSize="10sp" />
</RelativeLayout>
</RelativeLayout>
......
......@@ -9,6 +9,6 @@
<com.github.lzyzsd.jsbridge.BridgeWebView
android:id="@+id/blTurntableWebview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent"/>
</RelativeLayout>
......@@ -78,22 +78,45 @@
android:elevation="1dip"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="10dp"
android:paddingEnd="10dp">
android:paddingStart="6dp"
android:paddingEnd="6dp">
<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@mipmap/ic_gold" />
<TextView
android:id="@+id/item_title_gold_count"
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:textColor="@color/my_color_orange"
android:textSize="26sp" />
android:layout_height="70dp"
android:layout_weight="1">
<TextView
android:id="@+id/item_title_gold_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="6dp"
android:text="0"
android:textColor="@color/my_color_orange"
android:textSize="26sp" />
<TextView
android:id="@+id/item_title_gold_about"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="-14dp"
android:layout_toRightOf="@+id/item_title_gold_count"
android:background="@mipmap/ic_goldtry_about"
android:gravity="center"
android:paddingLeft="1dp"
android:paddingRight="1dp"
android:text="约0.00元"
android:textColor="@color/white"
android:textSize="10sp" />
</RelativeLayout>
<LinearLayout
android:layout_width="wrap_content"
......@@ -113,7 +136,7 @@
android:id="@+id/btn_withdraw"
android:layout_width="60dp"
android:layout_height="30dp"
android:layout_marginStart="10dp"
android:layout_marginStart="4dp"
android:background="@drawable/shape_btn_switch"
android:text="提现"
android:textColor="@color/white"
......
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