Commit 228ee11e authored by 张释方's avatar 张释方

添加限时福利

parent 60de44cc
...@@ -319,10 +319,8 @@ ...@@ -319,10 +319,8 @@
android:noHistory="true"> android:noHistory="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="tencent1111016251" /> <data android:scheme="tencent1111016251" />
</intent-filter> </intent-filter>
</activity> </activity>
......
...@@ -218,6 +218,8 @@ object Constant { ...@@ -218,6 +218,8 @@ object Constant {
const val HOT_ACTIVITY_CPD = "TO_CPD" const val HOT_ACTIVITY_CPD = "TO_CPD"
const val HOT_ACTIVITY_CALLSHOW = "TO_CALLSHOW" const val HOT_ACTIVITY_CALLSHOW = "TO_CALLSHOW"
const val HOT_ACTIVITY_MOKU = "TO_MOKU" const val HOT_ACTIVITY_MOKU = "TO_MOKU"
const val HOT_ACTIVITY_GZH = "showedWechatTips"
// 打开激活 // 打开激活
const val FIRST_DEVICE_FLAG = "first_device_flag" const val FIRST_DEVICE_FLAG = "first_device_flag"
......
package com.mints.goodmoney.mvp.model; package com.mints.goodmoney.mvp.model;
public class FlActivityBean { import java.io.Serializable;
} import java.util.List;
public class FlActivityBean implements Serializable {
private List<FlActivityBean.ActiveTipsConfigDTO> activeTipsConfig;
public List<FlActivityBean.ActiveTipsConfigDTO> getActiveTipsConfig() {
return activeTipsConfig;
}
public void setActiveTipsConfig(List<FlActivityBean.ActiveTipsConfigDTO> activeTipsConfig) {
this.activeTipsConfig = activeTipsConfig;
}
public class ActiveTipsConfigDTO implements Serializable {
private String title;
private String context;
private String url;
private String key;
private String activeKey;
private String hotTitle;
private ParmasDTO parmas;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContext() {
return context;
}
public void setContext(String context) {
this.context = context;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getActiveKey() {
return activeKey;
}
public void setActiveKey(String activeKey) {
this.activeKey = activeKey;
}
public String getHotTitle() {
return hotTitle;
}
public void setHotTitle(String hotTitle) {
this.hotTitle = hotTitle;
}
public ParmasDTO getParmas() {
return parmas;
}
public void setParmas(ParmasDTO parmas) {
this.parmas = parmas;
}
public class ParmasDTO implements Serializable {
private String xmPlaceIdInTurn;
private String title;
public String getXmPlaceIdInTurn() {
return xmPlaceIdInTurn;
}
public void setXmPlaceIdInTurn(String xmPlaceIdInTurn) {
this.xmPlaceIdInTurn = xmPlaceIdInTurn;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
}
}
\ No newline at end of file
...@@ -7,10 +7,7 @@ import com.mints.goodmoney.common.DeviceInfo ...@@ -7,10 +7,7 @@ import com.mints.goodmoney.common.DeviceInfo
import com.mints.goodmoney.manager.AppHttpManager import com.mints.goodmoney.manager.AppHttpManager
import com.mints.goodmoney.manager.ShumeiManager import com.mints.goodmoney.manager.ShumeiManager
import com.mints.goodmoney.manager.UserManager import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.BaseResponse import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.model.MainVideoMsgBean
import com.mints.goodmoney.mvp.model.UserBean
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
import com.mints.goodmoney.mvp.views.HomeView import com.mints.goodmoney.mvp.views.HomeView
import com.mints.goodmoney.utils.DeviceUuidFactory import com.mints.goodmoney.utils.DeviceUuidFactory
import com.mints.goodmoney.utils.IPUtil import com.mints.goodmoney.utils.IPUtil
...@@ -23,6 +20,39 @@ import java.util.* ...@@ -23,6 +20,39 @@ import java.util.*
class HomePresenter : BasePresenter<HomeView>() { class HomePresenter : BasePresenter<HomeView>() {
/**
* 获取限时福利活动数据
*/
fun canActiveListMsg(){
AppHttpManager.getInstance(loanApplication)
.call(loanService.canActiveListMsg(),
object : BaseSubscriber<BaseResponse<FlActivityBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<FlActivityBean>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
when (code) {
200 -> view.getFlActivityMsg(baseResponse.getData())
else -> {
view.showToast(message)
}
}
}
})
}
/** /**
* 打开激活 * 打开激活
*/ */
...@@ -82,12 +112,17 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -82,12 +112,17 @@ class HomePresenter : BasePresenter<HomeView>() {
view.getHallBaseMsgFail() view.getHallBaseMsgFail()
} }
override fun onNext(baseResponse: BaseResponse<UserTaskMsgBean>) { override fun onNext(baseResponse: BaseResponse<UserTaskMsgBean>) {
if (isLinkView) return if (isLinkView) return
val code = baseResponse.getStatus() val code = baseResponse.getStatus()
val message = baseResponse.getMessage() val message = baseResponse.getMessage()
when (code) { when (code) {
200 -> view.getHallBaseMsgSuc(baseResponse.getData()) 200 -> {
canActiveListMsg()
view.getHallBaseMsgSuc(baseResponse.getData())
}
else -> { else -> {
view.showToast(message) view.showToast(message)
} }
...@@ -250,4 +285,38 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -250,4 +285,38 @@ class HomePresenter : BasePresenter<HomeView>() {
} }
}) })
} }
/**
* 限时福利参数传递
*/
fun activeGuidanceTips(status: Int,activeKey:String) {
val vo = HashMap<String, Any>()
vo["status"] = status
vo["activeKey"]=activeKey
AppHttpManager.getInstance(loanApplication)
.call(loanService.activeGuidanceTips(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
val code: Int = baseResponse.getStatus()
val message: String = baseResponse.getMessage()
when (code) {
200 -> {
}
else -> {
view.showToast(message)
}
}
}
})
}
} }
\ No newline at end of file
package com.mints.goodmoney.mvp.views package com.mints.goodmoney.mvp.views
import com.mints.goodmoney.mvp.model.FlActivityBean
import com.mints.goodmoney.mvp.model.MainVideoMsgBean import com.mints.goodmoney.mvp.model.MainVideoMsgBean
import com.mints.goodmoney.mvp.model.UserTaskMsgBean import com.mints.goodmoney.mvp.model.UserTaskMsgBean
...@@ -8,4 +9,5 @@ interface HomeView : BaseView { ...@@ -8,4 +9,5 @@ interface HomeView : BaseView {
fun getHallBaseMsgSuc(data: UserTaskMsgBean) fun getHallBaseMsgSuc(data: UserTaskMsgBean)
fun getHallBaseMsgFail() fun getHallBaseMsgFail()
fun getHomeVedioMsgSuc(data: MainVideoMsgBean) fun getHomeVedioMsgSuc(data: MainVideoMsgBean)
fun getFlActivityMsg(data: FlActivityBean)
} }
...@@ -11,6 +11,7 @@ import com.mints.goodmoney.mvp.model.ClickTurnBean; ...@@ -11,6 +11,7 @@ import com.mints.goodmoney.mvp.model.ClickTurnBean;
import com.mints.goodmoney.mvp.model.CommonParamBean; import com.mints.goodmoney.mvp.model.CommonParamBean;
import com.mints.goodmoney.mvp.model.DrawcashBean; import com.mints.goodmoney.mvp.model.DrawcashBean;
import com.mints.goodmoney.mvp.model.DrawcashRecordBean; import com.mints.goodmoney.mvp.model.DrawcashRecordBean;
import com.mints.goodmoney.mvp.model.FlActivityBean;
import com.mints.goodmoney.mvp.model.FriendHallMsgBean; import com.mints.goodmoney.mvp.model.FriendHallMsgBean;
import com.mints.goodmoney.mvp.model.GoldRecordBean; import com.mints.goodmoney.mvp.model.GoldRecordBean;
import com.mints.goodmoney.mvp.model.KylBean; import com.mints.goodmoney.mvp.model.KylBean;
...@@ -631,6 +632,14 @@ public interface LoanService { ...@@ -631,6 +632,14 @@ public interface LoanService {
@POST("api/setWechatTipsStatus") @POST("api/setWechatTipsStatus")
Observable<BaseResponse<JsonObject>> setWechatTipsStatus(@Body Map<String, Object> vo); Observable<BaseResponse<JsonObject>> setWechatTipsStatus(@Body Map<String, Object> vo);
/**
* 传递判断参数(限时福利弹框)
*/
@POST("api/activeGuidanceTips")
Observable<BaseResponse<JsonObject>> activeGuidanceTips(@Body Map<String, Object> vo);
@POST("api/canActiveListMsg")
Observable<BaseResponse<FlActivityBean>> canActiveListMsg();
/** /**
* 获取权重信息 * 获取权重信息
* *
......
package com.mints.goodmoney.ui.fragment package com.mints.goodmoney.ui.fragment
import android.Manifest
import android.app.Dialog import android.app.Dialog
import android.content.* import android.content.*
import android.os.Bundle import android.os.Bundle
...@@ -14,8 +15,10 @@ import androidx.fragment.app.FragmentTransaction ...@@ -14,8 +15,10 @@ import androidx.fragment.app.FragmentTransaction
import com.daimajia.androidanimations.library.Techniques import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo import com.daimajia.androidanimations.library.YoYo
import com.daimajia.androidanimations.library.YoYo.YoYoString import com.daimajia.androidanimations.library.YoYo.YoYoString
import com.fly.scenemodule.SceneUtil
import com.mints.goodmoney.MintsApplication import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.ad.express.ExpressManager
import com.mints.goodmoney.ad.express.GroMoreExpressManager import com.mints.goodmoney.ad.express.GroMoreExpressManager
import com.mints.goodmoney.ad.express.PreLoadExpressManager import com.mints.goodmoney.ad.express.PreLoadExpressManager
import com.mints.goodmoney.ad.express.TTPreLoadExpressXmlyManager import com.mints.goodmoney.ad.express.TTPreLoadExpressXmlyManager
...@@ -23,14 +26,11 @@ import com.mints.goodmoney.ad.video.VideoAdingManager ...@@ -23,14 +26,11 @@ import com.mints.goodmoney.ad.video.VideoAdingManager
import com.mints.goodmoney.common.AppConfig import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.* import com.mints.goodmoney.manager.*
import com.mints.goodmoney.mvp.model.BaseResponse import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.model.FlowAdRulesBean
import com.mints.goodmoney.mvp.model.MainVideoMsgBean
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
import com.mints.goodmoney.mvp.presenters.HomePresenter import com.mints.goodmoney.mvp.presenters.HomePresenter
import com.mints.goodmoney.mvp.views.HomeView import com.mints.goodmoney.mvp.views.HomeView
import com.mints.goodmoney.ui.activitys.AwardActivity import com.mints.goodmoney.ui.activitys.*
import com.mints.goodmoney.ui.activitys.WebActivity import com.mints.goodmoney.ui.adapter.MainMyAdapter
import com.mints.goodmoney.ui.fragment.base.BaseFragment import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.ui.widgets.countdowntimer.CountDownTimerSupport import com.mints.goodmoney.ui.widgets.countdowntimer.CountDownTimerSupport
import com.mints.goodmoney.ui.widgets.countdowntimer.OnCountDownTimerListener import com.mints.goodmoney.ui.widgets.countdowntimer.OnCountDownTimerListener
...@@ -41,11 +41,13 @@ import com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils ...@@ -41,11 +41,13 @@ import com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils
import com.mints.goodmoney.utils.LogUtil import com.mints.goodmoney.utils.LogUtil
import com.mints.goodmoney.utils.TimeRender import com.mints.goodmoney.utils.TimeRender
import com.mints.library.utils.CommonUtils import com.mints.library.utils.CommonUtils
import com.tbruyelle.rxpermissions.RxPermissions
import com.yilan.sdk.player.ylplayer.YLPlayerConfig import com.yilan.sdk.player.ylplayer.YLPlayerConfig
import com.yilan.sdk.player.ylplayer.callback.OnPlayerCallBack import com.yilan.sdk.player.ylplayer.callback.OnPlayerCallBack
import com.yilan.sdk.ui.configs.YLUIConfig import com.yilan.sdk.ui.configs.YLUIConfig
import com.yilan.sdk.ui.little.YLLittleVideoFragment import com.yilan.sdk.ui.little.YLLittleVideoFragment
import com.yilan.sdk.ylad.YLAdListener import com.yilan.sdk.ylad.YLAdListener
import kotlinx.android.synthetic.main.item_fragment_main_my_promotions.*
import kotlinx.android.synthetic.main.layout_red_bag.* import kotlinx.android.synthetic.main.layout_red_bag.*
import kotlinx.android.synthetic.main.layout_red_box.* import kotlinx.android.synthetic.main.layout_red_box.*
import net.grandcentrix.tray.AppPreferences import net.grandcentrix.tray.AppPreferences
...@@ -91,11 +93,23 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -91,11 +93,23 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 公众号弹窗 true-显示 // 公众号弹窗 true-显示
private var gzhDialogFlag = true private var gzhDialogFlag = true
// 限时福利弹窗 true-显示
private var flDialogFlag = true
// 任务数据
private val dataList: MutableList<MyInfo.AutoListBean> = mutableListOf()
// 当天签到金币
private var carrierType = ""
override fun getContentViewLayoutID() = R.layout.fragment_main_first override fun getContentViewLayoutID() = R.layout.fragment_main_first
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
homePresenter.attachView(this) homePresenter.attachView(this)
//活动初始化
initManager()
videoAdingManager = VideoAdingManager.getInstance(activity) videoAdingManager = VideoAdingManager.getInstance(activity)
// 奖励页预加载 信息流广告 // 奖励页预加载 信息流广告
PreLoadExpressManager.loadADFrameLayout() PreLoadExpressManager.loadADFrameLayout()
...@@ -119,6 +133,20 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -119,6 +133,20 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
innerApp() innerApp()
} }
private fun initManager() {
//登录成功
if (!TextUtils.isEmpty(userManager.userID)) {
// 登录成功的用户初始化愉悦赚
if (userManager.userIsLogin()) {
YyzManager.initYyz()
}
}
//初始化魔窟
if (!TextUtils.isEmpty(MintsApplication.OAID)) {
MokuManager.initOaid(MintsApplication.OAID)
}
}
private fun innerApp() { private fun innerApp() {
if (userManager.userIsLogin()) { if (userManager.userIsLogin()) {
homePresenter.getNetWorkIp() homePresenter.getNetWorkIp()
...@@ -221,8 +249,9 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -221,8 +249,9 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
if (activity == null || requireActivity().isFinishing) { if (activity == null || requireActivity().isFinishing) {
return return
} }
// 公众号弹框 // // 公众号弹框
GzhDialogShow(data) // GzhDialogShow(data)
userMsgBean = data userMsgBean = data
...@@ -310,6 +339,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -310,6 +339,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
} }
} }
/**
* 限时福利回调方法
*/
override fun getFlActivityMsg(data: FlActivityBean) {
//限时福利弹框
FlDialogShow(data.activeTipsConfig)
}
override fun onClick(v: View) { override fun onClick(v: View) {
when (v.id) { when (v.id) {
R.id.rl_fragment_main_redbox -> { R.id.rl_fragment_main_redbox -> {
...@@ -334,18 +371,18 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -334,18 +371,18 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
} }
} }
/** // /**
* 公众号弹出(判断) // * 公众号弹出(判断)
*/ // */
private fun GzhDialogShow(data: UserTaskMsgBean) { // private fun GzhDialogShow(data: UserTaskMsgBean) {
//用户 第二天打开应用并且非重新下载安装 // //用户 第二天打开应用并且非重新下载安装
if (data.isShowWechatTips && !ps.getBoolean(Constant.LOAN_PERMISSION_FLAG, true) && gzhDialogFlag) { // if (data.isShowWechatTips && !ps.getBoolean(Constant.LOAN_PERMISSION_FLAG, true) && gzhDialogFlag) {
gzhDialogFlag = false // gzhDialogFlag = false
gzhDialog() // gzhDialog()
//服务器交互,做回调 //弹窗打开传入1 // //服务器交互,做回调 //弹窗打开传入1
homePresenter.setWechatTipsStatus(Constant.STATUS_CODE_ONE) // homePresenter.setWechatTipsStatus(Constant.STATUS_CODE_ONE)
} // }
} // }
private fun showPowerDialog() { private fun showPowerDialog() {
if (ps.getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) { if (ps.getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) {
...@@ -360,6 +397,153 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -360,6 +397,153 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
} }
} }
/**
* 参加活动弹框
*/
private fun FlDialogShow(flList: MutableList<FlActivityBean.ActiveTipsConfigDTO>?) {
//活动是否存在(存在弹框,不存在不弹框),有活动 判断打开应用后是否已经弹框过 , 是否是在权限弹框弹出后 再弹出
if (flList != null && flList.size > 0 &&
!ps.getBoolean(Constant.LOAN_PERMISSION_FLAG, true) && flDialogFlag) {
//服务器交互,做回调 //弹窗打开传入1
homePresenter.activeGuidanceTips(Constant.STATUS_CODE_ONE, flList[0].activeKey)
flDialog(flList)
flDialogFlag = false//再次打开应用继续弹框
}
}
/**
* 限时福利弹框点击响应
*/
private fun flDialog(flList: MutableList<FlActivityBean.ActiveTipsConfigDTO>) {
DialogUtils.showFlDialog(
flList[0], requireActivity(),
object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
when (v?.id) {
R.id.tv_focus -> {//参与活动
val flhost: FlActivityBean.ActiveTipsConfigDTO = flList[0]
//服务器交互,做回调 //弹窗后今日不在弹出传入2
if (!TextUtils.isEmpty(flhost.key)) {
when (flhost.key) {
//公众号弹窗
Constant.HOT_ACTIVITY_GZH -> {
gzhDialog()
}
Constant.HOT_ACTIVITY_WATER -> {
ExpressManager.loadExpress()
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
readyGo(WaterActivity::class.java)
homePresenter.activeGuidanceTips(Constant.STATUS_CODE_TWO, Constant.HOT_ACTIVITY_WATER)
}
Constant.HOT_ACTIVITY_WALK -> {
ExpressManager.loadExpress()
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK)
readyGo(WalkActivity::class.java)
homePresenter.activeGuidanceTips(Constant.STATUS_CODE_TWO, Constant.HOT_ACTIVITY_WALK)
}
Constant.HOT_ACTIVITY_CARD -> {
readyGo(EraseActivity::class.java)
homePresenter.activeGuidanceTips(Constant.STATUS_CODE_TWO, Constant.HOT_ACTIVITY_CARD)
}
Constant.HOT_ACTIVITY_LIEBAO -> {
readyGo(LiebaoGameActivity::class.java)
homePresenter.activeGuidanceTips(Constant.STATUS_CODE_TWO, Constant.HOT_ACTIVITY_LIEBAO)
}
Constant.HOT_ACTIVITY_MORNINGCLOCK -> {
ExpressManager.loadExpress()
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_MORNINGCLOCK)
readyGo(MorningClockActivity::class.java)
homePresenter.activeGuidanceTips(Constant.STATUS_CODE_TWO, Constant.HOT_ACTIVITY_MORNINGCLOCK)
}
Constant.HOT_ACTIVITY_YYZ -> {
// 愉悦赚事件
if (!userManager.userIsLogin()) {
// dialog?.dismiss()
readyGo(WxLoginActivity::class.java)
return
}
YyzManager.openYyzTask(requireActivity())
homePresenter.activeGuidanceTips(Constant.STATUS_CODE_TWO, Constant.HOT_ACTIVITY_YYZ)
}
Constant.HOT_ACTIVITY_EAT -> {
ExpressManager.loadExpress()
// TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_EAT)
readyGo(FoodSubsidyActivity::class.java)
homePresenter.activeGuidanceTips(Constant.STATUS_CODE_TWO, Constant.HOT_ACTIVITY_EAT)
}
Constant.HOT_ACTIVITY_SHARE_NEWS -> {
if (!userManager.userIsLogin()) {
// dialog?.dismiss()
readyGo(WxLoginActivity::class.java)
return
}
shareArticle(300)
homePresenter.activeGuidanceTips(Constant.STATUS_CODE_TWO, Constant.HOT_ACTIVITY_SHARE_NEWS)
}
Constant.HOT_ACTIVITY_CPD -> {
if (!UserManager.getInstance().userIsLogin()) {
// dialog?.dismiss()
readyGo(WxLoginActivity::class.java)
return
}
carrierType = ""
readyGo(TaskCpdActivity::class.java)
homePresenter.activeGuidanceTips(Constant.STATUS_CODE_TWO, Constant.HOT_ACTIVITY_CPD)
}
Constant.HOT_ACTIVITY_MOKU -> {//截图任务
gotoMoku()
homePresenter.activeGuidanceTips(Constant.STATUS_CODE_TWO, Constant.HOT_ACTIVITY_MOKU)
}
else -> {
if (!TextUtils.isEmpty(flhost.key) && !TextUtils.isEmpty(flhost.title)) {
val bundle = Bundle()
bundle.putString(WebActivity.WEB_TITLE, flhost.title)
bundle.putString(WebActivity.WEB_URL, flhost.key)
readyGo(WebActivity::class.java, bundle)
}
}
}
}
dialog?.dismiss()
}
R.id.iv_Close -> {
//关闭当前界面
dialog?.dismiss()
}
}
}
})
}
private fun gotoMoku() {
RxPermissions(requireActivity())
.request(Manifest.permission.READ_PHONE_STATE,
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE)
.subscribe { granted: Boolean ->
if (granted) {
MokuManager.gotoMoku(requireContext())
if (ps.getBoolean(Constant.MOKU_FLAG_GUIDE, true)) {
readyGo(MokuGuideActivity::class.java)
ps.put(Constant.MOKU_FLAG_GUIDE, false)
}
} else {
showMissingPermissionDialog("设备,存储")
}
}
}
private fun shareArticle(coin: Int) {
val bundle = Bundle()
bundle.putInt(Constant.WRAPPER_TYPE, Constant.WRAPPER_TYPE_WZ)
readyGo(WrapperActivity::class.java, bundle)
}
/** /**
* 一览视频初始化 * 一览视频初始化
*/ */
...@@ -573,15 +757,13 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -573,15 +757,13 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
} }
R.id.tv_subscribe -> {//我已订阅 R.id.tv_subscribe -> {//我已订阅
//关闭当前页面 //关闭当前页面
//并不在提示当前弹窗
if (activity != null && !activity!!.isFinishing && dialog != null && dialog.isShowing) { if (activity != null && !activity!!.isFinishing && dialog != null && dialog.isShowing) {
dialog.dismiss() dialog.dismiss()
homePresenter.setWechatTipsStatus(Constant.STATUS_CODE_TWO) // homePresenter.setWechatTipsStatus(Constant.STATUS_CODE_TWO)
} }
} }
R.id.iv_Close -> { R.id.iv_Close -> {
//关闭当前界面 //关闭当前界面
//关闭后当天不在显示
if (activity != null && !activity!!.isFinishing && dialog != null && dialog.isShowing) { if (activity != null && !activity!!.isFinishing && dialog != null && dialog.isShowing) {
dialog.dismiss() dialog.dismiss()
} }
......
...@@ -1262,10 +1262,8 @@ class MyFragment : BaseFragment(), ...@@ -1262,10 +1262,8 @@ class MyFragment : BaseFragment(),
private fun initManager() { private fun initManager() {
BannerManager.init() BannerManager.init()
videoAdingManager = VideoAdingManager.getInstance(activity) videoAdingManager = VideoAdingManager.getInstance(activity)
LogUtil.d("lixianshouyi", "进入到initManager。。。。。。。。。。。。。。。。。。。。。。。。。。")
//登录成功 //登录成功
if (!TextUtils.isEmpty(userManager.userID)) { if (!TextUtils.isEmpty(userManager.userID)) {
LogUtil.d("lixianshouyi", "用户登陆成功!!!。。。。。。。。。。。。。。。。。。。。。。。。。。")
// 登录成功的用户初始化鱼丸盒子 // 登录成功的用户初始化鱼丸盒子
if (userManager.userIsLogin()) { if (userManager.userIsLogin()) {
YwhzManager.init(baseApplication) YwhzManager.init(baseApplication)
......
...@@ -2,6 +2,8 @@ package com.mints.goodmoney.ui.widgets.dialog ...@@ -2,6 +2,8 @@ package com.mints.goodmoney.ui.widgets.dialog
import android.content.Context import android.content.Context
import android.text.Spanned import android.text.Spanned
import com.mints.goodmoney.mvp.model.FlActivityBean
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
import java.lang.ref.WeakReference import java.lang.ref.WeakReference
object DialogUtils { object DialogUtils {
...@@ -64,6 +66,17 @@ object DialogUtils { ...@@ -64,6 +66,17 @@ object DialogUtils {
bonusDialog.show() bonusDialog.show()
dialogListener.setDialog(bonusDialog) dialogListener.setDialog(bonusDialog)
} }
/**
* 限时福利弹框
*/
fun showFlDialog(data: FlActivityBean.ActiveTipsConfigDTO, ctx: Context, dialogListener: DialogListener) {
val weakReference = WeakReference<Context>(ctx)
val bonusDialog = FlDialog(data, weakReference.get()!!, dialogListener)
bonusDialog.show()
dialogListener.setDialog(bonusDialog)
}
/** /**
* *
* 权限请求弹框 * 权限请求弹框
...@@ -74,21 +87,23 @@ object DialogUtils { ...@@ -74,21 +87,23 @@ object DialogUtils {
bonusDialog.show() bonusDialog.show()
dialogListener.setDialog(bonusDialog) dialogListener.setDialog(bonusDialog)
} }
/** /**
* 提现弹框 * 提现弹框
*/ */
fun showTxDialog(ctx: Context,dialogListener: DialogListener){ fun showTxDialog(ctx: Context, dialogListener: DialogListener) {
val weakReference = WeakReference<Context>(ctx) val weakReference = WeakReference<Context>(ctx)
val bonusDialog = TxDialog(weakReference.get()!!, dialogListener) val bonusDialog = TxDialog(weakReference.get()!!, dialogListener)
bonusDialog.show() bonusDialog.show()
dialogListener.setDialog(bonusDialog) dialogListener.setDialog(bonusDialog)
} }
/** /**
* 中奖弹窗 * 中奖弹窗
*/ */
fun showWinDialog(ctx: Context,str1:String,str2:String,dialogListener: DialogListener){ fun showWinDialog(ctx: Context, str1: String, str2: String, dialogListener: DialogListener) {
val weakReference = WeakReference<Context>(ctx) val weakReference = WeakReference<Context>(ctx)
val bonusDialog = WinDialog(weakReference.get()!!, dialogListener,str1,str2) val bonusDialog = WinDialog(weakReference.get()!!, dialogListener, str1, str2)
bonusDialog.show() bonusDialog.show()
dialogListener.setDialog(bonusDialog) dialogListener.setDialog(bonusDialog)
} }
......
package com.mints.goodmoney.ui.widgets.dialog package com.mints.goodmoney.ui.widgets.dialog
class FlDialog { import android.app.Dialog
import android.content.Context
import android.text.Html
import android.view.Gravity
import android.view.KeyEvent
import android.view.WindowManager
import android.widget.ImageView
import android.widget.TextView
import com.bumptech.glide.Glide
import com.mints.goodmoney.R
import com.mints.goodmoney.mvp.model.FlActivityBean
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
import com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils
import com.mints.goodmoney.utils.SpanUtils
class FlDialog(data: FlActivityBean.ActiveTipsConfigDTO, context: Context, private val listener: DialogListener) :
Dialog(context, R.style.dialog) {
private val lp: WindowManager.LayoutParams
private val iv_Close: ImageView
private val tv_focus: TextView
private val iv_fl: ImageView
private val tv_1: TextView
private val tv_2: TextView
init {
setContentView(R.layout.dialog_fl)
// 设置window属性
lp = window!!.attributes
lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.WRAP_CONTENT
lp.windowAnimations = R.style.DialogAnimBottom
window!!.attributes = lp
// 设置外部不可关闭
setCancelable(false)
setCanceledOnTouchOutside(false)
setOnKeyListener { _, i, _ ->
i == KeyEvent.KEYCODE_BACK
}
// 查找View
tv_focus = findViewById(R.id.tv_focus)
iv_Close = findViewById(R.id.iv_Close)
iv_fl = findViewById(R.id.iv_fl)
tv_1 = findViewById(R.id.tv_1)
tv_2 = findViewById(R.id.tv_2)
tv_1.text=data.title
tv_2.text=data.hotTitle
//显示图片
Glide.with(context).load(data.url).into(iv_fl)
tv_focus.setOnClickListener {
listener.onClick(it)
}
iv_Close.setOnClickListener {
listener.onClick(it)
}
}
} }
\ No newline at end of file
...@@ -12,6 +12,7 @@ import android.view.KeyEvent ...@@ -12,6 +12,7 @@ import android.view.KeyEvent
import android.view.WindowManager import android.view.WindowManager
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
/** /**
* 关注公众号 * 关注公众号
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="#2196F3" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="30dip" />
</selector> </shape>
\ No newline at end of file \ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 填充的颜色 -->
<solid android:color="#D62D20" />
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners android:radius="5dip" />
</shape> </shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_width="300dp"
android:layout_height="match_parent"> android:layout_height="400dp"
android:background="@mipmap/bg_fl">
</androidx.constraintlayout.widget.ConstraintLayout> <ImageView
\ No newline at end of file android:id="@+id/iv_Close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|end"
android:layout_marginTop="60dp"
android:layout_marginEnd="10dp"
android:padding="6dp"
android:src="@mipmap/iv_close_tx" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_gravity="bottom|center_horizontal"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
<TextView
android:id="@+id/tv_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:gravity="center"
android:text="限时福利"
android:textColor="#ffffff"
android:textSize="25sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginBottom="20dp"
android:layout_toRightOf="@id/tv_1"
android:background="@mipmap/bg_fl_iv"
android:paddingLeft="5dp"
android:paddingTop="3dp"
android:paddingRight="5dp"
android:paddingBottom="3dp"
android:text="3天有效"
android:textColor="#D23E1B"
android:textSize="12sp" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="10dp"
android:lineHeight="20dp"
android:text="恭喜获得加速赚钱特权,赚取金币\n快人一步!"
android:textColor="#CCffffff"
android:textSize="16sp" />
<ImageView
android:id="@+id/iv_fl"
android:layout_width="240dp"
android:layout_height="140dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="10dp"
android:gravity="center"
android:padding="6dp" />
<TextView
android:id="@+id/tv_focus"
android:layout_width="150dp"
android:layout_height="36dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:background="@mipmap/bg_fl_btn"
android:gravity="center"
android:text="参与活动"
android:textSize="20sp"
android:drawableRight="@mipmap/bg_fl_btn_enter"
android:paddingRight="20dp"
android:paddingLeft="20dp"
android:textColor="#C61800" />
</androidx.appcompat.widget.LinearLayoutCompat>
</FrameLayout>
\ No newline at end of file
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