Commit 2e8a1fd5 authored by huangjunhui's avatar huangjunhui

修改splash

parent 8f049419
......@@ -147,5 +147,6 @@ dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')
implementation project(path: ':task')
implementation project(path: ':game')
implementation project(path: ':library')
}
......@@ -114,6 +114,12 @@ class GameActivity : UnityPlayerActivity() {
EventUtils.onEvent(action)
}
// TODO 事件上传
fun eventAction(action:String,value:String){
EventUtils.onEvent(action,value)
}
//TODO 闯关红包 配置list
fun getCompleteRedList(){
ApiClient.taskApi.getCompleteList()
......
......@@ -13,6 +13,7 @@ import com.zxhl.library.config.ZXADSizeConfig
import com.zxhl.library.listener.ZXADExpressListener
import com.zxhl.library.module.NewsEntity
import com.zxhl.library.net.BaseActivity
import com.zxhl.library.net.NetConfig
import com.zxhl.library.utils.JumpUtils
import com.zxhl.library.utils.PhoneUtils
import com.zxhl.library.utils.Utils
......@@ -82,11 +83,11 @@ class GamePauseActivity :BaseActivity() {
}
//隐私协议
secret_agreement.setOnClickListener(View.OnClickListener {
JumpUtils.h5Jump("隐私协议","https://newspool.huolea.com/sspapiNovel/su/custom/gameysdzz/privacy.html");
JumpUtils.h5Jump("隐私协议", NetConfig.H5.WEB_URL_PRIVACY);
})
//用户协议
user_agreement.setOnClickListener(View.OnClickListener {
JumpUtils.h5Jump("隐私协议","https://newspool.huolea.com/sspapiNovel/su/custom/gameysdzz/user.html");
JumpUtils.h5Jump("用户协议", NetConfig.H5.WEB_URL_USER);
})
}
......
package com.zxhl.game.ysdzz.ui;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.util.Log;
import android.widget.FrameLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.core.app.ActivityCompat;
import com.bytedance.sdk.openadsdk.TTSplashAd;
import com.zxhl.detector.news.SplashContract;
import com.zxhl.game.ysdzz.ADConfig;
import com.zxhl.game.ysdzz.MainActivity;
import com.zxhl.game.ysdzz.R;
import com.zxhl.library.Constant;
import com.zxhl.library.config.AdManager;
import com.zxhl.library.listener.ZXADSplashListener;
import com.zxhl.library.module.NewsEntity;
import com.zxhl.library.net.BaseActivity;
import com.zxhl.library.net.PermissionsActivity;
import com.zxhl.library.net.SplashPresenter;
import com.zxhl.library.utils.EventUtils;
import com.zxhl.library.utils.SettingPreference;
import org.jetbrains.annotations.NotNull;
public class SplashActivity extends BaseActivity implements SplashContract.View {
private SplashPresenter mPresenter;
private TextView tv_skipview;
private FrameLayout splash_container;
@Override
public int layoutID() {
return R.layout.splash_layout;
}
@Override
public void init() {
EventUtils.INSTANCE.onEvent("app_start");
tv_skipview = findViewById(R.id.tv_skipview);
splash_container = findViewById(R.id.splash_container);
mPresenter = new SplashPresenter(this, this);
mPresenter.checkPermissions();//检测权限
// Intent intent
// = new Intent(this,GamePauseActivity.class);
// startActivity(intent);
}
@Override
public void jumpPage() {
//TODO 加载开屏广告
Log.e("huang","广告展现 开始"+System.currentTimeMillis());
if(SettingPreference.isFirst()){
//tipDialog();
SettingPreference.setIsFirst(false);
if(Constant.is_first_load_splash_ad==0){
startMain();
return;
}
}
AdManager.INSTANCE.loadSplashAd(this, ADConfig.INSTANCE.getAD_SPLASH(), tv_skipview, splash_container, new ZXADSplashListener() {
@Override
public void onSuccessResult() { }
@Override
public void onFailResult(@NotNull String result) { startMain(); }
@Override
public void onTimeout() { startMain(); }
@Override
public void onErrorResult(@NotNull String s) { startMain(); }
@Override
public void onSplashAdLoad(@NotNull TTSplashAd ad) { }
@Override
public void onAdClicked(@NotNull NewsEntity data) { }
@Override
public void onAdShow(@NotNull NewsEntity data) { }
@Override
public void onAdSkip() { startMain(); }
@Override
public void onAdTimeOver() { startMain(); }
});
}
//隐私协议
public void tipDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("协议");
builder.setMessage("111111111111111111111111111111111111111111111111111111111111111111111111");
builder.setIcon(R.mipmap.ic_launcher);
builder.setCancelable(false); //点击对话框以外的区域是否让对话框消失
//设置正面按钮
builder.setPositiveButton("同意", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
//设置反面按钮
builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
finish();
}
});
AlertDialog dialog = builder.create(); //创建AlertDialog对象
//对话框显示的监听事件
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
}
});
//对话框消失的监听事件
dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
}
});
dialog.show(); //显示对话框
}
private long startTime = 0L;
//防止两次点击
private void startMain() {
//用户点击了 跳过按钮 .......
if(System.currentTimeMillis()-startTime>2000){
startTime = System.currentTimeMillis();
Intent intent = new Intent(SplashActivity.this, GameActivity.class);
startActivity(intent);
finish();
}
}
@Override
public void jumpPermissionsPage() {
Intent intent = new Intent(this, PermissionsActivity.class);
intent.putExtra(PermissionsActivity.EXTRA_PERMISSIONS, SplashPresenter.Companion.getPERMISSIONS());
ActivityCompat.startActivityForResult(this, intent, Constant.REQUEST_CODE_ASK_PERMISSIONS, null);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == Constant.REQUEST_CODE_ASK_PERMISSIONS && resultCode == PermissionsActivity.PERMISSIONS_DENIED) {
startMain();
}else {
mPresenter.getAppConfig();
}
}
@Override
public boolean getDestroyed() { return false; }
}
package com.zxhl.game.ysdzz.ui
import android.content.Intent
import android.util.Log
import android.view.View
import android.widget.FrameLayout
import android.widget.TextView
import androidx.core.app.ActivityCompat
import com.bytedance.sdk.openadsdk.TTSplashAd
import com.zxhl.detector.news.SplashContract
import com.zxhl.game.ysdzz.ADConfig.AD_SPLASH
import com.zxhl.game.ysdzz.R
import com.zxhl.library.Constant
import com.zxhl.library.config.AdManager.loadSplashAd
import com.zxhl.library.listener.ZXADSplashListener
import com.zxhl.library.module.NewsEntity
import com.zxhl.library.net.BaseActivity
import com.zxhl.library.net.PermissionsActivity
import com.zxhl.library.net.SplashPresenter
import com.zxhl.library.net.SplashPresenter.Companion.PERMISSIONS
import com.zxhl.library.utils.EventUtils.onEvent
import com.zxhl.library.utils.SettingPreference
class SplashActivity : BaseActivity(), SplashContract.View {
private var mPresenter: SplashPresenter? = null
private var tv_skipview: TextView? = null
private var splash_container: FrameLayout? = null
override fun layoutID(): Int {
return R.layout.splash_layout
}
override fun init() {
onEvent("app_start")
tv_skipview = findViewById(R.id.tv_skipview)
splash_container =
findViewById(R.id.splash_container)
mPresenter = SplashPresenter(this, this)
mPresenter!!.checkPermissions() //检测权限
// Intent intent
// = new Intent(this,GamePauseActivity.class);
// startActivity(intent);
}
override fun jumpPage() {
//TODO 加载开屏广告
Log.e("huang", "广告展现 开始" + System.currentTimeMillis())
if (SettingPreference.isFirst()) {
//tipDialog();
// Center2Dialog.showPrivacyProtocol(this, View.OnClickListener { finish() }, View.OnClickListener {
SettingPreference.setIsFirst(false)
if (Constant.is_first_load_splash_ad == 0) {
startMain()
// return@OnClickListener
} else {
loadSplash()
}
}
// )
// } else {
loadSplash()
// }
}
private fun loadSplash() {
loadSplashAd(
this,
AD_SPLASH,
tv_skipview,
splash_container!!,
object : ZXADSplashListener {
override fun onSuccessResult() {}
override fun onFailResult(result: String) {
startMain()
}
override fun onTimeout() {
startMain()
}
override fun onErrorResult(s: String) {
startMain()
}
override fun onSplashAdLoad(ad: TTSplashAd) {}
override fun onAdClicked(data: NewsEntity) {}
override fun onAdShow(data: NewsEntity) {}
override fun onAdSkip() {
startMain()
}
override fun onAdTimeOver() {
startMain()
}
})
}
private var startTime = 0L
//防止两次点击
private fun startMain() {
//用户点击了 跳过按钮 .......
if (System.currentTimeMillis() - startTime > 2000) {
startTime = System.currentTimeMillis()
val intent =
Intent(this@SplashActivity, GameActivity::class.java)
startActivity(intent)
finish()
}
}
override fun jumpPermissionsPage() {
val intent =
Intent(this, PermissionsActivity::class.java)
intent.putExtra(
PermissionsActivity.EXTRA_PERMISSIONS,
PERMISSIONS
)
ActivityCompat.startActivityForResult(
this,
intent,
Constant.REQUEST_CODE_ASK_PERMISSIONS,
null
)
}
override fun onActivityResult(
requestCode: Int,
resultCode: Int,
data: Intent?
) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == Constant.REQUEST_CODE_ASK_PERMISSIONS && resultCode == PermissionsActivity.PERMISSIONS_DENIED) {
startMain()
} else {
mPresenter!!.getAppConfig()
}
}
override fun getDestroyed(): Boolean {
return false
}
}
\ No newline at end of file
package com.zxhl.library.net;
import android.view.View;
import com.zxhl.library.utils.JumpUtils;
import static com.zxhl.library.net.NetConfig.Environment.DEV;
import static com.zxhl.library.net.NetConfig.Environment.PRODUCT;
......@@ -223,13 +227,13 @@ public class NetConfig {
public static String WEB_URL_ABOUT_US;//TODO 关于我们页面
public static String WEB_URL_PRIVACY = "https://newspool.huolea.com/sspapiNovel/su/custom/funnycallapp/privacy.html";//TODO 隐私协议
public static String WEB_URL_PRIVACY = "https://newspool.huolea.com/sspapiNovel/su/custom/gameysdzz/privacy.html";//TODO 隐私协议
public static String WEB_URL_FEEDBACK;//TODO 用户反馈
public static String WEB_URL_CLEARINSTRUCTIONS;//TODO
public static String WEB_URL_USER = "https://newspool.huolea.com/sspapiNovel/su/custom/funnycallapp/user.html";//TODO 用户协议
public static String WEB_URL_USER = "https://newspool.huolea.com/sspapiNovel/su/custom/gameysdzz/user.html";//TODO 用户协议
public static String WEB_URL_SHARE_LAND; //TODO
......
......@@ -25,7 +25,7 @@ import com.zxhl.library.utils.StatusBarUtil
import com.zxhl.task.R
import com.zxhl.task.module.contract.NewWebContract
import com.zxhl.task.module.presenter.NewWebPresenter
import com.zxhl.task.module.utils.CenterDialog
import com.zxhl.task.module.utils.Center2Dialog
import com.zxhl.task.module.weight.MyWebChromeClient
import com.zxhl.task.module.weight.ScrollWebView
import kotlinx.android.synthetic.main.activity_new_web.*
......@@ -137,14 +137,14 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
isAdds = true
var text = "阅读奖励 金币+" + coins
if (Constant.kkz_award_render_type == 1) {
CenterDialog.showDialogReadCoins(this, coins, value, object : View.OnClickListener {
Center2Dialog.showDialogReadCoins(this, coins, value, object : View.OnClickListener {
override fun onClick(v: View?) {
isAdds = false
mPresenter?.nextUrl()
}
})
} else {
showNewCoinsDialog = CenterDialog.showNewCoinsDialog(this@NewWebActivity, coins)
showNewCoinsDialog = Center2Dialog.showNewCoinsDialog(this@NewWebActivity, coins)
}
}
......@@ -321,7 +321,7 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
if (isAdds == true) {
super.finish()
} else {
CenterDialog.showSignOutDialog(this, this)
Center2Dialog.showSignOutDialog(this, this)
}
}
......
......@@ -22,7 +22,7 @@ import com.zxhl.library.utils.StatusBarUtil
import com.zxhl.task.R
import com.zxhl.task.module.contract.RedPacketContract
import com.zxhl.task.module.presenter.RedPacketPresenter
import com.zxhl.task.module.utils.CenterDialog
import com.zxhl.task.module.utils.Center2Dialog
import com.zxhl.task.module.utils.ToastUtils
import com.zxhl.task.module.weight.helper.RedPacketViewHelper
import kotlinx.android.synthetic.main.layout_count_down.*
......@@ -112,7 +112,7 @@ class RedPackageActivity : Activity(), RedPacketContract.View {
tvCount?.setText("" + 0 + "s")
mPresenter?.addRedPkg(ids)
mRedPacketViewHelper!!.endGiftRain()
CenterDialog.showGetGoldDialog(this@RedPackageActivity,
Center2Dialog.showGetGoldDialog(this@RedPackageActivity,
goldCount,
redNum,
goldNum,
......
......@@ -10,7 +10,6 @@ import android.graphics.PixelFormat
import android.net.Uri
import android.net.http.SslError
import android.text.TextUtils
import android.util.Base64
import android.util.Log
import android.view.*
import android.webkit.*
......@@ -25,16 +24,12 @@ import com.zxhl.library.net.*
import com.zxhl.library.utils.StatusBarUtil
import com.zxhl.library.utils.Utils
import com.zxhl.task.R
import com.zxhl.task.module.utils.CenterDialog
import com.zxhl.task.module.utils.Center2Dialog
import com.zxhl.task.module.utils.JavaInterface
import com.zxhl.task.module.utils.RxTimerUtil
import com.zxhl.task.module.weight.MyWebChromeClient
import com.zxhl.task.module.weight.ScrollWebView
import io.reactivex.Observer
import io.reactivex.disposables.Disposable
import kotlinx.android.synthetic.main.activity_web.*
import okhttp3.ResponseBody
import java.io.IOException
import java.util.regex.Pattern
......@@ -356,7 +351,7 @@ class WebActivity : BaseActivity(), View.OnClickListener {
override fun onSuccess(result: CoinEntity?) {
if (result != null && result.coins > 0) {
var text = "阅读奖励 金币+" + result.coins
CenterDialog.showNewCoinsDialog(this@WebActivity, result.coins)
Center2Dialog.showNewCoinsDialog(this@WebActivity, result.coins)
isSuc = true
status = OVER
setTimerLayoutGone()
......@@ -639,7 +634,7 @@ class WebActivity : BaseActivity(), View.OnClickListener {
override fun finish() {
if (incentive_level == 2 || incentive_level == 8 || incentive_level == 9 || incentive_level == 11) {
if (!isAdd) {
CenterDialog.showSignOutDialog(this, this)
Center2Dialog.showSignOutDialog(this, this)
} else {
super.finish()
}
......
......@@ -48,6 +48,7 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
//立即提现
cash_coin_tv_now?.setOnClickListener {
EventUtils.onEvent("withdraw_cash_click", "金币提现详情页-提现按钮")
EventUtils.onEvent("GetCash_Btn_Click", "金币提现详情页-提现按钮")
val userInfoData = SettingPreference.getUserInfoData()
if (userInfoData != null) {
if (!userInfoData.isBindWxPayOpenid!!) {
......@@ -135,6 +136,7 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
//
override fun onCashResult(result: CashEntity) {
if (result.coinList != null) {
EventUtils.onEvent("GetCashPage_Coin_Show")
var arrlist :ArrayList<CashEntity.CoinListBean> = ArrayList()
for(value in result?.coinList!!){
if(value?.show==1){
......@@ -157,7 +159,9 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
}
}
//微信提现成功
override fun onWxCash(result: WechatResultEntity) {
EventUtils.onEvent("WithDraw_Coin_Success",""+result?.reason)
mLoading?.dismiss()
cash_coin_tv_now.isEnabled = true
showToast(result?.reason)
......@@ -166,6 +170,7 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
}
override fun onWxCashFail(errorMsg: String) {
EventUtils.onEvent("WithDraw_Coin_Faile",""+errorMsg)
mLoading?.dismiss()
showToast(errorMsg)
cash_coin_tv_now.isEnabled = true
......@@ -176,9 +181,9 @@ class CoinCrashFragment : BaseFragment(), WithdrawCashContract.View {
}
override fun withdrawSuccess(cash: Float, status: String, type: String, desc: String) {
Toast.makeText(mActivity,desc,Toast.LENGTH_LONG).show()
mPresenter?.getCashConfig(1)// 获取金币提现
// Toast.makeText(mActivity,desc,Toast.LENGTH_LONG).show()
//
// mPresenter?.getCashConfig(1)// 获取金币提现
}
......
......@@ -26,7 +26,7 @@ import com.zxhl.task.module.adapter.TaskSignInAdapter
import com.zxhl.task.module.contract.TaskContract
import com.zxhl.task.module.listener.OnRecycleItemClickListener
import com.zxhl.task.module.presenter.TaskPresenter
import com.zxhl.task.module.utils.CenterDialog
import com.zxhl.task.module.utils.Center2Dialog
import com.zxhl.task.module.weight.LoadingDialog
import kotlinx.android.synthetic.main.activity_task_game_xxl.*
import java.text.DecimalFormat
......@@ -93,7 +93,7 @@ class GameTaskActivity : BaseActivity(), TaskContract.View, View.OnClickListener
return
}
//事件上报
EventUtils.onEvent("TaskPage_TaskList_Click")
EventUtils.onEvent("TaskPage_TaskList_Click","sid:"+newsEntity?.sid)
if (newsEntity?.opentype == 50) {//游戏页面
val sid: String = data.sid.toString()
if (sid.equals("2334")) {//连闯5关
......@@ -167,14 +167,14 @@ class GameTaskActivity : BaseActivity(), TaskContract.View, View.OnClickListener
//领红包
ll_get_red.setOnClickListener {
CenterDialog.showDialogRed(this@GameTaskActivity, this@GameTaskActivity)
Center2Dialog.showDialogRed(this@GameTaskActivity, this@GameTaskActivity)
}
handler?.postDelayed(Runnable {
var i = System.currentTimeMillis() % 1800000//整点毫秒数 距离上个整点的毫秒数
var l1 = ((1800000 - i) / 1000).toInt()
startTimeTask(l1, task_game_time)
CenterDialog.showDialogRed(this@GameTaskActivity, this@GameTaskActivity)
Center2Dialog.showDialogRed(this@GameTaskActivity, this@GameTaskActivity)
}, 1000)
//事件上报
......@@ -307,7 +307,7 @@ class GameTaskActivity : BaseActivity(), TaskContract.View, View.OnClickListener
if (isOnline) {//如果是在线红包的话,需要弹框
isOnline = !isOnline
handler.postDelayed(Runnable {
CenterDialog.showSignDialog(this@GameTaskActivity, coin, object : View.OnClickListener {
Center2Dialog.showSignDialog(this@GameTaskActivity, coin, object : View.OnClickListener {
override fun onClick(v: View?) {
if (mLoading == null) {
mLoading = LoadingDialog.getLoadingDialog(
......
......@@ -49,7 +49,9 @@ class RedCrashFragment :BaseFragment(), WithdrawCashContract.View {
//立即提现
cash_coin_tv_now?.setOnClickListener {
EventUtils.onEvent("withdraw_cash_click", "金币提现详情页-提现按钮")
EventUtils.onEvent("withdraw_cash_click", "红包提现详情页-提现按钮")
EventUtils.onEvent("GetCash_Btn_Click", "红包提现详情页-提现按钮")
val userInfoData = SettingPreference.getUserInfoData()
if (userInfoData != null) {
if (!userInfoData.isBindWxPayOpenid!!) {
......@@ -168,6 +170,8 @@ class RedCrashFragment :BaseFragment(), WithdrawCashContract.View {
override fun onCashResult(result: CashEntity) {
if(result.cashList!=null){
EventUtils.onEvent("GetCashPage_RedPack_Show")
mNumAdapter?.setSelectPosition(0)
mNumAdapter?.clear()
mNumAdapter?.setType(mDefaultType)
......@@ -186,14 +190,14 @@ class RedCrashFragment :BaseFragment(), WithdrawCashContract.View {
override fun onWxCash(result: WechatResultEntity) {
EventUtils.onEvent("WithDraw_RedPack_Success",""+result?.reason)
showToast(result?.reason)
mPresenter?.getCashConfig(2)// 获取金币提现
}
override fun onWxCashFail(errorMsg: String) {
EventUtils.onEvent("WithDraw_RedPack_Faile",""+errorMsg)
showToast(errorMsg)
}
......
......@@ -27,7 +27,7 @@ import com.zxhl.task.module.luckydraw.presenter.ScratchCardPresenter
import com.zxhl.task.module.utils.AdDialog
import com.zxhl.task.module.utils.AdDialogCallback
import com.zxhl.task.module.utils.CallbackIncentiveVideo
import com.zxhl.task.module.utils.CenterDialog
import com.zxhl.task.module.utils.Center2Dialog
import kotlinx.android.synthetic.main.activity_scratch_card.*
import java.util.*
......@@ -62,7 +62,7 @@ class ScratchCardActivity : BaseActivity(), ScratchCardContract.View {
scratch_card_top_desc_right_icon?.setOnClickListener {
//奖励说明
CenterDialog.showScratchExplainDialog(this@ScratchCardActivity)
Center2Dialog.showScratchExplainDialog(this@ScratchCardActivity)
}
id_content_scrape_card?.setTopView(R.layout.scrape_card_content_top_view)
......
......@@ -36,7 +36,7 @@ import com.zxhl.task.module.luckydraw.presenter.LuckyAdPresenter
import com.zxhl.task.module.utils.AdDialog
import com.zxhl.task.module.utils.AdDialogCallback
import com.zxhl.task.module.utils.AdRenderCallback
import com.zxhl.task.module.utils.CenterDialog
import com.zxhl.task.module.utils.Center2Dialog
import com.zxhl.task.module.utils.RxTimerUtil
import com.zxhl.task.module.weight.CenterMenuDialog
import kotlinx.android.synthetic.main.activity_lucky_ad.*
......@@ -460,7 +460,7 @@ class LuckyAdFragment : LuckyAnimImpl(), LuckyAdContract.View, AdCallback<String
override fun showBoxDialog(coins: String, limit: String) {
if (mActivity != null)
CenterDialog.showDialogLuckyBox(mActivity, coins.toInt(), 0, limit, this)
Center2Dialog.showDialogLuckyBox(mActivity, coins.toInt(), 0, limit, this)
}
override fun onResult(code: Int, result: String?) {
......
......@@ -29,7 +29,7 @@ import com.zxhl.task.module.luckydraw.presenter.SlotMachinePresenter
import com.zxhl.task.module.utils.AdDialog
import com.zxhl.task.module.utils.AdDialogCallback
import com.zxhl.task.module.utils.AninUtils
import com.zxhl.task.module.utils.CenterDialog
import com.zxhl.task.module.utils.Center2Dialog
import com.zxhl.task.module.utils.TextSwitcherAnimation
import com.zxhl.task.module.weight.SlotMachineRecyClerView
import kotlinx.android.synthetic.main.fragment_slot_machine_layout.*
......@@ -80,7 +80,7 @@ class SlotMachineFragment : BaseFragment(), SlotMachineContract.View {
icon_slotmachine_rule?.setOnClickListener {
//活动规则弹窗
CenterDialog.showActivityRulesDialog(mActivity)
Center2Dialog.showActivityRulesDialog(mActivity)
}
......@@ -265,7 +265,7 @@ class SlotMachineFragment : BaseFragment(), SlotMachineContract.View {
override fun slotMachineRe(result: SlotMachineReEntity) {
CenterDialog.showSlotMachineDialog(mActivity,result?.receiveNum?:"")
Center2Dialog.showSlotMachineDialog(mActivity,result?.receiveNum?:"")
presenter?.slotMachineInfo()
}
......@@ -305,7 +305,7 @@ class SlotMachineFragment : BaseFragment(), SlotMachineContract.View {
slot_machine_more_nomal?.setBackgroundResource(R.drawable.icon_slotmachine_waite_next)
slot_machine_more_nomal?.isEnabled = false
CenterDialog.showSlotMachineTimerDialog(mActivity,entity?.countdownSecond?:0)
Center2Dialog.showSlotMachineTimerDialog(mActivity,entity?.countdownSecond?:0)
}
5 ->{
......@@ -363,7 +363,7 @@ class SlotMachineFragment : BaseFragment(), SlotMachineContract.View {
CenterDialog.showSlotMachineBoxDialog(mActivity,object :View.OnClickListener{
Center2Dialog.showSlotMachineBoxDialog(mActivity,object :View.OnClickListener{
override fun onClick(v: View?) {
......
......@@ -2,9 +2,15 @@ package com.zxhl.task.module.utils
import android.app.Activity
import android.app.Dialog
import android.graphics.Color
import android.os.Build
import android.os.CountDownTimer
import android.text.SpannableStringBuilder
import android.text.Spanned
import android.text.TextUtils
import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.text.style.ForegroundColorSpan
import android.view.*
import android.view.animation.*
import android.widget.*
......@@ -16,6 +22,7 @@ import com.zxhl.library.config.AdManager
import com.zxhl.library.config.ZXADSizeConfig
import com.zxhl.library.listener.ZXADExpressListener
import com.zxhl.library.module.NewsEntity
import com.zxhl.library.net.NetConfig
import com.zxhl.library.utils.*
import com.zxhl.task.R
import com.zxhl.task.module.listener.AdCallback
......@@ -24,7 +31,7 @@ import java.util.*
/**
* Created by gaoleichao on 2018/8/17.
*/
object CenterDialog : BaseDialog() {
object Center2Dialog : BaseDialog() {
fun showActivityRulesDialog(activity: Activity?) {
if (activity == null) {
......@@ -136,10 +143,10 @@ object CenterDialog : BaseDialog() {
}
val mDialog = Dialog(activity,R.style.UpdateVersionCompatDialogTheme)
val mDialogView = showBottomDialog(R.layout.dialog_sign_dialog,
activity,
mDialog,
0,
Gravity.CENTER)
activity,
mDialog,
0,
Gravity.CENTER)
val id_dialog_datecoins_close = mDialogView.findViewById<ImageView>(R.id.id_dialog_datecoins_close)
val dialog_time_reward_bg_img_an = mDialogView.findViewById<ImageView>(R.id.dialog_time_reward_bg_img_an)
val task_sign_coin_number = mDialogView.findViewById<TextView>(R.id.task_sign_coin_number)
......@@ -641,5 +648,95 @@ object CenterDialog : BaseDialog() {
/**
* 隐私协议弹窗
*/
fun showPrivacyProtocol(activity: Activity, disagreelistener: View.OnClickListener,agreelistener: View.OnClickListener?) {
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView =
showBottomDialog(
R.layout.dialog_privacy_protocol_view,
activity,
mDialog,
0,
Gravity.CENTER
)
val content = mDialogView.findViewById<TextView>(R.id.id_dialog_privacy_protocol_content)
val desc = mDialogView.findViewById<TextView>(R.id.id_dialog_privacy_protocol_desc)
mDialogView.findViewById<TextView>(R.id.cancel_button)
.setOnClickListener { activity.finish() }
val clickUa: ClickableSpan = object : ClickableSpan() {
override fun onClick(widget: View) {
JumpUtils.h5Jump("隐私政策", NetConfig.H5.WEB_URL_PRIVACY)
}
}
val clickPrivat: ClickableSpan = object : ClickableSpan() {
override fun onClick(widget: View) {
JumpUtils.h5Jump("用户协议", NetConfig.H5.WEB_URL_USER)
}
}
// 《隐私政策》和《用户协议》,请您在使用前仔细阅读并了解
val descStr = SpannableStringBuilder("您点击“同意”,即表示您阅读并同意更新后的《用户协议》和《隐私政策》")
descStr.setSpan(
clickPrivat, 22, 26,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
descStr.setSpan(
clickUa, 29, descStr.length - 1,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
descStr.setSpan(
ForegroundColorSpan(Color.parseColor("#44a1ff")), 21, 27,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
descStr.setSpan(
ForegroundColorSpan(Color.parseColor("#44a1ff")), 29, descStr.length - 1,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
desc.text = descStr
desc.setMovementMethod(LinkMovementMethod.getInstance());
val str = "欢迎使用趣味来电!为了更好的保护您的隐私和个人信息安全,根据国家相关法律规定和标准更新了"
val ss = SpannableStringBuilder("查看完整《用户协议》和《隐私政策》,请您在使用前仔细阅读并了解。")
ss.setSpan(
clickPrivat, 4, 10,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
ss.setSpan(
clickUa, 12, 16,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
ss.setSpan(
ForegroundColorSpan(Color.parseColor("#44a1ff")), 4, 10,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
ss.setSpan(
ForegroundColorSpan(Color.parseColor("#44a1ff")), 12, 16,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
content.append(str)
content.append(ss)
content.setMovementMethod(LinkMovementMethod.getInstance());
mDialogView.findViewById<TextView>(R.id.privacy_protocol_button).setOnClickListener {
mDialog.dismiss()
agreelistener?.onClick(it)
}
mDialog.findViewById<TextView>(R.id.cancel_button).setOnClickListener {
mDialog.dismiss()
disagreelistener?.onClick(it)
}
mDialog.setCanceledOnTouchOutside(false)
mDialog.show()
}
}
\ No newline at end of file
package com.zxhl.task.module.utils
import android.app.Activity
import android.app.Dialog
import android.graphics.Color
import android.text.SpannableStringBuilder
import android.text.Spanned
import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.text.style.ForegroundColorSpan
import android.view.Gravity
import android.view.View
import android.widget.TextView
import com.zxhl.library.net.NetConfig
import com.zxhl.library.utils.JumpUtils
import com.zxhl.task.R
object SDialog{
/**
* 隐私协议弹窗
*/
fun showPrivacyProtocol(activity: Activity, disagreelistener: View.OnClickListener, agreelistener: View.OnClickListener?) {
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView =
Center2Dialog.showBottomDialog(
R.layout.dialog_privacy_protocol_view,
activity,
mDialog,
0,
Gravity.CENTER
)
val content = mDialogView.findViewById<TextView>(R.id.id_dialog_privacy_protocol_content)
val desc = mDialogView.findViewById<TextView>(R.id.id_dialog_privacy_protocol_desc)
mDialogView.findViewById<TextView>(R.id.cancel_button)
.setOnClickListener { activity.finish() }
val clickUa: ClickableSpan = object : ClickableSpan() {
override fun onClick(widget: View) {
JumpUtils.h5Jump("隐私政策", NetConfig.H5.WEB_URL_PRIVACY)
}
}
val clickPrivat: ClickableSpan = object : ClickableSpan() {
override fun onClick(widget: View) {
JumpUtils.h5Jump("用户协议", NetConfig.H5.WEB_URL_USER)
}
}
// 《隐私政策》和《用户协议》,请您在使用前仔细阅读并了解
val descStr = SpannableStringBuilder("您点击“同意”,即表示您阅读并同意更新后的《用户协议》和《隐私政策》")
descStr.setSpan(
clickPrivat, 22, 26,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
descStr.setSpan(
clickUa, 29, descStr.length - 1,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
descStr.setSpan(
ForegroundColorSpan(Color.parseColor("#44a1ff")), 21, 27,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
descStr.setSpan(
ForegroundColorSpan(Color.parseColor("#44a1ff")), 29, descStr.length - 1,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
desc.text = descStr
desc.setMovementMethod(LinkMovementMethod.getInstance());
val str = "欢迎使用趣味来电!为了更好的保护您的隐私和个人信息安全,根据国家相关法律规定和标准更新了"
val ss = SpannableStringBuilder("查看完整《用户协议》和《隐私政策》,请您在使用前仔细阅读并了解。")
ss.setSpan(
clickPrivat, 4, 10,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
ss.setSpan(
clickUa, 12, 16,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
ss.setSpan(
ForegroundColorSpan(Color.parseColor("#44a1ff")), 4, 10,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
ss.setSpan(
ForegroundColorSpan(Color.parseColor("#44a1ff")), 12, 16,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
content.append(str)
content.append(ss)
content.setMovementMethod(LinkMovementMethod.getInstance());
mDialog.run {
ss.setSpan(
clickPrivat, 4, 10,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
ss.setSpan(
clickUa, 12, 16,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
ss.setSpan(
ForegroundColorSpan(Color.parseColor("#44a1ff")), 4, 10,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
ss.setSpan(
ForegroundColorSpan(Color.parseColor("#44a1ff")), 12, 16,
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
content.append(str)
content.append(ss)
content.setMovementMethod(LinkMovementMethod.getInstance());
val privacy_protocol_button = findViewById<TextView>(R.id.privacy_protocol_button)
val cancel_button = mDialog.findViewById<TextView>(R.id.cancel_button)
privacy_protocol_button.setOnClickListener {
mDialog.dismiss()
agreelistener?.onClick(privacy_protocol_button)
}
cancel_button.setOnClickListener {
mDialog.dismiss()
disagreelistener?.onClick(cancel_button)
}
}
mDialog.setCanceledOnTouchOutside(false)
mDialog.show()
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#00c98d"/>
<corners android:radius="6dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
>
<LinearLayout
android:layout_width="298dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:background="@drawable/shape_white_r6">
<TextView
android:id="@+id/privacy_protocol_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="19dp"
android:textSize="16sp"
android:layout_gravity="center_horizontal"
android:textColor="@color/color_333333"
android:text="用户协议及隐私条款"/>
<ScrollView android:layout_width="wrap_content"
android:fadingEdge="none"
android:overScrollMode="never"
android:layout_height="327.5dp">
<LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:textSize="15sp"
android:textColor="#666666"
android:text="我们依据最新法律,向您说明趣味来电\n软件的隐私政策,特向您推送本提示,\n请您阅读并充分理解相关条款。"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:text="我们承诺:"
android:textSize="15sp"
android:textColor="#333333"/>
<RelativeLayout
android:layout_marginTop="13dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/baozhan_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:layout_toRightOf="@+id/baozhan_img"
android:layout_alignTop="@+id/baozhan_img"
android:textColor="#999999"
android:textSize="12sp"
android:layout_marginLeft="4dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="我们会严格按照《网络安全法》、《信息网络传播保护条例》等保护您的个人信息"/>
</RelativeLayout>
<RelativeLayout
android:layout_marginTop="31dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/gerenxinxi_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:layout_toRightOf="@+id/gerenxinxi_img"
android:layout_alignTop="@+id/gerenxinxi_img"
android:textColor="#999999"
android:textSize="12sp"
android:layout_marginLeft="4dp"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="如果未经您的授权,我们不会使用您的个人信息用于您未授权的其他途径和目的"/>
</RelativeLayout>
<TextView
android:id="@+id/id_dialog_privacy_protocol_desc"
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="14sp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:textColor="#666666"
/>
<TextView
android:id="@+id/id_dialog_privacy_protocol_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingExtra="8dp"
android:textSize="14sp"/>
</LinearLayout>
</ScrollView>
<RelativeLayout
android:layout_marginTop="15dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View android:layout_width="match_parent"
android:layout_height="0.5dp"
android:alpha="0.6"
android:layout_alignParentTop="true"
android:background="#DDDDDD"/>
<TextView
android:id="@+id/cancel_button"
android:layout_width="115.5dp"
android:layout_height="37dp"
android:text="不同意"
android:gravity="center"
android:layout_marginLeft="20dp"
android:layout_marginTop="11dp"
android:layout_marginBottom="11dp"
android:textColor="#999999"
android:textSize="16sp" />
<TextView
android:id="@+id/privacy_protocol_button"
android:layout_width="115.5dp"
android:layout_height="37dp"
android:text="同意"
android:gravity="center"
android:layout_marginTop="11dp"
android:layout_marginRight="20dp"
android:layout_alignParentRight="true"
android:layout_marginBottom="11dp"
android:background="@drawable/shape_00c98d_r6"
android:textColor="@color/white"
android:textSize="16sp" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
\ 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