Commit e322a929 authored by maxiaoliang's avatar maxiaoliang

修改bug

parent 2821c685
...@@ -75,17 +75,30 @@ ...@@ -75,17 +75,30 @@
</activity> </activity>
<service android:name="com.ym.msdh.game.notif.NotificationService" /> <service android:name="com.ym.msdh.game.notif.NotificationService" />
<activity <activity
android:name="com.ym.msdh.game.activity.WxLoginActivity" android:name="com.ym.msdh.game.activity.WxLoginActivity"
android:exported="true" /> android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="wxlogin"
android:scheme="msdh" />
</intent-filter>
</activity>
<!-- <activity-->
<!-- android:name="com.ym.msdh.game.activity.WxLoginActivity"-->
<!-- android:exported="true" />-->
<activity <activity
android:name="com.ym.msdh.game.GameActivity" android:name="com.ym.msdh.game.GameActivity"
android:exported="true" android:exported="true"
android:launchMode="singleTask" /> <!-- 友盟配置 --> android:launchMode="singleTask" /> <!-- 友盟配置 -->
<meta-data <meta-data
android:name="UMENG_APPKEY" android:name="UMENG_APPKEY"
android:value="5f9bb48945b2b751a91fb2d5" /> android:value="5fd703f8498d9e0d4d8cc896" />
<meta-data <meta-data
android:name="UMENG_CHANNEL" android:name="UMENG_CHANNEL"
android:value="${UMENG_CHANNEL_VALUE}" /> <!-- 微信配置 --> android:value="${UMENG_CHANNEL_VALUE}" /> <!-- 微信配置 -->
......
...@@ -6,6 +6,7 @@ import android.content.ComponentName ...@@ -6,6 +6,7 @@ import android.content.ComponentName
import android.content.Intent import android.content.Intent
import android.content.ServiceConnection import android.content.ServiceConnection
import android.os.Bundle import android.os.Bundle
import android.os.Handler
import android.os.IBinder import android.os.IBinder
import android.text.TextUtils import android.text.TextUtils
import android.util.Log import android.util.Log
...@@ -22,12 +23,12 @@ import com.ym.library.net.GameApiClient ...@@ -22,12 +23,12 @@ import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers import com.ym.library.net.RxSchedulers
import com.ym.library.utils.* import com.ym.library.utils.*
import com.ym.modulecommon.AppliContext import com.ym.modulecommon.AppliContext
import com.ym.modulecommon.module.UserInfoEntity import com.ym.modulecommon.utils.AdPreference
import com.ym.msdh.R
import com.ym.msdh.game.activity.WxLoginActivity import com.ym.msdh.game.activity.WxLoginActivity
import com.ym.msdh.game.listener.IDialogViewCloseCallback import com.ym.msdh.game.listener.IDialogViewCloseCallback
import com.ym.msdh.game.notif.NotificationService import com.ym.msdh.game.notif.NotificationService
import com.ym.msdh.game.view.* import com.ym.msdh.game.view.*
import com.ym.userinfo.module.net.UserApiClient
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import org.jetbrains.anko.act import org.jetbrains.anko.act
...@@ -42,7 +43,6 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -42,7 +43,6 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
private var mOrderString = ""; private var mOrderString = "";
private val mContext = AppliContext.get() private val mContext = AppliContext.get()
private var mRefreshLoginObservable: Observable<String>? = null private var mRefreshLoginObservable: Observable<String>? = null
var ispop:Int=0
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
...@@ -50,6 +50,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -50,6 +50,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
if (SettingPreference.getIsShowGuide()) { if (SettingPreference.getIsShowGuide()) {
SettingPreference.setIsShowGuide(false) SettingPreference.setIsShowGuide(false)
} }
mHandler.sendEmptyMessage(0)
mRefreshLoginObservable = RxBus.get().register("refresh_login", String::class.java) mRefreshLoginObservable = RxBus.get().register("refresh_login", String::class.java)
TurntableDialog.initTurntableAnim() TurntableDialog.initTurntableAnim()
getUserInfo() getUserInfo()
...@@ -57,7 +58,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -57,7 +58,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
mRefreshLoginObservable?.observeOn(AndroidSchedulers.mainThread())?.subscribe({ mRefreshLoginObservable?.observeOn(AndroidSchedulers.mainThread())?.subscribe({
when (it) { when (it) {
"not_login" -> { "not_login" -> {
com.ym.modulecommon.utils.SettingPreference.setToken("") AdPreference.setToken("")
try { try {
val intent = Intent(this, WxLoginActivity::class.java) val intent = Intent(this, WxLoginActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
...@@ -342,7 +343,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -342,7 +343,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
.subscribe(object : BaseObserver<HomeInfoEntity>() { .subscribe(object : BaseObserver<HomeInfoEntity>() {
override fun onSuccess(result: HomeInfoEntity?) { override fun onSuccess(result: HomeInfoEntity?) {
if(result!=null){ if(result!=null){
ispop=result.isPopup Constant.ispop=result.isPopup
Log.d("wxw", "获取首页信息" + Utils.obj2Str(result)) Log.d("wxw", "获取首页信息" + Utils.obj2Str(result))
callback?.onHomeSuccess(true, Utils.obj2Str(result)) callback?.onHomeSuccess(true, Utils.obj2Str(result))
} }
...@@ -490,6 +491,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -490,6 +491,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}) })
},View.OnClickListener { },View.OnClickListener {
if(result.force==1){ if(result.force==1){
EventUtils.onEvent("chai_hongbao_video_click","拆红包强弹")
AdUtils.playRewardAd( AdUtils.playRewardAd(
this@GameActivity, this@GameActivity,
"qiangtan_redPack_double_click", "qiangtan_redPack_double_click",
...@@ -544,7 +546,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -544,7 +546,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
// , // ,
// null // null
// ) // )
GameDialog.showGetCash(this@GameActivity,"${result.rewardContentList[0].totalRewardNum?.toDouble()/100}", GameDialog.showGetCash(this@GameActivity,0,"${result.rewardContentList[0].totalRewardNum?.toDouble()/100}",
View.OnClickListener { View.OnClickListener {
callUnity("TitleView", "getHomeInfo", "") callUnity("TitleView", "getHomeInfo", "")
}) })
...@@ -652,6 +654,8 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -652,6 +654,8 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
}) })
}else{
getUnlockLandNew(id, 4, 0)
} }
}) })
...@@ -955,7 +959,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -955,7 +959,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
if (result != null) { if (result != null) {
var type = result.type var type = result.type
if(type==1){ if(type==1){
GameDialog.showGetCash(this@GameActivity,"${result.awardNum ?: 0}",View.OnClickListener { GameDialog.showGetCash(this@GameActivity,0,"${result.awardNum ?: 0}",View.OnClickListener {
callUnity("TitleView", "getHomeInfo", "") callUnity("TitleView", "getHomeInfo", "")
}) })
}else{ }else{
...@@ -989,7 +993,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -989,7 +993,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
var type = result.type var type = result.type
if (type != null) { if (type != null) {
if(type==1){ if(type==1){
GameDialog.showGetCash(this@GameActivity,"${result.awardNum ?: 0}",View.OnClickListener { GameDialog.showGetCash(this@GameActivity,0,"${result.awardNum ?: 0}",View.OnClickListener {
callUnity("TitleView", "getHomeInfo", "") callUnity("TitleView", "getHomeInfo", "")
}) })
}else{ }else{
...@@ -1035,10 +1039,10 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -1035,10 +1039,10 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
EventUtils.onEvent("SplashPresenter_getUserInfo_fail") EventUtils.onEvent("SplashPresenter_getUserInfo_fail")
} else { } else {
EventUtils.onEvent("SplashPresenter_getUserInfo_success") EventUtils.onEvent("SplashPresenter_getUserInfo_success")
com.ym.modulecommon.utils.SettingPreference.saveUserInfo(result) SettingPreference.saveUserInfo(result)
SettingPreference.setTrackId(result.gaodeTrackId ?: 0L) SettingPreference.setTrackId(result.gaodeTrackId ?: 0L)
SettingPreference.setTerminalId(result.gaodeTerminalId ?: 0L) SettingPreference.setTerminalId(result.gaodeTerminalId ?: 0L)
com.ym.modulecommon.utils.SettingPreference.setUid(uid) AdPreference.setUid(uid)
} }
} }
...@@ -1262,20 +1266,40 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -1262,20 +1266,40 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}) })
} }
//订单领取奖励 //首次新手提现弹窗
fun showOrderReward() { fun showOrderReward() {
Log.e("wxw","订单接口进来") Log.e("wxw","订单接口进来")
GameApiClient.gameApi.getOrderReceive().compose(RxSchedulers.observableIO2Main()) GameApiClient.gameApi.getOrderReceive().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<OrderAwardEntity>() { .subscribe(object : BaseObserver<OrderAwardEntity>() {
override fun onSuccess(result: OrderAwardEntity?) { override fun onSuccess(result: OrderAwardEntity?) {
callUnity("TitleView", "getHomeInfo", "")
Log.d("wxw", "订单领取" + Utils.obj2Str(result)) Log.d("wxw", "订单领取" + Utils.obj2Str(result))
if (result != null) { if (result != null) {
GameDialog.showGetCash( GameDialog.showxinshoutixian(this@GameActivity,View.OnClickListener {
this@GameActivity, UserApiClient.userApi.getUserWxWithdraw(1)
result.awardCash, .compose(RxSchedulers.observableIO2Main())
View.OnClickListener { .subscribe(object : BaseObserver<WithdrawEntity>() {
override fun onSuccess(result: WithdrawEntity) {
callUnity("orderview", "getOrderData", "") callUnity("orderview", "getOrderData", "")
callUnity("TitleView", "getHomeInfo", "") MainDialog.showWithDraw( this@GameActivity,
result?.status ?: 0,
result?.title ?: "",
result?.reason ?: "",
result?.buttonText ?: "",
result?.buttonStatus ?: 0,
1,
1,
"0.3",
true,
Dialog(this@GameActivity))
}
override fun onFailure(e: Throwable, code: String, errorMsg: String?) {
}
})
}) })
} }
...@@ -1287,11 +1311,35 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -1287,11 +1311,35 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
}) })
} }
fun showbigLevelDialog(level:Int){
GameApiClient.gameApi.getOrderReceive().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<OrderAwardEntity>() {
override fun onSuccess(result: OrderAwardEntity?) {
Log.d("wxw", "完成1级以上订单" + Utils.obj2Str(result))
if (result != null) {
GameDialog.showGetCash(this@GameActivity,level,result.awardCash,View.OnClickListener {
callUnity("orderview", "getOrderData", "")
callUnity("TitleView", "getHomeInfo", "")
})
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
Log.d("wxw", "订单领取 error")
}
})
}
//大富翁美梦成真 //大富翁美梦成真
fun onClickDreamComeTrue() { fun onClickDreamComeTrue() {
Log.e("ispop",""+ispop)
JumpUtils.h5Jump("美梦成真", "${Constant.Param.Confirmurl}?is_popup1=${ispop}", false, this) JumpUtils.h5Jump("美梦成真", "${Constant.Param.Confirmurl}?is_popup1=${Constant.ispop}", false, this)
} }
//展示不可拆红包弹窗 //展示不可拆红包弹窗
...@@ -1322,4 +1370,13 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -1322,4 +1370,13 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}) })
}) })
} }
private var mHandler: Handler = Handler {
when (it.what) {
0 -> {
EventUtils.onEvent("timing_report", Constant.ReportSessionId)
it.target.sendEmptyMessageDelayed(0, 30000)
}
}
false
}
} }
\ No newline at end of file
...@@ -23,6 +23,7 @@ import com.ym.library.net.SplashPresenter ...@@ -23,6 +23,7 @@ import com.ym.library.net.SplashPresenter
import com.ym.library.net.SplashPresenter.Companion.PERMISSIONS import com.ym.library.net.SplashPresenter.Companion.PERMISSIONS
import com.ym.library.utils.* import com.ym.library.utils.*
import com.ym.modulecommon.base.BaseActivity import com.ym.modulecommon.base.BaseActivity
import com.ym.modulecommon.utils.AdPreference
import com.ym.msdh.R import com.ym.msdh.R
class SplashActivity : BaseActivity(), SplashContract.View { class SplashActivity : BaseActivity(), SplashContract.View {
...@@ -65,9 +66,6 @@ class SplashActivity : BaseActivity(), SplashContract.View { ...@@ -65,9 +66,6 @@ class SplashActivity : BaseActivity(), SplashContract.View {
} }
override fun className(): String {
return SplashActivity::class.java.simpleName
}
override fun jumpPage() { override fun jumpPage() {
if (!SettingPreference.getIsShowGuide()) { if (!SettingPreference.getIsShowGuide()) {
...@@ -102,7 +100,7 @@ class SplashActivity : BaseActivity(), SplashContract.View { ...@@ -102,7 +100,7 @@ class SplashActivity : BaseActivity(), SplashContract.View {
isClick = false isClick = false
startTime = System.currentTimeMillis() startTime = System.currentTimeMillis()
// startActivity(Intent(this@SplashActivity, GameActivity::class.java)) // startActivity(Intent(this@SplashActivity, GameActivity::class.java))
val token =com.ym.modulecommon.utils.SettingPreference.getToken() val token =AdPreference.getToken()
if (token.isEmpty()){ if (token.isEmpty()){
EventUtils.onEvent("login_token_null", "未登录") EventUtils.onEvent("login_token_null", "未登录")
startActivity(Intent(this@SplashActivity, WxLoginActivity::class.java)) startActivity(Intent(this@SplashActivity, WxLoginActivity::class.java))
...@@ -172,23 +170,11 @@ class SplashActivity : BaseActivity(), SplashContract.View { ...@@ -172,23 +170,11 @@ class SplashActivity : BaseActivity(), SplashContract.View {
} }
} }
override fun activity(): Activity {
return this
}
override fun getDestroyed(): Boolean { override fun getDestroyed(): Boolean {
return false return false
} }
override fun onResume() {
super.onResume()
EventUtils.onEvent("page_status", Utils.obj2Str(ReportEntity(Constant.ReportSessionId, "SplashActivity", "onResume")))
MobclickAgent.onResume(this)
}
override fun onPause() {
super.onPause()
EventUtils.onEvent("page_status", Utils.obj2Str(ReportEntity(Constant.ReportSessionId, "SplashActivity", "onPause")))
MobclickAgent.onPause(this)
}
} }
\ No newline at end of file
...@@ -49,7 +49,7 @@ class WxLoginActivity : BaseActivity(), WxImplUtils.IWxLoginCallback { ...@@ -49,7 +49,7 @@ class WxLoginActivity : BaseActivity(), WxImplUtils.IWxLoginCallback {
} }
fun wxLogin() { fun wxLogin() {
onEvent("click_login", "点击微信登录") onEvent("login_click", "点击微信登录")
WxImplUtils().onAuth(act, this) WxImplUtils().onAuth(act, this)
// WxImplUtils().onAuth( // WxImplUtils().onAuth(
// act,this // act,this
......
...@@ -81,7 +81,7 @@ class WateringTaskAdpater : ...@@ -81,7 +81,7 @@ class WateringTaskAdpater :
// holder.tvCount.text = "+${data.coins}" // holder.tvCount.text = "+${data.coins}"
// } // }
holder.imgcoin.setImageResource(R.mipmap.icon_popupwater_icon) holder.imgcoin.setImageResource(R.drawable.icon_pop_coin)
if (!TextUtils.isEmpty(data.description)) { if (!TextUtils.isEmpty(data.description)) {
holder.btnProgess.visibility = View.GONE holder.btnProgess.visibility = View.GONE
holder.tvTitle.text = data.title+" (${data.current_nums}/${data.awardLimit})" holder.tvTitle.text = data.title+" (${data.current_nums}/${data.awardLimit})"
......
...@@ -64,7 +64,7 @@ class BaseApplication : BaseApplication() { ...@@ -64,7 +64,7 @@ class BaseApplication : BaseApplication() {
AdManager.init(this,"b1c85b22f06d1990") AdManager.init(this,"b1c85b22f06d1990")
LogUtils.getConfig().logSwitch = true LogUtils.getConfig().logSwitch = true
UMConfigure.setLogEnabled(true) UMConfigure.setLogEnabled(true)
UMConfigure.init(this, "5f9bb48945b2b751a91fb2d5", "", UMConfigure.DEVICE_TYPE_PHONE, "") UMConfigure.init(this, "5fd703f8498d9e0d4d8cc896", "", UMConfigure.DEVICE_TYPE_PHONE, "")
PlatformConfig.setWeixin(Constant.WX_APPID, Constant.WX_APPKEY) PlatformConfig.setWeixin(Constant.WX_APPID, Constant.WX_APPKEY)
var isDebug = true var isDebug = true
...@@ -82,7 +82,7 @@ class BaseApplication : BaseApplication() { ...@@ -82,7 +82,7 @@ class BaseApplication : BaseApplication() {
// 设置是否为上报进程 // 设置是否为上报进程
strategy.isUploadProcess = processName == null || processName == packageName strategy.isUploadProcess = processName == null || processName == packageName
//Bugly初始化 //Bugly初始化
CrashReport.initCrashReport(this, "262040511a", isDebug, strategy) CrashReport.initCrashReport(this, "d54c4bc8b8", isDebug, strategy)
//========== Bugly ========== //========== Bugly ==========
//小满 //小满
......
...@@ -707,25 +707,36 @@ object MainDialog { ...@@ -707,25 +707,36 @@ object MainDialog {
Gravity.CENTER Gravity.CENTER
) )
EventUtils.onEvent("seed_show","生产弹窗展示") EventUtils.onEvent("seed_show","生产弹窗展示")
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_ad) val layout_dialog_root =
AdUtils.showFeedAd(activity, "seed_not_enough_bigimage", layoutAd) mDialogView?.findViewById<LinearLayout>(com.ym.library.R.id.layout_shengchan_root)
mDialogView.findViewById<TextView>(R.id.tv_dialog_shengchan_coin)?.text = "$seedPrice" val iv_close = mDialogView?.findViewById<ImageView>(com.ym.library.R.id.iv_shengchan_close)
mDialogView.findViewById<TextView>(R.id.tv_dialog_shengchan_num)?.text = val tv_coin = mDialogView?.findViewById<TextView>(com.ym.library.R.id.tv_dialog_shengchan_coin)
"今天剩余${seedVideo}次" val tv_dialog_shengchan_num =
mDialogView?.findViewById<TextView>(com.ym.library.R.id.tv_dialog_shengchan_num)
val btn_dialog_coin_shengchan =
mDialogView?.findViewById<ImageView>(com.ym.library.R.id.btn_dialog_coin_shengchan)
val btn_dialog_ad_shengchan =
mDialogView?.findViewById<ImageView>(com.ym.library.R.id.btn_dialog_ad_shengchan)
val layout_ad = mDialogView?.findViewById<FrameLayout>(com.ym.library.R.id.layout_ad)
AdUtils.showFeedAd(activity, "seed_not_enough_bigimage", layout_ad)
tv_coin.text = "${seedPrice}"
tv_dialog_shengchan_num.text = "今天剩余${seedVideo}次"
var seedImg = mDialogView.findViewById<ImageView>(R.id.id_seed_not_enough_img); var seedImg = mDialogView.findViewById<ImageView>(R.id.id_seed_not_enough_img);
if (id != null) { if (id != null) {
setImage(seedImg, id) setImage(seedImg, id)
} }
mDialogView.findViewById<ImageView>(R.id.iv_shengchan_close).setOnClickListener { iv_close.setOnClickListener {
mDialog.dismiss() mDialog.dismiss()
} }
//买种子 //买种子
mDialogView.findViewById<ImageView>(R.id.btn_dialog_coin_shengchan).setOnClickListener { btn_dialog_coin_shengchan.setOnClickListener {
buySeedOnClickListener.onClick(it) buySeedOnClickListener.onClick(it)
mDialog.dismiss() mDialog.dismiss()
} }
//看视频领取种子 //看视频领取种子
mDialogView.findViewById<ImageView>(R.id.btn_dialog_ad_shengchan).setOnClickListener { btn_dialog_ad_shengchan.setOnClickListener {
EventUtils.onEvent("seed_video_btn_click","生产视频按钮点击") EventUtils.onEvent("seed_video_btn_click","生产视频按钮点击")
receiveSeedOnClickListener.onClick(it) receiveSeedOnClickListener.onClick(it)
mDialog.dismiss() mDialog.dismiss()
...@@ -736,14 +747,23 @@ object MainDialog { ...@@ -736,14 +747,23 @@ object MainDialog {
AdUtils.loadFeedCacheAdToCache(activity) AdUtils.loadFeedCacheAdToCache(activity)
} }
}) })
mDialog?.setCanceledOnTouchOutside(false) FilterUtils.addClickAlpha(btn_dialog_coin_shengchan)
mDialog?.setCancelable(false) FilterUtils.addClickAlpha(btn_dialog_ad_shengchan)
if (activity.isFinishing) {
return mDialog.setCanceledOnTouchOutside(false)
} mDialog.setCancelable(false)
if (!activity?.isFinishing) {
mDialog?.show() mDialog?.show()
} }
layout_ad?.postDelayed({
layout_ad.visibility = View.VISIBLE
if (layout_ad?.visibility == View.VISIBLE) {
layout_dialog_root.gravity = Gravity.BOTTOM
}
}, 500)
}
/** /**
* 添加点击缩放效果 * 添加点击缩放效果
*/ */
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="15.5dp" android:layout_marginTop="15.5dp"
android:text="微信登录才能提现哦~" android:text="微信登录才能提现哦~"
android:textColor="#B33B01" android:textColor="#FFFFFF"
android:textSize="20sp" /> android:textSize="@dimen/sp_17" />
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="登陆即同意" android:text="登陆即同意"
android:textColor="#7F490A" android:textColor="#874700"
android:textSize="@dimen/dp_13" /> android:textSize="@dimen/dp_13" />
<TextView <TextView
...@@ -51,14 +51,14 @@ ...@@ -51,14 +51,14 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="《用户协议》" android:text="《用户协议》"
android:textColor="#C56713" android:textColor="#D26100"
android:textSize="@dimen/dp_13" /> android:textSize="@dimen/dp_13" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="和" android:text="和"
android:textColor="#7F490A" android:textColor="#874700"
android:textSize="@dimen/dp_13" /> android:textSize="@dimen/dp_13" />
<TextView <TextView
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="《隐私政策》" android:text="《隐私政策》"
android:textColor="#C56713" android:textColor="#D26100"
android:textSize="@dimen/dp_13" /> android:textSize="@dimen/dp_13" />
</LinearLayout> </LinearLayout>
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/id_tv_gongxi_get" android:layout_below="@+id/id_tv_gongxi_get"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="37dp" android:layout_marginTop="47dp"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="visible"> android:visibility="visible">
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
android:id="@+id/tv_get_drop_count" android:id="@+id/tv_get_drop_count"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_marginTop="11dp"
android:includeFontPadding="false" android:includeFontPadding="false"
android:textColor="#095100" android:textColor="#095100"
android:textSize="18sp" android:textSize="18sp"
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
android:id="@+id/tv_get_drop_count2" android:id="@+id/tv_get_drop_count2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_marginTop="11dp"
android:includeFontPadding="false" android:includeFontPadding="false"
android:textColor="#095100" android:textColor="#095100"
android:textSize="18sp" android:textSize="18sp"
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
android:id="@+id/tv_get_drop_count3" android:id="@+id/tv_get_drop_count3"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_marginTop="@dimen/dp_11"
android:includeFontPadding="false" android:includeFontPadding="false"
android:textColor="#095100" android:textColor="#095100"
android:textSize="18sp" android:textSize="18sp"
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginBottom="33dp" android:layout_marginBottom="@dimen/dp_28"
android:background="@drawable/icon_dialog_get_showxia_btn" /> android:background="@drawable/icon_dialog_get_showxia_btn" />
</RelativeLayout> </RelativeLayout>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_one" android:id="@+id/ll_one"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_76" android:layout_height="@dimen/dp_90"
android:background="@drawable/icon_luck_task"> android:background="@drawable/icon_luck_task">
<TextView <TextView
...@@ -62,18 +62,11 @@ ...@@ -62,18 +62,11 @@
<LinearLayout <LinearLayout
android:id="@+id/id_ll_right"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerInParent="true" android:layout_marginRight="@dimen/dp_20">
android:layout_marginRight="25dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<LinearLayout
android:id="@+id/id_ll_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView <ImageView
android:id="@+id/img_icon_item" android:id="@+id/img_icon_item"
...@@ -96,8 +89,11 @@ ...@@ -96,8 +89,11 @@
android:id="@+id/tv_watering_item_status" android:id="@+id/tv_watering_item_status"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="@dimen/dp_20"
android:layout_marginBottom="@dimen/dp_19"
android:src="@mipmap/icon_mian_popup_complete" /> android:src="@mipmap/icon_mian_popup_complete" />
</LinearLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -67,7 +67,7 @@ dependencies { ...@@ -67,7 +67,7 @@ dependencies {
api ("com.bx:adsdk:1.3.3"){ api ("com.bx:adsdk:1.3.3"){
exclude group: 'com.google.code.gson' exclude group: 'com.google.code.gson'
} }
api 'com.ym.admodule:admodule:1.0.2.31' api 'com.ym.admodule:admodule:1.0.3.3'
api 'com.airbnb.android:lottie:3.1.0' api 'com.airbnb.android:lottie:3.1.0'
/* api 'androidx.appcompat:appcompat:1.2.0-alpha02' /* api 'androidx.appcompat:appcompat:1.2.0-alpha02'
api 'com.android.support:design:28.0.0' api 'com.android.support:design:28.0.0'
......
...@@ -157,7 +157,7 @@ public class Constant { ...@@ -157,7 +157,7 @@ public class Constant {
public static int isDialogActivity = 0; //是否弹出活动弹窗 public static int isDialogActivity = 0; //是否弹出活动弹窗
public static int kkz_award_render_type = 0; public static int kkz_award_render_type = 0;
public static int qq = 0;// public static int qq = 0;//
public static int ispop=0;
public static class Permission { public static class Permission {
public static final String PERMISSION_CAMERA = Manifest.permission.CAMERA; public static final String PERMISSION_CAMERA = Manifest.permission.CAMERA;
......
...@@ -42,7 +42,9 @@ import com.ym.library.net.RxSchedulers ...@@ -42,7 +42,9 @@ import com.ym.library.net.RxSchedulers
import com.ym.library.rxbus.RxBusConstant import com.ym.library.rxbus.RxBusConstant
import com.ym.library.rxbus.RxBusUtil import com.ym.library.rxbus.RxBusUtil
import com.ym.library.utils.* import com.ym.library.utils.*
import com.ym.library.utils.SettingPreference.getUserInfoData
import com.ym.modulecommon.AppliContext import com.ym.modulecommon.AppliContext
import com.ym.modulecommon.utils.AdPreference
import io.reactivex.Observer import io.reactivex.Observer
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
import okhttp3.ResponseBody import okhttp3.ResponseBody
...@@ -70,7 +72,7 @@ abstract class JavaInterface { ...@@ -70,7 +72,7 @@ abstract class JavaInterface {
@JavascriptInterface @JavascriptInterface
fun getNovelUid(): String? { fun getNovelUid(): String? {
System.out.println("getNovelUid()") System.out.println("getNovelUid()")
return com.ym.modulecommon.utils.SettingPreference.getUid() return AdPreference.getUid()
} }
@JavascriptInterface @JavascriptInterface
...@@ -97,7 +99,7 @@ abstract class JavaInterface { ...@@ -97,7 +99,7 @@ abstract class JavaInterface {
*/ */
@JavascriptInterface @JavascriptInterface
fun getToken(): String { fun getToken(): String {
return com.ym.modulecommon.utils.SettingPreference.getToken() return AdPreference.getToken()
} }
/** /**
...@@ -477,27 +479,27 @@ abstract class JavaInterface { ...@@ -477,27 +479,27 @@ abstract class JavaInterface {
val params = JSONObject() val params = JSONObject()
val ts = System.currentTimeMillis() val ts = System.currentTimeMillis()
params.put(Constant.Device.ts, ts) params.put(Constant.Device.ts, ts)
params.put(Constant.Device.uid, com.ym.modulecommon.utils.SettingPreference.getUid()) params.put(Constant.Device.uid, AdPreference.getUid())
params.put(Constant.Device.token,com.ym.modulecommon.utils.SettingPreference.getToken()) params.put(Constant.Device.token,AdPreference.getToken())
params.put(Constant.Device.aid, com.ym.modulecommon.utils.SettingPreference.getAndroidId()) params.put(Constant.Device.aid, AdPreference.getAndroidId())
params.put(Constant.Device.imei, com.ym.modulecommon.utils.SettingPreference.getImei()) params.put(Constant.Device.imei, AdPreference.getImei())
params.put(Constant.Device.device, com.ym.modulecommon.utils.SettingPreference.getDevice()) params.put(Constant.Device.device, AdPreference.getDevice())
params.put(Constant.Device.mac, com.ym.modulecommon.utils.SettingPreference.getMac()) params.put(Constant.Device.mac, AdPreference.getMac())
params.put(Constant.Device.platform, "android") params.put(Constant.Device.platform, "android")
params.put(Constant.Device.carrier, com.ym.modulecommon.utils.SettingPreference.getCarrier()) params.put(Constant.Device.carrier, AdPreference.getCarrier())
params.put(Constant.Device.w, com.ym.modulecommon.utils.SettingPreference.getW()) params.put(Constant.Device.w, AdPreference.getW())
params.put(Constant.Device.vendor, Build.MANUFACTURER) params.put(Constant.Device.vendor, Build.MANUFACTURER)
params.put(Constant.Device.h, com.ym.modulecommon.utils.SettingPreference.getH()) params.put(Constant.Device.h, AdPreference.getH())
params.put(Constant.Device.ip, com.ym.modulecommon.utils.SettingPreference.getIp()) params.put(Constant.Device.ip, AdPreference.getIp())
params.put(Constant.Device.imsi, com.ym.modulecommon.utils.SettingPreference.getImsi()) params.put(Constant.Device.imsi, AdPreference.getImsi())
params.put(Constant.Device.model, com.ym.modulecommon.utils.SettingPreference.getModel()) params.put(Constant.Device.model, AdPreference.getModel())
params.put(Constant.Device.vn, com.ym.modulecommon.utils.SettingPreference.getVN()) params.put(Constant.Device.vn, AdPreference.getVN())
params.put(Constant.Device.ntt, com.ym.modulecommon.utils.SettingPreference.getNTT()) params.put(Constant.Device.ntt, AdPreference.getNTT())
params.put(Constant.Device.vc, com.ym.modulecommon.utils.SettingPreference.getVC()) params.put(Constant.Device.vc, AdPreference.getVC())
params.put(Constant.Device.source, com.ym.modulecommon.utils.SettingPreference.getSource()) params.put(Constant.Device.source, AdPreference.getSource())
params.put(Constant.Device.ua, com.ym.modulecommon.utils.SettingPreference.getUA()) params.put(Constant.Device.ua, AdPreference.getUA())
params.put(Constant.Device.svn, com.ym.modulecommon.utils.SettingPreference.getSVN()) params.put(Constant.Device.svn, AdPreference.getSVN())
var param = obj2Array(params) var param = obj2Array(params)
System.out.println("-------------:$param") System.out.println("-------------:$param")
return params.toString() return params.toString()
...@@ -640,7 +642,7 @@ abstract class JavaInterface { ...@@ -640,7 +642,7 @@ abstract class JavaInterface {
@JavascriptInterface @JavascriptInterface
fun withDraw() { fun withDraw() {
val token =com.ym.modulecommon.utils.SettingPreference.getToken() val token =AdPreference.getToken()
if (token.isEmpty()) { if (token.isEmpty()) {
WxImplUtils().onAuth(act, object : WxImplUtils.IWxLoginCallback { WxImplUtils().onAuth(act, object : WxImplUtils.IWxLoginCallback {
override fun onWxSuccess(token: String?, openid: String?) { override fun onWxSuccess(token: String?, openid: String?) {
...@@ -979,90 +981,100 @@ abstract class JavaInterface { ...@@ -979,90 +981,100 @@ abstract class JavaInterface {
fun showGetCoinsDialog(type:Int,id: String, coins: String) { fun showGetCoinsDialog(type:Int,id: String, coins: String) {
LogUtils.e("huang -----h5", "showGetCoinsDialog type:"+type+" id:"+id+" coins:"+coins) LogUtils.e("huang -----h5", "showGetCoinsDialog type:"+type+" id:"+id+" coins:"+coins)
mWebView.context.runOnUiThread { mWebView.context.runOnUiThread {
CenterDialog.showHomeDialogStyle1(act, 3, View.OnClickListener { if(act==null){
return@runOnUiThread
if(type==2 && it.id.equals(R.id.id_iv_dismiss)){
var type = "2"
mWebView.loadUrl("javascript:closeWindows('$type')")
}else{
if (VideoTimeUtils.isCanShowReward()) {
var action = ""
if(type==1){
action = "scraping_card_doubling_video"
}else{
action = "rich_man_doubling_video"
}
Toast.makeText(act, "看完福利视频后奖励即可翻倍", Toast.LENGTH_SHORT).show()
AdManager.playRewardAd(
AdUtils.AD_REWARD_VIDIO,
action,
act!!,
object : ZXADVideoListener {
//看激励视频金币翻倍
override fun onAdClose() {//视频关闭
if(type==1){
EventUtils.onEvent("close_scraping_card_doubling_video", "刮刮卡翻倍激励视频完成")
}else{
EventUtils.onEvent("close_rich_man_doubling_video", "大富翁翻倍激励视频完成")
} }
if (act?.isFinishing!!)return@runOnUiThread
CenterDialog.showH5Dialog(act!!,coins.toDouble(),1,2,object :H5Listener{
override fun onDialogClose(type: String,shutdownType: Int) {
mWebView.loadUrl("javascript:closeWindows('$type','$shutdownType')")
ApiClient.userApi.h5Receive(id)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<BubbleOrBoxReceiveEntity?>() {
override fun onSuccess(result: BubbleOrBoxReceiveEntity?) {}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {} })
ReportPresenter.report()
/* if (com.ym.library.Constant.videoNumber < com.ym.library.Constant.videoCount - 1) {
ToastUtils.showTextToast("再观看${(com.ym.library.Constant.videoCount - com.ym.library.Constant.videoNumber - 1)}个视频即可完成今日打卡")
}*/
VideoNumberUtils.setVideoNumber()
VideoTimeUtils.setVideoTime()
CenterDialog.showH5Dialog(act!!, (coins.toDouble()*2), 1,type,object:H5Listener{
override fun onDialogClose(type: String) {
var type = "2"
mWebView.loadUrl("javascript:closeWindows('$type')")
} }
}) })
LogUtils.e("huang1","h5page:"+type+" type:"+1) // CenterDialog.showHomeDialogStyle1(act, 3, View.OnClickListener {
//
} // if(type==2 && it.id.equals(R.id.id_iv_dismiss)){
// var type = "2"
override fun onAdShow() { // mWebView.loadUrl("javascript:closeWindows('$type')")
AdManager.loadNextCacheRewardVideoAd(AdUtils.AD_REWARD_VIDIO, act!!) // }else{
} // if (VideoTimeUtils.isCanShowReward()) {
override fun onAdVideoBarClick() {} // var action = ""
override fun onError(errorMsg: String?) {//视频播放错误 // if(type==1){
// AppClient.appApi.h5Receive(id) // action = "scraping_card_doubling_video"
// }else{
// action = "rich_man_doubling_video"
// }
//
// Toast.makeText(act, "看完福利视频后奖励即可翻倍", Toast.LENGTH_SHORT).show()
// AdManager.playRewardAd(
// AdUtils.AD_REWARD_VIDIO,
// action,
// act!!,
// object : ZXADVideoListener {
// //看激励视频金币翻倍
// override fun onAdClose() {//视频关闭
// if(type==1){
// EventUtils.onEvent("close_scraping_card_doubling_video", "刮刮卡翻倍激励视频完成")
// }else{
// EventUtils.onEvent("close_rich_man_doubling_video", "大富翁翻倍激励视频完成")
// }
//
//
// ApiClient.userApi.h5Receive(id)
// .compose(RxSchedulers.observableIO2Main()) // .compose(RxSchedulers.observableIO2Main())
// .subscribe(object : BaseObserver<BubbleOrBoxReceiveEntity?>() { // .subscribe(object : BaseObserver<BubbleOrBoxReceiveEntity?>() {
// override fun onSuccess(result: BubbleOrBoxReceiveEntity?) {} // override fun onSuccess(result: BubbleOrBoxReceiveEntity?) {}
// override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {} }) // override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {} })
// ReportPresenter.report()
// /* if (com.ym.library.Constant.videoNumber < com.ym.library.Constant.videoCount - 1) {
// ToastUtils.showTextToast("再观看${(com.ym.library.Constant.videoCount - com.ym.library.Constant.videoNumber - 1)}个视频即可完成今日打卡")
// }*/
// //
// CenterDialog.showH5Dialog(act!!, (coins.toDouble()*2), 0,type,object:H5Listener{ // VideoNumberUtils.setVideoNumber()
// VideoTimeUtils.setVideoTime()
//
// CenterDialog.showH5Dialog(act!!, (coins.toDouble()*2), 1,type,object:H5Listener{
// override fun onDialogClose(type: String) { // override fun onDialogClose(type: String) {
// var type = "2" // var type = "2"
// mWebView.loadUrl("javascript:closeWindows('$type')") // mWebView.loadUrl("javascript:closeWindows('$type')")
// }
//
// })
// LogUtils.e("huang1","h5page:"+type+" type:"+1)
// //
// } // }
// //
// override fun onAdShow() {
// AdManager.loadNextCacheRewardVideoAd(AdUtils.AD_REWARD_VIDIO, act!!)
// }
// override fun onAdVideoBarClick() {}
// override fun onError(errorMsg: String?) {//视频播放错误
//// AppClient.appApi.h5Receive(id)
//// .compose(RxSchedulers.observableIO2Main())
//// .subscribe(object : BaseObserver<BubbleOrBoxReceiveEntity?>() {
//// override fun onSuccess(result: BubbleOrBoxReceiveEntity?) {}
//// override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {} })
////
//// CenterDialog.showH5Dialog(act!!, (coins.toDouble()*2), 0,type,object:H5Listener{
//// override fun onDialogClose(type: String) {
//// var type = "2"
//// mWebView.loadUrl("javascript:closeWindows('$type')")
////
//// }
////
//// })
//// LogUtils.e("huang2","h5page:"+type+" type:"+0)
//
// }
//
// override fun onSuccess() {}
// }) // })
// LogUtils.e("huang2","h5page:"+type+" type:"+0) // }
// }
} //
//
override fun onSuccess() {} //
}) // }, coins.toInt(), if(type==1){"H5_Dismiss"}else {"H5_Not_Dimiss"}, "0")
}
}
}, coins.toInt(), if(type==1){"H5_Dismiss"}else {"H5_Not_Dimiss"}, "0")
} }
} }
...@@ -1096,7 +1108,13 @@ abstract class JavaInterface { ...@@ -1096,7 +1108,13 @@ abstract class JavaInterface {
if(type==1){ if(type==1){
action = "scraping_card_nomal_video" action = "scraping_card_nomal_video"
}else if(type==2){ }else if(type==2){
if(type2.equals("jiacishu")){
action = "rich_man_nomal_video" action = "rich_man_nomal_video"
}else if(type2.equals("kengwei")){
action="rich_man_qipan_video"
}
}else if(type==3){ }else if(type==3){
action = "everyday_dividend_video" action = "everyday_dividend_video"
} }
...@@ -1150,8 +1168,10 @@ abstract class JavaInterface { ...@@ -1150,8 +1168,10 @@ abstract class JavaInterface {
LogUtils.e("huang -----h5", "showBigImgDialog 0 $number") LogUtils.e("huang -----h5", "showBigImgDialog 0 $number")
mWebView.context.runOnUiThread { mWebView.context.runOnUiThread {
CenterDialog.showH5Dialog(act!!, number.toDouble(), 1,h5Page,object:H5Listener{ CenterDialog.showH5Dialog(act!!, number.toDouble(), 1,h5Page,object:H5Listener{
override fun onDialogClose(type: String) {
mWebView.loadUrl("javascript:closeWindows('$type')")
override fun onDialogClose(type: String, shutdownType: Int) {
mWebView.loadUrl("javascript:closeWindows('$type','$shutdownType')")
} }
}) })
...@@ -1170,9 +1190,10 @@ abstract class JavaInterface { ...@@ -1170,9 +1190,10 @@ abstract class JavaInterface {
mWebView.context.runOnUiThread { mWebView.context.runOnUiThread {
CenterDialog.showH5Dialog(act!!, DateUtils.numbToDoule(number),type,h5Page,object: CenterDialog.showH5Dialog(act!!, DateUtils.numbToDoule(number),type,h5Page,object:
H5Listener { H5Listener {
override fun onDialogClose(type: String) {
mWebView.loadUrl("javascript:closeWindows('$type')") override fun onDialogClose(type: String, shutdownType: Int) {
mWebView.loadUrl("javascript:closeWindows('$type','$shutdownType')")
} }
}) })
LogUtils.e("huang4","h5page:"+h5Page+" type:"+type) LogUtils.e("huang4","h5page:"+h5Page+" type:"+type)
......
...@@ -18,6 +18,7 @@ import com.ym.library.net.* ...@@ -18,6 +18,7 @@ import com.ym.library.net.*
import com.ym.library.utils.EventUtils import com.ym.library.utils.EventUtils
import com.ym.library.utils.SettingPreference import com.ym.library.utils.SettingPreference
import com.ym.library.utils.Utils import com.ym.library.utils.Utils
import com.ym.modulecommon.utils.AdPreference
import kotlinx.android.synthetic.main.activity_xiaoman.* import kotlinx.android.synthetic.main.activity_xiaoman.*
class XiaoManActivity : BaseActivity() { class XiaoManActivity : BaseActivity() {
...@@ -35,7 +36,7 @@ class XiaoManActivity : BaseActivity() { ...@@ -35,7 +36,7 @@ class XiaoManActivity : BaseActivity() {
* @param placeId 资源位id:必传 * @param placeId 资源位id:必传
* @param callback CampaignCallback 回调 * @param callback CampaignCallback 回调
*/ */
campaignFragment = CampaignFragment.newInstance(com.ym.modulecommon.utils.SettingPreference.getToken()) campaignFragment = CampaignFragment.newInstance(AdPreference.getToken())
campaignFragment?.setPlaceId("2773") campaignFragment?.setPlaceId("2773")
campaignFragment?.setCallback(object : CampaignCallback() { campaignFragment?.setCallback(object : CampaignCallback() {
override fun showAd(params: String) { override fun showAd(params: String) {
......
...@@ -6,6 +6,7 @@ import com.ym.library.net.NetConfig ...@@ -6,6 +6,7 @@ import com.ym.library.net.NetConfig
import com.ym.library.utils.LogUtils import com.ym.library.utils.LogUtils
import com.ym.library.utils.PhoneUtils import com.ym.library.utils.PhoneUtils
import com.ym.library.utils.SettingPreference import com.ym.library.utils.SettingPreference
import com.ym.modulecommon.utils.AdPreference
import okhttp3.Interceptor import okhttp3.Interceptor
import okhttp3.logging.HttpLoggingInterceptor import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
...@@ -40,9 +41,9 @@ object VersionClient { ...@@ -40,9 +41,9 @@ object VersionClient {
// builder.addHeader("User-Agent", SettingPreference.getUserAgent()) // builder.addHeader("User-Agent", SettingPreference.getUserAgent())
// } // }
// if (request.url().host().toString().contains("zhangxinhulian.com")) { // if (request.url().host().toString().contains("zhangxinhulian.com")) {
builder.addHeader(Constant.aid, com.ym.modulecommon.utils.SettingPreference.getAndroidId()) builder.addHeader(Constant.aid, AdPreference.getAndroidId())
LogUtils.e(com.ym.modulecommon.utils.SettingPreference.getAndroidId()) LogUtils.e(AdPreference.getAndroidId())
// } // }
chain.proceed(builder.build()) chain.proceed(builder.build())
} }
......
package com.ym.library.module
import java.io.Serializable
/**
* Created by Antonio on 2019/6/12.
*/
class UserInfoEntity : Serializable {
var uid: String? = ""
var token: String? = ""
var successMsg: String? = ""
var diamond: Diamond? = null
var receiveCoins: Int? = 0 //待领取金币
var avaCent:Double = 0.0 //可用金额(分)
var avaYuan:Double = 0.0 //可用金额 (元)
var avaCoin:Int = 0 //可用金币
var coinRate:Int = 0 //比例
var title:String = ""
var mind:String = ""
class Diamond {
var value: Int = 0
var cash: String = ""
}
var headImage: String? = "" //头像
var nickname: String? = "" //昵称
var sex: String? = "" //性别
var phoneNo: String? = "" //手机号
var availCoins: Int? = 0 //可用金币
var headimgurl: String? = "" //头像
var coins: Int? = 0
var newAwardFlag: Int = 0
var memberType: Int = 0
var isTourist: Int? = 0
var isMember: Boolean = false
var weight: String? = ""
var height: String? = ""
var gaodeTrackId: Long? = 0
var gaodeTerminalId: Long? = 0
var age: String? = ""
var memberEndTime: String? = ""
var appIcon: String? = ""
var shareCode: String? = ""
var task: String? = "" //是否有任务通知
var isBindPhone: Boolean? = false //是否绑定手机
var isBind: Boolean? = false //是否绑定微信
var isBindWxPayOpenid: Boolean? = false //微信提现授权
}
\ No newline at end of file
...@@ -4,8 +4,8 @@ import android.text.TextUtils ...@@ -4,8 +4,8 @@ import android.text.TextUtils
import com.ym.admodule.BuildConfig import com.ym.admodule.BuildConfig
import com.ym.library.Constant import com.ym.library.Constant
import com.ym.modulecommon.net.NetConfig import com.ym.modulecommon.net.NetConfig
import com.ym.modulecommon.utils.AdPreference
import com.ym.modulecommon.utils.PhoneUtils import com.ym.modulecommon.utils.PhoneUtils
import com.ym.modulecommon.utils.SettingPreference
import okhttp3.Interceptor import okhttp3.Interceptor
import okhttp3.Request import okhttp3.Request
import okhttp3.logging.HttpLoggingInterceptor import okhttp3.logging.HttpLoggingInterceptor
...@@ -34,12 +34,12 @@ object ApiClient { ...@@ -34,12 +34,12 @@ object ApiClient {
private val headInterceptor = Interceptor { chain -> private val headInterceptor = Interceptor { chain ->
val request = chain.request() val request = chain.request()
val builder = request.newBuilder() val builder = request.newBuilder()
builder.addHeader(Constant.aid, SettingPreference.getAndroidId()) builder.addHeader(Constant.aid, AdPreference.getAndroidId())
builder.addHeader(Constant.Device.env, Constant.Param.env) builder.addHeader(Constant.Device.env, Constant.Param.env)
if (!TextUtils.isEmpty(SettingPreference.getUserAgent())) { if (!TextUtils.isEmpty(AdPreference.getUserAgent())) {
builder.addHeader("web-user-agent", SettingPreference.getUserAgent()) builder.addHeader("web-user-agent", AdPreference.getUserAgent())
builder.removeHeader("User-Agent") builder.removeHeader("User-Agent")
builder.addHeader("User-Agent", SettingPreference.getUserAgent()) builder.addHeader("User-Agent", AdPreference.getUserAgent())
} }
val headers: Request = builder.build() val headers: Request = builder.build()
chain.proceed(headers) chain.proceed(headers)
......
...@@ -30,235 +30,16 @@ import com.ym.library.utils.Utils; ...@@ -30,235 +30,16 @@ import com.ym.library.utils.Utils;
/** /**
* Created by gaoleichao on 2019/4/17 * Created by gaoleichao on 2019/4/17
*/ */
public abstract class BaseActivity extends RxAppCompatActivity { public abstract class BaseActivity extends com.ym.modulecommon.base.BaseActivity {
public abstract int layoutID();
// public abstract Context context();
public Activity activity(){
return this;
}
public String className() {
return activity().getClass().getSimpleName();
}
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
if (com.ym.modulecommon.net.NetConfig.sEnvironment == com.ym.modulecommon.net.NetConfig.Environment.PRODUCT) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
}
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // 禁用横屏
//
RxBusUtil.getDefault().register(this); RxBusUtil.getDefault().register(this);
before();
if (layoutID() != 0) {
setContentView(layoutID());
}
after();
init(savedInstanceState);
init();
data();
}
public void before() {
// baseHandler = new WeakHandler();
// StatusBarUtil.setTranslucent(this);
}
protected void after() {
ImmersionBar.with(this).setOnNavigationBarListener(new OnNavigationBarListener() {
@Override
public void onNavigationBarChange(boolean show) {
}
}).init();
}
public abstract void init();
public void data() {
}
public void init(@Nullable Bundle savedInstanceState) {
}
// protected WeakHandler baseHandler;
protected boolean mIsNeedGoneNavigationBar = false;
@Override
protected void onResume() {
super.onResume();
if (activity() != null) {
MobclickAgent.onResume(activity());
}
if (className() != null) {
Log.d("BaseActivity","onResume =" + className());
EventUtils.INSTANCE.onEvent("page_status", Utils.obj2Str(new ReportEntity(Constant.ReportSessionId, className(), "onResume")));
}
}
@Override
protected void onPause() {
super.onPause();
if (className() != null) {
Log.d("BaseActivity","onPause =" + className());
EventUtils.INSTANCE.onEvent("page_status", Utils.obj2Str(new ReportEntity(Constant.ReportSessionId, className(), "onPause")));
}
if (activity() != null) {
MobclickAgent.onPause(activity());
}
} }
/**
* 设置是否隐藏导航栏
*
* @param isNeed
*/
protected void setNeedGoneNavigationBar(boolean isNeed) {
// mIsNeedGoneNavigationBar = isNeed;
// if (mIsNeedGoneNavigationBar) {
// baseHandler.postDelayed(mHideRunnable, 200);
// final View decorView = getWindow().getDecorView();
// decorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {
// @Override
// public void onSystemUiVisibilityChange(int visibility) {
// decorView.requestLayout();
//
// }
// });
// }
}
// protected Runnable mHideRunnable = new Runnable() {
// @Override
// public void run() {
// int flags;
// int curApiVersion = Build.VERSION.SDK_INT;
// // This work only for android 4.4+
// if (curApiVersion >= Build.VERSION_CODES.KITKAT) {
// // This work only for android 4.4+
// // hide navigation bar permanently in android activity
// // touch the screen, the navigation bar will not show
// flags = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE;
//// | View.SYSTEM_UI_FLAG_FULLSCREEN;
//
// } else {
// // touch the screen, the navigation bar will show
// flags = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
// }
//
// // must be executed in main thread :)
// getWindow().getDecorView().setSystemUiVisibility(flags);
// }
// };
public void openActivity(Class pClass) {
openActivity(pClass, null);
}
public void openActivity(Class pClass, Bundle pBundle) {
Intent intent = new Intent(this, pClass);
if (pBundle != null) {
intent.putExtras(pBundle);
}
startActivity(intent);
}
/**
* 设置屏幕亮度
*
* @param context
* @param brightness 1-255
*/
public void changeAppBrightness(Context context, int brightness) {
Window window = ((Activity) context).getWindow();
WindowManager.LayoutParams lp = window.getAttributes();
if (brightness == -1) {
lp.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE;
} else {
Log.d("glc", "brightness:" + brightness);
lp.screenBrightness = (brightness <= 0 ? 1 : brightness) / 255f;
;
}
window.setAttributes(lp);
}
public int getAppBrightness() {
int systemBrightness = 0;
try {
systemBrightness = Settings.System.getInt(getContentResolver(), Settings.System.SCREEN_BRIGHTNESS);
} catch (Settings.SettingNotFoundException e) {
e.printStackTrace();
}
return systemBrightness;
}
// 隐藏键盘
public void hideKeyBoard() {
try {
((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(this.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
} catch (Exception e) {
e.printStackTrace();
}
}
// 显示键盘
public void showKeyBoard(View view) {
try {
((InputMethodManager) getSystemService(INPUT_METHOD_SERVICE)).showSoftInput(view, 0);
} catch (Exception e) {
e.printStackTrace();
}
}
public void hideNavigationBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
// 全屏显示,隐藏状态栏和导航栏,拉出状态栏和导航栏显示一会儿后消失。
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
} else {
// 全屏显示,隐藏状态栏
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
}
}
}
// @Override
// protected void onResume() {
// super.onResume();
// MobclickAgent.onResume(context());
// }
// @Override
// protected void onPause() {
// super.onPause();
// MobclickAgent.onPause(context());
// }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
// Glide.get(AppliContext.get()).clearMemory(); // Glide.get(AppliContext.get()).clearMemory();
RxBusUtil.getDefault().unregister(this); RxBusUtil.getDefault().unregister(this);
} }
@Override
public Resources getResources() {
Resources res = super.getResources();
Configuration config = new Configuration();
config.setToDefaults();
res.updateConfiguration(config, res.getDisplayMetrics());
return res;
}
} }
...@@ -5,6 +5,7 @@ import com.ym.library.Constant ...@@ -5,6 +5,7 @@ import com.ym.library.Constant
import com.ym.library.utils.PhoneUtils import com.ym.library.utils.PhoneUtils
import com.ym.library.utils.SettingPreference import com.ym.library.utils.SettingPreference
import com.ym.modulecommon.net.NetConfig import com.ym.modulecommon.net.NetConfig
import com.ym.modulecommon.utils.AdPreference
import okhttp3.Interceptor import okhttp3.Interceptor
import okhttp3.Request import okhttp3.Request
import okhttp3.logging.HttpLoggingInterceptor import okhttp3.logging.HttpLoggingInterceptor
...@@ -33,7 +34,7 @@ object EventApiClient { ...@@ -33,7 +34,7 @@ object EventApiClient {
val request = chain.request() val request = chain.request()
val builder = request.newBuilder() val builder = request.newBuilder()
// PhoneUtils.addHeader(builder) // PhoneUtils.addHeader(builder)
builder.addHeader(Constant.aid, com.ym.modulecommon.utils.SettingPreference.getAndroidId()) builder.addHeader(Constant.aid, AdPreference.getAndroidId())
val headers: Request = builder.build() val headers: Request = builder.build()
chain.proceed(headers) chain.proceed(headers)
} }
......
...@@ -4,8 +4,8 @@ import android.text.TextUtils ...@@ -4,8 +4,8 @@ import android.text.TextUtils
import com.ym.library.BuildConfig import com.ym.library.BuildConfig
import com.ym.library.Constant import com.ym.library.Constant
import com.ym.modulecommon.net.NetConfig import com.ym.modulecommon.net.NetConfig
import com.ym.modulecommon.utils.AdPreference
import com.ym.modulecommon.utils.PhoneUtils import com.ym.modulecommon.utils.PhoneUtils
import com.ym.modulecommon.utils.SettingPreference
import okhttp3.Interceptor import okhttp3.Interceptor
import okhttp3.Request import okhttp3.Request
import okhttp3.logging.HttpLoggingInterceptor import okhttp3.logging.HttpLoggingInterceptor
...@@ -36,12 +36,12 @@ object GameApiClient { ...@@ -36,12 +36,12 @@ object GameApiClient {
private val headInterceptor = Interceptor { chain -> private val headInterceptor = Interceptor { chain ->
val request = chain.request() val request = chain.request()
val builder = request.newBuilder() val builder = request.newBuilder()
builder.addHeader(Constant.aid, SettingPreference.getAndroidId()) builder.addHeader(Constant.aid, AdPreference.getAndroidId())
builder.addHeader(Constant.Device.env, Constant.Param.env) builder.addHeader(Constant.Device.env, Constant.Param.env)
if (!TextUtils.isEmpty(SettingPreference.getUserAgent())) { if (!TextUtils.isEmpty(AdPreference.getUserAgent())) {
builder.addHeader("web-user-agent", SettingPreference.getUserAgent()) builder.addHeader("web-user-agent", AdPreference.getUserAgent())
builder.removeHeader("User-Agent") builder.removeHeader("User-Agent")
builder.addHeader("User-Agent", SettingPreference.getUserAgent()) builder.addHeader("User-Agent", AdPreference.getUserAgent())
} }
val headers: Request = builder.build() val headers: Request = builder.build()
chain.proceed(headers) chain.proceed(headers)
......
...@@ -2,7 +2,6 @@ package com.ym.library.net ...@@ -2,7 +2,6 @@ package com.ym.library.net
import com.ym.cattle.module.BubbleOrBoxReceiveEntity import com.ym.cattle.module.BubbleOrBoxReceiveEntity
import com.ym.library.module.* import com.ym.library.module.*
import com.ym.modulecommon.module.UserInfoEntity
import io.reactivex.Observable import io.reactivex.Observable
import okhttp3.ResponseBody import okhttp3.ResponseBody
import retrofit2.http.* import retrofit2.http.*
......
package com.ym.library.net package com.ym.library.net
import android.app.Activity import android.app.Activity
import android.content.Intent
import android.os.Build import android.os.Build
import android.text.TextUtils import android.text.TextUtils
import android.util.Log import android.util.Log
import com.ayl.ces.jni.CesCore import com.ayl.ces.jni.CesCore
import com.ym.library.Constant import com.ym.library.Constant
import com.ym.library.module.UserInfoEntity
import com.ym.library.utils.* import com.ym.library.utils.*
import com.ym.modulecommon.AdConfig
import com.ym.modulecommon.AppliContext import com.ym.modulecommon.AppliContext
import com.ym.modulecommon.Config import com.ym.modulecommon.utils.AdPreference
import com.ym.modulecommon.module.UserInfoEntity
import com.ym.modulecommon.utils.SettingPreference.saveSecDesc
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.ObservableOnSubscribe import io.reactivex.ObservableOnSubscribe
import io.reactivex.Observer import io.reactivex.Observer
...@@ -87,7 +88,7 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -87,7 +88,7 @@ class SplashPresenter : SplashContract.Presenter {
EventUtils.onEvent("SplashPresenter_getAppConfig") EventUtils.onEvent("SplashPresenter_getAppConfig")
val url = NetConfig.Novel.NOVEL_INIT_URL val url = NetConfig.Novel.NOVEL_INIT_URL
val cv = CpuUtils.getArchType(AppliContext.get()) val cv = CpuUtils.getArchType(AppliContext.get())
var md5 = com.ym.modulecommon.utils.SettingPreference.getMd5() var md5 = AdPreference.getMd5()
if (TextUtils.isEmpty(md5)) { if (TextUtils.isEmpty(md5)) {
md5 = "" md5 = ""
} }
...@@ -119,7 +120,7 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -119,7 +120,7 @@ class SplashPresenter : SplashContract.Presenter {
private fun initConfig(mNovelInitEntity: NovelInitEntity) { private fun initConfig(mNovelInitEntity: NovelInitEntity) {
Config.init(mActivity) AdConfig.init(mActivity)
EventUtils.onEvent("SplashPresenter_initConfig") EventUtils.onEvent("SplashPresenter_initConfig")
NetConfig.Other.HELP_AND_FEEDBACK_URL = mNovelInitEntity?.help NetConfig.Other.HELP_AND_FEEDBACK_URL = mNovelInitEntity?.help
NetConfig.Other.PRIVACY_PROTOCOL_URL = mNovelInitEntity?.agreement NetConfig.Other.PRIVACY_PROTOCOL_URL = mNovelInitEntity?.agreement
...@@ -343,24 +344,30 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -343,24 +344,30 @@ class SplashPresenter : SplashContract.Presenter {
if (lua != null && !TextUtils.isEmpty(lua)) { if (lua != null && !TextUtils.isEmpty(lua)) {
Log.d("lua", "lua:---->" + lua) Log.d("lua", "lua:---->" + lua)
if (!TextUtils.isEmpty(md5)) { if (!TextUtils.isEmpty(md5)) {
com.ym.modulecommon.utils.SettingPreference.saveMd5(md5) AdPreference.saveMd5(md5)
} }
com.ym.modulecommon.utils.SettingPreference.saveSecDesc(lua) AdPreference.saveSecDesc(lua)
CesCore.getInstance().setData(lua) CesCore.getInstance().setData(lua)
Constant.Param.env = CesCore.getInstance().Ckwork(com.ym.modulecommon.utils.SettingPreference.getAndroidId()) Constant.Param.env = CesCore.getInstance().Ckwork(AdPreference.getAndroidId())
Constant.Param.md5 = com.ym.modulecommon.utils.SettingPreference.getMd5() Constant.Param.md5 = AdPreference.getMd5()
} else { } else {
val lua = com.ym.modulecommon.utils.SettingPreference.getSecDesc() val lua = AdPreference.getSecDesc()
if (!TextUtils.isEmpty(lua)) { if (!TextUtils.isEmpty(lua)) {
CesCore.getInstance().setData(lua) CesCore.getInstance().setData(lua)
Constant.Param.env = CesCore.getInstance().Ckwork(com.ym.modulecommon.utils.SettingPreference.getAndroidId()) Constant.Param.env = CesCore.getInstance().Ckwork(AdPreference.getAndroidId())
} }
} }
// deviceLogin() // deviceLogin()
// getUserInfo() // getUserInfo()
// TODO // TODO
mView.jumpPage() if(AdPreference.getToken().isNotEmpty()){
getUserInfo()
}else{
// mView.jumpPage()
JumpUtils.jumpWxLogin()
mActivity.finish()
}
} }
private fun deviceLogin() { private fun deviceLogin() {
...@@ -371,10 +378,10 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -371,10 +378,10 @@ class SplashPresenter : SplashContract.Presenter {
val token = result.token val token = result.token
if (!TextUtils.isEmpty(token)) { if (!TextUtils.isEmpty(token)) {
EventUtils.onEvent("SplashPresenter_deviceLogin_success") EventUtils.onEvent("SplashPresenter_deviceLogin_success")
com.ym.modulecommon.utils.SettingPreference.setToken(token) AdPreference.setToken(token)
} else { } else {
EventUtils.onEvent("SplashPresenter_deviceLogin_fail") EventUtils.onEvent("SplashPresenter_deviceLogin_fail")
com.ym.modulecommon.utils.SettingPreference.setToken("") AdPreference.setToken("")
} }
getUserInfo() getUserInfo()
} }
...@@ -384,9 +391,9 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -384,9 +391,9 @@ class SplashPresenter : SplashContract.Presenter {
if (!TextUtils.equals(code, "200")) { if (!TextUtils.equals(code, "200")) {
Constant.Param.uid = "" Constant.Param.uid = ""
Constant.Param.token = "" Constant.Param.token = ""
com.ym.modulecommon.utils.SettingPreference.setUid("") AdPreference.setUid("")
com.ym.modulecommon.utils.SettingPreference.setToken("") AdPreference.setToken("")
com.ym.modulecommon.utils.SettingPreference.saveUserInfo(null) SettingPreference.saveUserInfo(null)
} }
getUserInfo() getUserInfo()
} }
...@@ -403,10 +410,10 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -403,10 +410,10 @@ class SplashPresenter : SplashContract.Presenter {
EventUtils.onEvent("SplashPresenter_getUserInfo_fail") EventUtils.onEvent("SplashPresenter_getUserInfo_fail")
} else { } else {
EventUtils.onEvent("SplashPresenter_getUserInfo_success") EventUtils.onEvent("SplashPresenter_getUserInfo_success")
com.ym.modulecommon.utils.SettingPreference.saveUserInfo(result) SettingPreference.saveUserInfo(result)
SettingPreference.setTrackId(result.gaodeTrackId ?: 0L) SettingPreference.setTrackId(result.gaodeTrackId ?: 0L)
SettingPreference.setTerminalId(result.gaodeTerminalId ?: 0L) SettingPreference.setTerminalId(result.gaodeTerminalId ?: 0L)
com.ym.modulecommon.utils.SettingPreference.setUid(uid) AdPreference.setUid(uid)
} }
mView.jumpPage() mView.jumpPage()
} }
......
...@@ -5,6 +5,7 @@ import com.ym.library.Constant ...@@ -5,6 +5,7 @@ import com.ym.library.Constant
import com.ym.library.utils.PhoneUtils import com.ym.library.utils.PhoneUtils
import com.ym.library.utils.SettingPreference import com.ym.library.utils.SettingPreference
import com.ym.modulecommon.net.NetConfig import com.ym.modulecommon.net.NetConfig
import com.ym.modulecommon.utils.AdPreference
import okhttp3.Interceptor import okhttp3.Interceptor
import okhttp3.Request import okhttp3.Request
import okhttp3.logging.HttpLoggingInterceptor import okhttp3.logging.HttpLoggingInterceptor
...@@ -33,12 +34,12 @@ object ZXADClient { ...@@ -33,12 +34,12 @@ object ZXADClient {
private val headInterceptor = Interceptor { chain -> private val headInterceptor = Interceptor { chain ->
val request = chain.request() val request = chain.request()
val builder = request.newBuilder() val builder = request.newBuilder()
builder.addHeader(Constant.aid, com.ym.modulecommon.utils.SettingPreference.getAndroidId()) builder.addHeader(Constant.aid, AdPreference.getAndroidId())
builder.addHeader(Constant.Device.env, Constant.Param.env) builder.addHeader(Constant.Device.env, Constant.Param.env)
if (!TextUtils.isEmpty(com.ym.modulecommon.utils.SettingPreference.getUserAgent())) { if (!TextUtils.isEmpty(AdPreference.getUserAgent())) {
builder.addHeader("web-user-agent", com.ym.modulecommon.utils.SettingPreference.getUserAgent()) builder.addHeader("web-user-agent", AdPreference.getUserAgent())
builder.removeHeader("User-Agent") builder.removeHeader("User-Agent")
builder.addHeader("User-Agent", com.ym.modulecommon.utils.SettingPreference.getUserAgent()) builder.addHeader("User-Agent", AdPreference.getUserAgent())
} }
val headers: Request = builder.build() val headers: Request = builder.build()
chain.proceed(headers) chain.proceed(headers)
......
...@@ -257,4 +257,7 @@ interface RounterApi { ...@@ -257,4 +257,7 @@ interface RounterApi {
@RounterUri(Constant.scheme + "://user_info") @RounterUri(Constant.scheme + "://user_info")
fun getIntentUserInfo(): Intent fun getIntentUserInfo(): Intent
@RounterUri(Constant.scheme + "://wxlogin")
fun getIntentWxLogin(): Intent
} }
\ No newline at end of file
...@@ -84,6 +84,10 @@ object AdUtils { ...@@ -84,6 +84,10 @@ object AdUtils {
EventUtils.onEvent("chai_hongbao_double_video_show","红包翻倍视频曝光") EventUtils.onEvent("chai_hongbao_double_video_show","红包翻倍视频曝光")
}else if(actionName.equals("qiangtan_redPack_double_click")){ }else if(actionName.equals("qiangtan_redPack_double_click")){
EventUtils.onEvent("chai_hongbao_video_show","拆红包强弹视频曝光") EventUtils.onEvent("chai_hongbao_video_show","拆红包强弹视频曝光")
}else if(actionName.equals("rich_man_nomal_video")){
EventUtils.onEvent("dfw_touzi_viedo_show","大富翁骰子视频曝光")
}else if(actionName.equals("rich_man_qipan_video")){
EventUtils.onEvent("dfw_qipan_video_show","大富翁棋盘视频曝光")
} }
} }
......
...@@ -708,9 +708,9 @@ object CenterDialog : BaseDialog() { ...@@ -708,9 +708,9 @@ object CenterDialog : BaseDialog() {
} }
if (type == 1) { if (type == 1) {
listener.onDialogClose("2") listener.onDialogClose("2",0)
} else if (type == 0) { } else if (type == 0) {
listener.onDialogClose("1") listener.onDialogClose("1",0)
} }
} }
iv_ok.setOnClickListener { iv_ok.setOnClickListener {
...@@ -720,9 +720,9 @@ object CenterDialog : BaseDialog() { ...@@ -720,9 +720,9 @@ object CenterDialog : BaseDialog() {
} }
if (type == 1) { if (type == 1) {
listener.onDialogClose("2") listener.onDialogClose("2",1)
} else if (type == 0) { } else if (type == 0) {
listener.onDialogClose("1") listener.onDialogClose("1",1)
} }
} }
......
...@@ -94,7 +94,7 @@ object GameDialog : BaseDialog() { ...@@ -94,7 +94,7 @@ object GameDialog : BaseDialog() {
0, 0,
Gravity.CENTER Gravity.CENTER
) )
EventUtils.onEvent("hongbao_show","次数红包弹窗展示") EventUtils.onEvent("hongbao_show", "次数红包弹窗展示")
val layout_dialog_root = val layout_dialog_root =
mDialogView?.findViewById<LinearLayout>(R.id.layout_dialog_open_red_root) mDialogView?.findViewById<LinearLayout>(R.id.layout_dialog_open_red_root)
val iv_close = mDialogView?.findViewById<ImageView>(R.id.iv_open_red_close) val iv_close = mDialogView?.findViewById<ImageView>(R.id.iv_open_red_close)
...@@ -156,8 +156,8 @@ object GameDialog : BaseDialog() { ...@@ -156,8 +156,8 @@ object GameDialog : BaseDialog() {
val tv_speed_up_num = mDialogView?.findViewById<TextView>(R.id.tv_speed_up_num) val tv_speed_up_num = mDialogView?.findViewById<TextView>(R.id.tv_speed_up_num)
val btn_speed_up_btn = mDialogView?.findViewById<ImageView>(R.id.btn_speed_up_btn) val btn_speed_up_btn = mDialogView?.findViewById<ImageView>(R.id.btn_speed_up_btn)
val layout_ad = mDialogView?.findViewById<FrameLayout>(R.id.layout_ad) val layout_ad = mDialogView?.findViewById<FrameLayout>(R.id.layout_ad)
tv_speed_up_time.text = "所有土地获得${time}分钟加速" tv_speed_up_time.text = "所有美食加快${time}分钟"
tv_speed_up_num.text = "今天还剩${num}次" tv_speed_up_num.text = "今天剩余${num}次"
btn_speed_up_btn.setOnClickListener { btn_speed_up_btn.setOnClickListener {
listener.onClick(it) listener.onClick(it)
EventUtils.onEvent("alljiasu_video_btn_click", "全体加速视频按钮点击") EventUtils.onEvent("alljiasu_video_btn_click", "全体加速视频按钮点击")
...@@ -273,7 +273,7 @@ object GameDialog : BaseDialog() { ...@@ -273,7 +273,7 @@ object GameDialog : BaseDialog() {
0, 0,
Gravity.CENTER Gravity.CENTER
) )
EventUtils.onEvent("box_show","宝箱弹窗展示") EventUtils.onEvent("box_show", "宝箱弹窗展示")
val layout_dialog_root = val layout_dialog_root =
mDialogView?.findViewById<LinearLayout>(R.id.layout_get_box_root) mDialogView?.findViewById<LinearLayout>(R.id.layout_get_box_root)
val iv_close = mDialogView?.findViewById<ImageView>(R.id.iv_get_box_close) val iv_close = mDialogView?.findViewById<ImageView>(R.id.iv_get_box_close)
...@@ -286,7 +286,7 @@ object GameDialog : BaseDialog() { ...@@ -286,7 +286,7 @@ object GameDialog : BaseDialog() {
btn_get_box_btn.setOnClickListener { btn_get_box_btn.setOnClickListener {
adListener.onClick(it) adListener.onClick(it)
EventUtils.onEvent("box_video_btn_click","宝箱视频按钮点击") EventUtils.onEvent("box_video_btn_click", "宝箱视频按钮点击")
mDialog?.dismiss() mDialog?.dismiss()
} }
...@@ -371,7 +371,7 @@ object GameDialog : BaseDialog() { ...@@ -371,7 +371,7 @@ object GameDialog : BaseDialog() {
tv_red_pg_reward.text = "+${reward}元" tv_red_pg_reward.text = "+${reward}元"
btn_red_pg_doubled.setOnClickListener { btn_red_pg_doubled.setOnClickListener {
EventUtils.onEvent("chai_hongbao_double_video_click","红包翻倍按钮点击") EventUtils.onEvent("chai_hongbao_double_video_click", "红包翻倍按钮点击")
listener.onClick(it) listener.onClick(it)
mDialog?.dismiss() mDialog?.dismiss()
} }
...@@ -404,7 +404,12 @@ object GameDialog : BaseDialog() { ...@@ -404,7 +404,12 @@ object GameDialog : BaseDialog() {
/** /**
* 店铺损坏 * 店铺损坏
*/ */
fun showShopDamage(activity: Activity, type: Int, isshow:Boolean,listener: View.OnClickListener) { fun showShopDamage(
activity: Activity,
type: Int,
isshow: Boolean,
listener: View.OnClickListener
) {
if (activity == null) return if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme) val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView = val mDialogView =
...@@ -415,7 +420,7 @@ object GameDialog : BaseDialog() { ...@@ -415,7 +420,7 @@ object GameDialog : BaseDialog() {
0, 0,
Gravity.CENTER Gravity.CENTER
) )
EventUtils.onEvent("stop_show","暂停营业弹窗展示") EventUtils.onEvent("stop_show", "暂停营业弹窗展示")
val layout_dialog_root = val layout_dialog_root =
mDialogView.findViewById<LinearLayout>(R.id.layout_dialog_shop_damage_root) mDialogView.findViewById<LinearLayout>(R.id.layout_dialog_shop_damage_root)
val btn_shop_damage_ad = mDialogView.findViewById<ImageView>(R.id.btn_shop_damage_ad) val btn_shop_damage_ad = mDialogView.findViewById<ImageView>(R.id.btn_shop_damage_ad)
...@@ -424,13 +429,18 @@ object GameDialog : BaseDialog() { ...@@ -424,13 +429,18 @@ object GameDialog : BaseDialog() {
val iv_diamoind_close = mDialogView.findViewById<ImageView>(R.id.iv_shop_damage_close) val iv_diamoind_close = mDialogView.findViewById<ImageView>(R.id.iv_shop_damage_close)
val layout_ad = mDialogView?.findViewById<FrameLayout>(R.id.layout_ad) val layout_ad = mDialogView?.findViewById<FrameLayout>(R.id.layout_ad)
setSunHuaiImg(iv_shop_damage_img_reward, type) setSunHuaiImg(iv_shop_damage_img_reward, type)
if(isshow){ if (isshow) {
btn_shop_damage_ad.setImageResource(R.drawable.icon_shop_damage_btn) btn_shop_damage_ad.setImageResource(R.drawable.icon_shop_damage_btn)
}else{ } else {
btn_shop_damage_ad.setImageResource(R.drawable.icon_shop_damage_no_btn) btn_shop_damage_ad.setImageResource(R.drawable.icon_shop_damage_no_btn)
} }
btn_shop_damage_ad.setOnClickListener { btn_shop_damage_ad.setOnClickListener {
EventUtils.onEvent("weixiu_video_btn_click","维修视频按钮点击") if (isshow) {
EventUtils.onEvent("weixiu_video_btn_click", "维修视频按钮点击")
} else {
EventUtils.onEvent("weixiu_btn_click", "维修按钮点击(不用看视频)")
}
listener.onClick(it) listener.onClick(it)
mDialog?.dismiss() mDialog?.dismiss()
} }
...@@ -471,7 +481,7 @@ object GameDialog : BaseDialog() { ...@@ -471,7 +481,7 @@ object GameDialog : BaseDialog() {
/** /**
* 恭喜获得现金 * 恭喜获得现金
*/ */
fun showGetCash(activity: Activity, cash: String, listener: View.OnClickListener) { fun showGetCash(activity: Activity, level: Int, cash: String, listener: View.OnClickListener) {
if (activity == null) return if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme) val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView = val mDialogView =
...@@ -482,27 +492,34 @@ object GameDialog : BaseDialog() { ...@@ -482,27 +492,34 @@ object GameDialog : BaseDialog() {
0, 0,
Gravity.CENTER Gravity.CENTER
) )
EventUtils.onEvent("dingdan_reward_show", "订单奖励弹窗展示")
val layout_dialog_root = val layout_dialog_root =
mDialogView.findViewById<LinearLayout>(R.id.layout_dialog_get_cash_root) mDialogView.findViewById<LinearLayout>(R.id.layout_dialog_get_cash_root)
val tv_get_cash_reward = mDialogView.findViewById<TextView>(R.id.tv_get_cash_reward) val tv_get_cash_reward = mDialogView.findViewById<TextView>(R.id.tv_get_cash_reward)
val id_getcash_title = mDialogView.findViewById<TextView>(R.id.id_getcash_title)
val btn_get_cash = mDialogView.findViewById<ImageView>(R.id.btn_get_cash) val btn_get_cash = mDialogView.findViewById<ImageView>(R.id.btn_get_cash)
val iv_diamoind_close = mDialogView.findViewById<ImageView>(R.id.iv_get_cash_close) val iv_diamoind_close = mDialogView.findViewById<ImageView>(R.id.iv_get_cash_close)
val layout_ad = mDialogView?.findViewById<FrameLayout>(R.id.layout_ad) val layout_ad = mDialogView?.findViewById<FrameLayout>(R.id.layout_ad)
if (level == 0) {
id_getcash_title.text = "恭喜获得现金"
} else {
id_getcash_title.text = "完成${level}级订单"
}
tv_get_cash_reward.text = "+${cash}元" tv_get_cash_reward.text = "+${cash}元"
btn_get_cash.setOnClickListener { btn_get_cash.setOnClickListener {
mDialog?.dismiss() mDialog?.dismiss()
listener.onClick(it)
} }
iv_diamoind_close.setOnClickListener { iv_diamoind_close.setOnClickListener {
mDialog?.dismiss() mDialog?.dismiss()
listener.onClick(it)
} }
mDialog?.setOnDismissListener { // mDialog?.setOnDismissListener {
listener.onClick(btn_get_cash) // listener.onClick(it)
} // }
FilterUtils.addClickAlpha(btn_get_cash) FilterUtils.addClickAlpha(btn_get_cash)
...@@ -600,7 +617,7 @@ object GameDialog : BaseDialog() { ...@@ -600,7 +617,7 @@ object GameDialog : BaseDialog() {
btn_accelerator_btn.setOnClickListener { btn_accelerator_btn.setOnClickListener {
mDialog?.dismiss() mDialog?.dismiss()
EventUtils.onEvent("jiasu_video_btn_click","加速器视频按钮点击") EventUtils.onEvent("jiasu_video_btn_click", "加速器视频按钮点击")
listener.onClick(it) listener.onClick(it)
} }
...@@ -706,7 +723,7 @@ object GameDialog : BaseDialog() { ...@@ -706,7 +723,7 @@ object GameDialog : BaseDialog() {
/** /**
* 钻石奖励领取 * 钻石奖励领取
*/ */
fun showDiamandReward(activity: Activity,rewardNum: Int) { fun showDiamandReward(activity: Activity, rewardNum: Int) {
if (activity == null) return if (activity == null) return
EventUtils.onEvent("jiasu_show") EventUtils.onEvent("jiasu_show")
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme) val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
...@@ -752,4 +769,38 @@ object GameDialog : BaseDialog() { ...@@ -752,4 +769,38 @@ object GameDialog : BaseDialog() {
}, 500) }, 500)
} }
//新手提现
fun showxinshoutixian(activity: Activity, listener: View.OnClickListener) {
if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView =
showBottomDialog(
R.layout.dialog_layout_xinshou_reward,
activity,
mDialog,
0,
Gravity.CENTER
)
EventUtils.onEvent("xinshou0.3_show", "新手可提现弹窗展示")
val iv_close = mDialogView?.findViewById<ImageView>(R.id.id_img_dialog_close)
val btn_lijitixian = mDialogView.findViewById<ImageView>(R.id.img_liji_tixian)
btn_lijitixian.setOnClickListener {
mDialog?.dismiss()
EventUtils.onEvent("xinshou0.3_click", "新手可提现弹窗点击")
listener.onClick(it)
}
iv_close.setOnClickListener {
mDialog?.dismiss()
}
FilterUtils.addClickAlpha(btn_lijitixian)
mDialog.setCanceledOnTouchOutside(false)
mDialog.setCancelable(false)
if (!activity?.isFinishing) {
mDialog?.show()
}
}
} }
\ No newline at end of file
...@@ -6,5 +6,6 @@ package com.ym.cattle.listener ...@@ -6,5 +6,6 @@ package com.ym.cattle.listener
*/ */
interface H5Listener { interface H5Listener {
fun onDialogClose(type: String) //fun onDialogClose(type: String)
fun onDialogClose(type: String,shutdownType:Int)
} }
\ No newline at end of file
...@@ -6,17 +6,20 @@ import android.text.TextUtils; ...@@ -6,17 +6,20 @@ import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import com.ym.library.Constant;
import com.ym.library.listener.IAdVideoListener; import com.ym.library.listener.IAdVideoListener;
import com.ym.library.module.NewsEntity; import com.ym.library.module.NewsEntity;
import com.ym.library.module.ShaveListEntity; import com.ym.library.module.ShaveListEntity;
import com.ym.library.module.UserInfoEntity;
import com.ym.library.router.RounterApi; import com.ym.library.router.RounterApi;
import com.ym.library.router.RounterBus; import com.ym.library.router.RounterBus;
import com.ym.library.rxbus.BusData; import com.ym.library.rxbus.BusData;
import com.ym.library.rxbus.RxBusConstant; import com.ym.library.rxbus.RxBusConstant;
import com.ym.library.rxbus.RxBusUtil; import com.ym.library.rxbus.RxBusUtil;
import com.ym.modulecommon.AppliContext; import com.ym.modulecommon.AppliContext;
import com.ym.modulecommon.module.UserInfoEntity; import com.ym.modulecommon.utils.AdPreference;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
...@@ -35,12 +38,12 @@ public class JumpUtils { ...@@ -35,12 +38,12 @@ public class JumpUtils {
} }
} }
public static void h5Jump(String title, String url,boolean showToolbar,Activity activity) { public static void h5Jump(String title, String url, boolean showToolbar, Activity activity) {
try { try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivityWeb(title, url,showToolbar); Intent intent = RounterBus.getRounter(RounterApi.class).getIntentActivityWeb(title, url, showToolbar);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); // intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
if (activity!=null){ if (activity != null) {
activity.startActivity(intent); activity.startActivity(intent);
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -107,14 +110,14 @@ public class JumpUtils { ...@@ -107,14 +110,14 @@ public class JumpUtils {
} }
public static boolean isLogin(Boolean isJump) { public static boolean isLogin(Boolean isJump) {
String token =com.ym.modulecommon.utils.SettingPreference.getToken(); String token = AdPreference.getToken();
Log.i("TAG", "isLogin: " + token); Log.i("TAG", "isLogin: " + token);
String uid = com.ym.modulecommon.utils.SettingPreference.getUid(); String uid = AdPreference.getUid();
UserInfoEntity entity = SettingPreference.getUserInfoData(); UserInfoEntity entity = SettingPreference.getUserInfoData();
if (TextUtils.isEmpty(token) || TextUtils.isEmpty(uid) || entity == null) { if (TextUtils.isEmpty(token) || TextUtils.isEmpty(uid) || entity == null) {
com.ym.modulecommon.utils.SettingPreference.setUid(""); AdPreference.setUid("");
com.ym.modulecommon.utils.SettingPreference.setToken(""); AdPreference.setToken("");
com.ym.modulecommon.utils.SettingPreference.saveUserInfo(null); SettingPreference.saveUserInfo(null);
return false; return false;
} }
return true; return true;
...@@ -264,7 +267,7 @@ public class JumpUtils { ...@@ -264,7 +267,7 @@ public class JumpUtils {
try { try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentScratchCard(); Intent intent = RounterBus.getRounter(RounterApi.class).getIntentScratchCard();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra("json",entity); intent.putExtra("json", entity);
AppliContext.get().startActivity(intent); AppliContext.get().startActivity(intent);
} catch (Exception e) { } catch (Exception e) {
} }
...@@ -343,7 +346,7 @@ public class JumpUtils { ...@@ -343,7 +346,7 @@ public class JumpUtils {
} }
//广告跳转 //广告跳转
public static void adJump(NewsEntity data,Activity activity) { public static void adJump(NewsEntity data, Activity activity) {
Log.d("JumpUtils", "data.title =" + data.getTitle()); Log.d("JumpUtils", "data.title =" + data.getTitle());
Log.d("JumpUtils", "data.openType =" + data.getOpentype()); Log.d("JumpUtils", "data.openType =" + data.getOpentype());
Log.d("JumpUtils", "data.sid =" + data.getSid()); Log.d("JumpUtils", "data.sid =" + data.getSid());
...@@ -353,6 +356,12 @@ public class JumpUtils { ...@@ -353,6 +356,12 @@ public class JumpUtils {
int incentiveLevel = data.getIncentive_level(); int incentiveLevel = data.getIncentive_level();
int appmodelId = data.getAppmodel_id(); int appmodelId = data.getAppmodel_id();
if (sid.equals("2497")) {
h5Jump(data.getTitle(), data.getUrl()+"?is_popup1="+Constant.ispop, false, activity);
return;
}
if (data.getOpentype() == NewsEntity.AD_TYPE_URL) { if (data.getOpentype() == NewsEntity.AD_TYPE_URL) {
if (incentiveLevel == 9 || incentiveLevel == 3 || incentiveLevel == 7 || incentiveLevel == 8) { if (incentiveLevel == 9 || incentiveLevel == 3 || incentiveLevel == 7 || incentiveLevel == 8) {
JumpUtils.jumpReadH5Activity( JumpUtils.jumpReadH5Activity(
...@@ -389,8 +398,9 @@ public class JumpUtils { ...@@ -389,8 +398,9 @@ public class JumpUtils {
String.valueOf(data.getDelay()), String.valueOf(data.getDelay()),
data.getDeep_url_re() data.getDeep_url_re()
); );
} else { } else {
h5Jump(data.getTitle(), data.getUrl(),false,activity); h5Jump(data.getTitle(), data.getUrl(), false, activity);
} }
} else if (data.getOpentype() == NewsEntity.AD_TYPE_APPMODEL && data.getStatus() != 2) { } else if (data.getOpentype() == NewsEntity.AD_TYPE_APPMODEL && data.getStatus() != 2) {
if (appmodelId == 59) { if (appmodelId == 59) {
...@@ -429,18 +439,20 @@ public class JumpUtils { ...@@ -429,18 +439,20 @@ public class JumpUtils {
if (TextUtils.equals(sid, "2077")) { if (TextUtils.equals(sid, "2077")) {
//看视频加金币 //看视频加金币
} }
showAd(activity,data); showAd(activity, data);
} }
} }
public static void showAd(Activity activity,NewsEntity data) { public static void showAd(Activity activity, NewsEntity data) {
AdUtils.INSTANCE.playRewardAd(activity, "box_click", new IAdVideoListener() { AdUtils.INSTANCE.playRewardAd(activity, "box_click", new IAdVideoListener() {
@Override @Override
public void onAdClose() { } public void onAdClose() {
}
@Override @Override
public void onError(@Nullable String errorMsg) { } public void onError(@Nullable String errorMsg) {
}
}); });
} }
...@@ -467,5 +479,14 @@ public class JumpUtils { ...@@ -467,5 +479,14 @@ public class JumpUtils {
} }
} }
public static void jumpWxLogin() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentWxLogin();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AppliContext.get().startActivity(intent);
} catch (Exception e) {
Utils.showToast(AppliContext.get(), "该版本暂不支持,请更新版本!");
}
}
} }
...@@ -23,6 +23,7 @@ import com.ym.library.Constant ...@@ -23,6 +23,7 @@ import com.ym.library.Constant
import com.ym.library.module.NewsEntity import com.ym.library.module.NewsEntity
import com.ym.library.module.NovelEntity import com.ym.library.module.NovelEntity
import com.ym.modulecommon.AppliContext import com.ym.modulecommon.AppliContext
import com.ym.modulecommon.utils.AdPreference
import okhttp3.Request import okhttp3.Request
import java.io.* import java.io.*
import java.net.NetworkInterface import java.net.NetworkInterface
...@@ -781,25 +782,25 @@ object PhoneUtils { ...@@ -781,25 +782,25 @@ object PhoneUtils {
// builder.addHeader(Constant.lon, SettingPreference.getLon()) // builder.addHeader(Constant.lon, SettingPreference.getLon())
// builder.addHeader(Constant.locationtype, SettingPreference.getLocationType()) // builder.addHeader(Constant.locationtype, SettingPreference.getLocationType())
// builder.addHeader(Constant.city, URLEncoder.encode(SettingPreference.getCity(), "utf-8")) // builder.addHeader(Constant.city, URLEncoder.encode(SettingPreference.getCity(), "utf-8"))
builder.put(Constant.source, com.ym.modulecommon.utils.SettingPreference.getSource()) builder.put(Constant.source, AdPreference.getSource())
builder.put(Constant.vc, com.ym.modulecommon.utils.SettingPreference.getVC()) builder.put(Constant.vc, AdPreference.getVC())
builder.put(Constant.vn, com.ym.modulecommon.utils.SettingPreference.getVN()) builder.put(Constant.vn, AdPreference.getVN())
builder.put(Constant.h, com.ym.modulecommon.utils.SettingPreference.getH()) builder.put(Constant.h, AdPreference.getH())
builder.put(Constant.w, com.ym.modulecommon.utils.SettingPreference.getW()) builder.put(Constant.w, AdPreference.getW())
builder.put(Constant.model, com.ym.modulecommon.utils.SettingPreference.getModel()) builder.put(Constant.model, AdPreference.getModel())
builder.put(Constant.ntt, com.ym.modulecommon.utils.SettingPreference.getNTT()) builder.put(Constant.ntt, AdPreference.getNTT())
builder.put(Constant.aid, com.ym.modulecommon.utils.SettingPreference.getAndroidId()) builder.put(Constant.aid, AdPreference.getAndroidId())
builder.put(Constant.device, com.ym.modulecommon.utils.SettingPreference.getDevice()) builder.put(Constant.device, AdPreference.getDevice())
builder.put(Constant.carrier, com.ym.modulecommon.utils.SettingPreference.getCarrier()) builder.put(Constant.carrier, AdPreference.getCarrier())
builder.put(Constant.mac, com.ym.modulecommon.utils.SettingPreference.getMac()) builder.put(Constant.mac, AdPreference.getMac())
builder.put(Constant.imei, com.ym.modulecommon.utils.SettingPreference.getImei()) builder.put(Constant.imei, AdPreference.getImei())
builder.put(Constant.imsi, com.ym.modulecommon.utils.SettingPreference.getImsi()) builder.put(Constant.imsi, AdPreference.getImsi())
builder.put(Constant.ssid, com.ym.modulecommon.utils.SettingPreference.getSsid()) builder.put(Constant.ssid, AdPreference.getSsid())
System.out.println("com.ym.modulecommon.utils.SettingPreference.getAndroidId():" + com.ym.modulecommon.utils.SettingPreference.getAndroidId()) System.out.println("com.ym.modulecommon.utils.SettingPreference.getAndroidId():" + AdPreference.getAndroidId())
if (!TextUtils.isEmpty(com.ym.modulecommon.utils.SettingPreference.getUserAgent())) { if (!TextUtils.isEmpty(AdPreference.getUserAgent())) {
builder.put("web-user-agent", com.ym.modulecommon.utils.SettingPreference.getUserAgent()) builder.put("web-user-agent", AdPreference.getUserAgent())
builder.remove("User-Agent") builder.remove("User-Agent")
builder.put("User-Agent", com.ym.modulecommon.utils.SettingPreference.getUserAgent()) builder.put("User-Agent", AdPreference.getUserAgent())
} }
// if (!TextUtils.isEmpty(com.ym.modulecommon.utils.SettingPreference.getUid())) { // if (!TextUtils.isEmpty(com.ym.modulecommon.utils.SettingPreference.getUid())) {
// builder.put("uid", com.ym.modulecommon.utils.SettingPreference.getUid()) // builder.put("uid", com.ym.modulecommon.utils.SettingPreference.getUid())
...@@ -812,29 +813,29 @@ object PhoneUtils { ...@@ -812,29 +813,29 @@ object PhoneUtils {
builder.addHeader(Constant.vendor, Constant.Param.vendor) builder.addHeader(Constant.vendor, Constant.Param.vendor)
builder.addHeader(Constant.svn, Constant.Param.svn) builder.addHeader(Constant.svn, Constant.Param.svn)
builder.addHeader(Constant.token, com.ym.modulecommon.utils.SettingPreference.getToken()) builder.addHeader(Constant.token, AdPreference.getToken())
builder.addHeader(Constant.vc, com.ym.modulecommon.utils.SettingPreference.getVC()) builder.addHeader(Constant.vc, AdPreference.getVC())
builder.addHeader(Constant.vn, com.ym.modulecommon.utils.SettingPreference.getVN()) builder.addHeader(Constant.vn, AdPreference.getVN())
builder.addHeader(Constant.h, com.ym.modulecommon.utils.SettingPreference.getH()) builder.addHeader(Constant.h, AdPreference.getH())
builder.addHeader(Constant.w, com.ym.modulecommon.utils.SettingPreference.getW()) builder.addHeader(Constant.w, AdPreference.getW())
builder.addHeader(Constant.model, com.ym.modulecommon.utils.SettingPreference.getModel()) builder.addHeader(Constant.model, AdPreference.getModel())
builder.addHeader(Constant.ntt, com.ym.modulecommon.utils.SettingPreference.getNTT()) builder.addHeader(Constant.ntt, AdPreference.getNTT())
builder.addHeader(Constant.aid, com.ym.modulecommon.utils.SettingPreference.getAndroidId()) builder.addHeader(Constant.aid, AdPreference.getAndroidId())
builder.addHeader(Constant.device, com.ym.modulecommon.utils.SettingPreference.getDevice()) builder.addHeader(Constant.device, AdPreference.getDevice())
builder.addHeader(Constant.carrier, com.ym.modulecommon.utils.SettingPreference.getCarrier()) builder.addHeader(Constant.carrier, AdPreference.getCarrier())
builder.addHeader(Constant.mac, com.ym.modulecommon.utils.SettingPreference.getMac()) builder.addHeader(Constant.mac, AdPreference.getMac())
builder.addHeader(Constant.imei, com.ym.modulecommon.utils.SettingPreference.getImei()) builder.addHeader(Constant.imei, AdPreference.getImei())
builder.addHeader(Constant.imsi, com.ym.modulecommon.utils.SettingPreference.getImsi()) builder.addHeader(Constant.imsi, AdPreference.getImsi())
builder.addHeader(Constant.ssid, com.ym.modulecommon.utils.SettingPreference.getSsid()) builder.addHeader(Constant.ssid, AdPreference.getSsid())
builder.addHeader(Constant.source, com.ym.modulecommon.utils.SettingPreference.getSource()) builder.addHeader(Constant.source, AdPreference.getSource())
if (!TextUtils.isEmpty(com.ym.modulecommon.utils.SettingPreference.getUserAgent())) { if (!TextUtils.isEmpty(AdPreference.getUserAgent())) {
builder.addHeader("web-user-agent", com.ym.modulecommon.utils.SettingPreference.getUserAgent()) builder.addHeader("web-user-agent", AdPreference.getUserAgent())
builder.removeHeader("User-Agent") builder.removeHeader("User-Agent")
builder.addHeader("User-Agent", com.ym.modulecommon.utils.SettingPreference.getUserAgent()) builder.addHeader("User-Agent", AdPreference.getUserAgent())
} }
if (!TextUtils.isEmpty(com.ym.modulecommon.utils.SettingPreference.getUid())) { if (!TextUtils.isEmpty(AdPreference.getUid())) {
builder.addHeader("uid", com.ym.modulecommon.utils.SettingPreference.getUid()) builder.addHeader("uid", AdPreference.getUid())
} }
builder.addHeader( builder.addHeader(
"dip", "dip",
...@@ -848,41 +849,41 @@ object PhoneUtils { ...@@ -848,41 +849,41 @@ object PhoneUtils {
params.put(Constant.Device.ts, ts) params.put(Constant.Device.ts, ts)
// params.put("appKey", "faba1d018f76086") // params.put("appKey", "faba1d018f76086")
// params.put("appLs", Constant.appLs) // params.put("appLs", Constant.appLs)
params.put(Constant.Device.uid, com.ym.modulecommon.utils.SettingPreference.getUid()) params.put(Constant.Device.uid, AdPreference.getUid())
params.put(Constant.Device.token, com.ym.modulecommon.utils.SettingPreference.getToken()) params.put(Constant.Device.token, AdPreference.getToken())
params.put(Constant.Device.pkg, AppliContext.get().packageName) params.put(Constant.Device.pkg, AppliContext.get().packageName)
params.put(Constant.Device.aid, com.ym.modulecommon.utils.SettingPreference.getAndroidId()) params.put(Constant.Device.aid, AdPreference.getAndroidId())
params.put(Constant.Device.imei, com.ym.modulecommon.utils.SettingPreference.getImei()) params.put(Constant.Device.imei, AdPreference.getImei())
params.put(Constant.Device.device, com.ym.modulecommon.utils.SettingPreference.getDevice()) params.put(Constant.Device.device, AdPreference.getDevice())
params.put(Constant.Device.mac, com.ym.modulecommon.utils.SettingPreference.getMac()) params.put(Constant.Device.mac, AdPreference.getMac())
params.put(Constant.Device.platform, "android") params.put(Constant.Device.platform, "android")
params.put(Constant.Device.carrier, com.ym.modulecommon.utils.SettingPreference.getCarrier()) params.put(Constant.Device.carrier, AdPreference.getCarrier())
params.put(Constant.Device.w, com.ym.modulecommon.utils.SettingPreference.getW()) params.put(Constant.Device.w, AdPreference.getW())
params.put(Constant.Device.vendor, Build.MANUFACTURER) params.put(Constant.Device.vendor, Build.MANUFACTURER)
params.put(Constant.Device.h, com.ym.modulecommon.utils.SettingPreference.getH()) params.put(Constant.Device.h, AdPreference.getH())
params.put(Constant.Device.ip, com.ym.modulecommon.utils.SettingPreference.getIp()) params.put(Constant.Device.ip, AdPreference.getIp())
params.put(Constant.Device.imsi, com.ym.modulecommon.utils.SettingPreference.getImsi()) params.put(Constant.Device.imsi, AdPreference.getImsi())
params.put(Constant.Device.model, com.ym.modulecommon.utils.SettingPreference.getModel()) params.put(Constant.Device.model, AdPreference.getModel())
params.put(Constant.Device.vn, com.ym.modulecommon.utils.SettingPreference.getVN()) params.put(Constant.Device.vn, AdPreference.getVN())
params.put(Constant.Device.ntt, com.ym.modulecommon.utils.SettingPreference.getNTT()) params.put(Constant.Device.ntt, AdPreference.getNTT())
params.put(Constant.Device.vc, com.ym.modulecommon.utils.SettingPreference.getVC()) params.put(Constant.Device.vc, AdPreference.getVC())
params.put(Constant.Device.source, com.ym.modulecommon.utils.SettingPreference.getSource()) params.put(Constant.Device.source, AdPreference.getSource())
params.put(Constant.Device.ua, com.ym.modulecommon.utils.SettingPreference.getUA()) params.put(Constant.Device.ua, AdPreference.getUA())
params.put(Constant.Device.svn, com.ym.modulecommon.utils.SettingPreference.getSVN()) params.put(Constant.Device.svn, AdPreference.getSVN())
params.put(Constant.Device.lat, com.ym.modulecommon.utils.SettingPreference.getLat()) params.put(Constant.Device.lat, AdPreference.getLat())
params.put(Constant.Device.lon, com.ym.modulecommon.utils.SettingPreference.getLon()) params.put(Constant.Device.lon, AdPreference.getLon())
params.put(Constant.Device.locationtype, com.ym.modulecommon.utils.SettingPreference.getLocationType()) params.put(Constant.Device.locationtype, AdPreference.getLocationType())
// params.put(Constant.Device.city, URLEncoder.encode(com.ym.modulecommon.utils.SettingPreference.getCity(), "utf-8")) // params.put(Constant.Device.city, URLEncoder.encode(com.ym.modulecommon.utils.SettingPreference.getCity(), "utf-8"))
params.put(Constant.Device.city, com.ym.modulecommon.utils.SettingPreference.getCity()) params.put(Constant.Device.city, AdPreference.getCity())
params.put( params.put(
"dip", "dip",
AppliContext.get()?.getResources()?.getDisplayMetrics()?.density.toString() AppliContext.get()?.getResources()?.getDisplayMetrics()?.density.toString()
) )
if (!TextUtils.isEmpty(com.ym.modulecommon.utils.SettingPreference.getUserAgent())) { if (!TextUtils.isEmpty(AdPreference.getUserAgent())) {
params.put("web-user-agent", com.ym.modulecommon.utils.SettingPreference.getUserAgent()) params.put("web-user-agent", AdPreference.getUserAgent())
} }
params.put("device_uuid", com.ym.modulecommon.utils.SettingPreference.getUUid()) params.put("device_uuid", AdPreference.getUUid())
return params return params
} }
...@@ -907,7 +908,7 @@ object PhoneUtils { ...@@ -907,7 +908,7 @@ object PhoneUtils {
builder.put("imei", Constant.Param.imei) builder.put("imei", Constant.Param.imei)
builder.put("user-agent", Constant.Param.userAgent) builder.put("user-agent", Constant.Param.userAgent)
builder.put("platform", "android") builder.put("platform", "android")
builder.put("env", com.ym.modulecommon.Constant.param.env) builder.put("env", Constant.Param.env)
builder.put("cv", Constant.Param.cv) builder.put("cv", Constant.Param.cv)
builder.put("lat", Constant.Param.lat) builder.put("lat", Constant.Param.lat)
builder.put("lon", Constant.Param.lon) builder.put("lon", Constant.Param.lon)
......
...@@ -8,14 +8,17 @@ import androidx.annotation.Nullable; ...@@ -8,14 +8,17 @@ import androidx.annotation.Nullable;
import com.ym.commen.module.VideoEntity; import com.ym.commen.module.VideoEntity;
import com.ym.library.Constant; import com.ym.library.Constant;
import com.ym.library.module.UserInfoEntity;
import com.ym.library.module.WithdrawCardEntity; import com.ym.library.module.WithdrawCardEntity;
import com.ym.library.module.WithdrawEntity; import com.ym.library.module.WithdrawEntity;
import com.ym.library.net.NovelInitEntity; import com.ym.library.net.NovelInitEntity;
import com.ym.modulecommon.AppliContext; import com.ym.modulecommon.AppliContext;
import com.ym.modulecommon.module.UserInfoEntity;
import java.util.List; import java.util.List;
import static com.ym.modulecommon.utils.AdPreference.setUid;
/** /**
* Created by gaoleichao on 2018/5/5. * Created by gaoleichao on 2018/5/5.
...@@ -845,29 +848,29 @@ public class SettingPreference { ...@@ -845,29 +848,29 @@ public class SettingPreference {
// editor.commit(); // editor.commit();
// } // }
// //
// // 保存登陆用户信息。 // 保存登陆用户信息。
// public static void saveUserInfo(UserInfoEntity userInfoData) { public static void saveUserInfo(UserInfoEntity userInfoData) {
// if (userInfoData == null) { if (userInfoData == null) {
// setUid(""); setUid("");
// } else { } else {
// setUid(userInfoData.getUid()); setUid(userInfoData.getUid());
//
// setAgeDate(userInfoData.getAge()); setAgeDate(userInfoData.getAge());
// String gender; String gender;
// if (TextUtils.equals(userInfoData.getSex(), "1")) if (TextUtils.equals(userInfoData.getSex(), "1"))
// gender = "男"; gender = "男";
// else { else {
// gender = "女"; gender = "女";
// } }
// setGenderDate(gender); setGenderDate(gender);
// setWeightDate(userInfoData.getWeight() + "kg"); setWeightDate(userInfoData.getWeight() + "kg");
// setHeightDate(userInfoData.getHeight() + "cm"); setHeightDate(userInfoData.getHeight() + "cm");
// setStepSettingType(userInfoData); setStepSettingType(userInfoData);
// } }
// SharedPreferences settings = AppliContext.get().getSharedPreferences(USER_SETTING, 0); SharedPreferences settings = AppliContext.get().getSharedPreferences(USER_SETTING, 0);
// SharedPreferences.Editor editor = settings.edit(); SharedPreferences.Editor editor = settings.edit();
// editor.putString(USER_INFO_KEY, null == userInfoData ? "" : Utils.obj2Str(userInfoData)).commit(); editor.putString(USER_INFO_KEY, null == userInfoData ? "" : Utils.obj2Str(userInfoData)).commit();
// } }
private static void setStepSettingType(UserInfoEntity userInfoData) { private static void setStepSettingType(UserInfoEntity userInfoData) {
String type = "1"; String type = "1";
......
...@@ -38,6 +38,7 @@ import androidx.core.content.ContextCompat; ...@@ -38,6 +38,7 @@ import androidx.core.content.ContextCompat;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.ym.modulecommon.AppliContext; import com.ym.modulecommon.AppliContext;
import com.ym.modulecommon.utils.AdPreference;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
...@@ -879,7 +880,7 @@ public class Utils { ...@@ -879,7 +880,7 @@ public class Utils {
public static boolean isLogin() { public static boolean isLogin() {
String token =com.ym.modulecommon.utils.SettingPreference.getToken(); String token = AdPreference.getToken();
if (TextUtils.isEmpty(token)) { if (TextUtils.isEmpty(token)) {
return false; return false;
} }
......
...@@ -10,7 +10,7 @@ object VideoNumberUtils { ...@@ -10,7 +10,7 @@ object VideoNumberUtils {
fun setVideoNumber(){ fun setVideoNumber(){
Constant.videoNumber = Constant.videoNumber+1 Constant.videoNumber = Constant.videoNumber+1
if (Constant.videoNumber < Constant.videoCount) { if (Constant.videoNumber < Constant.videoCount) {
ToastUtils.showTextToast("再观看${(Constant.videoCount - Constant.videoNumber)}个视频即可完成今日打卡") //ToastUtils.showTextToast("再观看${(Constant.videoCount - Constant.videoNumber)}个视频即可完成今日打卡")
} }
} }
......
...@@ -11,13 +11,14 @@ import com.umeng.socialize.UMShareConfig; ...@@ -11,13 +11,14 @@ import com.umeng.socialize.UMShareConfig;
import com.umeng.socialize.bean.SHARE_MEDIA; import com.umeng.socialize.bean.SHARE_MEDIA;
import com.ym.library.Constant; import com.ym.library.Constant;
import com.ym.library.R; import com.ym.library.R;
import com.ym.library.module.UserInfoEntity;
import com.ym.library.module.WxBindEntity; import com.ym.library.module.WxBindEntity;
import com.ym.library.net.ApiClient; import com.ym.library.net.ApiClient;
import com.ym.library.net.BaseObserver; import com.ym.library.net.BaseObserver;
import com.ym.library.net.RxSchedulers; import com.ym.library.net.RxSchedulers;
import com.ym.library.widget.LoadingDialog; import com.ym.library.widget.LoadingDialog;
import com.ym.modulecommon.AppliContext; import com.ym.modulecommon.AppliContext;
import com.ym.modulecommon.module.UserInfoEntity; import com.ym.modulecommon.utils.AdPreference;
import java.util.Map; import java.util.Map;
...@@ -80,7 +81,7 @@ public class WxImplUtils implements UMAuthListener { ...@@ -80,7 +81,7 @@ public class WxImplUtils implements UMAuthListener {
public void onSuccess(WxBindEntity result) { public void onSuccess(WxBindEntity result) {
Log.i(TAG, "onSuccess: " + result.getFlushToken()); Log.i(TAG, "onSuccess: " + result.getFlushToken());
if (result.getFlushToken() != null && !"".equals(result.getFlushToken())) { if (result.getFlushToken() != null && !"".equals(result.getFlushToken())) {
com.ym.modulecommon.utils.SettingPreference.setToken(result.getFlushToken()); AdPreference.setToken(result.getFlushToken());
UserInfoEntity user = SettingPreference.getUserInfoData(); UserInfoEntity user = SettingPreference.getUserInfoData();
if (user != null) { if (user != null) {
...@@ -88,7 +89,7 @@ public class WxImplUtils implements UMAuthListener { ...@@ -88,7 +89,7 @@ public class WxImplUtils implements UMAuthListener {
user.setHeadimgurl(data.get("iconurl")); user.setHeadimgurl(data.get("iconurl"));
user.setNickname(data.get("screen_name")); user.setNickname(data.get("screen_name"));
} }
com.ym.modulecommon.utils.SettingPreference.saveUserInfo(user); SettingPreference.saveUserInfo(user);
SettingPreference.saveUserInfoName(data.get("screen_name")); SettingPreference.saveUserInfoName(data.get("screen_name"));
mCallback.onWxSuccess(data.get("access_token"), data.get("openid")); mCallback.onWxSuccess(data.get("access_token"), data.get("openid"));
} else { } else {
...@@ -110,8 +111,8 @@ public class WxImplUtils implements UMAuthListener { ...@@ -110,8 +111,8 @@ public class WxImplUtils implements UMAuthListener {
str = errorMsg; str = errorMsg;
Constant.Param.uid = ""; Constant.Param.uid = "";
Constant.Param.token = ""; Constant.Param.token = "";
com.ym.modulecommon.utils.SettingPreference.setToken(""); AdPreference.setToken("");
com.ym.modulecommon.utils.SettingPreference.saveUserInfo(null); SettingPreference.saveUserInfo(null);
mLoading.setResult(false, str, 1000); mLoading.setResult(false, str, 1000);
mLoading.dismiss(); mLoading.dismiss();
// mCallback.onWxFail(errorMsg); // mCallback.onWxFail(errorMsg);
......
...@@ -3,7 +3,6 @@ package com.ym.library.wechat ...@@ -3,7 +3,6 @@ package com.ym.library.wechat
import com.ym.library.module.* import com.ym.library.module.*
import com.ym.library.net.NetConfig import com.ym.library.net.NetConfig
import com.ym.library.net.Response import com.ym.library.net.Response
import com.ym.modulecommon.module.UserInfoEntity
import io.reactivex.Observable import io.reactivex.Observable
import okhttp3.ResponseBody import okhttp3.ResponseBody
import retrofit2.http.* import retrofit2.http.*
...@@ -24,13 +23,13 @@ interface IUserInfoApi { ...@@ -24,13 +23,13 @@ interface IUserInfoApi {
/** // /**
* 微信提现 // * 微信提现
* // *
* @return // * @return
*/ // */
@POST(NetConfig.Withdraw.URL_USER_GS_DO_WD) // @POST(NetConfig.Withdraw.URL_USER_GS_DO_WD)
fun getUserWxWithdraw(@Query("wdId") wdId: Int): Observable<Response<WithdrawEntity>> // fun getUserWxWithdraw(@Query("wdId") wdId: Int): Observable<Response<WithdrawEntity>>
/** /**
......
...@@ -5,6 +5,7 @@ import com.ym.library.Constant ...@@ -5,6 +5,7 @@ import com.ym.library.Constant
import com.ym.library.net.NetConfig import com.ym.library.net.NetConfig
import com.ym.library.utils.PhoneUtils import com.ym.library.utils.PhoneUtils
import com.ym.library.utils.SettingPreference import com.ym.library.utils.SettingPreference
import com.ym.modulecommon.utils.AdPreference
import okhttp3.* import okhttp3.*
import okhttp3.logging.HttpLoggingInterceptor import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
...@@ -32,12 +33,12 @@ object UserApiClient { ...@@ -32,12 +33,12 @@ object UserApiClient {
private val headInterceptor = Interceptor { chain -> private val headInterceptor = Interceptor { chain ->
val request = chain.request() val request = chain.request()
val builder = request.newBuilder() val builder = request.newBuilder()
builder.addHeader(Constant.aid, com.ym.modulecommon.utils.SettingPreference.getAndroidId()) builder.addHeader(Constant.aid, AdPreference.getAndroidId())
builder.addHeader(Constant.Device.env, Constant.Param.env) builder.addHeader(Constant.Device.env, Constant.Param.env)
if (!TextUtils.isEmpty(com.ym.modulecommon.utils.SettingPreference.getUserAgent())) { if (!TextUtils.isEmpty(AdPreference.getUserAgent())) {
builder.addHeader("web-user-agent", com.ym.modulecommon.utils.SettingPreference.getUserAgent()) builder.addHeader("web-user-agent", AdPreference.getUserAgent())
builder.removeHeader("User-Agent") builder.removeHeader("User-Agent")
builder.addHeader("User-Agent", com.ym.modulecommon.utils.SettingPreference.getUserAgent()) builder.addHeader("User-Agent", AdPreference.getUserAgent())
} }
val headers: Request = builder.build() val headers: Request = builder.build()
chain.proceed(headers) chain.proceed(headers)
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
android:background="@drawable/icon_base_dialog_cash_bg"> android:background="@drawable/icon_base_dialog_cash_bg">
<com.ym.library.widget.FontTextView <com.ym.library.widget.FontTextView
android:id="@+id/id_getcash_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:gravity="center"
android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="328dp"
android:layout_height="274dp"
android:layout_marginTop="6dp"
android:layout_marginRight="5dp"
android:background="@drawable/icon_base_dialog_bg">
<com.ym.library.widget.FontTextView
android:id="@+id/tv_withdraw_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="6dp"
android:textColor="@color/white"
android:textSize="22sp"
android:text="完成1级订单"/>
<TextView
android:id="@+id/id_tv_cash_content"
android:text="恭喜获得0.3元提现机会"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginLeft="40dp"
android:layout_marginTop="117dp"
android:layout_marginRight="40dp"
android:gravity="center"
android:includeFontPadding="false"
android:lineSpacingExtra="5dp"
android:textColor="#095100"
android:textSize="17sp"
android:visibility="visible" />
<ImageView
android:id="@+id/img_liji_tixian"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:src="@drawable/icon_liji_tixian"
/>
</RelativeLayout>
<ImageView
android:id="@+id/id_img_dialog_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:src="@drawable/icon_base_dialog_close"
android:visibility="gone"/>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
...@@ -12,14 +12,16 @@ import androidx.recyclerview.widget.GridLayoutManager ...@@ -12,14 +12,16 @@ import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import com.umeng.socialize.UMShareAPI import com.umeng.socialize.UMShareAPI
import com.ym.library.listener.OnRecycleItemClickListener import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.library.module.UserInfoEntity
import com.ym.library.module.WithdrawEntity import com.ym.library.module.WithdrawEntity
import com.ym.library.net.BaseActivity import com.ym.library.net.BaseActivity
import com.ym.modulecommon.module.UserInfoEntity
import com.ym.library.rxbus.RxBusConstant import com.ym.library.rxbus.RxBusConstant
import com.ym.library.rxbus.Subscribe import com.ym.library.rxbus.Subscribe
import com.ym.library.rxbus.ThreadMode import com.ym.library.rxbus.ThreadMode
import com.ym.library.utils.* import com.ym.library.utils.*
import com.ym.library.utils.SettingPreference.getUserInfoData
import com.ym.module.userinfo.R import com.ym.module.userinfo.R
import com.ym.modulecommon.utils.AdPreference
import com.ym.userinfo.module.adapter.WithdrawAdapter import com.ym.userinfo.module.adapter.WithdrawAdapter
import com.ym.userinfo.module.contract.UserContract import com.ym.userinfo.module.contract.UserContract
import com.ym.userinfo.module.entity.LotteryEntity import com.ym.userinfo.module.entity.LotteryEntity
...@@ -275,7 +277,7 @@ class UserInfoActivity : BaseActivity(), View.OnClickListener, ...@@ -275,7 +277,7 @@ class UserInfoActivity : BaseActivity(), View.OnClickListener,
} }
override fun setUserGold(data: UserInfoEntity) { override fun setUserGold(data: UserInfoEntity) {
// RxBusUtil.getDefault().send(RxBusConstant.RX_MAIN_ACTIVITY_TITLE, Constant.textInfo) // RxBusUtil.getDefault().send(RxBusConstant.RX_MAIN_ACTIVITY_TITLE, Constant.textInfo)
if (data != null) { if (data != null) {
if (isRefresh) { if (isRefresh) {
refresh_user_layout?.isRefreshing = false refresh_user_layout?.isRefreshing = false
...@@ -287,18 +289,22 @@ class UserInfoActivity : BaseActivity(), View.OnClickListener, ...@@ -287,18 +289,22 @@ class UserInfoActivity : BaseActivity(), View.OnClickListener,
} }
} }
override fun setUserGoldFailure() { override fun setUserGoldFailure() {
if (isRefresh) { if (isRefresh) {
refresh_user_layout?.isRefreshing = false refresh_user_layout?.isRefreshing = false
} }
} }
//微信是否绑定 //微信是否绑定
override fun wxBindSuccess(data: UserInfoEntity) { override fun wxBindSuccess(data: UserInfoEntity) {
if (data?.isBind == true) { if (data?.isBind == true) {
val userInfoData = com.ym.modulecommon.utils.SettingPreference.getUserInfoData() val userInfoData = SettingPreference.getUserInfoData()
userInfoData.isBind = true userInfoData.isBind = true
com.ym.modulecommon.utils.SettingPreference.saveUserInfo(userInfoData) SettingPreference.saveUserInfo(userInfoData)
if (isWithdrawLottery) { if (isWithdrawLottery) {
if (sessionId != "") { if (sessionId != "") {
isWithdrawLottery = false isWithdrawLottery = false
...@@ -353,6 +359,9 @@ class UserInfoActivity : BaseActivity(), View.OnClickListener, ...@@ -353,6 +359,9 @@ class UserInfoActivity : BaseActivity(), View.OnClickListener,
Toast.makeText(this, errorMsg, Toast.LENGTH_SHORT).show() Toast.makeText(this, errorMsg, Toast.LENGTH_SHORT).show()
} }
override fun userMindSuccess(data: UserInfoEntity) { override fun userMindSuccess(data: UserInfoEntity) {
tv_user_precautions?.text = data.title tv_user_precautions?.text = data.title
tv_user_precaution1?.text = data.mind tv_user_precaution1?.text = data.mind
......
package com.ym.userinfo.module.contract package com.ym.userinfo.module.contract
import com.ym.library.module.UserInfoEntity
import com.ym.library.module.WithdrawEntity import com.ym.library.module.WithdrawEntity
import com.ym.modulecommon.module.UserInfoEntity
import com.ym.userinfo.module.entity.LotteryEntity import com.ym.userinfo.module.entity.LotteryEntity
/** /**
......
...@@ -3,7 +3,6 @@ package com.ym.userinfo.module.net ...@@ -3,7 +3,6 @@ package com.ym.userinfo.module.net
import com.ym.library.module.* import com.ym.library.module.*
import com.ym.library.net.NetConfig import com.ym.library.net.NetConfig
import com.ym.library.net.Response import com.ym.library.net.Response
import com.ym.modulecommon.module.UserInfoEntity
import com.ym.userinfo.module.entity.LotteryEntity import com.ym.userinfo.module.entity.LotteryEntity
import io.reactivex.Observable import io.reactivex.Observable
import okhttp3.ResponseBody import okhttp3.ResponseBody
......
...@@ -5,6 +5,7 @@ import com.ym.library.Constant ...@@ -5,6 +5,7 @@ import com.ym.library.Constant
import com.ym.library.net.NetConfig import com.ym.library.net.NetConfig
import com.ym.library.utils.PhoneUtils import com.ym.library.utils.PhoneUtils
import com.ym.library.utils.SettingPreference import com.ym.library.utils.SettingPreference
import com.ym.modulecommon.utils.AdPreference
import okhttp3.* import okhttp3.*
import okhttp3.logging.HttpLoggingInterceptor import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
...@@ -32,12 +33,12 @@ object UserApiClient { ...@@ -32,12 +33,12 @@ object UserApiClient {
private val headInterceptor = Interceptor { chain -> private val headInterceptor = Interceptor { chain ->
val request = chain.request() val request = chain.request()
val builder = request.newBuilder() val builder = request.newBuilder()
builder.addHeader(Constant.aid, com.ym.modulecommon.utils.SettingPreference.getAndroidId()) builder.addHeader(Constant.aid, AdPreference.getAndroidId())
builder.addHeader(Constant.Device.env, Constant.Param.env) builder.addHeader(Constant.Device.env, Constant.Param.env)
if (!TextUtils.isEmpty(com.ym.modulecommon.utils.SettingPreference.getUserAgent())) { if (!TextUtils.isEmpty(AdPreference.getUserAgent())) {
builder.addHeader("web-user-agent", com.ym.modulecommon.utils.SettingPreference.getUserAgent()) builder.addHeader("web-user-agent", AdPreference.getUserAgent())
builder.removeHeader("User-Agent") builder.removeHeader("User-Agent")
builder.addHeader("User-Agent", com.ym.modulecommon.utils.SettingPreference.getUserAgent()) builder.addHeader("User-Agent", AdPreference.getUserAgent())
} }
val headers: Request = builder.build() val headers: Request = builder.build()
chain.proceed(headers) chain.proceed(headers)
......
package com.ym.userinfo.module.presenter package com.ym.userinfo.module.presenter
import com.ym.library.module.BaseWithdrawEntity import com.ym.library.module.BaseWithdrawEntity
import com.ym.library.module.UserInfoEntity
import com.ym.library.module.WithdrawEntity import com.ym.library.module.WithdrawEntity
import com.ym.library.net.BaseObserver import com.ym.library.net.BaseObserver
import com.ym.library.net.RxSchedulers import com.ym.library.net.RxSchedulers
import com.ym.modulecommon.module.UserInfoEntity import com.ym.modulecommon.utils.AdPreference
import com.ym.userinfo.module.contract.UserContract import com.ym.userinfo.module.contract.UserContract
import com.ym.userinfo.module.entity.LotteryEntity import com.ym.userinfo.module.entity.LotteryEntity
import com.ym.userinfo.module.net.UserApiClient import com.ym.userinfo.module.net.UserApiClient
...@@ -88,7 +89,7 @@ class UserPresenter : UserContract.Presenter { ...@@ -88,7 +89,7 @@ class UserPresenter : UserContract.Presenter {
//微信是否绑定 //微信是否绑定
override fun requestIsWxBind() { override fun requestIsWxBind() {
val token =com.ym.modulecommon.utils.SettingPreference.getToken() val token = AdPreference.getToken()
UserApiClient.userApi.getIsBindWithdrawWx(token) UserApiClient.userApi.getIsBindWithdrawWx(token)
.compose(RxSchedulers.observableIO2Main()) .compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<UserInfoEntity>() { .subscribe(object : BaseObserver<UserInfoEntity>() {
......
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