Commit 2c72efec authored by xw's avatar xw

[提交人]:王雪伟

[提交简述] :多多花园
[实现方案] :1. 广告内部竞价
        2. 拼图红包换成大富翁
        3. 除虫支持按概率决定是否需要看视频
        4. 福利任务加入15秒时间间隔
parent 0be7fc44
...@@ -53,6 +53,19 @@ ...@@ -53,6 +53,19 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity
android:name="com.ym.game.activity.MonopolyWebActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="nomal_web"
android:scheme="ddhy" />
</intent-filter>
</activity>
<meta-data <meta-data
android:name="android.max_aspect" android:name="android.max_aspect"
android:value="2.4" /> <!-- 适配华为(huawei)刘海屏 --> android:value="2.4" /> <!-- 适配华为(huawei)刘海屏 -->
......
{"v":"5.7.4","fr":25,"ip":0,"op":38,"w":298,"h":240,"nm":"编组 2","ddd":0,"assets":[{"id":"image_0","w":28,"h":26,"u":"images/","p":"img_0.png","e":0},{"id":"image_1","w":28,"h":26,"u":"images/","p":"img_1.png","e":0},{"id":"image_2","w":26,"h":28,"u":"images/","p":"img_2.png","e":0},{"id":"image_3","w":38,"h":40,"u":"images/","p":"img_3.png","e":0},{"id":"image_4","w":186,"h":150,"u":"images/","p":"img_4.png","e":0},{"id":"image_5","w":298,"h":68,"u":"images/","p":"img_5.png","e":0}],"layers":[{"ddd":0,"ind":1,"ty":2,"nm":"路径 7备份.png","cl":"png","refId":"image_0","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":25,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":28,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":31,"s":[100]},{"t":34,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[206,34,0],"ix":2,"l":2},"a":{"a":0,"k":[14,13,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":25,"s":[80,80,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":30,"s":[80,80,100]},{"t":34,"s":[80,80,100]}],"ix":6,"l":2}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"路径 7备份 2.png","cl":"png","refId":"image_1","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":18,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":21,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":24,"s":[100]},{"t":27,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[22,49,0],"ix":2,"l":2},"a":{"a":0,"k":[14,13,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":18,"s":[66,66,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":23,"s":[90,90,100]},{"t":27,"s":[66,66,100]}],"ix":6,"l":2}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":2,"nm":"路径 7.png","cl":"png","refId":"image_2","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":13,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":16,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":19,"s":[100]},{"t":22,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[249,95,0],"ix":2,"l":2},"a":{"a":0,"k":[13,14,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":13,"s":[66,66,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":18,"s":[100,100,100]},{"t":22,"s":[66,66,100]}],"ix":6,"l":2}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":2,"nm":"金币备份 5.png","cl":"png","refId":"image_3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"t":0,"s":[137.5,-24.5,0],"to":[0,14.167,0],"ti":[0,-14.167,0]},{"t":6,"s":[137.5,60.5,0]}],"ix":2,"l":2},"a":{"a":0,"k":[19,20,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ip":0,"op":7,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":2,"nm":"4dc98b69-914d-4182-99e6-d80ccf347e23.png","cl":"png","refId":"image_4","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[128.5,219.75,0],"ix":2,"l":2},"a":{"a":0,"k":[97,149,0],"ix":1,"l":2},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":8,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":10,"s":[100,90,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":12,"s":[100,104,100]},{"t":14,"s":[100,100,100]}],"ix":6,"l":2}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":6,"ty":2,"nm":"编组 2.png","cl":"png","refId":"image_5","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[149,206.25,0],"ix":2,"l":2},"a":{"a":0,"k":[149,34,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ip":0,"op":750,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file
...@@ -21,10 +21,8 @@ import com.ym.library.MyConstant ...@@ -21,10 +21,8 @@ import com.ym.library.MyConstant
import com.ym.library.down.UpdateVersionManager import com.ym.library.down.UpdateVersionManager
import com.ym.library.listener.IAdVideoListener import com.ym.library.listener.IAdVideoListener
import com.ym.library.module.* import com.ym.library.module.*
import com.ym.library.net.ApiClient import com.ym.library.net.*
import com.ym.library.net.BaseObserver import com.ym.library.net.NetConfig.H5.mDFWType
import com.ym.library.net.GameApiClient
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.utils.AdPreference import com.ym.modulecommon.utils.AdPreference
...@@ -72,7 +70,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -72,7 +70,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
openNotif() openNotif()
} }
"close_notif" -> { "close_notif" -> {
if(scc!=null){ if (scc != null) {
unbindService(scc) unbindService(scc)
} }
} }
...@@ -207,25 +205,34 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -207,25 +205,34 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
/** /**
* 拼图红包 * 大富翁
*/ */
fun onPuzzleClick() { fun onMonopolyClick() {
MainLooper.get()?.post(Runnable { MainLooper.get()?.post(Runnable {
if (Utils.isFastClick2()) { if (Utils.isFastClick2()) {
JumpUtils.h5NormalJump(
"大富翁",
NetConfig.H5.CONFIRMURL + "?is_popup1=" + mDFWType,
false,
act
)
Log.d("wxw","大富翁"+NetConfig.H5.CONFIRMURL + "?is_popup1=" + mDFWType);
//CashExchangeDialog.showCashExchage(this, this) //CashExchangeDialog.showCashExchage(this, this)
PuzzleDialog.showPuzzleDialog(this, this) // PuzzleDialog.showPuzzleDialog(this, this)
} }
}) })
} }
/** /**
* 拼图红包 * 拼图红包
*/ */
fun onMonopolyClick() { fun onPuzzleClick() {
MainLooper.get()?.post(Runnable { MainLooper.get()?.post(Runnable {
if (Utils.isFastClick2()) { if (Utils.isFastClick2()) {
//CashExchangeDialog.showCashExchage(this, this) //CashExchangeDialog.showCashExchage(this, this)
// PuzzleDialog.showPuzzleDialog(this, this) PuzzleDialog.showPuzzleDialog(this, this)
} }
}) })
} }
...@@ -333,6 +340,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -333,6 +340,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
GameApiClient.gameApi.getGameHomeInfo().compose(RxSchedulers.observableIO2Main()) GameApiClient.gameApi.getGameHomeInfo().compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<HomeInfoEntity>() { .subscribe(object : BaseObserver<HomeInfoEntity>() {
override fun onSuccess(result: HomeInfoEntity?) { override fun onSuccess(result: HomeInfoEntity?) {
if (result != null) {
mDFWType = 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))
} }
...@@ -374,6 +384,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -374,6 +384,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
.subscribe(object : BaseObserver<NewLandListEntity>() { .subscribe(object : BaseObserver<NewLandListEntity>() {
override fun onSuccess(result: NewLandListEntity?) { override fun onSuccess(result: NewLandListEntity?) {
var json = Utils.obj2Str(result) var json = Utils.obj2Str(result)
if (result?.videoRate != null) {
// MyConstant.isShowCleanWormVideo = result.videoRate
}
Log.d("Wxw", "初始化地块列表成功$from$json") Log.d("Wxw", "初始化地块列表成功$from$json")
if (from == 1) { if (from == 1) {
callUnity("Canvas", "loadLandListSuccess", json) callUnity("Canvas", "loadLandListSuccess", json)
...@@ -577,11 +590,11 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -577,11 +590,11 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}) })
} }
//看视频除虫 fun lookAdVideoCleanWorm(id: Int, isShow: Boolean) {
fun lookAdVideoCleanWorm(id: Int) {
this.runOnUiThread(object : Runnable { this.runOnUiThread(object : Runnable {
override fun run() { override fun run() {
MainDialog.showDialogWorm(this@GameActivity, View.OnClickListener { MainDialog.showDialogWorm(this@GameActivity, isShow, View.OnClickListener {
//需要看视频除虫
AdUtils.playRewardAd( AdUtils.playRewardAd(
this@GameActivity, this@GameActivity,
"CleanWorm", "CleanWorm",
...@@ -594,12 +607,12 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback { ...@@ -594,12 +607,12 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
} }
}) })
}, View.OnClickListener {
//不用看视频 直接除虫
getUnlockLandNew(id, 4, 0)
}) })
} }
}) })
} }
......
package com.ym.game.activity;
import android.app.Activity;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.WindowManager;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.airbnb.lottie.LottieAnimationView;
import com.ym.ddhy.R;
import com.ym.game.monopoly.LollipopFixedWebView;
import com.ym.library.activity.JavaInterface;
import com.ym.library.net.MyBaseActivity;
import com.ym.modulecommon.utils.LogUtils;
import com.ym.modulecommon.utils.StatusBarUtil;
import org.jetbrains.annotations.NotNull;
/**
* @author (wangXuewei)
* @datetime 2020-12-11 20:42 GMT+8
* @detail :
*/
public class MonopolyWebActivity extends MyBaseActivity {
private String url;
private String title;
private LollipopFixedWebView webView;
private ProgressBar pg;
private RelativeLayout rl_anim;
private LinearLayout ll_web;
@Override
public int layoutID() {
return R.layout.activity_monopoly_webview;
}
@Override
public void init() {
StatusBarUtil.transportStatus(this, getResources().getColor(com.ym.library.R.color.transparent));
title = getIntent().getData().getQueryParameter("title");
if (title.equals("分红")) {
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
url = getIntent().getData().getQueryParameter("url");
title = getIntent().getData().getQueryParameter("title");
LogUtils.e("huang url:"+url);
LottieAnimationView id_lottie_dreams_come_true = findViewById(R.id.id_lottie_dreams_come_true);
ll_web = findViewById(R.id.ll_web);
rl_anim = findViewById(R.id.rl_anim);
rl_anim.setVisibility(View.VISIBLE);
id_lottie_dreams_come_true.setImageAssetsFolder("hloading/images/");
id_lottie_dreams_come_true.setAnimation("hloading/data.json");
id_lottie_dreams_come_true.setRepeatCount(-1);
id_lottie_dreams_come_true.playAnimation();
initWebView();
initTitle();
}
private void initWebView() {
pg = findViewById(R.id.progressBar);
webView = findViewById(R.id.activity_webview);
webView.getSettings().setUseWideViewPort(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.setLayerType(View.LAYER_TYPE_HARDWARE,null);//开启硬件加速
// webView.getSettings().setDefaultFontSize(56);
// webView.getSettings().setMinimumFontSize(40);//设置最小字体
// 建议禁止缓存加载,以确保在攻击发生时可快速获取最新的滑动验证组件进行对抗。
webView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
webView.getSettings().setAppCacheEnabled(true);
// 设置不使用默认浏览器,而直接使用WebView组件加载页面。
// 设置WebView组件支持加载JavaScript。
webView.getSettings().setJavaScriptEnabled(true);
// 建立JavaScript调用Java接口的桥梁。
webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
webView.setWebContentsDebuggingEnabled(true);
// 解决对某些标签的不支持出现白屏
webView.getSettings().setDomStorageEnabled(true);
webView.addJavascriptInterface(new WebJavaInterface(this, webView), "android");
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
webView.setWebChromeClient(new android.webkit.WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int newProgress) {
if (newProgress == 100) {
pg.setVisibility(View.GONE);//加载完网页进度条消失
ll_web.setVisibility(View.VISIBLE);
rl_anim.setVisibility(View.GONE);
} else {
pg.setVisibility(View.VISIBLE);//开始加载网页时显示进度条
pg.setProgress(newProgress);//设置进度值
}
}
});
webView.loadUrl(url);
// webView.loadDataWithBaseURL(null, url, "text/html", "utf-8", null);//解决乱码问题
}
private void initTitle() {
RelativeLayout id_rl_toolbar = findViewById(com.ym.library.R.id.id_rl_toolbar);
if (getIntent().getData().getBooleanQueryParameter("showToolbar", true)) {
id_rl_toolbar.setVisibility(View.VISIBLE);
} else {
id_rl_toolbar.setVisibility(View.GONE);
}
findViewById(com.ym.library.R.id.id_iv_back).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finish();
}
});
TextView tv_title = findViewById(com.ym.library.R.id.tv_user_toolbar_title);
tv_title.setText(title);
}
@Override
protected void onResume() {
super.onResume();
if (webView != null) {
webView.loadUrl("javascript:onResume()");
}
}
@Override
protected void onPause() {
super.onPause();
if (webView != null) {
webView.loadUrl("javascript:onPause()");
}
}
@Override
protected void onDestroy() {
super.onDestroy();
if (webView != null) {
ViewParent parent = webView.getParent();
if (parent != null) {
((ViewGroup) parent).removeView(webView);
}
webView.removeAllViews();
webView.destroy();
webView = null;
}
}
class WebJavaInterface extends JavaInterface {
public WebJavaInterface(@NotNull Activity act, @NotNull WebView web) {
super(act, web);
}
}
}
...@@ -98,7 +98,7 @@ class WelfareActivity : MyBaseActivity(), WelfareContract.View, ...@@ -98,7 +98,7 @@ class WelfareActivity : MyBaseActivity(), WelfareContract.View,
recycler_welfare_task?.adapter = taskAdapter recycler_welfare_task?.adapter = taskAdapter
} }
private var mSid: Int? = 0
override fun onItemClick(view: View, position: Int, data: NewsEntity) { override fun onItemClick(view: View, position: Int, data: NewsEntity) {
mData = data mData = data
if (!isClick) { if (!isClick) {
...@@ -109,7 +109,10 @@ class WelfareActivity : MyBaseActivity(), WelfareContract.View, ...@@ -109,7 +109,10 @@ class WelfareActivity : MyBaseActivity(), WelfareContract.View,
EventUtils.onEvent("welfare_task_undone_click_${data.sid}") EventUtils.onEvent("welfare_task_undone_click_${data.sid}")
if (data.opentype == NewsEntity.AD_TYPE_SDK) { if (data.opentype == NewsEntity.AD_TYPE_SDK) {
if (data.sid != null) { if (data.sid != null) {
showAd(data.sid)
mSid = data.sid
// showAd(data.sid)
mPresenter?.getADShowTimer()
EventUtils.onEvent("welfare_task_undone_click_total") EventUtils.onEvent("welfare_task_undone_click_total")
} }
} else { } else {
...@@ -251,6 +254,14 @@ class WelfareActivity : MyBaseActivity(), WelfareContract.View, ...@@ -251,6 +254,14 @@ class WelfareActivity : MyBaseActivity(), WelfareContract.View,
} }
} }
override fun taskTimeCd(time: Int?) {
if (time == 0 && mSid != null && mSid != 0) {
showAd(mSid!!)
} else {
Utils.showToast(this, "手速太快啦,${time}秒后再来吧")
}
}
fun showAd(sId: Int) { fun showAd(sId: Int) {
AdUtils.playRewardAd(this, "welfare_task", object : IAdVideoListener { AdUtils.playRewardAd(this, "welfare_task", object : IAdVideoListener {
override fun onAdClose() { override fun onAdClose() {
......
...@@ -9,6 +9,7 @@ class WelfareContract { ...@@ -9,6 +9,7 @@ class WelfareContract {
fun taskReceiveListResult(result: TaskCompleteEntity?) fun taskReceiveListResult(result: TaskCompleteEntity?)
fun taskCashResult(result: List<FlyBoxEntity>?) fun taskCashResult(result: List<FlyBoxEntity>?)
fun welfareTaskCashResult(result: ExchangeEntity?) fun welfareTaskCashResult(result: ExchangeEntity?)
fun taskTimeCd(time: Int?)
} }
interface Presenter { interface Presenter {
......
package com.ym.game.monopoly;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Configuration;
import android.os.Build;
import android.util.AttributeSet;
import android.webkit.WebView;
/**
* Craeted by ${junqi.li}
* Craeted by 2020/10/26
*/
public class LollipopFixedWebView extends WebView {
public LollipopFixedWebView(Context context) {
super(getFixedContext(context));
}
public LollipopFixedWebView(Context context, AttributeSet attrs) {
super(getFixedContext(context), attrs);
}
public LollipopFixedWebView(Context context, AttributeSet attrs, int defStyleAttr) {
super(getFixedContext(context), attrs, defStyleAttr);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public LollipopFixedWebView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(getFixedContext(context), attrs, defStyleAttr, defStyleRes);
}
public LollipopFixedWebView(Context context, AttributeSet attrs, int defStyleAttr, boolean privateBrowsing) {
super(getFixedContext(context), attrs, defStyleAttr, privateBrowsing);
}
public static Context getFixedContext(Context context) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
return context.createConfigurationContext(new Configuration());
}
} else {
return context;
}
return null;
}
}
...@@ -99,4 +99,23 @@ class WelfarePresenter : WelfareContract.Presenter { ...@@ -99,4 +99,23 @@ class WelfarePresenter : WelfareContract.Presenter {
} }
}) })
} }
fun getADShowTimer(){
GameApiClient.gameApi.getAdTimeCD().compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
mView?.taskTimeCd(result?.cd)
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView?.taskTimeCd(0)
}
})
}
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.ym.game.view ...@@ -3,6 +3,7 @@ package com.ym.game.view
import android.app.Activity import android.app.Activity
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
import android.content.DialogInterface
import android.view.Gravity import android.view.Gravity
import android.view.MotionEvent import android.view.MotionEvent
import android.view.View import android.view.View
...@@ -597,7 +598,9 @@ object MainDialog { ...@@ -597,7 +598,9 @@ object MainDialog {
//生虫弹窗 //生虫弹窗
fun showDialogWorm( fun showDialogWorm(
activity: Activity?, activity: Activity?,
onClickListener: View.OnClickListener isShow: Boolean,
onClickListener: View.OnClickListener,
onClickNoVideoListener: View.OnClickListener
) { ) {
if (activity == null) return if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme) val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
...@@ -614,13 +617,34 @@ object MainDialog { ...@@ -614,13 +617,34 @@ object MainDialog {
mDialogView.findViewById<ImageView>(R.id.id_img_close_clean_worm).setOnClickListener { mDialogView.findViewById<ImageView>(R.id.id_img_close_clean_worm).setOnClickListener {
mDialog.dismiss() mDialog.dismiss()
} }
var cleanWormBtn = mDialogView.findViewById<ImageView>(R.id.id_img_clean_worm)
mDialogView.findViewById<ImageView>(R.id.id_img_clean_worm).setOnClickListener { cleanWormBtn.setOnClickListener {
EventUtils.onEvent("click_clean_worm_video_btn", "除虫看视频点击") EventUtils.onEvent("click_clean_worm_video_btn", "除虫看视频点击")
onClickListener.onClick(it) onClickListener.onClick(it)
mDialog.dismiss() mDialog.dismiss()
} }
var cleanWormBtnNoVideo = mDialogView.findViewById<ImageView>(R.id.id_img_clean_worm_no_video)
cleanWormBtnNoVideo.setOnClickListener {
EventUtils.onEvent("click_clean_worm_btn", "除虫点击")
onClickNoVideoListener.onClick(it)
mDialog.dismiss()
}
//需要看视频
if (isShow){
cleanWormBtn.visibility=View.VISIBLE
cleanWormBtnNoVideo.visibility=View.GONE
}else{
cleanWormBtn.visibility=View.GONE
cleanWormBtnNoVideo.visibility=View.VISIBLE
}
mDialog.setOnDismissListener(object : DialogInterface.OnDismissListener {
override fun onDismiss(p0: DialogInterface?) {
// onDestroy()
AdUtils.loadFeedCacheAdToCache(activity)
}
})
mDialog?.setCanceledOnTouchOutside(false) mDialog?.setCanceledOnTouchOutside(false)
mDialog?.setCancelable(false) mDialog?.setCancelable(false)
if(activity.isFinishing){ if(activity.isFinishing){
...@@ -629,7 +653,6 @@ object MainDialog { ...@@ -629,7 +653,6 @@ object MainDialog {
mDialog?.show() mDialog?.show()
} }
//种子不足弹窗 //种子不足弹窗
fun showDialogSeedNotEnough( fun showDialogSeedNotEnough(
activity: Activity?, activity: Activity?,
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/worm_btn_press_no_video" android:state_pressed="true"/>
<item android:drawable="@drawable/worm_btn_no_video" android:state_pressed="false"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/id_rl_toolbar"
android:layout_width="match_parent"
android:layout_height="90dp"
android:background="@color/white">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignParentBottom="true">
<ImageView
android:id="@+id/id_iv_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="14dp"
android:src="@drawable/back_img" />
<TextView
android:id="@+id/tv_user_toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="#000000"
android:textSize="18sp"
android:textStyle="bold" />
</RelativeLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/ll_web"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ProgressBar
android:id="@+id/progressBar"
style="@style/crowd_item_progressBar"
android:layout_width="match_parent"
android:layout_height="3dp"
android:background="@color/white" />
<com.ym.game.monopoly.LollipopFixedWebView
android:id="@+id/activity_webview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_FEDA83" />
</LinearLayout>
<RelativeLayout
android:id="@+id/rl_anim"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:visibility="visible">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/id_lottie_dreams_come_true"
android:layout_width="161dp"
android:layout_height="128dp"
android:layout_marginBottom="-2dp"
app:lottie_autoPlay="true"
android:visibility="gone"
app:lottie_loop="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/id_lottie_dreams_come_true"
android:layout_centerHorizontal="true"
android:layout_marginTop="19dp"
android:text="努力加载中…"
android:textColor="#ff999999"
android:textSize="14sp" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
...@@ -74,9 +74,19 @@ ...@@ -74,9 +74,19 @@
android:layout_marginBottom="@dimen/dp_20" android:layout_marginBottom="@dimen/dp_20"
android:src="@drawable/select_clean_worm" /> android:src="@drawable/select_clean_worm" />
<ImageView
android:id="@+id/id_img_clean_worm_no_video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_20"
android:src="@drawable/select_clean_worm_no_video"
android:visibility="gone" />
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>
<include layout="@layout/layout_base_feed_ad"/> <include layout="@layout/layout_base_feed_ad" />
</LinearLayout> </LinearLayout>
...@@ -11,4 +11,12 @@ ...@@ -11,4 +11,12 @@
<item name="android:windowEnterAnimation">@anim/main_popup_enter_anim</item> <item name="android:windowEnterAnimation">@anim/main_popup_enter_anim</item>
<item name="android:windowExitAnimation">@anim/main_popup_exit_anim</item> <item name="android:windowExitAnimation">@anim/main_popup_exit_anim</item>
</style> </style>
<style name="crowd_item_progressBar">
<item name="android:indeterminateOnly">false</item>
<item name="android:progressDrawable">@color/color_ffffff</item>
<item name="android:minHeight">10dp</item>
<item name="android:maxHeight">10dp</item>
</style>
</resources> </resources>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<activity <activity
android:name="com.game.luckyfarm.UnityPlayerActivity" android:name="com.game.luckyfarm.UnityPlayerActivity"
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density"
android:hardwareAccelerated="false" android:hardwareAccelerated="true"
android:label="@string/app_name" android:label="@string/app_name"
android:launchMode="singleTask" android:launchMode="singleTask"
android:screenOrientation="portrait"> android:screenOrientation="portrait">
......
...@@ -64,10 +64,10 @@ dependencies { ...@@ -64,10 +64,10 @@ dependencies {
api 'com.android.support:recyclerview-v7:28.0.0' api 'com.android.support:recyclerview-v7:28.0.0'
api 'com.tencent.bugly:crashreport:latest.release' api 'com.tencent.bugly:crashreport:latest.release'
api 'com.tencent.bugly:nativecrashreport:latest.release' api 'com.tencent.bugly:nativecrashreport:latest.release'
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.3.14' api 'com.ym.admodule:admodule:1.0.3.15'
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'
......
...@@ -5,6 +5,9 @@ import android.os.Build; ...@@ -5,6 +5,9 @@ import android.os.Build;
import com.ym.library.net.LatestLoginInfo; import com.ym.library.net.LatestLoginInfo;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List; import java.util.List;
/** /**
...@@ -157,6 +160,16 @@ public class MyConstant { ...@@ -157,6 +160,16 @@ public class MyConstant {
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;//
@Nullable
public static int videoNumber = 0;
public static int videoCount = 15;
public static long videoTime = 0;
public static long videoTimeOut = 0;
@NotNull
public static int[] animationLocation;
public static int isopenranking;
public static boolean hasWishGood =false;
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;
......
package com.ym.library.listener
/**
* Created by erwin on 2020/11/23
*
*/
interface H5Listener {
fun onDialogClose(type: String,shutdownType:Int)
}
\ No newline at end of file
package com.ym.library.module
class BubbleOrBoxReceiveEntity {
var balance: Int? = 0
}
\ No newline at end of file
...@@ -31,6 +31,15 @@ public class HomeInfoEntity { ...@@ -31,6 +31,15 @@ public class HomeInfoEntity {
private int subSeedVideoNum;//看种子不足视频剩余次数 private int subSeedVideoNum;//看种子不足视频剩余次数
private int acceleratorsVideoNum;//看视频给加速剂的个数 private int acceleratorsVideoNum;//看视频给加速剂的个数
private int lotteryNum;//转盘剩余次数 private int lotteryNum;//转盘剩余次数
private int isPopup;//是否选过商品
public int getIsPopup() {
return isPopup;
}
public void setIsPopup(int isPopup) {
this.isPopup = isPopup;
}
public int getLotteryNum() { public int getLotteryNum() {
return lotteryNum; return lotteryNum;
......
...@@ -19,7 +19,33 @@ public class NewLandListEntity { ...@@ -19,7 +19,33 @@ public class NewLandListEntity {
private int rate; private int rate;
private int configNum; private int configNum;
private float timeRate; private float timeRate;
private int videoRate;
private int stopConfigNum;
private int currentWormNum;
private List<LandListEntity> landList; private List<LandListEntity> landList;
public int getCurrentWormNum() {
return currentWormNum;
}
public void setCurrentWormNum(int currentWormNum) {
this.currentWormNum = currentWormNum;
}
public int getStopConfigNum() {
return stopConfigNum;
}
public void setStopConfigNum(int stopConfigNum) {
this.stopConfigNum = stopConfigNum;
}
public int getVideoRate() {
return videoRate;
}
public void setVideoRate(int videoRate) {
this.videoRate = videoRate;
}
public float getTimeRate() { public float getTimeRate() {
return timeRate; return timeRate;
......
...@@ -17,6 +17,15 @@ public class StatusEntity { ...@@ -17,6 +17,15 @@ public class StatusEntity {
private int videoNum; private int videoNum;
private int awardNum; private int awardNum;
private int acceleratorsNum; private int acceleratorsNum;
private int cd;
public int getCd() {
return cd;
}
public void setCd(int cd) {
this.cd = cd;
}
public int getAcceleratorsNum() { public int getAcceleratorsNum() {
return acceleratorsNum; return acceleratorsNum;
......
package com.ym.library.net package com.ym.library.net
import android.text.TextUtils import android.text.TextUtils
import com.ym.library.BuildConfig import com.ym.admodule.BuildConfig
import com.ym.library.MyConstant import com.ym.library.MyConstant
import com.ym.modulecommon.net.NetConfig import com.ym.modulecommon.net.NetConfig
import com.ym.modulecommon.utils.AdPreference import com.ym.modulecommon.utils.AdPreference
......
...@@ -69,5 +69,5 @@ object GameApiClient { ...@@ -69,5 +69,5 @@ object GameApiClient {
.build() .build()
val gameApi by lazy { retrofit.create(IGameApi::class.java) } val gameApi by lazy { retrofit.create(IGameApi::class.java) }
val report by lazy { retrofit.create(IReportApi::class.java) }
} }
\ No newline at end of file
...@@ -351,4 +351,19 @@ interface IGameApi { ...@@ -351,4 +351,19 @@ interface IGameApi {
*/ */
@GET(NetConfig.Game.URL_GAME_WAREHOUSEDATA) @GET(NetConfig.Game.URL_GAME_WAREHOUSEDATA)
fun getWarehouseData(): Observable<Response<List<FlyBoxEntity>>> fun getWarehouseData(): Observable<Response<List<FlyBoxEntity>>>
@POST("app/v3/common/award/multiple")
fun h5Receive(
@Query("sid") id: String
): Observable<Response<BubbleOrBoxReceiveEntity?>>
@GET(NetConfig.Game.URL_GAME_AD_TIME_CD)
fun getAdTimeCD():Observable<Response<StatusEntity?>>
@POST(NetConfig.Game.URL_GAME_AD_VIDEO_REPORT)
fun adVideoReport(@Query("slot") slot:String): Observable<Response<Any>>
} }
\ No newline at end of file
package com.ym.library.net
import com.ym.modulecommon.net.Response
import io.reactivex.Observable
import retrofit2.http.GET
interface IReportApi {
@GET("app/v1/pigbox/reporting")
fun report(): Observable<Response<Any?>>
}
\ No newline at end of file
...@@ -133,6 +133,9 @@ public class NetConfig { ...@@ -133,6 +133,9 @@ public class NetConfig {
public static String WEB_URL_REVENUERANKINGURL; //收益排行 public static String WEB_URL_REVENUERANKINGURL; //收益排行
public static String WEB_URL_PURSEURL; //十万金币跳转 public static String WEB_URL_PURSEURL; //十万金币跳转
public static String CONFIRMURL = "http://h5v2test.zhangxinzhixun.com/monopoly/Confirm";//梦想成真
public static int mDFWType = 1;//大富翁type
} }
public static class Novel { public static class Novel {
...@@ -242,5 +245,7 @@ public class NetConfig { ...@@ -242,5 +245,7 @@ public class NetConfig {
public static final String URL_GAME_ORDER_LIST = "app/v1/game/ddhy/list_order";//花园 订单列表 public static final String URL_GAME_ORDER_LIST = "app/v1/game/ddhy/list_order";//花园 订单列表
public static final String URL_GAME_WITHDRAW_LIST = "app/v1/game/ddhy/withdraw_list";//兑换列表 public static final String URL_GAME_WITHDRAW_LIST = "app/v1/game/ddhy/withdraw_list";//兑换列表
public static final String URL_GAME_DOWD = "app/v1/game/ddhy/do_wd";//兑换接口 public static final String URL_GAME_DOWD = "app/v1/game/ddhy/do_wd";//兑换接口
//看广告间隔
public static final String URL_GAME_AD_TIME_CD = "app/v1/game/video_cd";
} }
} }
...@@ -131,6 +131,7 @@ class NovelInitEntity { ...@@ -131,6 +131,7 @@ class NovelInitEntity {
var clockInzurl:String?=""//打卡提现 var clockInzurl:String?=""//打卡提现
var rankingurl:String?=""//排行榜 var rankingurl:String?=""//排行榜
var withdrawurl:String?=""//提现页面 var withdrawurl:String?=""//提现页面
var Confirmurl:String?=""//大富翁
} }
class WxConfig { class WxConfig {
......
...@@ -305,7 +305,7 @@ class SplashPresenter : SplashContract.Presenter { ...@@ -305,7 +305,7 @@ class SplashPresenter : SplashContract.Presenter {
MyConstant.Param.PunchRecord = mNovelInitEntity.h5_url?.clockInzurl MyConstant.Param.PunchRecord = mNovelInitEntity.h5_url?.clockInzurl
MyConstant.Param.RankList = mNovelInitEntity.h5_url?.rankingurl MyConstant.Param.RankList = mNovelInitEntity.h5_url?.rankingurl
MyConstant.Param.WithDraw = mNovelInitEntity.h5_url?.withdrawurl MyConstant.Param.WithDraw = mNovelInitEntity.h5_url?.withdrawurl
NetConfig.H5.CONFIRMURL = mNovelInitEntity.h5_url?.Confirmurl
} }
......
package com.ym.library.presenter
import com.ym.library.net.GameApiClient
import com.ym.modulecommon.net.BaseObserver
import com.ym.modulecommon.net.RxSchedulers
object ReportPresenter {
fun report() {
GameApiClient.report.report().compose(RxSchedulers.observableIO2Main()).subscribe(object : BaseObserver<Any?>() {
override fun onSuccess(result: Any?) {
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
}
})
}
}
\ No newline at end of file
...@@ -29,6 +29,13 @@ interface RounterApi { ...@@ -29,6 +29,13 @@ interface RounterApi {
@RounterParam("showToolbar") showToolbar: Boolean @RounterParam("showToolbar") showToolbar: Boolean
): Intent ): Intent
@RounterUri(MyConstant.scheme + "://nomal_web")
fun getIntentNomalActivityWeb(
@RounterParam("title") title: String,
@RounterParam("url") url: String,
@RounterParam("showToolbar") showToolbar: Boolean
): Intent
@RounterUri(MyConstant.scheme + "://adshare") @RounterUri(MyConstant.scheme + "://adshare")
fun getIntentActivityAdShare(@RounterParam("data") data: String): Intent fun getIntentActivityAdShare(@RounterParam("data") data: String): Intent
......
...@@ -46,11 +46,21 @@ object AdUtils { ...@@ -46,11 +46,21 @@ object AdUtils {
//预加载 //预加载
// loadNextCacheRewardVideoAd(activity) // loadNextCacheRewardVideoAd(activity)
//看视频上报 //看视频上报
getVideoAcceleratorsReceive(); if ("welfare_task".equals(actionName)) {
getVideoAcceleratorsReceive("center_video_cd")
} else {
getVideoAcceleratorsReceive()
}
handler?.removeCallbacksAndMessages(null) handler?.removeCallbacksAndMessages(null)
} }
override fun onAdShow() { override fun onAdShow() {
if (actionName.equals("jiacishu")){
EventUtils.onEvent("dfw_touzi_video_show", "大富翁骰子视频曝光");
}
if (actionName.equals("kengwei")){
EventUtils.onEvent("dfw_qipan_video_show", "大富翁棋盘视频曝光");
}
Utils.showToast(activity, "看完视频可获得奖励") Utils.showToast(activity, "看完视频可获得奖励")
handler?.sendEmptyMessageDelayed(0, 2000) handler?.sendEmptyMessageDelayed(0, 2000)
} }
...@@ -100,11 +110,26 @@ object AdUtils { ...@@ -100,11 +110,26 @@ object AdUtils {
.compose(RxSchedulers.observableIO2Main()) .compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() { .subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) { override fun onSuccess(result: StatusEntity?) {
Log.d("wxw", "看视频上报 Success")
} }
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) { override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
Log.d("wxw", "看视频上报 error")
}
})
}
//看视频复活上报
fun getVideoAcceleratorsReceive(slot: String) {
GameApiClient.gameApi.adVideoReport(slot)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<Any>() {
override fun onSuccess(result: Any?) {
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
} }
}) })
} }
......
...@@ -2,6 +2,8 @@ package com.ym.library.utils; ...@@ -2,6 +2,8 @@ package com.ym.library.utils;
import android.text.TextUtils; import android.text.TextUtils;
import org.jetbrains.annotations.Nullable;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
...@@ -666,5 +668,18 @@ public class DateUtils { ...@@ -666,5 +668,18 @@ public class DateUtils {
return time ; return time ;
} }
public static double numbToDoule(String number) {
if(number!=null){
return Double.parseDouble(number);
}else {
return 0.0;
}
}
@Nullable
public static Object doubleToInt(double number) {
return Integer.parseInt(""+number);
}
} }
package com.ym.library.utils
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.ym.library.utils.MainLooper
import com.ym.modulecommon.AppliContext
/**
* Created by erwin on 2020/11/26
*
*/
object DialogCloseUtils {
fun setTimes(tv:TextView,iv:ImageView){
tv.visibility = View.VISIBLE
iv.visibility = View.GONE
tv.text = "3"
LJButtonCountTimer(AppliContext.get(), 3000, 1000, tv,iv).start()
}
}
\ No newline at end of file
...@@ -11,6 +11,7 @@ import com.ym.library.listener.IAdVideoListener; ...@@ -11,6 +11,7 @@ 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.net.NetConfig;
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;
...@@ -48,6 +49,18 @@ public class JumpUtils { ...@@ -48,6 +49,18 @@ public class JumpUtils {
Utils.showToast(AppliContext.get(), "该版本暂不支持,请更新版本!"); Utils.showToast(AppliContext.get(), "该版本暂不支持,请更新版本!");
} }
} }
public static void h5NormalJump(String title, String url,boolean showToolbar,Activity activity) {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentNomalActivityWeb(title, url,showToolbar);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
if (activity!=null){
activity.startActivity(intent);
}
} catch (Exception e) {
Utils.showToast(AppliContext.get(), "该版本暂不支持,请更新版本!");
}
}
public static void gatherJump(String CChannel, String pid, String albumId, String description, String area, String tvYear, public static void gatherJump(String CChannel, String pid, String albumId, String description, String area, String tvYear,
String score, String contentType, String name, String image, boolean topVisibleFlag, String score, String contentType, String name, String image, boolean topVisibleFlag,
...@@ -359,6 +372,14 @@ public class JumpUtils { ...@@ -359,6 +372,14 @@ public class JumpUtils {
//绑定微信号跳转 //绑定微信号跳转
} else if (TextUtils.equals("2080", sid + "")) { } else if (TextUtils.equals("2080", sid + "")) {
//签到提现任务 //签到提现任务
} else if (TextUtils.equals("2497", sid + "")) {
//掷骰子
JumpUtils.h5NormalJump(
"大富翁",
NetConfig.H5.CONFIRMURL + "?is_popup1=" + NetConfig.H5.mDFWType,
false,
activity
);
} else if (incentiveLevel > 0) { } else if (incentiveLevel > 0) {
if (sid.equals("2325")) { if (sid.equals("2325")) {
//成就殿堂 //成就殿堂
......
package com.ym.library.utils;
import android.content.Context;
import android.graphics.Color;
import android.os.CountDownTimer;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
/**
* 按钮倒计时
* @author lbm
*
*/
public class LJButtonCountTimer extends CountDownTimer {
TextView mButton;
ImageView close;
Context mContext;
public LJButtonCountTimer(Context ctx, long millisInFuture, long countDownInterval, TextView button, ImageView close) {
super(millisInFuture, countDownInterval);
this.mButton = button;
this.mContext = ctx;
this.close = close;
}
@Override
public void onFinish() {
mButton.setTextColor(Color.parseColor("#EED685"));
mButton.setVisibility(View.GONE);
close.setVisibility(View.VISIBLE);
mButton.setEnabled(true);
cancel();
}
@Override
public void onTick(long arg0) {
mButton.setTextColor(Color.parseColor("#EED685"));
mButton.setText(((arg0/1000)+1)+"");
mButton.setEnabled(false);
}
}
package com.ym.library.utils
import android.content.Context
import android.text.Html
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.widget.TextView
import android.widget.Toast
import com.ym.library.R
import com.ym.modulecommon.AppliContext
/**
* Created by erwin on 2020/11/5
*
*/
object ToastUtils {
/**
* 弹出文字
*/
fun showTextToast(s: String) {
val context: Context = AppliContext.get()
val view: View = LayoutInflater.from(context).inflate(R.layout.toast_text_layout, null)
val title: TextView = view.findViewById(R.id.toast_tv) as TextView
title.setText(s)
showToast(context, view)
}
private fun showToast(context: Context, view: View) {
val toast = Toast(context)
toast.setGravity(Gravity.CENTER_HORIZONTAL or Gravity.CENTER, 0, 0)
toast.setDuration(Toast.LENGTH_LONG)
toast.setView(view)
toast.show()
}
}
\ No newline at end of file
package com.ym.library.utils
import com.ym.library.MyConstant
/**
* Created by erwin on 2020/11/23
*
*/
object VideoNumberUtils {
fun setVideoNumber(){
MyConstant.videoNumber = MyConstant.videoNumber+1
if (MyConstant.videoNumber < MyConstant.videoCount) {
//ToastUtils.showTextToast("再观看${(MyConstant.videoCount - MyConstant.videoNumber)}个视频即可完成今日打卡")
}
}
}
\ No newline at end of file
package com.ym.library.utils
import com.ym.library.MyConstant
/**
* Created by erwin on 2020/11/20
*
* 视频20秒才能观看的utils
*
*/
object VideoTimeUtils {
fun isCanShowReward():Boolean{
return true
// if(System.currentTimeMillis()- Constant.videoTime< Constant.videoTimeOut){
// Toast.makeText(
// AppliContext.get(),"${(Constant.videoTimeOut-(System.currentTimeMillis()- Constant.videoTime))/1000}秒后再来领取吧",
// Toast.LENGTH_SHORT).show()
// }else{
// return true
// }
// return false
}
fun setVideoTime() {
MyConstant.videoTime = System.currentTimeMillis()
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="10dp" />
<stroke android:color="#fae18a" android:width="5dp"/>
<solid android:color="@color/white"/>
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<corners android:radius="10dp"/>
<solid android:color="#80000000"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
android:id="@+id/ad_framelayout"
android:layout_below="@+id/rl_content"
android:layout_margin="10dp"
android:padding="8dp"
android:background="@drawable/shape_ad_r10"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="260dp"
xmlns:android="http://schemas.android.com/apk/res/android" />
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="50dp"
android:layout_marginRight="6dp"
android:layout_alignParentRight="true"
android:layout_height="50dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<TextView
android:textSize="18sp"
android:text="3"
android:gravity="center"
android:layout_centerInParent="true"
android:textColor="@color/white"
android:visibility="gone"
android:background="@drawable/close_text_button"
android:layout_width="30dp"
android:id="@+id/id_tv_close_button"
android:layout_height="30dp"/>
<ImageView
android:id="@+id/id_iv_dismiss"
android:layout_width="wrap_content"
android:visibility="visible"
android:layout_centerInParent="true"
android:layout_height="wrap_content"
android:src="@drawable/icon_dialog_home_dismiss"
/>
</RelativeLayout>
\ No newline at end of file
This diff is collapsed.
<?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">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:gravity="center"
android:layout_centerInParent="true"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="289dp"
android:layout_height="288dp"
android:id="@+id/rl_content"
android:background="@drawable/bg_dialog_home_style_1"
android:layout_centerInParent="true">
<TextView
android:id="@+id/id_tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffa26a3b"
android:textSize="20sp"
android:text="恭喜获得"
android:textStyle="bold"
android:layout_centerHorizontal="true"
android:layout_marginTop="14dp"/>
<include layout="@layout/dialog_close_style"/>
<LinearLayout
android:id="@+id/id_ll_congratulations"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="54dp"
android:orientation="vertical"
android:gravity="center_horizontal"
android:visibility="gone">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_dialog_home_gold"
android:layout_marginBottom="20dp"
android:layout_marginTop="22dp"/>
<TextView
android:id="@+id/id_tv_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0金币"
android:textColor="#ffa26a3b"
android:textSize="20sp"
android:layout_marginBottom="15dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_below="@+id/id_tv_title"
android:layout_marginTop="45dp"
android:visibility="gone"
android:id="@+id/ll_big_money"
android:gravity="center_horizontal"
android:layout_centerHorizontal="true"
android:layout_height="wrap_content">
<ImageView
android:src="@drawable/heart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/tv_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3个心愿值"
android:textColor="#ffa26a3b"
android:layout_marginTop="20dp"
android:textSize="20sp"
/>
</LinearLayout>
<!--2 升级奖励-->
<LinearLayout
android:id="@+id/id_ll_upgrade"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="54dp"
android:orientation="vertical"
android:gravity="center_horizontal"
android:visibility="gone">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="-20dp"
android:layout_marginTop="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0.3元"
android:id="@+id/tv_red_title"
android:textColor="#ffa26a3b"
android:textSize="18sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="秒到账"
android:textColor="#f73737"
android:textSize="18sp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="红包"
android:textColor="#ffa26a3b"
android:textSize="18sp"/>
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_dialog_home_red_paper"/>
<TextView
android:layout_centerHorizontal="true"
android:text="0.3"
android:id="@+id/tv_red_number"
android:textColor="@color/white"
android:textSize="18sp"
android:layout_marginTop="50dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/iv_red_ok"
android:background="@drawable/bg_dialog_home_ok"
android:layout_marginTop="-20dp"
android:layout_marginBottom="8dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="奖励已发送到您的微信"
android:textColor="#ffa26a3b"
android:textSize="15sp"/>
</LinearLayout>
<ImageView
android:layout_marginTop="17dp"
android:id="@+id/iv_ok"
android:visibility="gone"
android:layout_marginBottom="20dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:src="@drawable/bg_dialog_home_accept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
<include layout="@layout/ad_layout_framelayout"
/>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="26dp"
android:paddingTop="22dp"
android:gravity="center"
android:id="@+id/toast_tv"
android:background="@drawable/toast_bg"
android:paddingBottom="28dp"
android:paddingRight="26dp"
android:text="再观看x个视频即可完成今日打卡"
android:textColor="#ffffffff"
android:textSize="18sp"
/>
</LinearLayout>
\ 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