Commit 008aca0d authored by mengcuiguang's avatar mengcuiguang

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

parent ae8cbd71
......@@ -192,6 +192,8 @@ dependencies {
implementation(name: 'GDTSDK.unionNoPlugin.4.294.1164', ext: 'aar')
// shareSdk
implementation project(':shareSdkLib')
// 应用管理中心分包
implementation(name: 'humesdk-1.0.0', ext: 'aar')
// umeng
implementation 'com.umeng.umsdk:common:9.1.0' // (必选)
implementation 'com.umeng.umsdk:asms:1.1.3' // asms包依赖(必选)
......@@ -234,6 +236,9 @@ dependencies {
implementation(name: 'bxmsdk-release-3.0.0-csj3300', 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'
......
......@@ -489,4 +489,15 @@
# ===================== 闪电盒子 START ================
-keep class com.wannuosili.sdk.** {*;}
-dontwarn com.wannuosili.sdk.**
# ======================= 闪电盒子 END ================
\ No newline at end of file
# ======================= 闪电盒子 END ================
# ===================== 瑞狮新闻 START ================
-keep class com.tencent.** {*;}
-keep class com.qq.e.** {public protected *;}
-keep class com.xr.xrsdk.** { *;}
# ======================= 瑞狮新闻 END ================
......@@ -180,6 +180,9 @@
<activity
android:name=".ui.activitys.AccountMergeActivity"
android:screenOrientation="portrait"/>
<activity
android:name=".ui.activitys.WrapperActivity"
android:screenOrientation="portrait"/>
<service
android:name=".service.UpdateService"
......@@ -319,6 +322,7 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/wn_file_paths" />
</provider>
</application>
</manifest>
\ No newline at end of file
......@@ -74,9 +74,6 @@ class InitAppService : IntentService("InitializeService") {
// 极光推送
initJpush()
// 掌阅书城
// ZhangyueManager.onCreateIreader(this.application)
// 变现猫
initBxm(this.application)
}
......
......@@ -15,6 +15,7 @@ import com.bun.miitmdid.core.JLibrary;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.LiebaoManager;
import com.mints.goodmoney.manager.MiitHelper;
import com.mints.goodmoney.manager.RsNewsManager;
import com.mints.goodmoney.manager.TtCsjAdManager;
import com.mints.goodmoney.manager.WnManager;
import com.mints.goodmoney.manager.YlVideoManager;
......@@ -120,6 +121,9 @@ public class MintsApplication extends MultiDexApplication {
// 猎豹游戏初始化
LiebaoManager.getInstance().initCmGameSdk();
// 瑞狮新闻
RsNewsManager.INSTANCE.init(this);
}
private MiitHelper.AppIdsUpdater appIdsUpdater = ids -> OAID = ids;
......
......@@ -13,6 +13,11 @@ public class AppConfig {
*/
public static boolean app_updateing = false;
/**
* 名单
*/
public static String app_black = "";
/**
* app应用首页 0-主页 1-大转盘 2-邀请好友 3-我
*/
......
......@@ -77,6 +77,7 @@ object Constant {
const val FRAGMENT_TAG_PAN = "FRAGMENT_TAG_PAN"
const val FRAGMENT_TAG_FRIENDS = "FRAGMENT_TAG_FRIENDS"
const val FRAGMENT_TAG_MY = "FRAGMENT_TAG_MY"
const val FRAGMENT_TAG_RSNEWS = "FRAGMENT_TAG_RSNEWS"
// 协议地址
var REGISTER_URL = BuildConfig.MainIp + "gm/register.html"//服务协议
......@@ -109,6 +110,11 @@ object Constant {
const val CARRIER_NEW_VISITOR = "CARRIER_NEW_VISITOR" //游客首次登录
const val CARRIER_GAME_ONLINE = "GAME_ONLINE" //跳转猎豹
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_HOMEVEDIO = "HOMEVEDIO" //首页红包
const val CARRIER_HOMEVEDIO_DOUBLE = "HOMEVEDIO_DOUBLE" //首页红包翻倍
......@@ -116,6 +122,7 @@ object Constant {
const val CARRIER_SMALLHOMEVEDIO_DOUBLE = "SMALLHOMEVEDIO_DOUBLE" //首页红包翻倍
const val CARRIER_MORNING_CLOCK = "MORNING_CLOCK" //早上打卡
const val CARRIER_DRAWCASH = "DRAWCASH" //提现
const val CARRIER_BLACK = "BLACK" //黑名单
const val CHALLENGE_SHAREFRIEND = "CHALLENGE_SHAREFRIEND" //邀请好友
......@@ -181,4 +188,9 @@ object Constant {
const val MERGE_MOBILE="merge_mobile"
const val MERGE_WXOPENID="merge_wxopenid"
const val MERGE_KEY="merge_key"
}
\ No newline at end of file
// wrapper type
const val WRAPPER_TYPE="wrapper_type"
}
......@@ -13,6 +13,8 @@ import android.os.Build
import android.provider.Settings
import android.telephony.TelephonyManager
import android.text.TextUtils
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.library.utils.json.JsonUtil
......@@ -405,6 +407,37 @@ class DeviceInfo private constructor() {
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
......
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 {
private VedioRulesBean vedioRules;
private String ip;
private String userRiskApp;
public OfflineBean getOfflineBean() {
return offline;
......@@ -26,4 +27,8 @@ public class UserTaskMsgBean implements Serializable {
public String getIp() {
return ip;
}
public String getUserRiskApp() {
return userRiskApp;
}
}
......@@ -29,6 +29,7 @@ class AccountMergePresenter : BasePresenter<AccountMergeView>() {
}
override fun onNext(baseResponse: BaseResponse<AccountMsgBean>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
......@@ -61,6 +62,7 @@ class AccountMergePresenter : BasePresenter<AccountMergeView>() {
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
......
package com.mints.goodmoney.mvp.presenters;
import android.text.TextUtils;
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.ShumeiManager;
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.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.Throwable;
......@@ -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) {
AppHttpManager.getInstance(loanApplication)
.call(loanService.reportAddCoinMsg(vo),
......
......@@ -23,6 +23,7 @@ class BookPresenter : BasePresenter<BookView>() {
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val data = baseResponse.data
when (code) {
......@@ -49,6 +50,7 @@ class BookPresenter : BasePresenter<BookView>() {
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val data = baseResponse.data
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;
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.common.DeviceInfo;
import com.mints.goodmoney.manager.AppHttpManager;
......@@ -12,6 +15,8 @@ import com.mints.goodmoney.mvp.model.DrawcashBean;
import com.mints.goodmoney.mvp.model.UserBean;
import com.mints.goodmoney.mvp.views.DrawcashView;
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.Throwable;
......@@ -119,67 +124,74 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
public void saveTerminalInfo(double curCash) {
view.showLoading("加载中...");
HashMap<String, Object> vo = new HashMap<>();
DeviceInfo deviceInfo = DeviceInfo.Companion.getInstance();
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", deviceInfo.getAppInfoMap());
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;
}
@Override
public void onError(Throwable e) {
if (isLinkView()) return;
view.hideLoading();
}
@Override
public void onNext(BaseResponse<UserBean> baseResponse) {
if (isLinkView()) return;
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;
}
@Override
public void onError(Throwable e) {
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;
}
}
});
}
@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) {
HashMap<String, Object> vo = new HashMap<>();
vo.put("cash", cash);
vo.put("payChannel", "WEIXIN");
......
......@@ -27,7 +27,6 @@ class FriendsActivityPresenter : BasePresenter<FriendsActivityView>() {
override fun onNext(baseResponse: BaseResponse<FriendHallMsgBean>) {
if (isLinkView) return
view.hideLoading()
when (baseResponse.status) {
200 -> {
......@@ -59,7 +58,6 @@ class FriendsActivityPresenter : BasePresenter<FriendsActivityView>() {
override fun onNext(baseResponse: BaseResponse<FriendHallMsgBean>) {
if (isLinkView) return
view.hideLoading()
when (baseResponse.status) {
200 -> {
......
......@@ -133,6 +133,8 @@ class HomePresenter : BasePresenter<HomeView>() {
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
val data: UserBean? = baseResponse.getData()
......
package com.mints.goodmoney.mvp.presenters
import android.content.pm.ApplicationInfo
import android.text.TextUtils
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.common.Constant
......@@ -12,8 +13,11 @@ import com.mints.goodmoney.mvp.model.BaseResponse
import com.mints.goodmoney.mvp.model.UserBean
import com.mints.goodmoney.mvp.views.LoginView
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.Throwable
import com.mints.library.utils.json.JsonUtil
import net.grandcentrix.tray.AppPreferences
import java.util.*
......@@ -225,46 +229,57 @@ class LoginPresenter : BasePresenter<LoginView>() {
* @param context
*/
fun saveTerminalInfo(userId: Long) {
val vo = HashMap<String, Any>()
val deviceInfo: DeviceInfo = DeviceInfo.instance
val macAddress: String = deviceInfo.getMacAddress()
val mac = macAddress.replace(":", "")
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.brand + " " + deviceInfo.mobileModel
vo["uuid"] = DeviceUuidFactory().deviceUuid
vo["osversion"] = deviceInfo.oSVersion
vo["appversion"] = deviceInfo.versionName
vo["shumeiId"] = ShumeiManager.getInstance().getShumeiDeviceId()
vo["appPkgList"] = deviceInfo.getAppInfoMap()
RxjavaUtil.executeRxTask<String>(object : CommonRxTask<String?>("") {
override fun doInIOThread() {
t = deviceInfo.getAppInfoMap()
}
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun doInUIThread() {
val vo = HashMap<String, Any>()
val macAddress: String = deviceInfo.getMacAddress()
val mac = macAddress.replace(":", "")
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.brand + " " + deviceInfo.mobileModel
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) {
if (isLinkView) return
}
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
override fun onError(e: Throwable) {
if (isLinkView) return
}
val code = baseResponse.status
when (code) {
200 -> {
JpushManager.getInstance().setJpushService(userId.toString())
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
val code = baseResponse.status
when (code) {
200 -> {
JpushManager.getInstance().setJpushService(userId.toString())
}
}
}
}
}
})
})
}
})
}
}
\ No newline at end of file
......@@ -160,6 +160,7 @@ class MyPresenter : BasePresenter<MyView>() {
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
val data: UserBean? = baseResponse.data
......
......@@ -33,6 +33,7 @@ class PanPresenter : BasePresenter<PanView>() {
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.getStatus()
val message = baseResponse.getMessage()
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 {
@POST("api/addReadSeconds")
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;
import android.text.TextUtils;
import com.bytedance.hume.readapk.HumeSDK;
import com.google.gson.Gson;
import com.mints.goodmoney.BuildConfig;
import com.mints.goodmoney.MintsApplication;
......@@ -44,6 +45,14 @@ public class OkHttpInterceptor implements Interceptor {
long time = System.currentTimeMillis();
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 = encrypt(request, tokenID, time, channel);//加密方法
......
......@@ -3,6 +3,7 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import android.view.View.OnLongClickListener
import com.bytedance.hume.readapk.HumeSDK
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
......@@ -31,7 +32,9 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
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
})
......
......@@ -4,9 +4,13 @@ import android.os.Bundle
import android.text.TextUtils
import android.view.KeyEvent
import android.view.View
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.video.VedioAdingManager
import com.mints.goodmoney.common.AppConfig
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.UserManager
import com.mints.goodmoney.mvp.model.VedioAdingBean
......@@ -18,10 +22,13 @@ import com.mints.goodmoney.ui.widgets.countdowntimer.OnCountDownTimerListener
import com.mints.goodmoney.utils.SoundPoolUtil
import com.mints.goodmoney.utils.SpanUtils
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 kotlinx.android.synthetic.main.activity_award.*
import java.math.BigDecimal
import java.util.*
import kotlin.collections.ArrayList
/**
......@@ -53,8 +60,49 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
vedioAdingManager = VedioAdingManager.getInstance(this)
initExpress()
initDataView()
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() {
......@@ -76,7 +124,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
vo["carrierType"] = carrierType
awardPresenter.reportAddCoinMsg(vo)
tvAwardContent.setText(curCoin.toString() + "金币已到账")
tvAwardContent.setText("${curCoin}金币已到账")
tvAwardNext.setText("我知道了")
}
Constant.CARRIER_HOMEVEDIO -> {
......@@ -84,18 +132,29 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
vo["carrierType"] = carrierType
awardPresenter.reportAddCoinMsg(vo)
tvAwardContent.setText(curCoin.toString() + "金币已到账")
tvAwardContent.setText("${curCoin}金币已到账")
tvAwardNext.setText("看视频再领${extraId}金币")
curCoin = extraId.toInt()
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 -> {
val vo = HashMap<String, Any>()
vo["carrierType"] = carrierType
awardPresenter.reportAddCoinMsg(vo)
tvAwardContent.setText(curCoin.toString() + "金币已到账")
tvAwardContent.setText("${curCoin}金币已到账")
tvAwardNext.setText("看视频再领${extraId}金币")
curCoin = extraId.toInt()
......@@ -106,7 +165,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
vo["carrierType"] = carrierType
awardPresenter.reportAddCoinMsg(vo)
tvAwardContent.setText(curCoin.toString() + "金币已到账")
tvAwardContent.setText("${curCoin}金币已到账")
tvAwardNext.setText("看视频再领${extraId}金币")
curCoin = extraId.toInt()
......@@ -116,23 +175,23 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
tvAwardContent.setText("新人红包")
tvAwardNext.setText("我知道了")
tvAwardHint.setVisibility(View.VISIBLE)
tvAwardHint.setText(curCoin.toString() + "金币已到账")
tvAwardHint.setText("${curCoin}金币已到账")
}
Constant.CARRIER_NEW_VISITOR -> {
tvAwardContent.setText("新人红包")
tvAwardNext.setText("点击领取")
tvAwardHint.setVisibility(View.VISIBLE)
tvAwardHint.setText(curCoin.toString() + "金币已到账")
tvAwardHint.setText("${curCoin}金币已到账")
}
Constant.CARRIER_OFFLINE_DOUBLE -> {
tvAwardContent.setText("离线收益奖励" + curCoin + "金币")
tvAwardContent.setText("离线收益奖励${curCoin}金币")
tvAwardNext.setText("金币翻倍")
}
Constant.CARRIER_ZHANGYUE -> {
tvAwardContent.setText("阅读奖励" + curCoin + "金币")
tvAwardContent.setText("阅读奖励${curCoin}金币")
}
Constant.CARRIER_SIGNIN_HOMEPAGE_AWARD -> {
tvAwardContent.setText("签到奖励" + curCoin + "金币")
tvAwardContent.setText("签到奖励${curCoin}金币")
tvAwardNext.setText("看视频最高可得3倍金币奖励")
carrierType = Constant.CARRIER_SIGNIN_HOMEPAGE_CARD
......@@ -143,7 +202,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
}
Constant.CARRIER_GAME -> {
if (curCoin > 0) {
tvAwardContent.setText("游戏奖励" + curCoin + "金币")
tvAwardContent.setText("游戏奖励${curCoin}金币")
} else {
tvAwardContent.setText("很遗憾,游戏试玩不足3秒")
}
......@@ -155,16 +214,16 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
tvAwardHint.visibility = View.GONE
}
Constant.CARRIER_VERSUS_VIDEO -> {
tvAwardContent.setText(curCoin.toString() + "金币已到账")
tvAwardContent.setText("${curCoin}金币已到账")
}
Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD,
Constant.CARRIER_WALK_BUBBLE, Constant.CARRIER_EATMEAL_SUBSIDY,
Constant.CARRIER_WALK, Constant.CARRIER_HOMEWATER -> {
tvAwardContent.setText("+" + curCoin + "金币")
tvAwardContent.setText("+${curCoin}金币")
tvAwardNext.setText("看视频领取")
}
else -> {
tvAwardContent.setText(curCoin.toString() + "金币已到账")
tvAwardContent.setText("${curCoin}金币已到账")
}
}
}
......@@ -250,7 +309,8 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
Constant.CARRIER_OFFLINE_DOUBLE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD,
Constant.CARRIER_CHALLENGE_TURN, Constant.CARRIER_CHALLENGE_CARD,
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()
}
Constant.CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE, Constant.CARRIER_HOMEVEDIO_DOUBLE,
......
......@@ -8,6 +8,7 @@ import android.view.View
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
import com.bytedance.hume.readapk.HumeSDK
import com.ireader.ireadersdk.IreaderApi
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.video.VedioAdingManager
......@@ -18,6 +19,7 @@ import com.mints.goodmoney.manager.ZhangyueManager
import com.mints.goodmoney.mvp.views.MainView
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.fragment.*
import com.mints.goodmoney.utils.LogUtil
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>
// 玩游戏,赚金币
const val TO_LIEBAO = "TO_LIEBAO"
// 新闻
const val TO_RUISHI = "TO_RUISHI"
}
private var mContext: Context = context
......
......@@ -46,7 +46,13 @@ class DhGameFragment : LazyLoadBaseFragment(), View.OnClickListener {
initListener()
}
override fun onFragmentResume() {
super.onFragmentResume()
// LogUtil.d(TAG, "onFragmentResume")
}
override fun onFragmentPause() {
// LogUtil.d(TAG, "onFragmentPause")
if (UserManager.getInstance().userIsLogin()) {
loadH5Game()
}
......
......@@ -6,6 +6,7 @@ import android.os.Looper
import android.text.TextUtils
import android.view.View
import androidx.fragment.app.FragmentTransaction
import com.bytedance.hume.readapk.HumeSDK
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.goodmoney.ad.video.VedioAdingManager
......@@ -100,7 +101,6 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override fun onResume() {
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MAIN) {
// 打开激活
uploadDeviceInfo()
......@@ -177,6 +177,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 保存Ip,用于穿山甲回调校验
ps.put(Constant.CSJ_VEDIO_APPIP, data.ip)
AppConfig.app_black = data.userRiskApp
// 新人福利 放到个人中心展示 防止首页红包转动异常
......
......@@ -32,7 +32,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
override fun onHiddenChanged(hidden: Boolean) {
if (curPosition == 0) {
mainFragment?.onHiddenChanged(hidden)
} else if (curPosition == 2) {
} else if (curPosition == 3) {
dhGameFragment?.onHiddenChanged(hidden)
}
super.onHiddenChanged(hidden)
......@@ -49,6 +49,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
val tabs: MutableList<String> = ArrayList()
tabs.add("视频")
tabs.add("书城")
tabs.add("新闻")
tabs.add("游戏")
val fragments: MutableList<Fragment> = ArrayList()
......@@ -56,13 +57,12 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
dhGameFragment = DhGameFragment()
fragments.add(mainFragment!!)
fragments.add(ZhangyueFragment())
fragments.add(RsNewsFragment())
fragments.add(dhGameFragment!!)
//去除两侧应阴影
vpFragmentMoney.overScrollMode = ViewPager.OVER_SCROLL_NEVER
vpFragmentMoney.offscreenPageLimit = tabs.size + 3
val adapter = MessageFragAdapter(childFragmentManager, fragments, tabs)
vpFragmentMoney.adapter = adapter
xtFragmentMoney.setxTabDisplayNum(tabs.size)
......@@ -81,20 +81,14 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
}
override fun onTabSelected(tab: XTabLayout.Tab) {
if (tab.position == 2) {
if (tab.position == 3) {
if (!UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java)
vpFragmentMoney.currentItem = if (curPosition == 2) 0 else curPosition
vpFragmentMoney.currentItem = if (curPosition == 3) 0 else curPosition
return
}
}
// if (tab.position == 1) {
// vpFragmentMoney.setCanScroll(false)
// } else {
// vpFragmentMoney.setCanScroll(true)
// }
curPosition = tab.position
}
}
\ No newline at end of file
......@@ -209,6 +209,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
// 更新权重
initAdWeight(data)
AppConfig.app_black = data.userRiskApp
// 新人福利
if (data.userMsg.firstGiveCoin > 0) {
......@@ -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 -> {
// }
......@@ -670,21 +690,25 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
}
private fun vedioAdingSuccess(adType: String) {
val bundle = Bundle()
if (TextUtils.equals(carrierType, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD)) {
bundle.putInt(Constant.MAIN_CUR_COIN, curSignCoin * 2)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD)
readyGo(AwardActivity::class.java, bundle)
return
}
if (activity != null && !activity!!.isFinishing()) {
val bundle = Bundle()
if (TextUtils.equals(carrierType, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD)) {
bundle.putInt(Constant.MAIN_CUR_COIN, curSignCoin * 2)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_SIGNIN_HOMEPAGE_CARD)
readyGo(AwardActivity::class.java, bundle)
return
}
for (autoListBean in userConfig!!.autoList) {
if (autoListBean.baseConfig.taskId == MainMyAdapter.APP_VEDIO) {
if (autoListBean.otherConfig != null) {
bundle.putInt(Constant.MAIN_CUR_COIN, autoListBean.otherConfig.coin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_VERSUS_VIDEO)
readyGo(AwardActivity::class.java, bundle)
return
userConfig?.let {
for (autoListBean in it.autoList) {
if (autoListBean.baseConfig.taskId == MainMyAdapter.APP_VEDIO) {
if (autoListBean.otherConfig != null) {
bundle.putInt(Constant.MAIN_CUR_COIN, autoListBean.otherConfig.coin)
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_VERSUS_VIDEO)
readyGo(AwardActivity::class.java, bundle)
return
}
}
}
}
}
......
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;
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);
}
public MyViewPager(Context context, AttributeSet attrs)
{
public MyViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
}
private boolean isCanScroll = false;
public void setCanScroll(boolean isCanScroll)
{
public void setCanScroll(boolean isCanScroll) {
this.isCanScroll = isCanScroll;
}
@Override
public boolean onTouchEvent(MotionEvent arg0)
{
if (isCanScroll)
{
public boolean onTouchEvent(MotionEvent arg0) {
if (isCanScroll) {
return super.onTouchEvent(arg0);
}
else
{
} else {
return false;
}
}
@Override
public boolean onInterceptTouchEvent(MotionEvent arg0)
{
if (isCanScroll)
{
public boolean onInterceptTouchEvent(MotionEvent arg0) {
if (isCanScroll) {
return super.onInterceptTouchEvent(arg0);
}
else
{
} else {
return false;
}
}
......
......@@ -43,14 +43,6 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
@Override
public void onActivityResumed(Activity activity) {
}
@Override
public void onActivityPaused(Activity activity) {
}
@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
if (activity == null)
return;
String simpleName = activity.getClass().getSimpleName();
......@@ -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
public void onActivityStarted(Activity activity) {
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