Commit 38df2f03 authored by mengcuiguang's avatar mengcuiguang

代码优化

parents d92cbc98 f40fa2a3
...@@ -9,8 +9,8 @@ android { ...@@ -9,8 +9,8 @@ android {
applicationId "com.mints.goodmoney" applicationId "com.mints.goodmoney"
minSdkVersion rootProject.ext.androidMinSdkVersion minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 6 versionCode 7
versionName "1.0.5" versionName "1.0.6"
flavorDimensions "default" flavorDimensions "default"
// dex突破65535的限制 // dex突破65535的限制
...@@ -180,7 +180,7 @@ dependencies { ...@@ -180,7 +180,7 @@ dependencies {
// 三方接入 // 三方接入
// leakcanary // leakcanary
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4' // debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
// 极光推送 // 极光推送
implementation 'cn.jiguang.sdk:jpush:3.6.6' implementation 'cn.jiguang.sdk:jpush:3.6.6'
implementation 'cn.jiguang.sdk:jcore:2.3.8' implementation 'cn.jiguang.sdk:jcore:2.3.8'
...@@ -192,6 +192,8 @@ dependencies { ...@@ -192,6 +192,8 @@ dependencies {
implementation(name: 'GDTSDK.unionNoPlugin.4.294.1164', ext: 'aar') implementation(name: 'GDTSDK.unionNoPlugin.4.294.1164', ext: 'aar')
// shareSdk // shareSdk
implementation project(':shareSdkLib') implementation project(':shareSdkLib')
// 应用管理中心分包
implementation(name: 'humesdk-1.0.0', ext: 'aar')
// umeng // umeng
implementation 'com.umeng.umsdk:common:9.1.0' // (必选) implementation 'com.umeng.umsdk:common:9.1.0' // (必选)
implementation 'com.umeng.umsdk:asms:1.1.3' // asms包依赖(必选) implementation 'com.umeng.umsdk:asms:1.1.3' // asms包依赖(必选)
...@@ -202,6 +204,7 @@ dependencies { ...@@ -202,6 +204,7 @@ dependencies {
implementation("com.yilan.sdk:ui:3.0.0.3") { implementation("com.yilan.sdk:ui:3.0.0.3") {
exclude group: 'com.yilan.sdk', module: 'toutiao' exclude group: 'com.yilan.sdk', module: 'toutiao'
exclude group: 'com.yilan.sdk', module: 'gdt' exclude group: 'com.yilan.sdk', module: 'gdt'
exclude group: 'com.yilan.sdk', module: 'ks'
} }
implementation('com.aliyun.ams:alicloud-android-httpdns:1.2.3@aar') { implementation('com.aliyun.ams:alicloud-android-httpdns:1.2.3@aar') {
transitive true transitive true
...@@ -234,7 +237,21 @@ dependencies { ...@@ -234,7 +237,21 @@ dependencies {
implementation(name: 'bxmsdk-release-3.0.0-csj3300', ext: 'aar') implementation(name: 'bxmsdk-release-3.0.0-csj3300', ext: 'aar')
// 闪电盒子 // 闪电盒子
implementation(name: 'wannuosili_ad_2.0.0', ext: 'aar') implementation(name: 'wannuosili_ad_2.0.0', ext: 'aar')
// 瑞狮新闻
implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
implementation(name: 'xrsdk-release_tbs', ext: 'aar')
// 枫岚
implementation(name: 'mh-adsdk', ext: 'aar')
implementation(name: 'mh-adsdk-ext', ext: 'aar')
implementation(name: 'ks_3.3.5.3', ext: 'aar')
// 聚乐云
implementation(name: 'okgo-2.1', ext: 'aar')
implementation(name: 'scenemodule-2.1', ext: 'aar')
implementation(name: 'scenead-2.1', ext: 'aar')
implementation 'com.just.agentweb:agentweb:4.1.2'
// implementation 'com.squareup.okio:okio:1.13.0'
// implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
// testImplementation 'junit:junit:4.13' // testImplementation 'junit:junit:4.13'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2' // androidTestImplementation 'androidx.test.ext:junit:1.1.2'
......
...@@ -489,4 +489,35 @@ ...@@ -489,4 +489,35 @@
# ===================== 闪电盒子 START ================ # ===================== 闪电盒子 START ================
-keep class com.wannuosili.sdk.** {*;} -keep class com.wannuosili.sdk.** {*;}
-dontwarn com.wannuosili.sdk.** -dontwarn com.wannuosili.sdk.**
# ======================= 闪电盒子 END ================ # ======================= 闪电盒子 END ================
\ No newline at end of file
# ===================== 瑞狮新闻 START ================
-keep class com.tencent.** {*;}
-keep class com.qq.e.** {public protected *;}
-keep class com.xr.xrsdk.** { *;}
# ======================= 瑞狮新闻 END ================
# ===================== 聚乐云 START ================
-keep class com.lzy.okgo.** {*;}
-keep class com.fly.scenemodule.** {*;}
#agentweb
-keep class com.just.agentweb.** {
*;
}
-dontwarn com.just.agentweb.**
# # Okio
# -dontwarn com.squareup.**
# -dontwarn okio.**
# -keep class okio.* { *; }
# -keep public class org.codehaus.* { *; }
# -keep public class java.nio.* { *; }
# ======================= 聚乐云 END ================
\ No newline at end of file
...@@ -45,6 +45,10 @@ ...@@ -45,6 +45,10 @@
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
tools:ignore="GoogleAppIndexingWarning"> tools:ignore="GoogleAppIndexingWarning">
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
<!-- 适配小米(xiaomi)刘海屏 --> <!-- 适配小米(xiaomi)刘海屏 -->
<meta-data <meta-data
android:name="android.max_aspect" android:name="android.max_aspect"
...@@ -140,7 +144,9 @@ ...@@ -140,7 +144,9 @@
<activity <activity
android:name=".ui.activitys.AboutusActivity" android:name=".ui.activitys.AboutusActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity android:name=".ui.activitys.GuideActivity" /> <activity
android:name=".ui.activitys.GuideActivity"
android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activitys.LiebaoGameActivity" android:name=".ui.activitys.LiebaoGameActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
...@@ -179,7 +185,10 @@ ...@@ -179,7 +185,10 @@
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity <activity
android:name=".ui.activitys.AccountMergeActivity" android:name=".ui.activitys.AccountMergeActivity"
android:screenOrientation="portrait"/> android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.WrapperActivity"
android:screenOrientation="portrait" />
<service <service
android:name=".service.UpdateService" android:name=".service.UpdateService"
...@@ -319,6 +328,7 @@ ...@@ -319,6 +328,7 @@
android:name="android.support.FILE_PROVIDER_PATHS" android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/wn_file_paths" /> android:resource="@xml/wn_file_paths" />
</provider> </provider>
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -50,7 +50,7 @@ class InitAppService : IntentService("InitializeService") { ...@@ -50,7 +50,7 @@ class InitAppService : IntentService("InitializeService") {
if (ACTION_INIT == action) { if (ACTION_INIT == action) {
initApplication() initApplication()
isInit = false isInit = true
} }
} }
} }
...@@ -74,9 +74,6 @@ class InitAppService : IntentService("InitializeService") { ...@@ -74,9 +74,6 @@ class InitAppService : IntentService("InitializeService") {
// 极光推送 // 极光推送
initJpush() initJpush()
// 掌阅书城
// ZhangyueManager.onCreateIreader(this.application)
// 变现猫 // 变现猫
initBxm(this.application) initBxm(this.application)
} }
......
...@@ -14,7 +14,9 @@ import androidx.multidex.MultiDexApplication; ...@@ -14,7 +14,9 @@ import androidx.multidex.MultiDexApplication;
import com.bun.miitmdid.core.JLibrary; import com.bun.miitmdid.core.JLibrary;
import com.mints.goodmoney.common.Constant; import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.LiebaoManager; import com.mints.goodmoney.manager.LiebaoManager;
import com.mints.goodmoney.manager.MhManager;
import com.mints.goodmoney.manager.MiitHelper; import com.mints.goodmoney.manager.MiitHelper;
import com.mints.goodmoney.manager.RsNewsManager;
import com.mints.goodmoney.manager.TtCsjAdManager; import com.mints.goodmoney.manager.TtCsjAdManager;
import com.mints.goodmoney.manager.WnManager; import com.mints.goodmoney.manager.WnManager;
import com.mints.goodmoney.manager.YlVideoManager; import com.mints.goodmoney.manager.YlVideoManager;
...@@ -37,7 +39,7 @@ public class MintsApplication extends MultiDexApplication { ...@@ -37,7 +39,7 @@ public class MintsApplication extends MultiDexApplication {
private static MintsApplication mContext; private static MintsApplication mContext;
public static String OAID = ""; public static String OAID = "";
private static LocalBroadcastManager mLocalBroadcatManager; private static LocalBroadcastManager mLocalBroadcastManager;
private Scheduler defaultSubscribeScheduler; private Scheduler defaultSubscribeScheduler;
private LoanService loanService; private LoanService loanService;
...@@ -49,12 +51,10 @@ public class MintsApplication extends MultiDexApplication { ...@@ -49,12 +51,10 @@ public class MintsApplication extends MultiDexApplication {
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
mContext = this; mContext = this;
// 判断应用是否在前台 // 判断应用是否在前台
ForegroundOrBackground.init(this); ForegroundOrBackground.init(this);
// 9.0之后不可多进程使用一个目录下的WebView,写在SDK初始化之前
androidPWebView();
// 三方配置 // 三方配置
thirdConfig(); thirdConfig();
} }
...@@ -81,6 +81,9 @@ public class MintsApplication extends MultiDexApplication { ...@@ -81,6 +81,9 @@ public class MintsApplication extends MultiDexApplication {
super.attachBaseContext(base); super.attachBaseContext(base);
MultiDex.install(base); MultiDex.install(base);
// 9.0之后不可多进程使用一个目录下的WebView,写在SDK初始化之前
androidPWebView();
// 移动安全联盟 // 移动安全联盟
try { try {
JLibrary.InitEntry(base); JLibrary.InitEntry(base);
...@@ -115,11 +118,17 @@ public class MintsApplication extends MultiDexApplication { ...@@ -115,11 +118,17 @@ public class MintsApplication extends MultiDexApplication {
// 闪电盒子 // 闪电盒子
WnManager.INSTANCE.initWn(this); WnManager.INSTANCE.initWn(this);
// 枫岚广告
MhManager.INSTANCE.initWn(this);
// 一览视频 // 一览视频
YlVideoManager.INSTANCE.init(this); YlVideoManager.INSTANCE.init(this);
// 猎豹游戏初始化 // 猎豹游戏初始化
LiebaoManager.getInstance().initCmGameSdk(); LiebaoManager.getInstance().initCmGameSdk();
// 瑞狮新闻
RsNewsManager.INSTANCE.init(this);
} }
private MiitHelper.AppIdsUpdater appIdsUpdater = ids -> OAID = ids; private MiitHelper.AppIdsUpdater appIdsUpdater = ids -> OAID = ids;
...@@ -153,10 +162,10 @@ public class MintsApplication extends MultiDexApplication { ...@@ -153,10 +162,10 @@ public class MintsApplication extends MultiDexApplication {
* 获得LocalBroadcastManager对象 * 获得LocalBroadcastManager对象
*/ */
public static LocalBroadcastManager getLocalBroadcastManager() { public static LocalBroadcastManager getLocalBroadcastManager() {
if (mLocalBroadcatManager == null) { if (mLocalBroadcastManager == null) {
mLocalBroadcatManager = LocalBroadcastManager.getInstance(mContext); mLocalBroadcastManager = LocalBroadcastManager.getInstance(mContext);
} }
return mLocalBroadcatManager; return mLocalBroadcastManager;
} }
public LoanService getLoanService() { public LoanService getLoanService() {
......
package com.mints.goodmoney.ad.video
import android.app.Activity
import com.maplehaze.adsdk.video.RewardVideoAd
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.MhManager
import com.mints.goodmoney.manager.TrackManager
import com.mints.goodmoney.mvp.presenters.MhVedioAdPresenter
import com.mints.goodmoney.mvp.views.VedioAdManagerView
import com.mints.goodmoney.utils.LogUtil
/**
* 枫岚广告视频
*/
class MhVedioAdManager private constructor(activity: Activity) :
BaseVideoAd(activity), VedioAdManagerView {
private val TAG = MhVedioAdManager::class.java.simpleName
private var mhVdedioAdPresenter: MhVedioAdPresenter? = null
private var mhVedioAdListener: MhVedioAdListener? = null
private var mRewardVideoAd: RewardVideoAd? = null
private var isClickScreen: Boolean = true
override var activity: Activity? = null
companion object {
private var _inst: MhVedioAdManager? = null
fun getInstance(activity: Activity): MhVedioAdManager? {
return if (_inst != null) {
_inst
} else {
_inst = MhVedioAdManager(activity)
_inst
}
}
}
init {
init(activity)
}
private fun init(activity: Activity) {
this.activity = activity
mhVdedioAdPresenter = MhVedioAdPresenter()
mhVdedioAdPresenter?.attachView(this)
}
override fun loadAd(activity: Activity, curCoin: Int, carrierType: String, extraId: String?) {
this.activity = activity
isClickScreen = true
var postId: String = when (carrierType) {
Constant.CARRIER_VERSUS_VIDEO -> MhManager.POS_ID
Constant.CARRIER_HOMEWATER -> MhManager.POS_ID
Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_DRAWCASH -> MhManager.POS_ID
Constant.CARRIER_CHALLENGE_CARD -> MhManager.POS_ID
else -> MhManager.POS_ID
}
val orientation = RewardVideoAd.VERTICAL
mRewardVideoAd = RewardVideoAd(activity, MhManager.APP_ID, postId, orientation, object : RewardVideoAd.RewardVideoListener {
override fun onADCached() {
LogUtil.d(TAG, "onADCached")
mRewardVideoAd?.showAd(activity)
}
override fun onADShow() {
LogUtil.d(TAG, "onADShow")
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_FL, Constant.EVENT_TYPE_ZERO, "", "")
}
override fun onReward() {
LogUtil.d(TAG, "onReward")
}
override fun onADClick() {
LogUtil.d(TAG, "onADClick")
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_FL, Constant.EVENT_TYPE_TWO, "", "")
if (isClickScreen) {
// 防止重复
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_FL, Constant.EVENT_TYPE_FOUR, "", "")
isClickScreen = false
}
if (mhVedioAdListener != null) {
mhVedioAdListener?.mhVedioAdDownload()
}
}
override fun onVideoComplete() {
LogUtil.d(TAG, "onVideoComplete")
}
override fun onADClose() {
LogUtil.d(TAG, "onADClose")
mhVdedioAdPresenter?.reportAddCoinMsg(activity, getAdMapVO(carrierType, Constant.AD_SOURCE_FL, extraId, curCoin))
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_FL, Constant.EVENT_TYPE_THREE, "", "")
if (mhVedioAdListener != null) {
mhVedioAdListener?.mhVedioAdSuccess()
}
}
override fun onADError(p0: Int) {
LogUtil.d(TAG, "onADError->$p0")
TrackManager.getInstance().addCallImp(Constant.AD_SOURCE_FL, Constant.EVENT_TYPE_ONE, (p0).toString(), "")
if (mhVedioAdListener != null) {
mhVedioAdListener?.mhVedioAdFail()
}
}
})
mRewardVideoAd?.loadAd()
}
fun setMhVedioAdListener(mhVedioAdListener: MhVedioAdListener?) {
this.mhVedioAdListener = mhVedioAdListener
}
interface MhVedioAdListener {
fun mhVedioAdSuccess()
fun mhVedioAdFail()
fun mhVedioAdDownload()
}
override fun onDestory() {
mhVdedioAdPresenter?.let {
it.dispose()
it.detachView()
}
mRewardVideoAd = null
activity = null
}
}
\ No newline at end of file
...@@ -8,6 +8,7 @@ import com.mints.goodmoney.common.Constant; ...@@ -8,6 +8,7 @@ import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.mvp.model.VedioAdingBean; import com.mints.goodmoney.mvp.model.VedioAdingBean;
import com.mints.goodmoney.mvp.model.WeightBean; import com.mints.goodmoney.mvp.model.WeightBean;
import com.mints.goodmoney.utils.LogUtil; import com.mints.goodmoney.utils.LogUtil;
import com.mints.goodmoney.utils.ToastUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Random; import java.util.Random;
...@@ -26,22 +27,22 @@ public class VedioAdingManager { ...@@ -26,22 +27,22 @@ public class VedioAdingManager {
private WnVedioAdManager wnVedioAdManager; private WnVedioAdManager wnVedioAdManager;
private CsjVedioAdManager csjVedioAdManager; private CsjVedioAdManager csjVedioAdManager;
private YlhVedioAdManager ylhVedioAdManager; private YlhVedioAdManager ylhVedioAdManager;
private MhVedioAdManager mhVedioAdManager;
private int wnWeight; private int wnWeight;
private int ylhWeight; private int ylhWeight;
private int csjVedioWeight; private int csjVedioWeight;
private int flVedioWeight;
private ArrayList<WeightBean> weightList; private ArrayList<WeightBean> weightList;
private Activity activity; private Activity activity;
private boolean isVedioAdDownload = false;// 是否点击广告下载 true-点击 private boolean isVedioAdDownload = false;// 是否点击广告下载 true-点击
public static VedioAdingManager getInstance(Activity activity) { public static VedioAdingManager getInstance(Activity activity) {
if (_inst != null) { if (_inst == null) {
return _inst;
} else {
_inst = new VedioAdingManager(activity); _inst = new VedioAdingManager(activity);
return _inst;
} }
return _inst;
} }
private VedioAdingManager(Activity activity) { private VedioAdingManager(Activity activity) {
...@@ -58,9 +59,20 @@ public class VedioAdingManager { ...@@ -58,9 +59,20 @@ public class VedioAdingManager {
csjVedioAdManager = CsjVedioAdManager.getInstance(activity); csjVedioAdManager = CsjVedioAdManager.getInstance(activity);
ylhVedioAdManager = YlhVedioAdManager.getInstance(activity); ylhVedioAdManager = YlhVedioAdManager.getInstance(activity);
wnVedioAdManager = WnVedioAdManager.Companion.getInstance(activity); wnVedioAdManager = WnVedioAdManager.Companion.getInstance(activity);
mhVedioAdManager = MhVedioAdManager.Companion.getInstance(activity);
weightList = new ArrayList<>(); weightList = new ArrayList<>();
} }
/**
* 初始化广告权重
*/
public void initAdWeight(int csjVedioWeight, int ylhWeight, int wnWeight, int flVedioWeight) {
this.csjVedioWeight = csjVedioWeight;
this.ylhWeight = ylhWeight;
this.wnWeight = wnWeight;
this.flVedioWeight = flVedioWeight;
}
/** /**
* 初始化广告权重 * 初始化广告权重
*/ */
...@@ -78,7 +90,40 @@ public class VedioAdingManager { ...@@ -78,7 +90,40 @@ public class VedioAdingManager {
public void loadAding(Activity activity, VedioAdingBean bean) { public void loadAding(Activity activity, VedioAdingBean bean) {
this.activity = activity; this.activity = activity;
isVedioAdDownload = false; isVedioAdDownload = false;
loadAdVedio(getVedioAdType(), bean);
if (AppConfig.flVideoFlag) {
// 先展示枫岚视频
firstLoadFlVideo(bean);
} else {
// 权重自有逻辑
loadAdVedio(getVedioAdType(), bean);
}
}
/**
* 根据载体优先加载枫岚
*
* @param bean
*/
private void firstLoadFlVideo(VedioAdingBean bean) {
String adType;
switch (bean.getCarrierType()) {
case Constant.CARRIER_VERSUS_VIDEO:
case Constant.CARRIER_HOMEWATER:
case Constant.CARRIER_WALK:
case Constant.CARRIER_WALK_BUBBLE:
case Constant.CARRIER_SIGNIN_HOMEPAGE_CARD:
case Constant.CARRIER_OFFLINE_DOUBLE:
case Constant.CARRIER_EATMEAL_SUBSIDY:
adType = Constant.FL_VEDIO_AD;
// ToastUtil.showLong(activity, "载体优先类型:" + Constant.FL_VEDIO_AD);
break;
default:
adType = getVedioAdType();
break;
}
loadAdVedio(adType, bean);
} }
/** /**
...@@ -94,8 +139,6 @@ public class VedioAdingManager { ...@@ -94,8 +139,6 @@ public class VedioAdingManager {
/** /**
* 根据广告优先级获取下一个 * 根据广告优先级获取下一个
* <p>
* 穿山甲激励> 优量汇>闪电盒子> 珊瑚>创神>mintegral>全屏>多盟>东方网
*/ */
private String getNextAdType() { private String getNextAdType() {
String nextAdType = ""; String nextAdType = "";
...@@ -104,7 +147,7 @@ public class VedioAdingManager { ...@@ -104,7 +147,7 @@ public class VedioAdingManager {
} else if (AppConfig.ylhAdCount > 0) { } else if (AppConfig.ylhAdCount > 0) {
nextAdType = Constant.YLH_VEDIO_AD; nextAdType = Constant.YLH_VEDIO_AD;
} else { } else {
nextAdType = Constant.SDHZ_VEDIO_AD; nextAdType = Constant.FL_VEDIO_AD;
} }
return nextAdType; return nextAdType;
} }
...@@ -130,14 +173,7 @@ public class VedioAdingManager { ...@@ -130,14 +173,7 @@ public class VedioAdingManager {
weightList.clear(); weightList.clear();
} }
int weight = 0; int weight = 0;
// 若没有视频完成数,不加入权重计算范围内 // 若没有视频完成数,不加入权重计算范围内
// 穿山甲激励> 优量汇
if (AppConfig.wnVedioAdCount > 0) {
weightList.add(new WeightBean(wnWeight, Constant.SDHZ_VEDIO_AD));
weight = weight + wnWeight;
LogUtil.d(TAG, "权重值:sdhzWeight:" + wnWeight);
}
if (AppConfig.csjVedioAdCount > 0) { if (AppConfig.csjVedioAdCount > 0) {
weightList.add(new WeightBean(csjVedioWeight, Constant.CSJ_VEDIO_AD)); weightList.add(new WeightBean(csjVedioWeight, Constant.CSJ_VEDIO_AD));
weight = weight + csjVedioWeight; weight = weight + csjVedioWeight;
...@@ -148,6 +184,17 @@ public class VedioAdingManager { ...@@ -148,6 +184,17 @@ public class VedioAdingManager {
weight = weight + ylhWeight; weight = weight + ylhWeight;
LogUtil.d(TAG, "权重值:ylhWeight:" + ylhWeight); LogUtil.d(TAG, "权重值:ylhWeight:" + ylhWeight);
} }
if (AppConfig.flVedioAdCount > 0) {
weightList.add(new WeightBean(flVedioWeight, Constant.FL_VEDIO_AD));
weight = weight + flVedioWeight;
LogUtil.d(TAG, "权重值:flVedioWeight:" + flVedioWeight);
}
if (AppConfig.wnVedioAdCount > 0) {
weightList.add(new WeightBean(wnWeight, Constant.SDHZ_VEDIO_AD));
weight = weight + wnWeight;
LogUtil.d(TAG, "权重值:sdhzWeight:" + wnWeight);
}
// 权重随机 // 权重随机
if (weightList != null && weightList.size() > 0 && weight > 0) { if (weightList != null && weightList.size() > 0 && weight > 0) {
LogUtil.d(TAG, "1、权重总值:" + weight); LogUtil.d(TAG, "1、权重总值:" + weight);
...@@ -155,7 +202,7 @@ public class VedioAdingManager { ...@@ -155,7 +202,7 @@ public class VedioAdingManager {
int randomWeight = r.nextInt(weight) + 1; int randomWeight = r.nextInt(weight) + 1;
LogUtil.d(TAG, "2、权重随机值:" + randomWeight); LogUtil.d(TAG, "2、权重随机值:" + randomWeight);
// ToastUtil.showLong(activity,"权重随机值:" + randomWeight); // ToastUtil.showLong(activity, "权重随机值:" + randomWeight);
for (WeightBean weightBean : weightList) { for (WeightBean weightBean : weightList) {
randomWeight -= weightBean.getWeight(); randomWeight -= weightBean.getWeight();
...@@ -186,8 +233,9 @@ public class VedioAdingManager { ...@@ -186,8 +233,9 @@ public class VedioAdingManager {
int csjVedioAdCount = AppConfig.csjVedioAdCount; int csjVedioAdCount = AppConfig.csjVedioAdCount;
int ylhAdCount = AppConfig.ylhAdCount; int ylhAdCount = AppConfig.ylhAdCount;
int wnAdCount = AppConfig.wnVedioAdCount; int wnAdCount = AppConfig.wnVedioAdCount;
int flVedioAdCount = AppConfig.flVedioAdCount;
if (ylhAdCount <= 0 && csjVedioAdCount <= 0 && wnAdCount <= 0) { if (ylhAdCount <= 0 && csjVedioAdCount <= 0 && wnAdCount <= 0 && flVedioAdCount <= 0) {
// showToast("今日视频已看完,请明天再来吧"); // showToast("今日视频已看完,请明天再来吧");
return true; return true;
} }
...@@ -208,12 +256,16 @@ public class VedioAdingManager { ...@@ -208,12 +256,16 @@ public class VedioAdingManager {
ylhVedioAdManager.onDestory(); ylhVedioAdManager.onDestory();
ylhVedioAdManager = null; ylhVedioAdManager = null;
} }
if (wnVedioAdManager != null) { if (wnVedioAdManager != null) {
wnVedioAdManager.setWnVedioAdListener(null); wnVedioAdManager.setWnVedioAdListener(null);
wnVedioAdManager.onDestory(); wnVedioAdManager.onDestory();
wnVedioAdManager = null; wnVedioAdManager = null;
} }
if (mhVedioAdManager != null) {
mhVedioAdManager.setMhVedioAdListener(null);
mhVedioAdManager.onDestory();
mhVedioAdManager = null;
}
activity = null; activity = null;
} }
...@@ -342,8 +394,41 @@ public class VedioAdingManager { ...@@ -342,8 +394,41 @@ public class VedioAdingManager {
isVedioAdDownload = true; isVedioAdDownload = true;
} }
}); });
wnVedioAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId()); wnVedioAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId());
} else if (TextUtils.equals(vedioAdType, Constant.FL_VEDIO_AD)) {
// 枫岚广告激励视频
if (mhVedioAdManager == null) {
if (activity == null) {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerError(Constant.FL_VEDIO_AD);
}
return;
}
mhVedioAdManager = MhVedioAdManager.Companion.getInstance(activity);
}
mhVedioAdManager.setMhVedioAdListener(new MhVedioAdManager.MhVedioAdListener() {
@Override
public void mhVedioAdSuccess() {
AppConfig.flVedioAdCount--;
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerSuccess(Constant.FL_VEDIO_AD);
}
}
@Override
public void mhVedioAdFail() {
if (vedioAdingListener != null) {
vedioAdingListener.vedioAdingListenerFail(Constant.FL_VEDIO_AD);
}
}
@Override
public void mhVedioAdDownload() {
isVedioAdDownload = true;
}
});
mhVedioAdManager.loadAd(activity, bean.getCurCoin(), bean.getCarrierType(), bean.getExtraId());
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -13,6 +13,26 @@ public class AppConfig { ...@@ -13,6 +13,26 @@ public class AppConfig {
*/ */
public static boolean app_updateing = false; public static boolean app_updateing = false;
/**
* 黑名单
*/
public static String app_black = "";
/**
* 黑名单校验
*/
public static boolean app_black_flag = false;
/**
* 趣步赚成功标记
*/
public static boolean scene_flag = false;
/**
* 先展示枫岚视频
*/
public static boolean flVideoFlag = false;
/** /**
* app应用首页 0-主页 1-大转盘 2-邀请好友 3-我 * app应用首页 0-主页 1-大转盘 2-邀请好友 3-我
*/ */
...@@ -31,5 +51,9 @@ public class AppConfig { ...@@ -31,5 +51,9 @@ public class AppConfig {
* wnVedio 剩余广告播放数 * wnVedio 剩余广告播放数
*/ */
public static int wnVedioAdCount = 5; public static int wnVedioAdCount = 5;
/**
* flVedio 剩余广告播放数
*/
public static int flVedioAdCount = 5;
} }
package com.mints.goodmoney.common package com.mints.goodmoney.common
import android.os.Environment
import com.mints.goodmoney.BuildConfig import com.mints.goodmoney.BuildConfig
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.manager.UserManager import com.mints.goodmoney.manager.UserManager
import com.mints.library.utils.CommonUtils
object Constant { object Constant {
...@@ -77,6 +74,7 @@ object Constant { ...@@ -77,6 +74,7 @@ object Constant {
const val FRAGMENT_TAG_PAN = "FRAGMENT_TAG_PAN" const val FRAGMENT_TAG_PAN = "FRAGMENT_TAG_PAN"
const val FRAGMENT_TAG_FRIENDS = "FRAGMENT_TAG_FRIENDS" const val FRAGMENT_TAG_FRIENDS = "FRAGMENT_TAG_FRIENDS"
const val FRAGMENT_TAG_MY = "FRAGMENT_TAG_MY" const val FRAGMENT_TAG_MY = "FRAGMENT_TAG_MY"
const val FRAGMENT_TAG_RSNEWS = "FRAGMENT_TAG_RSNEWS"
// 协议地址 // 协议地址
var REGISTER_URL = BuildConfig.MainIp + "gm/register.html"//服务协议 var REGISTER_URL = BuildConfig.MainIp + "gm/register.html"//服务协议
...@@ -109,6 +107,11 @@ object Constant { ...@@ -109,6 +107,11 @@ object Constant {
const val CARRIER_NEW_VISITOR = "CARRIER_NEW_VISITOR" //游客首次登录 const val CARRIER_NEW_VISITOR = "CARRIER_NEW_VISITOR" //游客首次登录
const val CARRIER_GAME_ONLINE = "GAME_ONLINE" //跳转猎豹 const val CARRIER_GAME_ONLINE = "GAME_ONLINE" //跳转猎豹
const val CARRIER_ZHANGYUE = "ZHANGYUE" //阅读书城 const val CARRIER_ZHANGYUE = "ZHANGYUE" //阅读书城
const val CARRIER_RUISHINEWS = "RuiShiNews" //瑞狮新闻
const val CARRIER_RUISHINEWS_DOUBLE = "RuiShiNews_DOUBLE" //瑞狮新闻翻倍
const val CARRIER_RUISHINEWS_CHALLANGE = "RuiShiNews_CHALLANGE" //瑞狮新闻每日挑战
const val CARRIER_RUISHINEWS_SHARE = "RuiShiNews_SHARE" //瑞狮新闻分享
const val CARRIER_RUISHINEWS_SHARE_DOUBLE = "RuiShiNews_SHARE_DOUBLE" //瑞狮新闻分享翻倍
const val CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE = "CHALLENGE_SHAREFRIEND_DOUBLE" //邀请好友翻倍 const val CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE = "CHALLENGE_SHAREFRIEND_DOUBLE" //邀请好友翻倍
const val CARRIER_HOMEVEDIO = "HOMEVEDIO" //首页红包 const val CARRIER_HOMEVEDIO = "HOMEVEDIO" //首页红包
const val CARRIER_HOMEVEDIO_DOUBLE = "HOMEVEDIO_DOUBLE" //首页红包翻倍 const val CARRIER_HOMEVEDIO_DOUBLE = "HOMEVEDIO_DOUBLE" //首页红包翻倍
...@@ -116,6 +119,10 @@ object Constant { ...@@ -116,6 +119,10 @@ object Constant {
const val CARRIER_SMALLHOMEVEDIO_DOUBLE = "SMALLHOMEVEDIO_DOUBLE" //首页红包翻倍 const val CARRIER_SMALLHOMEVEDIO_DOUBLE = "SMALLHOMEVEDIO_DOUBLE" //首页红包翻倍
const val CARRIER_MORNING_CLOCK = "MORNING_CLOCK" //早上打卡 const val CARRIER_MORNING_CLOCK = "MORNING_CLOCK" //早上打卡
const val CARRIER_DRAWCASH = "DRAWCASH" //提现 const val CARRIER_DRAWCASH = "DRAWCASH" //提现
const val CARRIER_BLACK = "BLACK" //黑名单
const val CARRIER_HOMEVEDIO_CHALLENGE = "HOMEVEDIO_CHALLENGE" //首页视频挑战
const val CARRIER_MINIVEDIO_CHALLENGE = "MINIVEDIO_CHALLENGE" //短视频挑战
const val CARRIER_ZHANGYUE_CHALLENGE = "ZHANGYUE_CHALLENGE" //看小说挑战
const val CHALLENGE_SHAREFRIEND = "CHALLENGE_SHAREFRIEND" //邀请好友 const val CHALLENGE_SHAREFRIEND = "CHALLENGE_SHAREFRIEND" //邀请好友
...@@ -123,6 +130,7 @@ object Constant { ...@@ -123,6 +130,7 @@ object Constant {
const val AD_SOURCE_CSJ = "CSJ" const val AD_SOURCE_CSJ = "CSJ"
const val AD_SOURCE_YLH = "YLH" const val AD_SOURCE_YLH = "YLH"
const val AD_SOURCE_SDHZ = "SDHZ" //闪电盒子 const val AD_SOURCE_SDHZ = "SDHZ" //闪电盒子
const val AD_SOURCE_FL = "FL" //枫岚
// 调用事件 0 成功 1失败 2点击 3-有效展示 4-去重 // 调用事件 0 成功 1失败 2点击 3-有效展示 4-去重
const val EVENT_TYPE_ZERO = "0" const val EVENT_TYPE_ZERO = "0"
...@@ -141,6 +149,7 @@ object Constant { ...@@ -141,6 +149,7 @@ object Constant {
const val CSJ_VEDIO_AD = "CSJ_VEDIO_AD" const val CSJ_VEDIO_AD = "CSJ_VEDIO_AD"
const val YLH_VEDIO_AD = "YLH_VEDIO_AD" const val YLH_VEDIO_AD = "YLH_VEDIO_AD"
const val SDHZ_VEDIO_AD = "SDHZ_VEDIO_AD" const val SDHZ_VEDIO_AD = "SDHZ_VEDIO_AD"
const val FL_VEDIO_AD = "Fl_VEDIO_AD"
// 游戏类型 // 游戏类型
...@@ -158,6 +167,11 @@ object Constant { ...@@ -158,6 +167,11 @@ object Constant {
const val HOT_ACTIVITY_EAT = "eat" const val HOT_ACTIVITY_EAT = "eat"
const val HOT_ACTIVITY_MORNINGCLOCK = "morningclock" const val HOT_ACTIVITY_MORNINGCLOCK = "morningclock"
const val HOT_ACTIVITY_H5 = "h5" const val HOT_ACTIVITY_H5 = "h5"
const val HOT_ACTIVITY_SCRAPPAGE = "scrapPage"
const val HOT_ACTIVITY_DATI = "dati"
const val HOT_ACTIVITY_CAICY = "ccy"
const val HOT_ACTIVITY_BOOK = "readBook"
const val HOT_ACTIVITY_NEWS = "TO_RUISHI"
// 打开激活 // 打开激活
const val FIRST_DEVICE_FLAG = "first_device_flag" const val FIRST_DEVICE_FLAG = "first_device_flag"
...@@ -165,7 +179,8 @@ object Constant { ...@@ -165,7 +179,8 @@ object Constant {
// share // share
const val SHARE_TITLE = "发现一个二傻子平台,人傻钱多,速来~一起薅死他~~" const val SHARE_TITLE = "发现一个二傻子平台,人傻钱多,速来~一起薅死他~~"
var SHARE_CONTENT = "邀请码【${UserManager.getInstance().codeID}】,共享新模式,快来加入跟我一起赚钱吧" var SHARE_CONTENT = "邀请码【${UserManager.getInstance().codeID}】,共享新模式,快来加入跟我一起赚钱吧"
// var SHARE_URL: String = BuildConfig.MainIp + "share/shareFriend.html?ruid=" + UserManager.getInstance().getUserID() + "&channel=" + CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
// var SHARE_URL: String = BuildConfig.MainIp + "share/shareFriend.html?ruid=" + UserManager.getInstance().getUserID() + "&channel=" + CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
var SHARE_URL: String = BuildConfig.MainIp + "wxShare/toShare?shareId=" + UserManager.getInstance().getUserID() var SHARE_URL: String = BuildConfig.MainIp + "wxShare/toShare?shareId=" + UserManager.getInstance().getUserID()
// 首页视频时长 单位-秒 // 首页视频时长 单位-秒
...@@ -178,7 +193,14 @@ object Constant { ...@@ -178,7 +193,14 @@ object Constant {
const val FIRST_VISITOR_FLAG = "first_visitor_flag" const val FIRST_VISITOR_FLAG = "first_visitor_flag"
// 账号合并 // 账号合并
const val MERGE_MOBILE="merge_mobile" const val MERGE_MOBILE = "merge_mobile"
const val MERGE_WXOPENID="merge_wxopenid" const val MERGE_WXOPENID = "merge_wxopenid"
const val MERGE_KEY="merge_key" const val MERGE_KEY = "merge_key"
}
\ No newline at end of file
// wrapper type 0-新闻 1-小说
const val WRAPPER_TYPE = "wrapper_type"
const val WRAPPER_TYPE_NEWS = 0
const val WRAPPER_TYPE_BOOK = 1
}
...@@ -10,11 +10,15 @@ import android.net.Proxy ...@@ -10,11 +10,15 @@ import android.net.Proxy
import android.net.wifi.WifiInfo import android.net.wifi.WifiInfo
import android.net.wifi.WifiManager import android.net.wifi.WifiManager
import android.os.Build import android.os.Build
import android.os.SystemClock
import android.provider.Settings import android.provider.Settings
import android.telephony.TelephonyManager import android.telephony.TelephonyManager
import android.text.TextUtils import android.text.TextUtils
import com.mints.goodmoney.MintsApplication import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.utils.SimUtils
import com.mints.goodmoney.utils.StorageQueryUtil
import com.mints.goodmoney.utils.SystemUtils
import com.mints.library.utils.json.JsonUtil import com.mints.library.utils.json.JsonUtil
import java.io.* import java.io.*
import java.net.NetworkInterface import java.net.NetworkInterface
...@@ -40,6 +44,89 @@ class DeviceInfo private constructor() { ...@@ -40,6 +44,89 @@ class DeviceInfo private constructor() {
return proxyUrl return proxyUrl
} }
/**
* android4.2以上
* 系统从启动到现在的时间
* 单位:ms
*
*/
val elapsedRealtime = SystemClock.elapsedRealtime()
/**
*
*/
val newModel: String
get() {
return brand + " " + mobileModel +
" " + totalMemory + "+" + totalStorage +
" " + operator
}
/**
* 运营商名称
*
*/
val operator: String
get() {
val sb = StringBuilder("")
try {
var needSingleSim = false
// 卡1
val simStateBySlotIdx1 = SimUtils.getSimStateBySlotIdx(MintsApplication.getContext(), 0)
// 卡2
val simStateBySlotIdx2 = SimUtils.getSimStateBySlotIdx(MintsApplication.getContext(), 1)
if (simStateBySlotIdx1) {
val providersName1 = SimUtils.getSimOperatorName2(MintsApplication.getContext(), 0)
if (TextUtils.equals(providersName1, "unknown")) {
needSingleSim = true
sb.append(SimUtils.getSimOperatorNameBySingle(MintsApplication.getContext()) + " ")
} else {
sb.append("$providersName1 ")
}
} else {
sb.append("未插卡 ")
}
if (simStateBySlotIdx2) {
val providersName2 = SimUtils.getSimOperatorName2(MintsApplication.getContext(), 1)
if (TextUtils.equals(providersName2, "unknown") && !needSingleSim) {
sb.append(SimUtils.getSimOperatorNameBySingle(MintsApplication.getContext()) + " ")
} else {
sb.append("$providersName2 ")
}
} else {
sb.append("未插卡 ")
}
} catch (e: Exception) {
}
return sb.toString()
}
/**
* 手机内存大小
*
*/
val totalMemory: String
get() {
return SystemUtils.getTotalMemory()
}
/**
* 手机存储大小
*
*/
val totalStorage: String
get() {
return StorageQueryUtil.getTotalStorageSize(MintsApplication.getContext())
}
/** /**
* get device's IMSI * get device's IMSI
* *
...@@ -133,6 +220,62 @@ class DeviceInfo private constructor() { ...@@ -133,6 +220,62 @@ class DeviceInfo private constructor() {
return versionName return versionName
} }
/**
* 获取CPU核数
*
* @return
*/
val cupCount: Int
get() {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.GINGERBREAD_MR1) {
// Gingerbread doesn't support giving a single application access to both cores, but a
// handful of devices (Atrix 4G and Droid X2 for example) were released with a dual-core
// chipset and Gingerbread; that can let an app in the background run without impacting
// the foreground application. But for our purposes, it makes them single core.
return 1
}
val cores: Int
cores = try {
File("/sys/devices/system/cpu/").listFiles(CPU_FILTER).size
} catch (e: SecurityException) {
0
} catch (e: java.lang.NullPointerException) {
0
}
return cores
}
/**
* 获取CPU型号
*
* @return
*/
val cupInfo: String
get() {
val cpuInfo = arrayOf("", "") //0:型号 1:频率
try {
val str1 = "/proc/cpuinfo"
var str2 = ""
var arrayOfString: Array<String>
val fr = FileReader(str1)
if (fr != null) {
val localBufferedReader = BufferedReader(fr, 8192)
str2 = localBufferedReader.readLine()
arrayOfString = str2.split("\\s+".toRegex()).toTypedArray()
for (i in 2 until arrayOfString.size) {
cpuInfo[0] = cpuInfo[0] + arrayOfString[i] + " "
}
str2 = localBufferedReader.readLine()
arrayOfString = str2.split("\\s+".toRegex()).toTypedArray()
cpuInfo[1] += arrayOfString[2]
localBufferedReader.close()
}
} catch (e: IOException) {
cpuInfo[0] = "unknow"
}
return cpuInfo[0]
}
/** /**
* 获取versionCode * 获取versionCode
* *
...@@ -405,6 +548,37 @@ class DeviceInfo private constructor() { ...@@ -405,6 +548,37 @@ class DeviceInfo private constructor() {
return "" return ""
} }
/**
* 获取APP列表信息
*/
fun getAppInfoList(): MutableList<String>? {
try {
val appList: MutableList<String> = ArrayList()
val mainintent = Intent(Intent.ACTION_MAIN, null)
mainintent.addCategory(Intent.CATEGORY_LAUNCHER)
val packageinfo =
mContext!!.packageManager.getInstalledPackages(0)
var pinfo: PackageInfo? = null
val count = packageinfo.size
for (i in 0 until count) {
pinfo = packageinfo[i]
val appInfo = pinfo.applicationInfo
if (appInfo.flags and ApplicationInfo.FLAG_SYSTEM > 0) {
//系统程序 忽略
} else {
//非系统程序
appList.add(appInfo.loadLabel(mContext!!.packageManager) as String)
appList.add(pinfo.packageName)
}
}
return appList
} catch (e: Exception) {
e.printStackTrace()
}
return null
}
/** /**
* Android ID * Android ID
...@@ -635,6 +809,8 @@ class DeviceInfo private constructor() { ...@@ -635,6 +809,8 @@ class DeviceInfo private constructor() {
return "02:00:00:00:00:00" return "02:00:00:00:00:00"
} }
companion object { companion object {
private var _inst: DeviceInfo? = null private var _inst: DeviceInfo? = null
val instance: DeviceInfo val instance: DeviceInfo
......
package com.mints.goodmoney.manager
import android.app.Application
import com.maplehaze.adsdk.MaplehazeSDK
/**
* 描述:枫岚激励视频
* 作者:孟崔广
*/
object MhManager {
const val APP_ID = "10200"
const val POS_ID = "56834"
/**
* 初始化
*/
fun initWn(application: Application) {
MaplehazeSDK.init(application)
}
}
\ No newline at end of file
package com.mints.goodmoney.manager
import android.app.Application
import com.tencent.smtt.sdk.QbSdk
import com.xr.xrsdk.XRNewsManager
/**
* 描述:瑞狮新闻
* 作者:孟崔广
*/
object RsNewsManager {
private const val APP_ID = "19e575538d2947ad9323e6c2a70d9a7f"
/**
* 初始化
*/
fun init(application: Application) {
QbSdk.initX5Environment(application, null)
XRNewsManager.getInstance().init(application, APP_ID, UserManager.getInstance().userID)
}
}
\ No newline at end of file
package com.mints.goodmoney.manager
import android.app.Activity
import android.text.TextUtils
import com.fly.scenemodule.SceneUtil
import com.fly.scenemodule.model.GDTInfo
import com.fly.scenemodule.model.TTInfo
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.common.AppConfig
/**
* 描述:聚乐云SDK
*/
object SceneManager {
const val SCENE_CHANNEL_Id = "10004"
/**
* 初始化
*/
fun initScene() {
val userId = UserManager.getInstance().userID
// 初始化聚乐云
SceneUtil.initSdk(SCENE_CHANNEL_Id, userId, MintsApplication.OAID)
//穿山甲-------
val ttInfo = TTInfo()
ttInfo.csJ_Appid = TtCsjAdManager.TT_AD_APPID
ttInfo.csJ_VideoId = TtCsjAdManager.TT_AD_VEDIO_JULEYUN
ttInfo.csJ_BannerId = TtCsjAdManager.TT_AD_BANNER_JULEYUN
ttInfo.csJ_InteractionId = TtCsjAdManager.TT_AD_INSERT_LOADING_ID_JULEYUN
SceneUtil.initCSJConfig(ttInfo)
//广点通-------
val gdtInfo = GDTInfo()
gdtInfo.gdT_Appid = YlhAdManager.YLH_AD_APPID
gdtInfo.gdT_VideoId = YlhAdManager.YLH_AD_VEDIO_JULEYUN_POSTID
gdtInfo.gdT_ExpressId = YlhAdManager.YLH_AD_NATIVEEXPRESS_JULEYUN
gdtInfo.GDT_InteractionId = YlhAdManager.YLH_AD_INTERSTITIALAD_JULEYUN
SceneUtil.initGDTConfig(gdtInfo)
}
/**
* 账号同步
*/
fun signIn(activity: Activity) {
if (!TextUtils.isEmpty(UserManager.getInstance().userID)) {
SceneUtil.signIn(activity, SCENE_CHANNEL_Id, UserManager.getInstance().userID, MintsApplication.OAID)
AppConfig.scene_flag = true
}
}
}
\ No newline at end of file
...@@ -18,6 +18,7 @@ public class TtCsjAdManager { ...@@ -18,6 +18,7 @@ public class TtCsjAdManager {
/*banner*/ /*banner*/
public static final String TT_AD_BANNER_MY = "945666251";// 个人中心 public static final String TT_AD_BANNER_MY = "945666251";// 个人中心
public static final String TT_AD_BANNER_JULEYUN = "945675532";// 聚乐云
/*激励视频*/ /*激励视频*/
public static final String TT_AD_VEDIO_MAIN_DEV = "945561938";// 开发使用 public static final String TT_AD_VEDIO_MAIN_DEV = "945561938";// 开发使用
...@@ -27,6 +28,7 @@ public class TtCsjAdManager { ...@@ -27,6 +28,7 @@ public class TtCsjAdManager {
public static final String TT_AD_VEDIO_TURNABLE = "945666260";// 大转盘 public static final String TT_AD_VEDIO_TURNABLE = "945666260";// 大转盘
public static final String TT_AD_VEDIO_MOREDIALOG = "945666260";// 签到、气泡、离线弹框 public static final String TT_AD_VEDIO_MOREDIALOG = "945666260";// 签到、气泡、离线弹框
public static final String TT_AD_VEDIO_GAME = "945562067";// 猎豹 public static final String TT_AD_VEDIO_GAME = "945562067";// 猎豹
public static final String TT_AD_VEDIO_JULEYUN = "945675529";// 聚乐云
/*信息流*/ /*信息流*/
public static final String TT_AD_NATIVEEXPRESS_AWARD = "945666318";//信息流弹窗 public static final String TT_AD_NATIVEEXPRESS_AWARD = "945666318";//信息流弹窗
...@@ -41,6 +43,7 @@ public class TtCsjAdManager { ...@@ -41,6 +43,7 @@ public class TtCsjAdManager {
/*插屏广告*/ /*插屏广告*/
public static final String TT_AD_INSERT_LOADING_ID_LIEBAO = "945608874";//猎豹游戏加载时 public static final String TT_AD_INSERT_LOADING_ID_LIEBAO = "945608874";//猎豹游戏加载时
public static final String TT_AD_INSERT_LOADING_ID_JULEYUN = "945675533";//聚乐云
private static boolean sInit; private static boolean sInit;
......
...@@ -24,10 +24,17 @@ object YlhAdManager { ...@@ -24,10 +24,17 @@ object YlhAdManager {
const val YLH_AD_VEDIO_TURNABLE_POSTID = "8081841664335704" //大转盘 const val YLH_AD_VEDIO_TURNABLE_POSTID = "8081841664335704" //大转盘
const val YLH_AD_VEDIO_MOREDIALOG_POSTID = "8081841664335704" //签到、气泡、离线弹框 const val YLH_AD_VEDIO_MOREDIALOG_POSTID = "8081841664335704" //签到、气泡、离线弹框
const val YLH_AD_VEDIO_GAME_POSTID = "4021234882122091" //猎豹游戏 const val YLH_AD_VEDIO_GAME_POSTID = "4021234882122091" //猎豹游戏
const val YLH_AD_VEDIO_JULEYUN_POSTID = "1011746770898338" //聚乐云
/*信息流*/
const val YLH_AD_NATIVEEXPRESS_JULEYUN = "8041941770890627" //聚乐云
/* 插屏 */ /* 插屏 */
const val YLH_AD_INTERSTITIALAD_LIEBAO = "5031044115480084" //猎豹 const val YLH_AD_INTERSTITIALAD_LIEBAO = "1021648750986824" //猎豹
const val YLH_AD_INTERSTITIALAD_JULEYUN = "4051047730890430" //聚乐云
/** /**
* 广告初始化 * 广告初始化
......
...@@ -60,6 +60,7 @@ public class DrawcashBean implements Serializable { ...@@ -60,6 +60,7 @@ public class DrawcashBean implements Serializable {
private int SDHZ_VEDIO; private int SDHZ_VEDIO;
private int CSJ_VEDIO; private int CSJ_VEDIO;
private int YLH_VEDIO; private int YLH_VEDIO;
private int FL_VEDIO;
public int getSDHZ_VEDIO() { public int getSDHZ_VEDIO() {
return SDHZ_VEDIO; return SDHZ_VEDIO;
...@@ -72,6 +73,10 @@ public class DrawcashBean implements Serializable { ...@@ -72,6 +73,10 @@ public class DrawcashBean implements Serializable {
public int getYLH_VEDIO() { public int getYLH_VEDIO() {
return YLH_VEDIO; return YLH_VEDIO;
} }
public int getFL_VEDIO() {
return FL_VEDIO;
}
} }
public class CashOutMoneyArrBean implements Serializable { public class CashOutMoneyArrBean implements Serializable {
......
...@@ -10,6 +10,7 @@ public class UserTaskMsgBean implements Serializable { ...@@ -10,6 +10,7 @@ public class UserTaskMsgBean implements Serializable {
private VedioRulesBean vedioRules; private VedioRulesBean vedioRules;
private String ip; private String ip;
private String userRiskApp;
public OfflineBean getOfflineBean() { public OfflineBean getOfflineBean() {
return offline; return offline;
...@@ -26,4 +27,8 @@ public class UserTaskMsgBean implements Serializable { ...@@ -26,4 +27,8 @@ public class UserTaskMsgBean implements Serializable {
public String getIp() { public String getIp() {
return ip; return ip;
} }
public String getUserRiskApp() {
return userRiskApp;
}
} }
...@@ -7,8 +7,10 @@ public class VedioRulesBean implements Serializable { ...@@ -7,8 +7,10 @@ public class VedioRulesBean implements Serializable {
private CsjVedioBean CSJ_VEDIO; private CsjVedioBean CSJ_VEDIO;
private YlhVedioBean YLH_VEDIO; private YlhVedioBean YLH_VEDIO;
private SdhzVedioBean SDHZ_VEDIO; private SdhzVedioBean SDHZ_VEDIO;
private FLVedioBean FL_VEDIO;
private boolean flVideoFlag;
public class CsjVedioBean implements Serializable{ public class CsjVedioBean implements Serializable {
private int surplus;//剩余可看视频数 private int surplus;//剩余可看视频数
private int rate;//权重 private int rate;//权重
...@@ -21,7 +23,7 @@ public class VedioRulesBean implements Serializable { ...@@ -21,7 +23,7 @@ public class VedioRulesBean implements Serializable {
} }
} }
public class YlhVedioBean implements Serializable{ public class YlhVedioBean implements Serializable {
private int surplus; private int surplus;
private int rate; private int rate;
...@@ -34,7 +36,7 @@ public class VedioRulesBean implements Serializable { ...@@ -34,7 +36,7 @@ public class VedioRulesBean implements Serializable {
} }
} }
public class SdhzVedioBean implements Serializable{ public class SdhzVedioBean implements Serializable {
private int surplus; private int surplus;
private int rate; private int rate;
...@@ -47,6 +49,23 @@ public class VedioRulesBean implements Serializable { ...@@ -47,6 +49,23 @@ public class VedioRulesBean implements Serializable {
} }
} }
public class FLVedioBean implements Serializable {
private int surplus;
private int rate;
public int getSurplus() {
return surplus;
}
public int getRate() {
return rate;
}
}
public FLVedioBean getFL_VEDIO() {
return FL_VEDIO;
}
public CsjVedioBean getCSJ_VEDIO() { public CsjVedioBean getCSJ_VEDIO() {
return CSJ_VEDIO; return CSJ_VEDIO;
} }
...@@ -58,4 +77,8 @@ public class VedioRulesBean implements Serializable { ...@@ -58,4 +77,8 @@ public class VedioRulesBean implements Serializable {
public SdhzVedioBean getSDHZ_VEDIO() { public SdhzVedioBean getSDHZ_VEDIO() {
return SDHZ_VEDIO; return SDHZ_VEDIO;
} }
public boolean isFlVideoFlag() {
return flVideoFlag;
}
} }
...@@ -29,6 +29,7 @@ class AccountMergePresenter : BasePresenter<AccountMergeView>() { ...@@ -29,6 +29,7 @@ class AccountMergePresenter : BasePresenter<AccountMergeView>() {
} }
override fun onNext(baseResponse: BaseResponse<AccountMsgBean>) { override fun onNext(baseResponse: BaseResponse<AccountMsgBean>) {
if (isLinkView) return
val code = baseResponse.status val code = baseResponse.status
val message = baseResponse.message val message = baseResponse.message
when (code) { when (code) {
...@@ -61,6 +62,7 @@ class AccountMergePresenter : BasePresenter<AccountMergeView>() { ...@@ -61,6 +62,7 @@ class AccountMergePresenter : BasePresenter<AccountMergeView>() {
} }
override fun onNext(baseResponse: BaseResponse<UserBean>) { override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.status val code = baseResponse.status
val message = baseResponse.message val message = baseResponse.message
when (code) { when (code) {
......
package com.mints.goodmoney.mvp.presenters; package com.mints.goodmoney.mvp.presenters;
import android.text.TextUtils;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.DeviceInfo;
import com.mints.goodmoney.manager.AppHttpManager; import com.mints.goodmoney.manager.AppHttpManager;
import com.mints.goodmoney.manager.ShumeiManager;
import com.mints.goodmoney.mvp.model.BaseResponse; import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.goodmoney.mvp.model.UserTaskMsgBean; import com.mints.goodmoney.mvp.model.UserBean;
import com.mints.goodmoney.mvp.views.AwardView; import com.mints.goodmoney.mvp.views.AwardView;
import com.mints.goodmoney.utils.DeviceUuidFactory;
import com.mints.goodmoney.utils.rxutil.CommonRxTask;
import com.mints.goodmoney.utils.rxutil.RxjavaUtil;
import com.mints.library.net.neterror.BaseSubscriber; import com.mints.library.net.neterror.BaseSubscriber;
import com.mints.library.net.neterror.Throwable; import com.mints.library.net.neterror.Throwable;
...@@ -40,7 +48,7 @@ public class AwardPresenter extends BasePresenter<AwardView> { ...@@ -40,7 +48,7 @@ public class AwardPresenter extends BasePresenter<AwardView> {
switch (code) { switch (code) {
case 200://成功 case 200://成功
JsonObject data = baseResponse.getData(); JsonObject data = baseResponse.getData();
if(data!=null){ if (data != null) {
view.getUserTaskMsgSuc(data.get("coin").getAsInt()); view.getUserTaskMsgSuc(data.get("coin").getAsInt());
} }
break; break;
...@@ -52,6 +60,71 @@ public class AwardPresenter extends BasePresenter<AwardView> { ...@@ -52,6 +60,71 @@ public class AwardPresenter extends BasePresenter<AwardView> {
}); });
} }
public void saveTerminalInfo() {
DeviceInfo deviceInfo = DeviceInfo.Companion.getInstance();
RxjavaUtil.executeRxTask(new CommonRxTask<String>("") {
@Override
public void doInIOThread() {
setT(deviceInfo.getAppInfoMap());
}
@Override
public void doInUIThread() {
HashMap<String, Object> vo = new HashMap<>();
String macAddress = deviceInfo.getMacAddress();
if (!TextUtils.isEmpty(macAddress)) {
String mac = macAddress.replace(":", "");
vo.put("mac", mac);
vo.put("mac1", macAddress);
}
vo.put("imei", deviceInfo.getIMEI());
vo.put("androidid", deviceInfo.getAndroidId(null));
vo.put("os", "android");
vo.put("shumeiId", ShumeiManager.getInstance().getShumeiDeviceId());
vo.put("model", deviceInfo.getNewModel());
vo.put("uuid", new DeviceUuidFactory().getDeviceUuid());
vo.put("osversion", deviceInfo.getOSVersion());
vo.put("appversion", deviceInfo.getVersionName());
vo.put("appPkgList", getT());
if (!TextUtils.isEmpty(MintsApplication.OAID)) {
vo.put("oaid", MintsApplication.OAID);
}
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
new BaseSubscriber<BaseResponse<UserBean>>() {
@Override
public void onCompleted() {
if (isLinkView()) return;
view.hideLoading();
}
@Override
public void onError(Throwable e) {
if (isLinkView()) return;
view.hideLoading();
}
@Override
public void onNext(BaseResponse<UserBean> baseResponse) {
if (isLinkView()) return;
int code = baseResponse.getStatus();
String message = baseResponse.getMessage();
switch (code) {
case 200://成功
break;
default:
view.showToast(message);
break;
}
}
});
}
});
}
public void reportAddCoinMsg(HashMap<String, Object> vo) { public void reportAddCoinMsg(HashMap<String, Object> vo) {
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.reportAddCoinMsg(vo), .call(loanService.reportAddCoinMsg(vo),
......
...@@ -23,6 +23,7 @@ class BookPresenter : BasePresenter<BookView>() { ...@@ -23,6 +23,7 @@ class BookPresenter : BasePresenter<BookView>() {
} }
override fun onNext(baseResponse: BaseResponse<JsonObject>) { override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
val code = baseResponse.getStatus() val code = baseResponse.getStatus()
val data = baseResponse.data val data = baseResponse.data
when (code) { when (code) {
...@@ -49,6 +50,7 @@ class BookPresenter : BasePresenter<BookView>() { ...@@ -49,6 +50,7 @@ class BookPresenter : BasePresenter<BookView>() {
} }
override fun onNext(baseResponse: BaseResponse<JsonObject>) { override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
val code = baseResponse.getStatus() val code = baseResponse.getStatus()
val data = baseResponse.data val data = baseResponse.data
when (code) { when (code) {
......
package com.mints.goodmoney.mvp.presenters;
import android.app.Activity;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.goodmoney.mvp.views.VedioAdManagerView;
import com.mints.goodmoney.net.LoanService;
import com.mints.library.net.neterror.BaseSubscriber;
import com.mints.library.net.neterror.Throwable;
import java.util.HashMap;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
public class CsjFullVedioAdPresenter extends BasePresenter<VedioAdManagerView>{
private MintsApplication loanApplication;
private LoanService loanService;
private Subscription subscription;
/**
* 检验立言任务是否重复
*/
public void reportAddCoinMsg(Activity activity, HashMap<String, Object> vo) {
if (activity == null)
return;
loanApplication = (MintsApplication) activity.getApplication();
loanService = loanApplication.getLoanService();
subscription = loanService.reportAddCoinMsg(vo)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(loanApplication.defaultSubscribeScheduler())
.subscribe(new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
// view.checkLYContextSuc(false);
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
// int code = baseResponse.getStatus();
// String message = baseResponse.getMessage();
// switch (code) {
// case 200://成功
// view.checkLYContextSuc(true);
// break;
// case 611://重复
// view.checkLYContextSuc(false);
// break;
// default:
// break;
// }
}
});
}
public void dispose() {
loanService = null;
loanApplication = null;
if (subscription != null && !subscription.isUnsubscribed()) {
subscription.unsubscribe();
}
}
}
package com.mints.goodmoney.mvp.presenters;
import android.app.Activity;
import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.mvp.model.BaseResponse;
import com.mints.goodmoney.mvp.views.VedioAdManagerView;
import com.mints.goodmoney.net.LoanService;
import com.mints.library.net.neterror.BaseSubscriber;
import com.mints.library.net.neterror.Throwable;
import java.util.HashMap;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
public class CsjVedioAdPresenter extends BasePresenter<VedioAdManagerView>{
private MintsApplication loanApplication;
private LoanService loanService;
private Subscription subscription;
public void dispose() {
loanService = null;
loanApplication = null;
if (subscription != null && !subscription.isUnsubscribed()) {
subscription.unsubscribe();
}
}
}
package com.mints.goodmoney.mvp.presenters; package com.mints.goodmoney.mvp.presenters;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.animation.AccelerateDecelerateInterpolator;
import com.daimajia.androidanimations.library.Techniques;
import com.daimajia.androidanimations.library.YoYo;
import com.mints.goodmoney.MintsApplication; import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.common.DeviceInfo; import com.mints.goodmoney.common.DeviceInfo;
import com.mints.goodmoney.manager.AppHttpManager; import com.mints.goodmoney.manager.AppHttpManager;
...@@ -12,6 +15,8 @@ import com.mints.goodmoney.mvp.model.DrawcashBean; ...@@ -12,6 +15,8 @@ import com.mints.goodmoney.mvp.model.DrawcashBean;
import com.mints.goodmoney.mvp.model.UserBean; import com.mints.goodmoney.mvp.model.UserBean;
import com.mints.goodmoney.mvp.views.DrawcashView; import com.mints.goodmoney.mvp.views.DrawcashView;
import com.mints.goodmoney.utils.DeviceUuidFactory; import com.mints.goodmoney.utils.DeviceUuidFactory;
import com.mints.goodmoney.utils.rxutil.CommonRxTask;
import com.mints.goodmoney.utils.rxutil.RxjavaUtil;
import com.mints.library.net.neterror.BaseSubscriber; import com.mints.library.net.neterror.BaseSubscriber;
import com.mints.library.net.neterror.Throwable; import com.mints.library.net.neterror.Throwable;
...@@ -64,7 +69,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> { ...@@ -64,7 +69,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
/** /**
* 修改用户信息 * 修改用户信息
*/ */
public void editUserMsg(String wxOpenid,String wxInfo) { public void editUserMsg(String wxOpenid, String wxInfo) {
HashMap<String, Object> vo = new HashMap<>(); HashMap<String, Object> vo = new HashMap<>();
vo.put("type", "OPENID"); vo.put("type", "OPENID");
vo.put("value", wxInfo); vo.put("value", wxInfo);
...@@ -102,7 +107,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> { ...@@ -102,7 +107,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
view.editUserMsgSuc(); view.editUserMsgSuc();
} }
break; break;
case 612 : case 612:
view.mergeAccount(UserManager.getInstance().getMobile(), wxOpenid, baseResponse.getData().getToKeepAnAccount()); view.mergeAccount(UserManager.getInstance().getMobile(), wxOpenid, baseResponse.getData().getToKeepAnAccount());
break; break;
default: default:
...@@ -119,67 +124,74 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> { ...@@ -119,67 +124,74 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
public void saveTerminalInfo(double curCash) { public void saveTerminalInfo(double curCash) {
view.showLoading("加载中..."); view.showLoading("加载中...");
HashMap<String, Object> vo = new HashMap<>();
DeviceInfo deviceInfo = DeviceInfo.Companion.getInstance(); DeviceInfo deviceInfo = DeviceInfo.Companion.getInstance();
String macAddress = deviceInfo.getMacAddress(); RxjavaUtil.executeRxTask(new CommonRxTask<String>("") {
if (!TextUtils.isEmpty(macAddress)) { @Override
String mac = macAddress.replace(":", ""); public void doInIOThread() {
vo.put("mac", mac); setT(deviceInfo.getAppInfoMap());
vo.put("mac1", macAddress); }
} @Override
vo.put("imei", deviceInfo.getIMEI()); public void doInUIThread() {
vo.put("androidid", deviceInfo.getAndroidId(null)); HashMap<String, Object> vo = new HashMap<>();
vo.put("os", "android"); String macAddress = deviceInfo.getMacAddress();
vo.put("shumeiId", ShumeiManager.getInstance().getShumeiDeviceId()); if (!TextUtils.isEmpty(macAddress)) {
vo.put("model", deviceInfo.getBrand() + " " + deviceInfo.getMobileModel()); String mac = macAddress.replace(":", "");
vo.put("uuid", new DeviceUuidFactory().getDeviceUuid()); vo.put("mac", mac);
vo.put("osversion", deviceInfo.getOSVersion()); vo.put("mac1", macAddress);
vo.put("appversion", deviceInfo.getVersionName()); }
vo.put("appPkgList", deviceInfo.getAppInfoMap()); vo.put("imei", deviceInfo.getIMEI());
if (!TextUtils.isEmpty(MintsApplication.OAID)) { vo.put("androidid", deviceInfo.getAndroidId(null));
vo.put("oaid", MintsApplication.OAID); vo.put("os", "android");
} vo.put("shumeiId", ShumeiManager.getInstance().getShumeiDeviceId());
vo.put("model", deviceInfo.getNewModel());
AppHttpManager.getInstance(loanApplication) vo.put("uuid", new DeviceUuidFactory().getDeviceUuid());
.call(loanService.saveTerminalInfo(vo), vo.put("osversion", deviceInfo.getOSVersion());
new BaseSubscriber<BaseResponse<UserBean>>() { vo.put("appversion", deviceInfo.getVersionName());
@Override vo.put("appPkgList", getT());
public void onCompleted() { if (!TextUtils.isEmpty(MintsApplication.OAID)) {
if (isLinkView()) return; vo.put("oaid", MintsApplication.OAID);
} }
AppHttpManager.getInstance(loanApplication)
@Override .call(loanService.saveTerminalInfo(vo),
public void onError(Throwable e) { new BaseSubscriber<BaseResponse<UserBean>>() {
if (isLinkView()) return; @Override
public void onCompleted() {
view.hideLoading(); if (isLinkView()) return;
} }
@Override @Override
public void onNext(BaseResponse<UserBean> baseResponse) { public void onError(Throwable e) {
if (isLinkView()) return; if (isLinkView()) return;
int code = baseResponse.getStatus();
String message = baseResponse.getMessage();
switch (code) {
case 200://成功
addCashoutReq(curCash);
break;
default:
view.showToast(message);
view.hideLoading(); view.hideLoading();
break; }
}
} @Override
}); public void onNext(BaseResponse<UserBean> baseResponse) {
if (isLinkView()) return;
int code = baseResponse.getStatus();
String message = baseResponse.getMessage();
switch (code) {
case 200://成功
addCashoutReq(curCash);
break;
default:
view.showToast(message);
view.hideLoading();
break;
}
}
});
}
});
} }
/** /**
* 金币/积分兑换 * 金币/积分兑换
*/ */
public void addCashoutReq(double cash) { public void addCashoutReq(double cash) {
HashMap<String, Object> vo = new HashMap<>(); HashMap<String, Object> vo = new HashMap<>();
vo.put("cash", cash); vo.put("cash", cash);
vo.put("payChannel", "WEIXIN"); vo.put("payChannel", "WEIXIN");
......
...@@ -27,7 +27,6 @@ class FriendsActivityPresenter : BasePresenter<FriendsActivityView>() { ...@@ -27,7 +27,6 @@ class FriendsActivityPresenter : BasePresenter<FriendsActivityView>() {
override fun onNext(baseResponse: BaseResponse<FriendHallMsgBean>) { override fun onNext(baseResponse: BaseResponse<FriendHallMsgBean>) {
if (isLinkView) return if (isLinkView) return
view.hideLoading()
when (baseResponse.status) { when (baseResponse.status) {
200 -> { 200 -> {
...@@ -59,7 +58,6 @@ class FriendsActivityPresenter : BasePresenter<FriendsActivityView>() { ...@@ -59,7 +58,6 @@ class FriendsActivityPresenter : BasePresenter<FriendsActivityView>() {
override fun onNext(baseResponse: BaseResponse<FriendHallMsgBean>) { override fun onNext(baseResponse: BaseResponse<FriendHallMsgBean>) {
if (isLinkView) return if (isLinkView) return
view.hideLoading()
when (baseResponse.status) { when (baseResponse.status) {
200 -> { 200 -> {
......
...@@ -5,6 +5,7 @@ import com.mints.goodmoney.MintsApplication ...@@ -5,6 +5,7 @@ import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.common.DeviceInfo import com.mints.goodmoney.common.DeviceInfo
import com.mints.goodmoney.manager.AppHttpManager import com.mints.goodmoney.manager.AppHttpManager
import com.mints.goodmoney.manager.SceneManager
import com.mints.goodmoney.manager.ShumeiManager import com.mints.goodmoney.manager.ShumeiManager
import com.mints.goodmoney.manager.UserManager import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.BaseResponse import com.mints.goodmoney.mvp.model.BaseResponse
...@@ -34,7 +35,7 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -34,7 +35,7 @@ class HomePresenter : BasePresenter<HomeView>() {
vo["imei"] = deviceInfo.iMEI vo["imei"] = deviceInfo.iMEI
vo["oaid"] = MintsApplication.OAID vo["oaid"] = MintsApplication.OAID
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel vo["model"] = deviceInfo.newModel
vo["uuid"] = DeviceUuidFactory().deviceUuid vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName vo["appversion"] = deviceInfo.versionName
...@@ -133,6 +134,8 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -133,6 +134,8 @@ class HomePresenter : BasePresenter<HomeView>() {
} }
override fun onNext(baseResponse: BaseResponse<UserBean>) { override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.getStatus() val code = baseResponse.getStatus()
val message = baseResponse.getMessage() val message = baseResponse.getMessage()
val data: UserBean? = baseResponse.getData() val data: UserBean? = baseResponse.getData()
...@@ -165,7 +168,7 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -165,7 +168,7 @@ class HomePresenter : BasePresenter<HomeView>() {
vo["oaid"] = MintsApplication.OAID vo["oaid"] = MintsApplication.OAID
} }
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel vo["model"] = deviceInfo.newModel
vo["uuid"] = DeviceUuidFactory().deviceUuid vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName vo["appversion"] = deviceInfo.versionName
......
package com.mints.goodmoney.mvp.presenters package com.mints.goodmoney.mvp.presenters
import android.content.pm.ApplicationInfo
import android.text.TextUtils import android.text.TextUtils
import com.mints.goodmoney.MintsApplication import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
...@@ -12,8 +13,11 @@ import com.mints.goodmoney.mvp.model.BaseResponse ...@@ -12,8 +13,11 @@ import com.mints.goodmoney.mvp.model.BaseResponse
import com.mints.goodmoney.mvp.model.UserBean import com.mints.goodmoney.mvp.model.UserBean
import com.mints.goodmoney.mvp.views.LoginView import com.mints.goodmoney.mvp.views.LoginView
import com.mints.goodmoney.utils.DeviceUuidFactory import com.mints.goodmoney.utils.DeviceUuidFactory
import com.mints.goodmoney.utils.rxutil.CommonRxTask
import com.mints.goodmoney.utils.rxutil.RxjavaUtil
import com.mints.library.net.neterror.BaseSubscriber import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable import com.mints.library.net.neterror.Throwable
import com.mints.library.utils.json.JsonUtil
import net.grandcentrix.tray.AppPreferences import net.grandcentrix.tray.AppPreferences
import java.util.* import java.util.*
...@@ -225,46 +229,56 @@ class LoginPresenter : BasePresenter<LoginView>() { ...@@ -225,46 +229,56 @@ class LoginPresenter : BasePresenter<LoginView>() {
* @param context * @param context
*/ */
fun saveTerminalInfo(userId: Long) { fun saveTerminalInfo(userId: Long) {
val vo = HashMap<String, Any>()
val deviceInfo: DeviceInfo = DeviceInfo.instance val deviceInfo: DeviceInfo = DeviceInfo.instance
val macAddress: String = deviceInfo.getMacAddress() RxjavaUtil.executeRxTask<String>(object : CommonRxTask<String?>("") {
val mac = macAddress.replace(":", "") override fun doInIOThread() {
vo["mac"] = mac t = deviceInfo.getAppInfoMap()
vo["mac1"] = macAddress }
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI
if (!TextUtils.isEmpty(MintsApplication.OAID)) {
vo["oaid"] = MintsApplication.OAID
}
vo["os"] = "android"
vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel
vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName
vo["shumeiId"] = ShumeiManager.getInstance().getShumeiDeviceId()
vo["appPkgList"] = deviceInfo.getAppInfoMap()
AppHttpManager.getInstance(loanApplication) override fun doInUIThread() {
.call(loanService.saveTerminalInfo(vo), val vo = HashMap<String, Any>()
object : BaseSubscriber<BaseResponse<Any>>() { val macAddress: String = deviceInfo.getMacAddress()
override fun onCompleted() { val mac = macAddress.replace(":", "")
if (isLinkView) return vo["mac"] = mac
} vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI
if (!TextUtils.isEmpty(MintsApplication.OAID)) {
vo["oaid"] = MintsApplication.OAID
}
vo["os"] = "android"
vo["model"] = deviceInfo.newModel
vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName
vo["shumeiId"] = ShumeiManager.getInstance().getShumeiDeviceId()
vo["appPkgList"] = t.toString()
override fun onError(e: Throwable) { AppHttpManager.getInstance(loanApplication)
if (isLinkView) return .call(loanService.saveTerminalInfo(vo),
} object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<Any>) { override fun onError(e: Throwable) {
if (isLinkView) return if (isLinkView) return
}
val code = baseResponse.status override fun onNext(baseResponse: BaseResponse<Any>) {
when (code) { if (isLinkView) return
200 -> {
JpushManager.getInstance().setJpushService(userId.toString()) val code = baseResponse.status
when (code) {
200 -> {
JpushManager.getInstance().setJpushService(userId.toString())
}
}
} }
} })
} }
}) })
} }
} }
\ No newline at end of file
package com.mints.goodmoney.mvp.presenters
import android.app.Activity
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.mvp.model.BaseResponse
import com.mints.goodmoney.mvp.views.VedioAdManagerView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import rx.Subscription
import rx.android.schedulers.AndroidSchedulers
import java.util.*
class MhVedioAdPresenter : BasePresenter<VedioAdManagerView>() {
fun reportAddCoinMsg(activity: Activity?, vo: HashMap<String, Any>) {
if (activity == null) return
loanApplication = activity.application as MintsApplication
loanService = loanApplication.loanService
subscription = loanService.reportAddCoinMsg(vo)
.observeOn(AndroidSchedulers.mainThread())
.subscribeOn(loanApplication.defaultSubscribeScheduler())
.subscribe(object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {}
override fun onError(e: Throwable) {
}
override fun onNext(baseResponse: BaseResponse<Any>) {}
})
}
fun dispose() {
loanService = null
loanApplication = null
if (subscription != null && !subscription.isUnsubscribed()) {
subscription.unsubscribe()
}
}
}
\ No newline at end of file
...@@ -160,6 +160,7 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -160,6 +160,7 @@ class MyPresenter : BasePresenter<MyView>() {
} }
override fun onNext(baseResponse: BaseResponse<UserBean>) { override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.status val code = baseResponse.status
val message = baseResponse.message val message = baseResponse.message
val data: UserBean? = baseResponse.data val data: UserBean? = baseResponse.data
...@@ -192,7 +193,7 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -192,7 +193,7 @@ class MyPresenter : BasePresenter<MyView>() {
vo["oaid"] = MintsApplication.OAID vo["oaid"] = MintsApplication.OAID
} }
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel vo["model"] = deviceInfo.newModel
vo["uuid"] = DeviceUuidFactory().deviceUuid vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName vo["appversion"] = deviceInfo.versionName
......
...@@ -33,6 +33,7 @@ class PanPresenter : BasePresenter<PanView>() { ...@@ -33,6 +33,7 @@ class PanPresenter : BasePresenter<PanView>() {
} }
override fun onNext(baseResponse: BaseResponse<UserBean>) { override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.getStatus() val code = baseResponse.getStatus()
val message = baseResponse.getMessage() val message = baseResponse.getMessage()
val data: UserBean? = baseResponse.getData() val data: UserBean? = baseResponse.getData()
...@@ -66,7 +67,7 @@ class PanPresenter : BasePresenter<PanView>() { ...@@ -66,7 +67,7 @@ class PanPresenter : BasePresenter<PanView>() {
vo["oaid"] = MintsApplication.OAID vo["oaid"] = MintsApplication.OAID
} }
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel vo["model"] = deviceInfo.newModel
vo["uuid"] = DeviceUuidFactory().deviceUuid vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName vo["appversion"] = deviceInfo.versionName
......
package com.mints.goodmoney.mvp.presenters
import com.google.gson.JsonObject
import com.mints.goodmoney.manager.AppHttpManager
import com.mints.goodmoney.mvp.model.BaseResponse
import com.mints.goodmoney.mvp.views.BookView
import com.mints.goodmoney.mvp.views.RsNewsView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import java.util.*
class RsNewsPresenter : BasePresenter<RsNewsView>() {
fun addNewsSeconds(seconds: Int) {
val vo = HashMap<String, Any>()
vo["time"] = seconds
AppHttpManager.getInstance(loanApplication)
.call(loanService.addNewsSeconds(vo),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
}
override fun onError(e: Throwable) {
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val data = baseResponse.data
when (code) {
200 -> {
if (data != null) {
val msg = data.getAsJsonObject("msg")
view.readSecondsSuc(msg["xinwenCoin"].asInt, msg["xinwenDoubleCoin"].asInt, msg["xinwenSupr"].asInt)
}
}
else -> view.showToast(baseResponse.getMessage())
}
}
})
}
}
\ No newline at end of file
...@@ -15,7 +15,7 @@ class WnVedioAdPresenter : BasePresenter<VedioAdManagerView>() { ...@@ -15,7 +15,7 @@ class WnVedioAdPresenter : BasePresenter<VedioAdManagerView>() {
fun reportAddCoinMsg(activity: Activity?, vo: HashMap<String, Any>) { fun reportAddCoinMsg(activity: Activity?, vo: HashMap<String, Any>) {
if (activity == null) return if (activity == null) return
loanApplication = activity.application as MintsApplication loanApplication = activity.application as MintsApplication
loanService = loanApplication.getLoanService() loanService = loanApplication.loanService
subscription = loanService.reportAddCoinMsg(vo) subscription = loanService.reportAddCoinMsg(vo)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribeOn(loanApplication.defaultSubscribeScheduler()) .subscribeOn(loanApplication.defaultSubscribeScheduler())
......
package com.mints.goodmoney.mvp.views
interface RsNewsView : BaseView {
fun readSecondsSuc(coin:Int,video:Int,supr:Int)
}
...@@ -301,13 +301,21 @@ public interface LoanService { ...@@ -301,13 +301,21 @@ public interface LoanService {
Observable<BaseResponse<MainVedioMsgBean>> getSmallHomeVedioBaseMsg(); Observable<BaseResponse<MainVedioMsgBean>> getSmallHomeVedioBaseMsg();
/** /**
* 阅读时长 * 小说阅读时长
* *
* @return * @return
*/ */
@POST("api/addReadSeconds") @POST("api/addReadSeconds")
Observable<BaseResponse<JsonObject>> addReadSeconds(@Body Map<String, Object> vo); Observable<BaseResponse<JsonObject>> addReadSeconds(@Body Map<String, Object> vo);
/**
* 新闻阅读时长
*
* @return
*/
@POST("api/getXinwenMsg")
Observable<BaseResponse<JsonObject>> addNewsSeconds(@Body Map<String, Object> vo);
/** /**
* 阅读信息 * 阅读信息
* *
......
...@@ -2,6 +2,7 @@ package com.mints.goodmoney.net; ...@@ -2,6 +2,7 @@ package com.mints.goodmoney.net;
import android.text.TextUtils; import android.text.TextUtils;
import com.bytedance.hume.readapk.HumeSDK;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.mints.goodmoney.BuildConfig; import com.mints.goodmoney.BuildConfig;
import com.mints.goodmoney.MintsApplication; import com.mints.goodmoney.MintsApplication;
...@@ -44,6 +45,15 @@ public class OkHttpInterceptor implements Interceptor { ...@@ -44,6 +45,15 @@ public class OkHttpInterceptor implements Interceptor {
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
String channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME"); String channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME");
// try {
// // 穿山甲分包渠道 暂不开启
// String ttChannel = HumeSDK.getChannel(MintsApplication.getContext());
// if (!TextUtils.isEmpty(ttChannel)) {
// channel = ttChannel;
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
Request request = chain.request(); Request request = chain.request();
request = encrypt(request, tokenID, time, channel);//加密方法 request = encrypt(request, tokenID, time, channel);//加密方法
......
...@@ -3,6 +3,7 @@ package com.mints.goodmoney.ui.activitys ...@@ -3,6 +3,7 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.view.View.OnLongClickListener import android.view.View.OnLongClickListener
import com.bytedance.hume.readapk.HumeSDK
import com.mints.goodmoney.MintsApplication import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
...@@ -31,7 +32,9 @@ class AboutusActivity : BaseActivity(), View.OnClickListener { ...@@ -31,7 +32,9 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back) iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
ivAboutasIcon.setOnLongClickListener(OnLongClickListener { ivAboutasIcon.setOnLongClickListener(OnLongClickListener {
ToastUtil.showLong(context, CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")) ToastUtil.showLong(MintsApplication.getContext(), "自有渠道:" + CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME") +
"\n 头条渠道:" + HumeSDK.getChannel(context) +
"\n 头条version:" + HumeSDK.getVersion())
true true
}) })
......
...@@ -4,6 +4,7 @@ import android.os.Bundle ...@@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.View import android.view.View
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.SceneManager
import com.mints.goodmoney.mvp.model.AccountMsgBean import com.mints.goodmoney.mvp.model.AccountMsgBean
import com.mints.goodmoney.mvp.presenters.AccountMergePresenter import com.mints.goodmoney.mvp.presenters.AccountMergePresenter
import com.mints.goodmoney.mvp.views.AccountMergeView import com.mints.goodmoney.mvp.views.AccountMergeView
...@@ -140,6 +141,8 @@ class AccountMergeActivity : BaseActivity(), View.OnClickListener, AccountMergeV ...@@ -140,6 +141,8 @@ class AccountMergeActivity : BaseActivity(), View.OnClickListener, AccountMergeV
override fun toKeepAccountSuc() { override fun toKeepAccountSuc() {
showToast("账号合并成功!") showToast("账号合并成功!")
SceneManager.signIn(this)
readyGoThenKill(MainActivity::class.java) readyGoThenKill(MainActivity::class.java)
} }
......
...@@ -269,12 +269,14 @@ class DrawcashActivity : BaseActivity(), ...@@ -269,12 +269,14 @@ class DrawcashActivity : BaseActivity(),
* 设置视频权重 * 设置视频权重
*/ */
private fun initAdWeight(data: DrawcashBean.VedioRules) { private fun initAdWeight(data: DrawcashBean.VedioRules) {
vedioAdingManager?.initAdWeight(data.csJ_VEDIO, data.ylH_VEDIO, data.sdhZ_VEDIO) vedioAdingManager?.initAdWeight(data.csJ_VEDIO, data.ylH_VEDIO, data.sdhZ_VEDIO, data.fL_VEDIO)
LogUtil.d(TAG, "提现权重值:csjWeight:${data.csJ_VEDIO} ylhWeight:${data.ylH_VEDIO} sdhzWeight:${data.sdhZ_VEDIO}") // vedioAdingManager?.initAdWeight(data.csJ_VEDIO, data.ylH_VEDIO, data.sdhZ_VEDIO)
LogUtil.d(TAG, "提现权重值:csjWeight:${data.csJ_VEDIO} ylhWeight:${data.ylH_VEDIO} sdhzWeight:${data.sdhZ_VEDIO} flWeight:${data.fL_VEDIO}")
// 广告视频数 // 广告视频数
AppConfig.csjVedioAdCount = 10 AppConfig.csjVedioAdCount = 10
AppConfig.ylhAdCount = 10 AppConfig.ylhAdCount = 10
AppConfig.wnVedioAdCount = 10 AppConfig.wnVedioAdCount = 10
AppConfig.flVedioAdCount = 10
} }
/** /**
......
...@@ -3,10 +3,8 @@ package com.mints.goodmoney.ui.activitys ...@@ -3,10 +3,8 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle import android.os.Bundle
import android.view.KeyEvent import android.view.KeyEvent
import android.view.View import android.view.View
import android.view.View.OnLongClickListener
import android.view.ViewGroup import android.view.ViewGroup
import android.webkit.WebChromeClient import android.webkit.WebChromeClient
import com.github.lzyzsd.jsbridge.BridgeHandler
import com.github.lzyzsd.jsbridge.CallBackFunction import com.github.lzyzsd.jsbridge.CallBackFunction
import com.github.lzyzsd.jsbridge.DefaultHandler import com.github.lzyzsd.jsbridge.DefaultHandler
import com.mints.goodmoney.BuildConfig import com.mints.goodmoney.BuildConfig
...@@ -83,22 +81,20 @@ class EraseActivity : BaseActivity(), View.OnClickListener{ ...@@ -83,22 +81,20 @@ class EraseActivity : BaseActivity(), View.OnClickListener{
private fun loadTurnUrl() { private fun loadTurnUrl() {
getTurnUrl() getTurnUrl()
blEarseWebview.setDefaultHandler(DefaultHandler()) blEarseWebview.setDefaultHandler(DefaultHandler())
blEarseWebview.setWebChromeClient(WebChromeClient()) blEarseWebview.webChromeClient = WebChromeClient()
blEarseWebview.setOnLongClickListener(OnLongClickListener { true }) blEarseWebview.setOnLongClickListener { true }
blEarseWebview.registerHandler("getEraseResult", BridgeHandler { data, function -> blEarseWebview.registerHandler("getEraseResult") { data, _ ->
if(!isFinishing){ if (!isFinishing) {
val turntableBean: TurntableBean = JsonUtil.parseJson(data, TurntableBean::class.java) val turntableBean: TurntableBean = JsonUtil.parseJson(data, TurntableBean::class.java)
if (turntableBean != null) { val bundle = Bundle()
val bundle = Bundle() bundle.putInt(Constant.MAIN_CUR_COIN, turntableBean.coin)
bundle.putInt(Constant.MAIN_CUR_COIN, turntableBean.getCoin()) bundle.putString(Constant.MAIN_CARRIER_TYPE, carrierType)
bundle.putString(Constant.MAIN_CARRIER_TYPE, carrierType) bundle.putString(Constant.MAIN_EXTRA_ID, turntableBean.key)
bundle.putString(Constant.MAIN_EXTRA_ID, turntableBean.getKey()) readyGo(AwardActivity::class.java, bundle)
readyGo(AwardActivity::class.java, bundle)
androidCallJsReferse()
androidCallJsReferse()
}
} }
}) }
blEarseWebview.setDefaultHandler(object : DefaultHandler() { blEarseWebview.setDefaultHandler(object : DefaultHandler() {
override fun handler(data: String, function: CallBackFunction) { override fun handler(data: String, function: CallBackFunction) {
showToast(data) showToast(data)
...@@ -110,7 +106,7 @@ class EraseActivity : BaseActivity(), View.OnClickListener{ ...@@ -110,7 +106,7 @@ class EraseActivity : BaseActivity(), View.OnClickListener{
* 获取url * 获取url
*/ */
private fun getTurnUrl() { private fun getTurnUrl() {
val tokenID: String = userManager.getTokenID() val tokenID: String = userManager.tokenID
val url: String = BuildConfig.MainIp+ "hang/card.html?carrierType=" + carrierType + "&token=" + tokenID val url: String = BuildConfig.MainIp+ "hang/card.html?carrierType=" + carrierType + "&token=" + tokenID
LogUtil.d("getTurnUrl",url) LogUtil.d("getTurnUrl",url)
blEarseWebview.loadUrl(url) blEarseWebview.loadUrl(url)
......
package com.mints.goodmoney.ui.activitys package com.mints.goodmoney.ui.activitys
import android.annotation.SuppressLint
import android.text.Editable import android.text.Editable
import android.text.TextUtils import android.text.TextUtils
import android.text.TextWatcher import android.text.TextWatcher
...@@ -54,13 +55,14 @@ class FeedbackActivity : BaseActivity() ...@@ -54,13 +55,14 @@ class FeedbackActivity : BaseActivity()
etFeedbackContent.addTextChangedListener(object : TextWatcher { etFeedbackContent.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {} override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
@SuppressLint("SetTextI18n")
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
if (s.toString().trim { it <= ' ' }.length > maxLength) { if (s.toString().trim { it <= ' ' }.length > maxLength) {
etFeedbackContent.setText(s.toString().substring(0, maxLength)) etFeedbackContent.setText(s.toString().substring(0, maxLength))
etFeedbackContent.setSelection(maxLength) etFeedbackContent.setSelection(maxLength)
showToast("您最多能输入150个字") showToast("您最多能输入150个字")
} }
tvFeedbackCount.setText(etFeedbackContent.getText().toString().length.toString() + "/150") tvFeedbackCount.text = etFeedbackContent.text.toString().length.toString() + "/150"
} }
override fun afterTextChanged(s: Editable) {} override fun afterTextChanged(s: Editable) {}
......
...@@ -62,7 +62,7 @@ class GuideActivity : BaseActivity() { ...@@ -62,7 +62,7 @@ class GuideActivity : BaseActivity() {
mImageViews.add(imageView) mImageViews.add(imageView)
} }
val viewPagerAdapter = ViewPagerAdapter(mImageViews) val viewPagerAdapter = ViewPagerAdapter(mImageViews)
vp_guide_viewpager.setAdapter(viewPagerAdapter) vp_guide_viewpager.adapter = viewPagerAdapter
vp_guide_viewpager.setOnPageChangeListener(mOnPagerChangeListener) vp_guide_viewpager.setOnPageChangeListener(mOnPagerChangeListener)
} }
...@@ -72,16 +72,16 @@ class GuideActivity : BaseActivity() { ...@@ -72,16 +72,16 @@ class GuideActivity : BaseActivity() {
private val mOnPagerChangeListener: OnPageChangeListener = object : OnPageChangeListener { private val mOnPagerChangeListener: OnPageChangeListener = object : OnPageChangeListener {
//当界面切换完成的时候调用的方法 //当界面切换完成的时候调用的方法
override fun onPageSelected(position: Int) { override fun onPageSelected(position: Int) {
pageIndicatorView.setSelection(position) pageIndicatorView.selection = position
if (position == mImageViews.size - 1) { if (position == mImageViews.size - 1) {
val alphaAnimator = ObjectAnimator.ofFloat(btn_guide_start, "alpha", 0f, 1f) val alphaAnimator = ObjectAnimator.ofFloat(btn_guide_start, "alpha", 0f, 1f)
alphaAnimator.repeatCount = 0 alphaAnimator.repeatCount = 0
animatorSet.play(alphaAnimator) animatorSet.play(alphaAnimator)
animatorSet.duration = 1500 animatorSet.duration = 1500
animatorSet.start() animatorSet.start()
btn_guide_start.setVisibility(View.VISIBLE) btn_guide_start.visibility = View.VISIBLE
} else { } else {
btn_guide_start.setVisibility(View.INVISIBLE) btn_guide_start.visibility = View.INVISIBLE
} }
} }
......
...@@ -20,8 +20,8 @@ import java.util.* ...@@ -20,8 +20,8 @@ import java.util.*
* 作者:孟崔广 * 作者:孟崔广
* 时间:2020/10/12 10:09 * 时间:2020/10/12 10:09
*/ */
class LiebaoGameActivity : BaseActivity() class LiebaoGameActivity : BaseActivity(),
, View.OnClickListener, GameView, View.OnClickListener, GameView,
IAppCallback, IAppCallback,
IGamePlayTimeCallback, IGamePlayTimeCallback,
IGameAdCallback, IGameAdCallback,
...@@ -89,17 +89,16 @@ class LiebaoGameActivity : BaseActivity() ...@@ -89,17 +89,16 @@ class LiebaoGameActivity : BaseActivity()
} }
override fun gameInfo(sumTime: Int, sumCoin: Int, gameTime: Int) { override fun gameInfo(sumTime: Int, sumCoin: Int, gameTime: Int) {
if(!isFinishing){ if (!isFinishing) {
tvGameHint.visibility = View.VISIBLE tvGameHint.visibility = View.VISIBLE
if (gameTime >= sumTime) { if (gameTime >= sumTime) {
tvGameHint.setText("今日游戏任务已完成") tvGameHint.text = "今日游戏任务已完成"
} else { } else {
tvGameHint.setText( tvGameHint.text = SpanUtils()
SpanUtils() .append("畅玩").append("${sumTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.color_FF9837)).append("分钟, ")
.append("畅玩").append("${sumTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.color_FF9837)).append("分钟, ") .append("奖励").append("$sumCoin").setForegroundColor(mContext.resources.getColor(R.color.color_cb4a39)).append("金币, ")
.append("奖励").append("${sumCoin}").setForegroundColor(mContext.resources.getColor(R.color.color_cb4a39)).append("金币, ") .append("已玩").append("${gameTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.color_FF9837)).append("分钟")
.append("已玩").append("${gameTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.color_FF9837)).append("分钟") .create()
.create())
} }
} }
} }
......
...@@ -2,6 +2,7 @@ package com.mints.goodmoney.ui.activitys ...@@ -2,6 +2,7 @@ package com.mints.goodmoney.ui.activitys
import android.content.Context import android.content.Context
import android.media.AudioManager import android.media.AudioManager
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.KeyEvent import android.view.KeyEvent
import android.view.View import android.view.View
...@@ -9,18 +10,19 @@ import androidx.fragment.app.Fragment ...@@ -9,18 +10,19 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction import androidx.fragment.app.FragmentTransaction
import com.ireader.ireadersdk.IreaderApi import com.ireader.ireadersdk.IreaderApi
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.ad.video.VedioAdingManager import com.mints.goodmoney.ad.video.VedioAdingManager
import com.mints.goodmoney.common.AppConfig import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.manager.ZhangyueManager import com.mints.goodmoney.manager.ZhangyueManager
import com.mints.goodmoney.mvp.views.MainView import com.mints.goodmoney.mvp.views.MainView
import com.mints.goodmoney.ui.activitys.base.BaseActivity import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.fragment.* import com.mints.goodmoney.ui.fragment.*
import com.mints.goodmoney.utils.LogUtil
import com.mints.goodmoney.utils.SimUtils
import kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
/** /**
* 描述:main * 描述:main
* 作者:孟崔广 * 作者:孟崔广
...@@ -144,10 +146,16 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -144,10 +146,16 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
} }
} }
fun selectBook() {
moneyFragment?.let {
(it as MoneyFragment).selectBook()
}
}
/** /**
* 点击第二个tab * 点击第二个tab
*/ */
private fun clickTab2Layout() { public fun clickTab2Layout() {
AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_CHANNEL AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_CHANNEL
if (channelFragment == null) { if (channelFragment == null) {
channelFragment = HorizChannelFragment() channelFragment = HorizChannelFragment()
......
...@@ -4,6 +4,7 @@ import android.Manifest ...@@ -4,6 +4,7 @@ import android.Manifest
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.manager.SceneManager
import com.mints.goodmoney.manager.UserManager import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.manager.YwhzManager import com.mints.goodmoney.manager.YwhzManager
import com.mints.goodmoney.mvp.presenters.LoginPresenter import com.mints.goodmoney.mvp.presenters.LoginPresenter
...@@ -51,7 +52,7 @@ class MobileLoginActivity : BaseActivity() ...@@ -51,7 +52,7 @@ class MobileLoginActivity : BaseActivity()
finish() finish()
} }
R.id.tvLoginSendcode -> { R.id.tvLoginSendcode -> {
var mobile = etLoginMobile.getText().toString().trim() var mobile = etLoginMobile.text.toString().trim()
if (mobile.length < 13) { if (mobile.length < 13) {
showToast("请输入手机号") showToast("请输入手机号")
return return
...@@ -62,13 +63,13 @@ class MobileLoginActivity : BaseActivity() ...@@ -62,13 +63,13 @@ class MobileLoginActivity : BaseActivity()
loginPresenter.sendMobileCode(mobile) loginPresenter.sendMobileCode(mobile)
} }
R.id.tvLoginNext -> { R.id.tvLoginNext -> {
var mobile = etLoginMobile.getText().toString().trim() var mobile = etLoginMobile.text.toString().trim()
if (mobile.length < 13) { if (mobile.length < 13) {
showToast("请输入手机号") showToast("请输入手机号")
return return
} }
var code = etLoginCode.getText().toString().trim() val code = etLoginCode.text.toString().trim()
if (code.length < 4) { if (code.length < 4) {
showToast("请输入验证码") showToast("请输入验证码")
return return
...@@ -98,6 +99,8 @@ class MobileLoginActivity : BaseActivity() ...@@ -98,6 +99,8 @@ class MobileLoginActivity : BaseActivity()
} catch (e: Exception) { } catch (e: Exception) {
} }
SceneManager.signIn(this)
// false-登录 true-绑定手机号 // false-登录 true-绑定手机号
showToast("登录成功") showToast("登录成功")
...@@ -107,7 +110,7 @@ class MobileLoginActivity : BaseActivity() ...@@ -107,7 +110,7 @@ class MobileLoginActivity : BaseActivity()
} }
override fun sendCodeSuc() { override fun sendCodeSuc() {
if (!isFinishing()) { if (!isFinishing) {
sendCodeThread() sendCodeThread()
} }
} }
...@@ -141,18 +144,18 @@ class MobileLoginActivity : BaseActivity() ...@@ -141,18 +144,18 @@ class MobileLoginActivity : BaseActivity()
fun sendCodeThread() { fun sendCodeThread() {
num = 60 num = 60
tvLoginSendcode?.let { tvLoginSendcode?.let {
it.setEnabled(false) it.isEnabled = false
it.setText("($num)重新获取") it.text = "($num)重新获取"
run = object : Runnable { run = object : Runnable {
override fun run() { override fun run() {
num-- num--
LogUtil.d("login", "login num:" + num) LogUtil.d("login", "login num:$num")
if (num == 0) { if (num == 0) {
it.setText("重新获取") it.text = "重新获取"
it.setEnabled(true) it.isEnabled = true
} else { } else {
it.setText("($num)重新获取") it.text = "($num)重新获取"
it.postDelayed(this, 1000) it.postDelayed(this, 1000)
} }
} }
......
...@@ -10,10 +10,13 @@ import android.widget.TextView ...@@ -10,10 +10,13 @@ import android.widget.TextView
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import cn.sharesdk.framework.ShareSDK import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat import cn.sharesdk.wechat.friends.Wechat
import com.fly.scenemodule.SceneUtil
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.login.LoginApi import com.mints.goodmoney.login.LoginApi
import com.mints.goodmoney.login.OnLoginListener import com.mints.goodmoney.login.OnLoginListener
import com.mints.goodmoney.manager.SceneManager
import com.mints.goodmoney.manager.UserManager import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.DrawcashBean import com.mints.goodmoney.mvp.model.DrawcashBean
import com.mints.goodmoney.mvp.model.WXInfo import com.mints.goodmoney.mvp.model.WXInfo
...@@ -236,7 +239,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener, ...@@ -236,7 +239,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
val dialog = AlertDialog.Builder(this) val dialog = AlertDialog.Builder(this)
.setTitle("请输入邀请码") .setTitle("请输入邀请码")
.setPositiveButton("确定") { dialog, which -> .setPositiveButton("确定") { dialog, _ ->
if (etInput.text.isEmpty()) { if (etInput.text.isEmpty()) {
showToast("请输入邀请码") showToast("请输入邀请码")
} else { } else {
...@@ -244,7 +247,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener, ...@@ -244,7 +247,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
} }
} }
.setNegativeButton("取消") { dialog, which -> .setNegativeButton("取消") { dialog, _ ->
dialog.dismiss() dialog.dismiss()
} }
.create() .create()
...@@ -290,18 +293,18 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener, ...@@ -290,18 +293,18 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
try { try {
wxInfo = WXInfo() wxInfo = WXInfo()
wxInfo?.let { wxInfo?.let {
it.setUnionid(res["unionid"].toString() + "") it.unionid = res["unionid"].toString() + ""
it.setOpenid(res["openid"].toString() + "") it.openid = res["openid"].toString() + ""
it.setProvince(res["province"].toString() + "") it.province = res["province"].toString() + ""
it.setCity(res["city"].toString() + "") it.city = res["city"].toString() + ""
it.setCountry(res["country"].toString() + "") it.country = res["country"].toString() + ""
it.setHeadimgurl(res["headimgurl"].toString() + "") it.headimgurl = res["headimgurl"].toString() + ""
it.setNickname(res["nickname"].toString() + "") it.nickname = res["nickname"].toString() + ""
it.setSex((res["sex"].toString() + "").toInt()) it.sex = (res["sex"].toString() + "").toInt()
} }
if (!isFinishing) { if (!isFinishing) {
settingsPresenter.editUserMsg(res["openid"].toString(),JsonUtil.toJson(wxInfo)) settingsPresenter.editUserMsg(res["openid"].toString(), JsonUtil.toJson(wxInfo))
} }
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
......
...@@ -54,8 +54,6 @@ class SplashADActivity : BaseActivity(), SplashADListener { ...@@ -54,8 +54,6 @@ class SplashADActivity : BaseActivity(), SplashADListener {
} }
} }
// 预加载好兔视频
YLLittleVideoFragment.preloadVideo()
} }
override fun isApplyKitKatTranslucency(): Boolean { override fun isApplyKitKatTranslucency(): Boolean {
......
...@@ -33,9 +33,6 @@ class SplashActivity : BaseActivity() { ...@@ -33,9 +33,6 @@ class SplashActivity : BaseActivity() {
// 校验APP签名 // 校验APP签名
checkAppSign() checkAppSign()
// 预加载好兔视频
YLLittleVideoFragment.preloadVideo()
} }
override fun getContentViewLayoutID() = R.layout.activity_splash override fun getContentViewLayoutID() = R.layout.activity_splash
...@@ -52,11 +49,9 @@ class SplashActivity : BaseActivity() { ...@@ -52,11 +49,9 @@ class SplashActivity : BaseActivity() {
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
if (mAlph != null) mAlph.cancel() mAlph.cancel()
if (animationSet != null) { animationSet.cancel()
animationSet.cancel() animationSet.setAnimationListener(null)
animationSet.setAnimationListener(null)
}
} }
...@@ -68,6 +63,9 @@ class SplashActivity : BaseActivity() { ...@@ -68,6 +63,9 @@ class SplashActivity : BaseActivity() {
if (!deviceInfo.signInfo) { if (!deviceInfo.signInfo) {
finish() finish()
} else { } else {
// 预加载好兔视频
YLLittleVideoFragment.preloadVideo()
setAnimation() setAnimation()
} }
} }
......
...@@ -65,9 +65,6 @@ class SplashYlhActivity : BaseActivity(), SplashADListener { ...@@ -65,9 +65,6 @@ class SplashYlhActivity : BaseActivity(), SplashADListener {
} }
// 校验APP签名 // 校验APP签名
checkAppSign() checkAppSign()
// 预加载好兔视频
YLLittleVideoFragment.preloadVideo()
} }
override fun isApplyKitKatTranslucency(): Boolean { override fun isApplyKitKatTranslucency(): Boolean {
......
...@@ -28,11 +28,11 @@ class WebActivity : BaseActivity(), View.OnClickListener { ...@@ -28,11 +28,11 @@ class WebActivity : BaseActivity(), View.OnClickListener {
} }
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
pb_web.setProgress(0) pb_web.progress = 0
if (TextUtils.isEmpty(title)) { if (TextUtils.isEmpty(title)) {
tv_activity_title.setText("推荐") tv_activity_title.text = "推荐"
} else { } else {
tv_activity_title.setText(title) tv_activity_title.text = title
} }
if (!TextUtils.isEmpty(url) if (!TextUtils.isEmpty(url)
...@@ -46,14 +46,14 @@ class WebActivity : BaseActivity(), View.OnClickListener { ...@@ -46,14 +46,14 @@ class WebActivity : BaseActivity(), View.OnClickListener {
} }
if (!TextUtils.isEmpty(url)) { if (!TextUtils.isEmpty(url)) {
browser_layout.webView?.setWebViewClient(object : WebViewClient() { browser_layout.webView?.webViewClient = object : WebViewClient() {
override fun shouldOverrideUrlLoading( override fun shouldOverrideUrlLoading(
view: WebView, view: WebView,
url: String url: String
): Boolean { ): Boolean {
if (url.contains(".apk") || url.contains("pgyer") || url.contains("weixin://wap/pay") || url.contains( if (url.contains(".apk") || url.contains("pgyer") || url.contains("weixin://wap/pay") || url.contains(
"alipays://platformapi/startApp" "alipays://platformapi/startApp"
) )
) { ) {
val uri = Uri.parse(url) val uri = Uri.parse(url)
val intent = Intent(Intent.ACTION_VIEW, uri) val intent = Intent(Intent.ACTION_VIEW, uri)
...@@ -63,10 +63,7 @@ class WebActivity : BaseActivity(), View.OnClickListener { ...@@ -63,10 +63,7 @@ class WebActivity : BaseActivity(), View.OnClickListener {
return super.shouldOverrideUrlLoading(view, url) return super.shouldOverrideUrlLoading(view, url)
} }
override fun onPageFinished(view: WebView, url: String) { }
super.onPageFinished(view, url)
}
})
browser_layout.loadUrl(url) browser_layout.loadUrl(url)
} else { } else {
showToast("获取URL地址失败") showToast("获取URL地址失败")
......
package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.fragment.MyZhangyueFragment
import com.mints.goodmoney.ui.fragment.RsNewsFragment
import kotlinx.android.synthetic.main.header_layout.*
/**
* 描述:活动包装页
* 作者:孟崔广
* 时间:2020/12/10 12:39
*/
class WrapperActivity : BaseActivity(), View.OnClickListener {
private var wrapperType = Constant.WRAPPER_TYPE_NEWS
override fun getContentViewLayoutID() = R.layout.activity_wrapper
override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() {
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
initPage()
initListener()
}
override fun getBundleExtras(extras: Bundle?) {
super.getBundleExtras(extras)
extras?.let {
wrapperType = it.getInt(Constant.WRAPPER_TYPE, Constant.WRAPPER_TYPE_NEWS)
}
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_left_icon -> finish()
}
}
private fun initPage() {
when (wrapperType) {
Constant.WRAPPER_TYPE_NEWS -> {
tv_title.text = "新闻"
val rsNewsFragment = RsNewsFragment()
if (!rsNewsFragment.isAdded()) {
// 提交事务
supportFragmentManager.beginTransaction()
.add(R.id.flWrapper, rsNewsFragment).commitAllowingStateLoss()
}
}
Constant.WRAPPER_TYPE_BOOK -> {
tv_title.text = "书城"
val zhangyueFragment = MyZhangyueFragment()
if (!zhangyueFragment.isAdded()) {
// 提交事务
supportFragmentManager.beginTransaction()
.add(R.id.flWrapper, zhangyueFragment).commit()
}
}
}
}
private fun initListener() {
iv_left_icon.setOnClickListener(this)
}
}
...@@ -14,6 +14,7 @@ import com.mints.goodmoney.R ...@@ -14,6 +14,7 @@ import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.login.LoginApi import com.mints.goodmoney.login.LoginApi
import com.mints.goodmoney.login.OnLoginListener import com.mints.goodmoney.login.OnLoginListener
import com.mints.goodmoney.manager.SceneManager
import com.mints.goodmoney.manager.YwhzManager import com.mints.goodmoney.manager.YwhzManager
import com.mints.goodmoney.mvp.model.WXInfo import com.mints.goodmoney.mvp.model.WXInfo
import com.mints.goodmoney.mvp.presenters.LoginPresenter import com.mints.goodmoney.mvp.presenters.LoginPresenter
...@@ -119,6 +120,8 @@ class WxLoginActivity : BaseActivity() ...@@ -119,6 +120,8 @@ class WxLoginActivity : BaseActivity()
} catch (e: Exception) { } catch (e: Exception) {
} }
SceneManager.signIn(this)
showToast("登录成功") showToast("登录成功")
progressDialog?.dismiss() progressDialog?.dismiss()
if (TextUtils.equals(channel, Constant.CHANNEL_SHARE)) { if (TextUtils.equals(channel, Constant.CHANNEL_SHARE)) {
...@@ -139,14 +142,14 @@ class WxLoginActivity : BaseActivity() ...@@ -139,14 +142,14 @@ class WxLoginActivity : BaseActivity()
try { try {
wxInfo = WXInfo() wxInfo = WXInfo()
wxInfo?.let { wxInfo?.let {
it.setUnionid(res["unionid"].toString() + "") it.unionid = res["unionid"].toString() + ""
it.setOpenid(res["openid"].toString() + "") it.openid = res["openid"].toString() + ""
it.setProvince(res["province"].toString() + "") it.province = res["province"].toString() + ""
it.setCity(res["city"].toString() + "") it.city = res["city"].toString() + ""
it.setCountry(res["country"].toString() + "") it.country = res["country"].toString() + ""
it.setHeadimgurl(res["headimgurl"].toString() + "") it.headimgurl = res["headimgurl"].toString() + ""
it.setNickname(res["nickname"].toString() + "") it.nickname = res["nickname"].toString() + ""
it.setSex((res["sex"].toString() + "").toInt()) it.sex = (res["sex"].toString() + "").toInt()
} }
if (!isFinishing) { if (!isFinishing) {
...@@ -170,8 +173,8 @@ class WxLoginActivity : BaseActivity() ...@@ -170,8 +173,8 @@ class WxLoginActivity : BaseActivity()
} }
override fun updateDrawState(ds: TextPaint) { override fun updateDrawState(ds: TextPaint) {
ds.setColor(resources.getColor(R.color.color_FF9837)) ds.color = resources.getColor(R.color.color_FF9837)
ds.setUnderlineText(false) ds.isUnderlineText = false
} }
}) })
.append("、") .append("、")
...@@ -184,8 +187,8 @@ class WxLoginActivity : BaseActivity() ...@@ -184,8 +187,8 @@ class WxLoginActivity : BaseActivity()
} }
override fun updateDrawState(ds: TextPaint) { override fun updateDrawState(ds: TextPaint) {
ds.setColor(resources.getColor(R.color.color_FF9837)) ds.color = resources.getColor(R.color.color_FF9837)
ds.setUnderlineText(false) ds.isUnderlineText = false
} }
}) })
.append("与您的利益切身相关。请您注册前务必仔细阅读!点击登录即表示您同意并愿意遵守好赚钱协议") .append("与您的利益切身相关。请您注册前务必仔细阅读!点击登录即表示您同意并愿意遵守好赚钱协议")
......
...@@ -30,6 +30,15 @@ class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean> ...@@ -30,6 +30,15 @@ class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean>
// 玩游戏,赚金币 // 玩游戏,赚金币
const val TO_LIEBAO = "TO_LIEBAO" const val TO_LIEBAO = "TO_LIEBAO"
// 新闻
const val TO_RUISHI = "TO_RUISHI"
// 短视频
const val TO_MINI_VEDIO = "TO_MINI_VEDIO"
// 掌阅阅读
const val TO_ZHANGYUE = "TO_ZHANGYUE"
} }
private var mContext: Context = context private var mContext: Context = context
......
...@@ -5,14 +5,11 @@ import android.content.Intent ...@@ -5,14 +5,11 @@ import android.content.Intent
import android.content.pm.ApplicationInfo import android.content.pm.ApplicationInfo
import android.net.Uri import android.net.Uri
import android.os.Build import android.os.Build
import android.text.TextUtils
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.webkit.WebSettings import android.webkit.WebSettings
import android.webkit.WebViewClient import android.webkit.WebViewClient
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.UserManager import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment import com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import com.mints.goodmoney.utils.LogUtil import com.mints.goodmoney.utils.LogUtil
...@@ -20,7 +17,6 @@ import com.mints.goodmoney.utils.MD5 ...@@ -20,7 +17,6 @@ import com.mints.goodmoney.utils.MD5
import com.mints.goodmoney.utils.URIEncoder import com.mints.goodmoney.utils.URIEncoder
import kotlinx.android.synthetic.main.fragment_main_dh.* import kotlinx.android.synthetic.main.fragment_main_dh.*
/** /**
* 描述:电魂游戏 * 描述:电魂游戏
* 作者:孟崔广 * 作者:孟崔广
...@@ -46,7 +42,13 @@ class DhGameFragment : LazyLoadBaseFragment(), View.OnClickListener { ...@@ -46,7 +42,13 @@ class DhGameFragment : LazyLoadBaseFragment(), View.OnClickListener {
initListener() initListener()
} }
override fun onFragmentResume() {
super.onFragmentResume()
// LogUtil.d(TAG, "onFragmentResume")
}
override fun onFragmentPause() { override fun onFragmentPause() {
// LogUtil.d(TAG, "onFragmentPause")
if (UserManager.getInstance().userIsLogin()) { if (UserManager.getInstance().userIsLogin()) {
loadH5Game() loadH5Game()
} }
......
...@@ -175,9 +175,6 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC ...@@ -175,9 +175,6 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
} }
2 -> { 2 -> {
friendsPresenter.getContributionLeaders() friendsPresenter.getContributionLeaders()
}
else -> {
} }
} }
} }
...@@ -223,8 +220,6 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC ...@@ -223,8 +220,6 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
2 -> { 2 -> {
friendsPresenter.getContributionLeaders() friendsPresenter.getContributionLeaders()
} }
else -> {
}
} }
} }
} }
......
...@@ -21,6 +21,11 @@ import kotlinx.android.synthetic.main.fragment_horiz_channel.cdvvYilanTime ...@@ -21,6 +21,11 @@ import kotlinx.android.synthetic.main.fragment_horiz_channel.cdvvYilanTime
import kotlinx.android.synthetic.main.fragment_horiz_channel.vs_tips import kotlinx.android.synthetic.main.fragment_horiz_channel.vs_tips
import net.grandcentrix.tray.AppPreferences import net.grandcentrix.tray.AppPreferences
/**
* 描述:横版视频页面
* 作者:孟崔广
* 时间:2020/10/29 13:48
*/
class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListener { class HorizChannelFragment : BaseFragment(), HorizChannelView, View.OnClickListener {
private val TAG = HorizChannelFragment::class.java.simpleName private val TAG = HorizChannelFragment::class.java.simpleName
......
...@@ -6,6 +6,7 @@ import android.os.Looper ...@@ -6,6 +6,7 @@ import android.os.Looper
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import androidx.fragment.app.FragmentTransaction import androidx.fragment.app.FragmentTransaction
import com.bytedance.hume.readapk.HumeSDK
import com.mints.goodmoney.MintsApplication import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.ad.video.VedioAdingManager import com.mints.goodmoney.ad.video.VedioAdingManager
...@@ -100,7 +101,6 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -100,7 +101,6 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MAIN) { if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MAIN) {
// 打开激活 // 打开激活
uploadDeviceInfo() uploadDeviceInfo()
...@@ -177,6 +177,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -177,6 +177,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 保存Ip,用于穿山甲回调校验 // 保存Ip,用于穿山甲回调校验
ps.put(Constant.CSJ_VEDIO_APPIP, data.ip) ps.put(Constant.CSJ_VEDIO_APPIP, data.ip)
AppConfig.app_black = data.userRiskApp
AppConfig.flVideoFlag = data.vedioRules.isFlVideoFlag
// 新人福利 放到个人中心展示 防止首页红包转动异常 // 新人福利 放到个人中心展示 防止首页红包转动异常
...@@ -490,13 +492,16 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -490,13 +492,16 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
* 设置视频权重 * 设置视频权重
*/ */
private fun initAdWeight(data: UserTaskMsgBean) { private fun initAdWeight(data: UserTaskMsgBean) {
vedioAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate) vedioAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate, data.vedioRules.sdhZ_VEDIO.rate, data.vedioRules.fL_VEDIO.rate)
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate} sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate}") LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate}" +
" sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} flWeight:${data.vedioRules.fL_VEDIO.rate}")
// 广告视频数 // 广告视频数
AppConfig.csjVedioAdCount = data.vedioRules.csJ_VEDIO.surplus AppConfig.csjVedioAdCount = data.vedioRules.csJ_VEDIO.surplus
AppConfig.ylhAdCount = data.vedioRules.ylH_VEDIO.surplus AppConfig.ylhAdCount = data.vedioRules.ylH_VEDIO.surplus
AppConfig.wnVedioAdCount = data.vedioRules.sdhZ_VEDIO.surplus AppConfig.wnVedioAdCount = data.vedioRules.sdhZ_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount} sdhzCount:${AppConfig.wnVedioAdCount}") AppConfig.flVedioAdCount = data.vedioRules.fL_VEDIO.surplus
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount}" +
" sdhzCount:${AppConfig.wnVedioAdCount} flCount:${AppConfig.flVedioAdCount}")
} }
......
...@@ -32,7 +32,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener { ...@@ -32,7 +32,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
override fun onHiddenChanged(hidden: Boolean) { override fun onHiddenChanged(hidden: Boolean) {
if (curPosition == 0) { if (curPosition == 0) {
mainFragment?.onHiddenChanged(hidden) mainFragment?.onHiddenChanged(hidden)
} else if (curPosition == 2) { } else if (curPosition == 3) {
dhGameFragment?.onHiddenChanged(hidden) dhGameFragment?.onHiddenChanged(hidden)
} }
super.onHiddenChanged(hidden) super.onHiddenChanged(hidden)
...@@ -49,6 +49,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener { ...@@ -49,6 +49,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
val tabs: MutableList<String> = ArrayList() val tabs: MutableList<String> = ArrayList()
tabs.add("视频") tabs.add("视频")
tabs.add("书城") tabs.add("书城")
tabs.add("新闻")
tabs.add("游戏") tabs.add("游戏")
val fragments: MutableList<Fragment> = ArrayList() val fragments: MutableList<Fragment> = ArrayList()
...@@ -56,13 +57,12 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener { ...@@ -56,13 +57,12 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
dhGameFragment = DhGameFragment() dhGameFragment = DhGameFragment()
fragments.add(mainFragment!!) fragments.add(mainFragment!!)
fragments.add(ZhangyueFragment()) fragments.add(ZhangyueFragment())
fragments.add(RsNewsFragment())
fragments.add(dhGameFragment!!) fragments.add(dhGameFragment!!)
//去除两侧应阴影 //去除两侧应阴影
vpFragmentMoney.overScrollMode = ViewPager.OVER_SCROLL_NEVER vpFragmentMoney.overScrollMode = ViewPager.OVER_SCROLL_NEVER
vpFragmentMoney.offscreenPageLimit = tabs.size + 3 vpFragmentMoney.offscreenPageLimit = tabs.size + 3
val adapter = MessageFragAdapter(childFragmentManager, fragments, tabs) val adapter = MessageFragAdapter(childFragmentManager, fragments, tabs)
vpFragmentMoney.adapter = adapter vpFragmentMoney.adapter = adapter
xtFragmentMoney.setxTabDisplayNum(tabs.size) xtFragmentMoney.setxTabDisplayNum(tabs.size)
...@@ -74,6 +74,10 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener { ...@@ -74,6 +74,10 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
vpFragmentMoney.currentItem = 0 vpFragmentMoney.currentItem = 0
} }
fun selectBook() {
vpFragmentMoney.currentItem = 1
}
override fun onTabReselected(tab: XTabLayout.Tab) { override fun onTabReselected(tab: XTabLayout.Tab) {
} }
...@@ -81,20 +85,14 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener { ...@@ -81,20 +85,14 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
} }
override fun onTabSelected(tab: XTabLayout.Tab) { override fun onTabSelected(tab: XTabLayout.Tab) {
if (tab.position == 2) { if (tab.position == 3) {
if (!UserManager.getInstance().userIsLogin()) { if (!UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java) readyGo(WxLoginActivity::class.java)
vpFragmentMoney.currentItem = if (curPosition == 2) 0 else curPosition vpFragmentMoney.currentItem = if (curPosition == 3) 0 else curPosition
return return
} }
} }
// if (tab.position == 1) {
// vpFragmentMoney.setCanScroll(false)
// } else {
// vpFragmentMoney.setCanScroll(true)
// }
curPosition = tab.position curPosition = tab.position
} }
} }
\ No newline at end of file
package com.mints.goodmoney.ui.fragment
import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction
import com.ireader.ireadersdk.IreaderApi
import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.mvp.presenters.BookPresenter
import com.mints.goodmoney.mvp.views.BookView
import com.mints.goodmoney.ui.activitys.AwardActivity
import com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import com.mints.goodmoney.utils.SpanUtils
import kotlinx.android.synthetic.main.fragment_main_zy.*
/**
* 描述:我的-掌阅书城
* 作者:孟崔广
*/
class MyZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChangeListener {
private val bookPresenter by lazy { BookPresenter() }
private var bookFragment: Fragment? = null
override fun getContentViewLayoutID() = R.layout.fragment_main_zy
override fun initViewsAndEvents() {
bookPresenter.attachView(this)
val transaction: FragmentTransaction = supportFragmentManager.beginTransaction()
if (bookFragment == null) {
// bookFragment = IreaderApi.getNovelBookStoreFragment()
bookFragment = IreaderApi.getNovelChannelFragment()
transaction.add(R.id.fragment, bookFragment!!, bookFragment!!::class.java.simpleName)
IreaderApi.setReadChangeListener(this)
} else {
transaction.show(bookFragment!!)
}
transaction.commitAllowingStateLoss()
}
override fun onFragmentFirstVisible() {
}
override fun onFragmentResume() {
super.onFragmentResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MAIN) {
bookPresenter.getReadInfo()
}
}
override fun onDestroy() {
super.onDestroy()
IreaderApi.setReadChangeListener(null)
bookPresenter.detachView()
}
override fun onReadStart() {
}
override fun onReadEnd(time: Long) {
// LogUtil.d(TAG, "onReadEnd time:" + time)
// LogUtil.d(TAG, "onReadEnd time(Int):" + (time/1000).toInt())
val seconds = (time / 1000).toInt()
// 阅读5秒以上 保存时长
if (seconds > 5) {
bookPresenter.addReadSeconds(seconds)
}
}
override fun onReadPage(time: Long) {
}
override fun readSecondsSuc(coin: Int) {
if (coin > 0) {
val bundle = Bundle()
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_ZHANGYUE)
bundle.putInt(Constant.MAIN_CUR_COIN, coin)
readyGo(AwardActivity::class.java, bundle)
}
}
override fun readInfo(sumTime: Int, sumCoin: Int, readTime: Int) {
//阅读{10}分钟,奖励{xx}金币,已读{x}分钟
tvZhangContent.visibility = View.VISIBLE
if (readTime >= sumTime) {
tvZhangContent.text = "今日阅读任务已完成"
} else {
tvZhangContent.text = SpanUtils()
.append("阅读").append("${sumTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.color_FF9837)).append("分钟, ")
.append("奖励").append("$sumCoin").setForegroundColor(mContext.resources.getColor(R.color.color_cb4a39)).append("金币, ")
.append("已读").append("${readTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.color_FF9837)).append("分钟")
.create()
}
}
}
\ No newline at end of file
...@@ -3,7 +3,6 @@ package com.mints.goodmoney.ui.fragment ...@@ -3,7 +3,6 @@ package com.mints.goodmoney.ui.fragment
import android.os.Bundle import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import android.view.MotionEvent import android.view.MotionEvent
import android.view.View
import android.webkit.WebChromeClient import android.webkit.WebChromeClient
import com.github.lzyzsd.jsbridge.CallBackFunction import com.github.lzyzsd.jsbridge.CallBackFunction
import com.github.lzyzsd.jsbridge.DefaultHandler import com.github.lzyzsd.jsbridge.DefaultHandler
...@@ -49,7 +48,7 @@ class PanFragment : BaseFragment(), PanView { ...@@ -49,7 +48,7 @@ class PanFragment : BaseFragment(), PanView {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (AppConfig.fragmentClickFlag === Constant.FRAGMENT_CLICK_PAN) { if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_PAN) {
if (TextUtils.isEmpty(userManager?.userID)) { if (TextUtils.isEmpty(userManager?.userID)) {
// 游客登录 // 游客登录
panPresenter.userLogin() panPresenter.userLogin()
...@@ -73,26 +72,20 @@ class PanFragment : BaseFragment(), PanView { ...@@ -73,26 +72,20 @@ class PanFragment : BaseFragment(), PanView {
*/ */
private fun loadTurnUrl() { private fun loadTurnUrl() {
getTurnUrl() getTurnUrl()
blTurntableWebview.setOnTouchListener(object : View.OnTouchListener { blTurntableWebview.setOnTouchListener { _, event -> event.action == MotionEvent.ACTION_MOVE }
override fun onTouch(v: View?, event: MotionEvent): Boolean {
return event.action == MotionEvent.ACTION_MOVE
}
})
blTurntableWebview.setDefaultHandler(DefaultHandler()) blTurntableWebview.setDefaultHandler(DefaultHandler())
blTurntableWebview.webChromeClient = WebChromeClient() blTurntableWebview.webChromeClient = WebChromeClient()
blTurntableWebview.setOnLongClickListener { true } blTurntableWebview.setOnLongClickListener { true }
//注册监听方法当js中调用callHandler方法时会调用此方法(handlerName必须和js中相同) //注册监听方法当js中调用callHandler方法时会调用此方法(handlerName必须和js中相同)
blTurntableWebview.registerHandler("getTurnResult") { data, function -> blTurntableWebview.registerHandler("getTurnResult") { data, _ ->
val turntableBean: TurntableBean = JsonUtil.parseJson(data, TurntableBean::class.java) val turntableBean: TurntableBean = JsonUtil.parseJson(data, TurntableBean::class.java)
if (turntableBean != null) { val bundle = Bundle()
val bundle = Bundle() bundle.putInt(Constant.MAIN_CUR_COIN, turntableBean.coin)
bundle.putInt(Constant.MAIN_CUR_COIN, turntableBean.coin) bundle.putString(Constant.MAIN_CARRIER_TYPE, carrierType)
bundle.putString(Constant.MAIN_CARRIER_TYPE, carrierType) bundle.putString(Constant.MAIN_EXTRA_ID, turntableBean.key)
bundle.putString(Constant.MAIN_EXTRA_ID, turntableBean.key) readyGo(AwardActivity::class.java, bundle)
readyGo(AwardActivity::class.java, bundle)
androidCallJsReferse() androidCallJsReferse()
}
} }
blTurntableWebview.setDefaultHandler(object : DefaultHandler() { blTurntableWebview.setDefaultHandler(object : DefaultHandler() {
override fun handler(data: String, function: CallBackFunction) { override fun handler(data: String, function: CallBackFunction) {
......
package com.mints.goodmoney.ui.fragment
import android.os.Bundle
import com.mints.goodmoney.R
import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.mvp.presenters.RsNewsPresenter
import com.mints.goodmoney.mvp.views.RsNewsView
import com.mints.goodmoney.ui.activitys.AwardActivity
import com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import com.xr.xrsdk.FinishReadNewsCallBack
import com.xr.xrsdk.XRNewsManager
/**
* 描述:瑞狮新闻
* 作者:孟崔广
* 时间:2020/12/9 10:55
*/
class RsNewsFragment : LazyLoadBaseFragment(), RsNewsView, FinishReadNewsCallBack {
private val rsNewsPresenter by lazy { RsNewsPresenter() }
override fun getContentViewLayoutID() = R.layout.fragment_main_rsnews
override fun initViewsAndEvents() {}
override fun onFragmentFirstVisible() {
rsNewsPresenter.attachView(this)
XRNewsManager.getInstance().addNewsFragment(supportFragmentManager, R.id.flMainRsNews, Constant.FRAGMENT_TAG_RSNEWS, this)
}
override fun onDestroy() {
super.onDestroy()
rsNewsPresenter.detachView()
}
override fun readSecondsSuc(coin: Int, video: Int, supr: Int) {
if (activity != null && !activity!!.isFinishing() && coin > 0 && supr > 0) {
val bundle = Bundle()
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_RUISHINEWS)
bundle.putInt(Constant.MAIN_CUR_COIN, coin)
bundle.putString(Constant.MAIN_EXTRA_ID, video.toString())
readyGo(AwardActivity::class.java, bundle)
}
}
override fun finishRead(id: String, seconds: Int) {
rsNewsPresenter.addNewsSeconds(seconds)
}
}
\ No newline at end of file
...@@ -92,7 +92,7 @@ class ZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChan ...@@ -92,7 +92,7 @@ class ZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChan
} else { } else {
tvZhangContent.text = SpanUtils() tvZhangContent.text = SpanUtils()
.append("阅读").append("${sumTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.color_FF9837)).append("分钟, ") .append("阅读").append("${sumTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.color_FF9837)).append("分钟, ")
.append("奖励").append("${sumCoin}").setForegroundColor(mContext.resources.getColor(R.color.color_cb4a39)).append("金币, ") .append("奖励").append("$sumCoin").setForegroundColor(mContext.resources.getColor(R.color.color_cb4a39)).append("金币, ")
.append("已读").append("${readTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.color_FF9837)).append("分钟") .append("已读").append("${readTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.color_FF9837)).append("分钟")
.create() .create()
} }
......
...@@ -6,49 +6,36 @@ import android.view.MotionEvent; ...@@ -6,49 +6,36 @@ import android.view.MotionEvent;
import androidx.viewpager.widget.ViewPager; import androidx.viewpager.widget.ViewPager;
public class MyViewPager extends ViewPager public class MyViewPager extends ViewPager {
{
public MyViewPager(Context context) public MyViewPager(Context context) {
{
super(context); super(context);
} }
public MyViewPager(Context context, AttributeSet attrs) public MyViewPager(Context context, AttributeSet attrs) {
{
super(context, attrs); super(context, attrs);
// TODO Auto-generated constructor stub
} }
private boolean isCanScroll = false; private boolean isCanScroll = false;
public void setCanScroll(boolean isCanScroll) public void setCanScroll(boolean isCanScroll) {
{
this.isCanScroll = isCanScroll; this.isCanScroll = isCanScroll;
} }
@Override @Override
public boolean onTouchEvent(MotionEvent arg0) public boolean onTouchEvent(MotionEvent arg0) {
{ if (isCanScroll) {
if (isCanScroll)
{
return super.onTouchEvent(arg0); return super.onTouchEvent(arg0);
} } else {
else
{
return false; return false;
} }
} }
@Override @Override
public boolean onInterceptTouchEvent(MotionEvent arg0) public boolean onInterceptTouchEvent(MotionEvent arg0) {
{ if (isCanScroll) {
if (isCanScroll)
{
return super.onInterceptTouchEvent(arg0); return super.onInterceptTouchEvent(arg0);
} } else {
else
{
return false; return false;
} }
} }
......
...@@ -784,8 +784,8 @@ public class BubbleSeekBar extends View { ...@@ -784,8 +784,8 @@ public class BubbleSeekBar extends View {
mProgress = (mThumbCenterX - mLeft) * mDelta / mTrackLength + mMin; mProgress = (mThumbCenterX - mLeft) * mDelta / mTrackLength + mMin;
mBubbleCenterRawX = mBubbleCenterRawSolidX + mThumbCenterX - mLeft; mBubbleCenterRawX = mBubbleCenterRawSolidX + mThumbCenterX - mLeft;
mLayoutParams.x = (int) (mBubbleCenterRawX + 0.5f);
if (mBubbleView.getParent() != null && mWindowManager != null) { if (mBubbleView.getParent() != null && mWindowManager != null) {
mLayoutParams.x = (int) (mBubbleCenterRawX + 0.5f);
mWindowManager.updateViewLayout(mBubbleView, mLayoutParams); mWindowManager.updateViewLayout(mBubbleView, mLayoutParams);
} }
mBubbleView.setProgressText(isShowProgressInFloat ? mBubbleView.setProgressText(isShowProgressInFloat ?
......
...@@ -94,11 +94,6 @@ public class AESUtils { ...@@ -94,11 +94,6 @@ public class AESUtils {
// System.out.println("decrypted message is below :"); // System.out.println("decrypted message is below :");
// System.out.println(MD5.GetMD5Code("meijie_2016").substring(8, 24)); // System.out.println(MD5.GetMD5Code("meijie_2016").substring(8, 24));
System.out.println(detrypt("5EBue8TMfYS2P8YAZUyJUKnYvTVEblnJMwC00vC1yZHjvqq6Ws4TeaXQ+7l+iwdzoQNi2yJ9CLrG\n" + System.out.println(MD5.GetMD5Code("goodmoney_2020").substring(8, 24));
"cfQlCjaAbr5gmLokexHida7yLofB7V5ItaxTGlXyxK3CH+Wr/lvbWKmP8YROCrtzrreqP8svuf0M\n" +
"AzKbOnPhoURvpfVS5di/dk3chtujIqC74xd5XpLJfHiXQadEX+12zq+IXa0xIWezTHjL6cJBTN6y\n" +
"xg5w6+ey7EYzEdJ118HaSTr1tLu7AkxguXJez9QxhB9nifRBvgl7tlY0oL20+yGGZ3WgR/CmWh9u\n" +
"PjEy0eB3NgmNd8SRmImXDYOQDMJqxa5AUMKjQkQ/NmrDLBdRO+9zy5Ujv7YL1KVoUmmxeH5EVPZR\n" +
"nV+E", "abcdnnnnnn123456"));
} }
} }
...@@ -43,14 +43,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall ...@@ -43,14 +43,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
@Override @Override
public void onActivityResumed(Activity activity) { public void onActivityResumed(Activity activity) {
}
@Override
public void onActivityPaused(Activity activity) {
}
@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
if (activity == null) if (activity == null)
return; return;
String simpleName = activity.getClass().getSimpleName(); String simpleName = activity.getClass().getSimpleName();
...@@ -66,6 +58,27 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall ...@@ -66,6 +58,27 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
} }
} }
@Override
public void onActivityPaused(Activity activity) {
}
@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
// if (activity == null)
// return;
// String simpleName = activity.getClass().getSimpleName();
// if (TextUtils.equals(simpleName, "MainActivity")) {
// // 版本更新
// if (vup == null) {
// vup = new VersionUpdatePresenter();
// }
// if (reference == null) {
// reference = new WeakReference<>(activity);
// }
// vup.updateVersion(reference.get());
// }
}
@Override @Override
public void onActivityStarted(Activity activity) { public void onActivityStarted(Activity activity) {
if (activity == null) if (activity == null)
......
...@@ -50,7 +50,7 @@ public class SoundPoolUtil { ...@@ -50,7 +50,7 @@ public class SoundPoolUtil {
} }
} }
public void destoryGoldVoice() { public void onDestory() {
if (player != null) { if (player != null) {
player.stop(); player.stop();
player.release(); player.release();
......
...@@ -2,6 +2,13 @@ package com.mints.goodmoney.utils ...@@ -2,6 +2,13 @@ package com.mints.goodmoney.utils
import android.app.ActivityManager import android.app.ActivityManager
import android.content.Context import android.content.Context
import android.os.Environment
import android.os.StatFs
import java.io.BufferedReader
import java.io.File
import java.io.FileReader
import kotlin.math.ceil
object SystemUtils { object SystemUtils {
...@@ -21,13 +28,56 @@ object SystemUtils { ...@@ -21,13 +28,56 @@ object SystemUtils {
fun getProcessName(cxt: Context, pid: Int): String? { fun getProcessName(cxt: Context, pid: Int): String? {
val am: ActivityManager = cxt.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager val am: ActivityManager = cxt.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
val runningApps: List<ActivityManager.RunningAppProcessInfo> = val runningApps: List<ActivityManager.RunningAppProcessInfo> =
am.runningAppProcesses am.runningAppProcesses
?: return null ?: return null
for (procInfo in runningApps) { for (procInfo in runningApps) {
if (procInfo.pid === pid) { if (procInfo.pid == pid) {
return procInfo.processName return procInfo.processName
} }
} }
return null return null
} }
/**
* ram
*/
fun getTotalMemory(): String {
// 系统内存信息文件
val file = "/proc/meminfo"
val memInfo: String
val strs: Array<String>
var memory: Long = 0
try {
val fileReader = FileReader(file)
val bufferedReader = BufferedReader(
fileReader,
8192
)
// 读取meminfo第一行,系统内存大小
memInfo = bufferedReader.readLine()
strs = memInfo.split("\\s+".toRegex()).toTypedArray()
// 获得系统总内存,单位KB
memory = Integer.valueOf(strs[1]).toLong()
bufferedReader.close()
} catch (e: Exception) {
e.printStackTrace()
}
return "" + ceil((memory.toFloat() / (1024 * 1024).toDouble())).toInt() + "GB"
}
/**
* 获取手机内部空间总大小
*
* @return 大小,字节为单位
*/
fun getTotalInternalMemorySize(): String {
//获取内部存储根目录
val path: File = Environment.getExternalStorageDirectory()
//系统的空间描述类
val stat = StatFs(path.absolutePath)
//每个区块占字节数
val totalSize = stat.totalBytes
return "" + ceil((totalSize.toFloat() / (1024 * 1024 * 1024).toDouble())).toInt() + "GB"
}
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?><!-- 中心背景 -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android"
<!-- 边 --> android:shape="rectangle">
<!-- <item>--> <!-- 实心 -->
<!-- <shape android:shape="rectangle">--> <solid android:color="#ffffff" />
<!-- <padding android:top="1dp" />--> <corners
<!-- <solid android:color="#00CCCCCC" />--> android:topLeftRadius="20dp"
<!-- <corners--> android:topRightRadius="20dp" />
<!-- android:topLeftRadius="20dp"--> </shape>
<!-- android:topRightRadius="20dp" />--> \ No newline at end of file
<!-- </shape>-->
<!-- </item>-->
<!-- <item>-->
<!-- <shape android:shape="rectangle">-->
<!-- <padding android:top="1dp" />-->
<!-- <solid android:color="#10CCCCCC" />-->
<!-- <corners-->
<!-- android:topLeftRadius="20dp"-->
<!-- android:topRightRadius="20dp" />-->
<!-- </shape>-->
<!-- </item>-->
<!-- <item>-->
<!-- <shape android:shape="rectangle">-->
<!-- <padding android:top="1dp" />-->
<!-- <solid android:color="#20CCCCCC" />-->
<!-- <corners-->
<!-- android:topLeftRadius="20dp"-->
<!-- android:topRightRadius="20dp" />-->
<!-- </shape>-->
<!-- </item>-->
<item>
<shape android:shape="rectangle">
<padding
android:bottom="1dp"
android:top="1dp" />
<solid android:color="#30CCCCCC" />
<corners
android:topLeftRadius="20dp"
android:topRightRadius="20dp" />
</shape>
</item>
<!-- 中心背景 -->
<item>
<shape
android:shape="rectangle"
android:useLevel="false">
<!-- 实心 -->
<solid android:color="#ffffff" />
<corners
android:topLeftRadius="20dp"
android:topRightRadius="20dp" />
</shape>
</item>
</layer-list>
\ No newline at end of file
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
<com.mints.goodmoney.ui.widgets.ElasticScrollView <com.mints.goodmoney.ui.widgets.ElasticScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:overScrollMode="never">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -47,6 +48,7 @@ ...@@ -47,6 +48,7 @@
<include <include
android:id="@+id/item_feedBack" android:id="@+id/item_feedBack"
layout="@layout/item_settings" /> layout="@layout/item_settings" />
<Button <Button
android:id="@+id/btn_switch" android:id="@+id/btn_switch"
android:layout_width="200dp" android:layout_width="200dp"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include layout="@layout/header_layout" />
<FrameLayout
android:id="@+id/flWrapper"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
...@@ -38,7 +37,6 @@ ...@@ -38,7 +37,6 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/color_F8F8F8"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <RelativeLayout
...@@ -102,7 +100,8 @@ ...@@ -102,7 +100,8 @@
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:background="@drawable/shape_white_border" android:background="@drawable/shape_gold_card"
android:elevation="2dip"
android:padding="15dp"> android:padding="15dp">
<TextView <TextView
...@@ -253,7 +252,8 @@ ...@@ -253,7 +252,8 @@
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:background="@drawable/shape_white_border" android:background="@drawable/shape_gold_card"
android:elevation="2dip"
android:padding="15dp"> android:padding="15dp">
<TextView <TextView
...@@ -294,8 +294,7 @@ ...@@ -294,8 +294,7 @@
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintEnd_toStartOf="@id/ll2" app:layout_constraintEnd_toStartOf="@id/ll2"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/line" app:layout_constraintTop_toBottomOf="@id/line">
tools:layout_editor_absoluteY="9dp">
<TextView <TextView
android:id="@+id/friends_sum" android:id="@+id/friends_sum"
...@@ -322,8 +321,7 @@ ...@@ -322,8 +321,7 @@
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintEnd_toStartOf="@id/ll3" app:layout_constraintEnd_toStartOf="@id/ll3"
app:layout_constraintStart_toEndOf="@id/ll1" app:layout_constraintStart_toEndOf="@id/ll1"
app:layout_constraintTop_toBottomOf="@id/line" app:layout_constraintTop_toBottomOf="@id/line">
tools:layout_editor_absoluteY="9dp">
<TextView <TextView
android:id="@+id/friends_directly_sum" android:id="@+id/friends_directly_sum"
...@@ -353,8 +351,7 @@ ...@@ -353,8 +351,7 @@
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ll2" app:layout_constraintStart_toEndOf="@id/ll2"
app:layout_constraintTop_toBottomOf="@id/line" app:layout_constraintTop_toBottomOf="@id/line">
tools:layout_editor_absoluteY="9dp">
<TextView <TextView
android:id="@+id/friends_indirect_sum" android:id="@+id/friends_indirect_sum"
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/flMainRsNews"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white" />
\ No newline at end of file
...@@ -16,6 +16,13 @@ ...@@ -16,6 +16,13 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginBottom="20dp" /> android:layout_marginBottom="10dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="20dp"
android:text="请关注公众号:金币宝箱,获取更多赚钱资讯" />
</merge> </merge>
\ No newline at end of file
...@@ -65,7 +65,8 @@ ...@@ -65,7 +65,8 @@
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:background="@drawable/shape_white_border"> android:background="@drawable/shape_gold_card"
android:elevation="2dip">
<ImageView <ImageView
android:id="@+id/imageView2" android:id="@+id/imageView2"
......
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