Commit 7dabf76c authored by jyx's avatar jyx

金币弹框页添加超级翻倍

parent d140cdb2
......@@ -81,13 +81,15 @@ class InitAppService : IntentService("InitializeService") {
PRDownloader.initialize(this, config)
}
/**
* 微转分享
*/
private fun initWzShare() {
val iwxapi = WXAPIFactory.createWXAPI(this, "wxc8ac2985f6a805e2", false)
iwxapi.registerApp("wxc8ac2985f6a805e2")
XzArticleSdk.get().init(MintsApplication.getContext(), iwxapi, "151", "haozhuanqian")
}
/**
* 绑定jpush
*/
......
......@@ -10,8 +10,6 @@ import android.webkit.WebView;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.multidex.MultiDexApplication;
import com.downloader.PRDownloader;
import com.downloader.PRDownloaderConfig;
import com.hjq.toast.ToastUtils;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.ChannelManager;
......@@ -121,16 +119,6 @@ public class MintsApplication extends MultiDexApplication {
// 按渠道匹配代码位
ChannelManager.INSTANCE.updataCodeIdForRegisterChannel(null);
// 子线程初始化三方SDK
String processName = SystemUtils.INSTANCE.getProcessName(this, android.os.Process.myPid());
if (processName != null) {
// 判断onCreate方法执行是否在当前应用的application上
boolean defaultProcess = TextUtils.equals(processName, Constant.MINTS_PKG_NAME);
if (defaultProcess) {
InitAppService.Companion.start(this); //初始化数据
}
}
// 优量汇
YlhAdManager.INSTANCE.initYlhAd(this);
......@@ -158,12 +146,18 @@ public class MintsApplication extends MultiDexApplication {
// 自定义logger
bindLogger();
// PR下载附件
// initPRDownloader();
// 天卓珊瑚
TzManager.INSTANCE.initTz(this);
// 子线程初始化三方SDK
String processName = SystemUtils.INSTANCE.getProcessName(this, android.os.Process.myPid());
if (processName != null) {
// 判断onCreate方法执行是否在当前应用的application上
boolean defaultProcess = TextUtils.equals(processName, Constant.MINTS_PKG_NAME);
if (defaultProcess) {
InitAppService.Companion.start(this); //初始化数据
}
}
}
/**
......@@ -197,16 +191,6 @@ public class MintsApplication extends MultiDexApplication {
Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy));
}
/**
* PR下载附件
*/
private void initPRDownloader() {
PRDownloaderConfig config = PRDownloaderConfig.newBuilder()
.setDatabaseEnabled(true)
.build();
PRDownloader.initialize(this, config);
}
private MiitHelper.AppIdsUpdater appIdsUpdater = ids -> OAID = ids;
/**
......
package com.mints.goodmoney.ad.tz_ad;
package com.mints.goodmoney.ad.download;
import androidx.annotation.Nullable;
......@@ -20,7 +20,7 @@ import java.util.HashMap;
import java.util.List;
/**
* 下载
* 珊瑚CPD下载安装试玩
*/
public final class CoralDownload {
......
......@@ -21,7 +21,7 @@ object AppTryPlayManager {
fun getTryPlayIsOK(pkg: String, useTime: Int): Boolean {
val timePkgUsed = AppUtil.getTimePkgUsed(MintsApplication.getContext(), pkg)
LogUtil.d("AAAAAAAAA" + timePkgUsed)
LogUtil.d("AppTryPlayManager -> " + timePkgUsed)
return timePkgUsed >= useTime
}
......
......@@ -57,7 +57,13 @@ public class AwardPresenter extends BasePresenter<AwardView> {
if (riskinfoRateElement != null) {
riskFlag = data.get("riskinfoRate").getAsBoolean();
}
view.getUserTaskMsgSuc(data.get("coin").getAsInt(),riskFlag );
boolean hideSomeodular = false;
JsonElement hideSomeodularElement = data.get("hideSomeodular");
if (hideSomeodularElement != null) {
hideSomeodular = data.get("hideSomeodular").getAsBoolean();
}
view.getUserTaskMsgSuc(data.get("coin").getAsInt(), riskFlag, hideSomeodular);
}
break;
default:
......
package com.mints.goodmoney.mvp.views
import com.mints.goodmoney.mvp.model.UserTaskMsgBean
interface AwardView : BaseView {
/**
* 获取用户配置信息成功
*/
fun getUserTaskMsgSuc(coin: Int,riskFlag:Boolean)
fun getUserTaskMsgSuc(coin: Int, riskFlag: Boolean, hideSomeodular: Boolean)
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.tz_ad.CoralDownload
import com.mints.goodmoney.ad.download.CoralDownload
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.AppTryPlayManager
import com.mints.goodmoney.manager.DownloadApkManager
......@@ -169,7 +169,6 @@ class TaskActivity : BaseActivity(), OnItemClickListener, OnRefreshListener, Cor
}
private fun clickDialog(position: Int) {
taskDialog = TaskDialog(this)
taskDialog?.setData(mTaskList[position], needUseTime, mCoin)
taskDialog?.show()
......@@ -197,10 +196,13 @@ class TaskActivity : BaseActivity(), OnItemClickListener, OnRefreshListener, Cor
}
override fun onLoadFail() {
iv_empty.visibility = View.VISIBLE
hideLoading()
showToast("加载失败,请下拉刷新重试")
hideLoading()
mTaskList.clear()
mTaskAdapter?.notifyDataSetChanged()
iv_empty.visibility = View.VISIBLE
srl_task.finishRefresh(false)
}
......
......@@ -71,7 +71,7 @@ object AppUtil {
val usageStatsManager = ctx.getSystemService("usagestats") as UsageStatsManager
val time = System.currentTimeMillis()
// 过去5分钟内app使用情况
val queryUsageStats = usageStatsManager.queryUsageStats(UsageStatsManager.INTERVAL_DAILY, time - 5 * 60 * 1000, time)
val queryUsageStats = usageStatsManager.queryUsageStats(UsageStatsManager.INTERVAL_DAILY, time - 5 * 6 * 1000, time)
var totalTime = 0L
if (queryUsageStats.size > 0) {
for (usageStat in queryUsageStats) {
......@@ -118,7 +118,7 @@ object AppUtil {
if (StringUtilMy.stringAvalable(paramString) && checkPackInfo(paramContext, paramString) && Build.VERSION.SDK_INT >= 21) {
val usageStatsManager = paramContext.getSystemService("usagestats") as UsageStatsManager
var l = System.currentTimeMillis()
val list = usageStatsManager.queryUsageStats(4, l - 6 * 60 * 1000L, l)
val list = usageStatsManager.queryUsageStats(4, l - 5 * 6 * 1000L, l)
if (list != null && list.size > 0) for (i in list.indices) {
val str = (list[i] as UsageStats).packageName
(list[i] as UsageStats).lastTimeUsed
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 弧形的半径 -->
<corners android:radius="20dip" />
<!-- 渐变色 -->
<solid android:color="#fffd9a2a" />
</shape>
\ 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="20dip" />
<!-- 渐变色 -->
<solid android:color="#fffd8d26" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="6dp" />
<solid android:color="@color/color_50000000" />
<solid android:color="@color/color_20000000" />
</shape>
\ 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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -9,14 +10,14 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="110dp"
android:layout_marginRight="30dp">
android:layout_marginTop="90dp"
android:layout_marginEnd="30dp">
<TextView
android:id="@+id/tvAwardBack"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:background="@drawable/shape_back"
android:gravity="center"
android:text="3"
......@@ -27,13 +28,12 @@
android:id="@+id/ivAwardBack"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:src="@mipmap/ic_drink_cancel"
android:visibility="gone" />
</RelativeLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
......@@ -53,47 +53,110 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="70dp"
android:layout_marginTop="60dp"
android:layout_marginBottom="10dp"
android:textColor="@color/color_333"
android:textSize="18sp"
android:textSize="20sp"
tools:text="恭喜获取120金币" />
<TextView
android:id="@+id/tvAwardHint"
android:layout_width="wrap_content"
android:id="@+id/tvAwardHighContent"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textColor="@color/color_AAA"
android:textSize="18sp"
android:visibility="gone"
tools:text="123" />
android:layout_marginBottom="10dp"
android:background="@drawable/shape_tips"
android:gravity="center"
android:padding="6dp"
android:textSize="14sp"
android:visibility="gone" />
<TextView
android:id="@+id/tvAwardNext"
android:id="@+id/tvAwardHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:background="@drawable/shape_tv_gold"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:paddingRight="20dp"
android:paddingBottom="10dp"
android:text="领取金币"
android:textColor="@color/white"
android:textSize="14sp" />
android:textColor="@color/color_AAA"
android:textSize="18sp"
android:visibility="gone" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tvAwardNext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/shape_btn_gold_left"
android:drawablePadding="4dp"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="10dp"
android:text="领取金币"
android:textColor="@color/white"
android:textSize="14sp"
app:layout_constraintEnd_toStartOf="@+id/tvAwardHigh"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvAwardHigh"
android:layout_width="160dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="@drawable/shape_btn_gold_right"
android:drawablePadding="4dp"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="超级加倍领取"
android:textColor="@color/white"
android:textSize="14sp"
android:visibility="gone"
app:drawableStartCompat="@mipmap/icon_video"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/tvAwardNext"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvAwardHighInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="12sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/tvAwardHigh"
app:layout_constraintStart_toStartOf="@+id/tvAwardHigh"
app:layout_constraintTop_toBottomOf="@id/tvAwardHigh" />
<TextView
android:id="@+id/tvAwardHighInfo2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textSize="12sp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/tvAwardNext"
app:layout_constraintStart_toStartOf="@+id/tvAwardNext"
app:layout_constraintTop_toBottomOf="@+id/tvAwardNext" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tvAwardCash"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="14dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:textColor="@color/color_333"
android:textSize="14sp"
tools:text="123" />
android:textSize="14sp" />
</LinearLayout>
......@@ -105,23 +168,14 @@
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:id="@+id/flAwardAd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="25dp"
android:layout_marginTop="10dp"
android:layout_marginRight="25dp"
android:background="@drawable/shape_bg_write">
android:background="@drawable/shape_bg_award" />
<FrameLayout
android:id="@+id/flAwardAd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/color_0000">
</FrameLayout>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
......@@ -80,7 +80,7 @@
android:layout_gravity="end"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:buttonTint="@color/color_00895B"
android:buttonTint="@color/color_FF9837"
android:clickable="false" />
</FrameLayout>
\ No newline at end of file
......@@ -10,6 +10,7 @@
<color name="color_ccc">#cccccc</color>
<color name="color_AAA">#AAAAAA</color>
<color name="color_0000">#00000000</color>
<color name="color_20000000">#20000000</color>
<color name="color_60000000">#60000000</color>
<color name="color_50000000">#50000000</color>
<color name="color_2B3238">#2B3238</color>
......
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