Commit 008aca0d authored by mengcuiguang's avatar mengcuiguang

添加新闻、添加分包sdk,代码优化

parent ae8cbd71
...@@ -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包依赖(必选)
...@@ -234,6 +236,9 @@ dependencies { ...@@ -234,6 +236,9 @@ 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:+'
compile(name: 'xrsdk-release_tbs', ext: 'aar')
// testImplementation 'junit:junit:4.13' // testImplementation 'junit:junit:4.13'
......
...@@ -490,3 +490,14 @@ ...@@ -490,3 +490,14 @@
-keep class com.wannuosili.sdk.** {*;} -keep class com.wannuosili.sdk.** {*;}
-dontwarn com.wannuosili.sdk.** -dontwarn com.wannuosili.sdk.**
# ======================= 闪电盒子 END ================ # ======================= 闪电盒子 END ================
# ===================== 瑞狮新闻 START ================
-keep class com.tencent.** {*;}
-keep class com.qq.e.** {public protected *;}
-keep class com.xr.xrsdk.** { *;}
# ======================= 瑞狮新闻 END ================
...@@ -180,6 +180,9 @@ ...@@ -180,6 +180,9 @@
<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 +322,7 @@ ...@@ -319,6 +322,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
...@@ -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)
} }
......
...@@ -15,6 +15,7 @@ import com.bun.miitmdid.core.JLibrary; ...@@ -15,6 +15,7 @@ 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.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;
...@@ -120,6 +121,9 @@ public class MintsApplication extends MultiDexApplication { ...@@ -120,6 +121,9 @@ public class MintsApplication extends MultiDexApplication {
// 猎豹游戏初始化 // 猎豹游戏初始化
LiebaoManager.getInstance().initCmGameSdk(); LiebaoManager.getInstance().initCmGameSdk();
// 瑞狮新闻
RsNewsManager.INSTANCE.init(this);
} }
private MiitHelper.AppIdsUpdater appIdsUpdater = ids -> OAID = ids; private MiitHelper.AppIdsUpdater appIdsUpdater = ids -> OAID = ids;
......
...@@ -13,6 +13,11 @@ public class AppConfig { ...@@ -13,6 +13,11 @@ public class AppConfig {
*/ */
public static boolean app_updateing = false; public static boolean app_updateing = false;
/**
* 名单
*/
public static String app_black = "";
/** /**
* app应用首页 0-主页 1-大转盘 2-邀请好友 3-我 * app应用首页 0-主页 1-大转盘 2-邀请好友 3-我
*/ */
......
...@@ -77,6 +77,7 @@ object Constant { ...@@ -77,6 +77,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 +110,11 @@ object Constant { ...@@ -109,6 +110,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 +122,7 @@ object Constant { ...@@ -116,6 +122,7 @@ 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 CHALLENGE_SHAREFRIEND = "CHALLENGE_SHAREFRIEND" //邀请好友 const val CHALLENGE_SHAREFRIEND = "CHALLENGE_SHAREFRIEND" //邀请好友
...@@ -181,4 +188,9 @@ object Constant { ...@@ -181,4 +188,9 @@ object Constant {
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"
// wrapper type
const val WRAPPER_TYPE="wrapper_type"
} }
...@@ -13,6 +13,8 @@ import android.os.Build ...@@ -13,6 +13,8 @@ import android.os.Build
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.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.mints.goodmoney.MintsApplication import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.library.utils.json.JsonUtil import com.mints.library.utils.json.JsonUtil
...@@ -405,6 +407,37 @@ class DeviceInfo private constructor() { ...@@ -405,6 +407,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
......
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().mobile)
}
}
\ No newline at end of file
...@@ -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;
}
} }
...@@ -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.UserBean;
import com.mints.goodmoney.mvp.model.UserTaskMsgBean; import com.mints.goodmoney.mvp.model.UserTaskMsgBean;
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;
...@@ -52,6 +61,71 @@ public class AwardPresenter extends BasePresenter<AwardView> { ...@@ -52,6 +61,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.getBrand() + " " + deviceInfo.getMobileModel());
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;
...@@ -119,14 +124,21 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> { ...@@ -119,14 +124,21 @@ 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();
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(); String macAddress = deviceInfo.getMacAddress();
if (!TextUtils.isEmpty(macAddress)) { if (!TextUtils.isEmpty(macAddress)) {
String mac = macAddress.replace(":", ""); String mac = macAddress.replace(":", "");
vo.put("mac", mac); vo.put("mac", mac);
vo.put("mac1", macAddress); vo.put("mac1", macAddress);
} }
vo.put("imei", deviceInfo.getIMEI()); vo.put("imei", deviceInfo.getIMEI());
vo.put("androidid", deviceInfo.getAndroidId(null)); vo.put("androidid", deviceInfo.getAndroidId(null));
...@@ -136,11 +148,10 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> { ...@@ -136,11 +148,10 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
vo.put("uuid", new DeviceUuidFactory().getDeviceUuid()); vo.put("uuid", new DeviceUuidFactory().getDeviceUuid());
vo.put("osversion", deviceInfo.getOSVersion()); vo.put("osversion", deviceInfo.getOSVersion());
vo.put("appversion", deviceInfo.getVersionName()); vo.put("appversion", deviceInfo.getVersionName());
vo.put("appPkgList", deviceInfo.getAppInfoMap()); vo.put("appPkgList", getT());
if (!TextUtils.isEmpty(MintsApplication.OAID)) { if (!TextUtils.isEmpty(MintsApplication.OAID)) {
vo.put("oaid", MintsApplication.OAID); vo.put("oaid", MintsApplication.OAID);
} }
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo), .call(loanService.saveTerminalInfo(vo),
new BaseSubscriber<BaseResponse<UserBean>>() { new BaseSubscriber<BaseResponse<UserBean>>() {
...@@ -174,12 +185,13 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> { ...@@ -174,12 +185,13 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
} }
}); });
} }
});
}
/** /**
* 金币/积分兑换 * 金币/积分兑换
*/ */
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 -> {
......
...@@ -133,6 +133,8 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -133,6 +133,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()
......
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,8 +229,14 @@ class LoginPresenter : BasePresenter<LoginView>() { ...@@ -225,8 +229,14 @@ 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
RxjavaUtil.executeRxTask<String>(object : CommonRxTask<String?>("") {
override fun doInIOThread() {
t = deviceInfo.getAppInfoMap()
}
override fun doInUIThread() {
val vo = HashMap<String, Any>()
val macAddress: String = deviceInfo.getMacAddress() val macAddress: String = deviceInfo.getMacAddress()
val mac = macAddress.replace(":", "") val mac = macAddress.replace(":", "")
vo["mac"] = mac vo["mac"] = mac
...@@ -242,7 +252,7 @@ class LoginPresenter : BasePresenter<LoginView>() { ...@@ -242,7 +252,7 @@ class LoginPresenter : BasePresenter<LoginView>() {
vo["osversion"] = deviceInfo.oSVersion vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName vo["appversion"] = deviceInfo.versionName
vo["shumeiId"] = ShumeiManager.getInstance().getShumeiDeviceId() vo["shumeiId"] = ShumeiManager.getInstance().getShumeiDeviceId()
vo["appPkgList"] = deviceInfo.getAppInfoMap() vo["appPkgList"] = t.toString()
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo), .call(loanService.saveTerminalInfo(vo),
...@@ -266,5 +276,10 @@ class LoginPresenter : BasePresenter<LoginView>() { ...@@ -266,5 +276,10 @@ class LoginPresenter : BasePresenter<LoginView>() {
} }
} }
}) })
}
})
} }
} }
\ 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
......
...@@ -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()
......
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
package com.mints.goodmoney.mvp.views
interface RsNewsView : BaseView {
fun readSecondsSuc(coin:Int,video:Int,supr:Int)
}
...@@ -308,6 +308,14 @@ public interface LoanService { ...@@ -308,6 +308,14 @@ public interface LoanService {
@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,14 @@ public class OkHttpInterceptor implements Interceptor { ...@@ -44,6 +45,14 @@ 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(context, "自有渠道:" + CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME") +
"\n 头条渠道:" + HumeSDK.getChannel(context) +
"\n 头条version:" + HumeSDK.getVersion())
true true
}) })
......
...@@ -4,9 +4,13 @@ import android.os.Bundle ...@@ -4,9 +4,13 @@ import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import android.view.KeyEvent import android.view.KeyEvent
import android.view.View import android.view.View
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
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.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.common.DeviceInfo.Companion.instance
import com.mints.goodmoney.manager.TTPreLoadExpressManager import com.mints.goodmoney.manager.TTPreLoadExpressManager
import com.mints.goodmoney.manager.UserManager import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.mvp.model.VedioAdingBean import com.mints.goodmoney.mvp.model.VedioAdingBean
...@@ -18,10 +22,13 @@ import com.mints.goodmoney.ui.widgets.countdowntimer.OnCountDownTimerListener ...@@ -18,10 +22,13 @@ import com.mints.goodmoney.ui.widgets.countdowntimer.OnCountDownTimerListener
import com.mints.goodmoney.utils.SoundPoolUtil import com.mints.goodmoney.utils.SoundPoolUtil
import com.mints.goodmoney.utils.SpanUtils import com.mints.goodmoney.utils.SpanUtils
import com.mints.goodmoney.utils.Utils import com.mints.goodmoney.utils.Utils
import com.mints.goodmoney.utils.rxutil.CommonRxTask
import com.mints.goodmoney.utils.rxutil.RxjavaUtil
import com.umeng.analytics.MobclickAgent import com.umeng.analytics.MobclickAgent
import kotlinx.android.synthetic.main.activity_award.* import kotlinx.android.synthetic.main.activity_award.*
import java.math.BigDecimal import java.math.BigDecimal
import java.util.* import java.util.*
import kotlin.collections.ArrayList
/** /**
...@@ -53,8 +60,49 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -53,8 +60,49 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
vedioAdingManager = VedioAdingManager.getInstance(this) vedioAdingManager = VedioAdingManager.getInstance(this)
initExpress() initExpress()
initDataView()
initListener() initListener()
judgeAppInfo()
}
/**
* 校验是否属于黑名单
*/
private fun judgeAppInfo() {
val deviceInfo = instance
RxjavaUtil.executeRxTask<String>(object : CommonRxTask<String?>("") {
override fun doInIOThread() {
var result = "false"
val appBlack = AppConfig.app_black
if (!TextUtils.isEmpty(appBlack)) {
val appInfoList = deviceInfo.getAppInfoList()
if (appInfoList != null && appInfoList!!.size > 0) {
val appBlackList = appBlack.split(",")
for (appBlackName in appBlackList) {
if (TextUtils.equals(result, "true")) {
break
}
for (appName in appInfoList) {
if (appName.contains(appBlackName)) {
result = "true"
break
}
}
}
}
}
t = result
}
override fun doInUIThread() {
if (TextUtils.equals(t.toString(), "true")) {
// 黑名单
awardPresenter.saveTerminalInfo()
carrierType = Constant.CARRIER_BLACK
} else {
initDataView()
}
}
})
} }
private fun initDataView() { private fun initDataView() {
...@@ -76,7 +124,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -76,7 +124,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
vo["carrierType"] = carrierType vo["carrierType"] = carrierType
awardPresenter.reportAddCoinMsg(vo) awardPresenter.reportAddCoinMsg(vo)
tvAwardContent.setText(curCoin.toString() + "金币已到账") tvAwardContent.setText("${curCoin}金币已到账")
tvAwardNext.setText("我知道了") tvAwardNext.setText("我知道了")
} }
Constant.CARRIER_HOMEVEDIO -> { Constant.CARRIER_HOMEVEDIO -> {
...@@ -84,18 +132,29 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -84,18 +132,29 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
vo["carrierType"] = carrierType vo["carrierType"] = carrierType
awardPresenter.reportAddCoinMsg(vo) awardPresenter.reportAddCoinMsg(vo)
tvAwardContent.setText(curCoin.toString() + "金币已到账") tvAwardContent.setText("${curCoin}金币已到账")
tvAwardNext.setText("看视频再领${extraId}金币") tvAwardNext.setText("看视频再领${extraId}金币")
curCoin = extraId.toInt() curCoin = extraId.toInt()
carrierType = Constant.CARRIER_HOMEVEDIO_DOUBLE carrierType = Constant.CARRIER_HOMEVEDIO_DOUBLE
} }
Constant.CARRIER_RUISHINEWS -> {
val vo = HashMap<String, Any>()
vo["carrierType"] = carrierType
awardPresenter.reportAddCoinMsg(vo)
tvAwardContent.setText("${curCoin}金币已到账")
tvAwardNext.setText("看视频再领${extraId}金币")
curCoin = extraId.toInt()
carrierType = Constant.CARRIER_RUISHINEWS_DOUBLE
}
Constant.CARRIER_SMALLHOMEVEDIO -> { Constant.CARRIER_SMALLHOMEVEDIO -> {
val vo = HashMap<String, Any>() val vo = HashMap<String, Any>()
vo["carrierType"] = carrierType vo["carrierType"] = carrierType
awardPresenter.reportAddCoinMsg(vo) awardPresenter.reportAddCoinMsg(vo)
tvAwardContent.setText(curCoin.toString() + "金币已到账") tvAwardContent.setText("${curCoin}金币已到账")
tvAwardNext.setText("看视频再领${extraId}金币") tvAwardNext.setText("看视频再领${extraId}金币")
curCoin = extraId.toInt() curCoin = extraId.toInt()
...@@ -106,7 +165,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -106,7 +165,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
vo["carrierType"] = carrierType vo["carrierType"] = carrierType
awardPresenter.reportAddCoinMsg(vo) awardPresenter.reportAddCoinMsg(vo)
tvAwardContent.setText(curCoin.toString() + "金币已到账") tvAwardContent.setText("${curCoin}金币已到账")
tvAwardNext.setText("看视频再领${extraId}金币") tvAwardNext.setText("看视频再领${extraId}金币")
curCoin = extraId.toInt() curCoin = extraId.toInt()
...@@ -116,23 +175,23 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -116,23 +175,23 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
tvAwardContent.setText("新人红包") tvAwardContent.setText("新人红包")
tvAwardNext.setText("我知道了") tvAwardNext.setText("我知道了")
tvAwardHint.setVisibility(View.VISIBLE) tvAwardHint.setVisibility(View.VISIBLE)
tvAwardHint.setText(curCoin.toString() + "金币已到账") tvAwardHint.setText("${curCoin}金币已到账")
} }
Constant.CARRIER_NEW_VISITOR -> { Constant.CARRIER_NEW_VISITOR -> {
tvAwardContent.setText("新人红包") tvAwardContent.setText("新人红包")
tvAwardNext.setText("点击领取") tvAwardNext.setText("点击领取")
tvAwardHint.setVisibility(View.VISIBLE) tvAwardHint.setVisibility(View.VISIBLE)
tvAwardHint.setText(curCoin.toString() + "金币已到账") tvAwardHint.setText("${curCoin}金币已到账")
} }
Constant.CARRIER_OFFLINE_DOUBLE -> { Constant.CARRIER_OFFLINE_DOUBLE -> {
tvAwardContent.setText("离线收益奖励" + curCoin + "金币") tvAwardContent.setText("离线收益奖励${curCoin}金币")
tvAwardNext.setText("金币翻倍") tvAwardNext.setText("金币翻倍")
} }
Constant.CARRIER_ZHANGYUE -> { Constant.CARRIER_ZHANGYUE -> {
tvAwardContent.setText("阅读奖励" + curCoin + "金币") tvAwardContent.setText("阅读奖励${curCoin}金币")
} }
Constant.CARRIER_SIGNIN_HOMEPAGE_AWARD -> { Constant.CARRIER_SIGNIN_HOMEPAGE_AWARD -> {
tvAwardContent.setText("签到奖励" + curCoin + "金币") tvAwardContent.setText("签到奖励${curCoin}金币")
tvAwardNext.setText("看视频最高可得3倍金币奖励") tvAwardNext.setText("看视频最高可得3倍金币奖励")
carrierType = Constant.CARRIER_SIGNIN_HOMEPAGE_CARD carrierType = Constant.CARRIER_SIGNIN_HOMEPAGE_CARD
...@@ -143,7 +202,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -143,7 +202,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
} }
Constant.CARRIER_GAME -> { Constant.CARRIER_GAME -> {
if (curCoin > 0) { if (curCoin > 0) {
tvAwardContent.setText("游戏奖励" + curCoin + "金币") tvAwardContent.setText("游戏奖励${curCoin}金币")
} else { } else {
tvAwardContent.setText("很遗憾,游戏试玩不足3秒") tvAwardContent.setText("很遗憾,游戏试玩不足3秒")
} }
...@@ -155,16 +214,16 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -155,16 +214,16 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
tvAwardHint.visibility = View.GONE tvAwardHint.visibility = View.GONE
} }
Constant.CARRIER_VERSUS_VIDEO -> { Constant.CARRIER_VERSUS_VIDEO -> {
tvAwardContent.setText(curCoin.toString() + "金币已到账") tvAwardContent.setText("${curCoin}金币已到账")
} }
Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD, Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD,
Constant.CARRIER_WALK_BUBBLE, Constant.CARRIER_EATMEAL_SUBSIDY, Constant.CARRIER_WALK_BUBBLE, Constant.CARRIER_EATMEAL_SUBSIDY,
Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER -> { Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER -> {
tvAwardContent.setText("+" + curCoin + "金币") tvAwardContent.setText("+${curCoin}金币")
tvAwardNext.setText("看视频领取") tvAwardNext.setText("看视频领取")
} }
else -> { else -> {
tvAwardContent.setText(curCoin.toString() + "金币已到账") tvAwardContent.setText("${curCoin}金币已到账")
} }
} }
} }
...@@ -250,7 +309,8 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener { ...@@ -250,7 +309,8 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
Constant.CARRIER_OFFLINE_DOUBLE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD, Constant.CARRIER_OFFLINE_DOUBLE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD,
Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD, Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD,
Constant.CARRIER_WALK_BUBBLE, Constant.CARRIER_EATMEAL_SUBSIDY, Constant.CARRIER_WALK_BUBBLE, Constant.CARRIER_EATMEAL_SUBSIDY,
Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER -> { Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER,
Constant.CARRIER_RUISHINEWS_DOUBLE -> {
awardVedio() awardVedio()
} }
Constant.CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE, Constant.CARRIER_HOMEVEDIO_DOUBLE, Constant.CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE, Constant.CARRIER_HOMEVEDIO_DOUBLE,
......
...@@ -8,6 +8,7 @@ import android.view.View ...@@ -8,6 +8,7 @@ import android.view.View
import androidx.fragment.app.Fragment 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.bytedance.hume.readapk.HumeSDK
import com.ireader.ireadersdk.IreaderApi import com.ireader.ireadersdk.IreaderApi
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.ad.video.VedioAdingManager import com.mints.goodmoney.ad.video.VedioAdingManager
...@@ -18,6 +19,7 @@ import com.mints.goodmoney.manager.ZhangyueManager ...@@ -18,6 +19,7 @@ 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 kotlinx.android.synthetic.main.activity_main.* import kotlinx.android.synthetic.main.activity_main.*
......
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.RsNewsFragment
import kotlinx.android.synthetic.main.header_layout.*
/**
* 描述:活动包装页
* 作者:孟崔广
* 时间:2020/12/10 12:39
*/
class WrapperActivity : BaseActivity(), View.OnClickListener {
private var wrapperType = 0
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, 0)
}
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_left_icon -> finish()
}
}
private fun initPage() {
when (wrapperType) {
0 -> {
tv_title.text = "新闻"
val rsNewsFragment = RsNewsFragment()
if (!rsNewsFragment.isAdded()) {
// 提交事务
supportFragmentManager.beginTransaction()
.add(R.id.flWrapper, rsNewsFragment).commitAllowingStateLoss()
}
}
}
}
private fun initListener() {
iv_left_icon.setOnClickListener(this)
}
}
...@@ -30,6 +30,9 @@ class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean> ...@@ -30,6 +30,9 @@ 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"
} }
private var mContext: Context = context private var mContext: Context = context
......
...@@ -46,7 +46,13 @@ class DhGameFragment : LazyLoadBaseFragment(), View.OnClickListener { ...@@ -46,7 +46,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()
} }
......
...@@ -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,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -177,6 +177,7 @@ 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
// 新人福利 放到个人中心展示 防止首页红包转动异常 // 新人福利 放到个人中心展示 防止首页红包转动异常
......
...@@ -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)
...@@ -81,20 +81,14 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener { ...@@ -81,20 +81,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
...@@ -209,6 +209,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -209,6 +209,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
// 更新权重 // 更新权重
initAdWeight(data) initAdWeight(data)
AppConfig.app_black = data.userRiskApp
// 新人福利 // 新人福利
if (data.userMsg.firstGiveCoin > 0) { if (data.userMsg.firstGiveCoin > 0) {
...@@ -478,6 +479,25 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -478,6 +479,25 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
} }
} }
} }
// 新闻
MainMyAdapter.TO_RUISHI -> {
if (taskBean.otherConfig != null) {
when (taskBean.otherConfig.status) {
0 -> {
readyGo(WrapperActivity::class.java)
}
1 -> {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, taskBean.otherConfig.coin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_RUISHINEWS_CHALLANGE)
readyGo(AwardActivity::class.java, bundle)
}
2 -> {
readyGo(WrapperActivity::class.java)
}
}
}
}
// 小说免费看,金币大家赚 // 小说免费看,金币大家赚
// MainMyAdapter.TASK_TYPE_FICTION -> { // MainMyAdapter.TASK_TYPE_FICTION -> {
// } // }
...@@ -670,6 +690,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -670,6 +690,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
} }
private fun vedioAdingSuccess(adType: String) { private fun vedioAdingSuccess(adType: String) {
if (activity != null && !activity!!.isFinishing()) {
val bundle = Bundle() val bundle = Bundle()
if (TextUtils.equals(carrierType, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD)) { if (TextUtils.equals(carrierType, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD)) {
bundle.putInt(Constant.MAIN_CUR_COIN, curSignCoin * 2) bundle.putInt(Constant.MAIN_CUR_COIN, curSignCoin * 2)
...@@ -678,7 +699,8 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -678,7 +699,8 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
return return
} }
for (autoListBean in userConfig!!.autoList) { userConfig?.let {
for (autoListBean in it.autoList) {
if (autoListBean.baseConfig.taskId == MainMyAdapter.APP_VEDIO) { if (autoListBean.baseConfig.taskId == MainMyAdapter.APP_VEDIO) {
if (autoListBean.otherConfig != null) { if (autoListBean.otherConfig != null) {
bundle.putInt(Constant.MAIN_CUR_COIN, autoListBean.otherConfig.coin) bundle.putInt(Constant.MAIN_CUR_COIN, autoListBean.otherConfig.coin)
...@@ -689,6 +711,8 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -689,6 +711,8 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
} }
} }
} }
}
}
/** /**
* 跳转QQ弹框 * 跳转QQ弹框
......
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
...@@ -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;
} }
} }
......
...@@ -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)
......
<?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"?>
<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
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