Commit 805a33c2 authored by jyx's avatar jyx

分红代码修改

parent f187d649
......@@ -6,7 +6,7 @@ android {
compileSdkVersion rootProject.ext.androidCompileSdkVersion
buildToolsVersion rootProject.ext.androidBuildToolsVersion
defaultConfig {
applicationId "com.mints.youyou"
applicationId "com.wenshu.youyou"
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 3
......@@ -235,7 +235,6 @@ dependencies {
// 瑞狮新闻
implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
implementation(name: 'xrsdk-release_tbs', ext: 'aar')
// implementation(name: 'xrsharesdk-release_tbs', ext: 'aar')
implementation(name: 'windAd-2.25.0', ext: 'aar')
implementation 'com.scwang.smart:refresh-layout-kernel:2.0.3'
implementation 'com.scwang.smart:refresh-header-classics:2.0.3'
......
......@@ -51,7 +51,7 @@
<uses-permission android:name="${applicationId}.permission.KW_SDK_BROADCAST" />
<application
android:name="com.wenshu.youyou.wenshuApplication"
android:name="com.wenshu.youyou.WenshuApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher_main"
android:label="@string/app_name"
......
......@@ -46,9 +46,9 @@ import rx.schedulers.Schedulers;
* 作者:孟崔广
* 时间:2020/10/09 11:40
*/
public class wenshuApplication extends MultiDexApplication {
public class WenshuApplication extends MultiDexApplication {
private static wenshuApplication mContext;
private static WenshuApplication mContext;
public static String OAID = "";
private static LocalBroadcastManager mLocalBroadcastManager;
......@@ -56,7 +56,7 @@ public class wenshuApplication extends MultiDexApplication {
private LoanService loanService;
public static wenshuApplication getContext() {
public static WenshuApplication getContext() {
return mContext;
}
......@@ -206,7 +206,7 @@ public class wenshuApplication extends MultiDexApplication {
* 参数4:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机。
* 参数5:Push推送业务的secret,需要集成Push功能时必须传入Push的secret,否则传空。
*/
UMConfigure.init(context, CommonUtils.getAppMetaData(wenshuApplication.getContext(), "UMENG_KEY"), CommonUtils.getAppMetaData(context, "CHANNEL_NAME"), UMConfigure.DEVICE_TYPE_PHONE, "");
UMConfigure.init(context, CommonUtils.getAppMetaData(WenshuApplication.getContext(), "UMENG_KEY"), CommonUtils.getAppMetaData(context, "CHANNEL_NAME"), UMConfigure.DEVICE_TYPE_PHONE, "");
UMConfigure.setLogEnabled(BuildConfig.DEBUG);
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.LEGACY_MANUAL);
} catch (Exception e) {
......@@ -221,7 +221,7 @@ public class wenshuApplication extends MultiDexApplication {
Intent intent = new Intent();
intent.setAction(Constant.ACTION_EXIT_APP);
intent.addCategory(Intent.CATEGORY_DEFAULT);
wenshuApplication.getLocalBroadcastManager().sendBroadcast(intent);
WenshuApplication.getLocalBroadcastManager().sendBroadcast(intent);
System.gc();
}
......
......@@ -5,7 +5,7 @@ import android.widget.FrameLayout
import com.bytedance.sdk.openadsdk.AdSlot
import com.bytedance.sdk.openadsdk.TTAdNative
import com.bytedance.sdk.openadsdk.TTNativeExpressAd
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.manager.TtCsjAdManager
import com.wenshu.youyou.utils.LogUtil
......@@ -18,17 +18,17 @@ object BannerManager {
private var mTTAd: TTNativeExpressAd? = null
fun init() {
// adNative = TtCsjAdManager.get().createAdNative(wenshuApplication.getContext())
// adNative = TtCsjAdManager.get().createAdNative(WenshuApplication.getContext())
//
// // 权限请求
// TtCsjAdManager.get().requestPermissionIfNecessary(wenshuApplication.getContext())
// TtCsjAdManager.get().requestPermissionIfNecessary(WenshuApplication.getContext())
}
/**
* 获取view宽高
*/
private fun getViewWidth(): Float {
val displayMetrics = wenshuApplication.getContext().resources.displayMetrics
val displayMetrics = WenshuApplication.getContext().resources.displayMetrics
val density = displayMetrics.density
// 屏幕宽度 - margin宽度
val pxWidth = displayMetrics.widthPixels - (20 * density + 0.5f)
......@@ -49,7 +49,7 @@ object BannerManager {
}
}
// ToastUtil.showLong(wenshuApplication.getContext(), "csj banner:$codeId")
// ToastUtil.showLong(WenshuApplication.getContext(), "csj banner:$codeId")
adNative?.let {
val adSlot = AdSlot.Builder()
......
......@@ -2,7 +2,7 @@ package com.wenshu.youyou.ad.download;
import androidx.annotation.Nullable;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.common.Constant;
import com.wenshu.youyou.manager.UserManager;
import com.wenshu.youyou.utils.LogUtil;
......@@ -42,7 +42,7 @@ public final class CoralDownload {
// }
type = RELEASE_TASK_TYPE_RELEASE;
new ADLoader(wenshuApplication.getContext())
new ADLoader(WenshuApplication.getContext())
.get(ADType.APP_DOWNLOAD)
.from(ADSource.CORAL)
.count(1)
......
......@@ -12,7 +12,7 @@ import android.widget.TextView
import com.bumptech.glide.Glide
import com.kwad.sdk.api.*
import com.kwad.sdk.api.KsNativeAd.VideoPlayListener
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.manager.KsManager
import com.wenshu.youyou.utils.LogUtil
......@@ -25,7 +25,7 @@ object KsPreLoadExpressManager {
private var mADLoadSuccessListener: KSADLoadSuccessListener? = null
private var mContext = wenshuApplication.getContext()
private var mContext = WenshuApplication.getContext()
fun setListener(adLoadSuccessListener: KSADLoadSuccessListener?) {
mADLoadSuccessListener = adLoadSuccessListener
......@@ -183,7 +183,7 @@ object KsPreLoadExpressManager {
object : KsNativeAd.AdInteractionListener {
override fun onAdClicked(view: View, ad: KsNativeAd) {
if (ad != null) {
// Toast.makeText(wenshuApplication.getContext(), "广告" + ad.appName + "被点击", Toast.LENGTH_SHORT).show()
// Toast.makeText(WenshuApplication.getContext(), "广告" + ad.appName + "被点击", Toast.LENGTH_SHORT).show()
}
}
......@@ -225,7 +225,7 @@ object KsPreLoadExpressManager {
adBaseViewHolder.mAppIcon.visibility = View.GONE
} else {
adBaseViewHolder.mAppIcon.visibility = View.VISIBLE
Glide.with(wenshuApplication.getContext()).load(ad.appIconUrl).into(adBaseViewHolder.mAppIcon)
Glide.with(WenshuApplication.getContext()).load(ad.appIconUrl).into(adBaseViewHolder.mAppIcon)
}
// app名称
if (!TextUtils.isEmpty(ad.appName)) {
......
......@@ -3,7 +3,7 @@ package com.wenshu.youyou.ad.express
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.mvp.model.WeightBean
import com.wenshu.youyou.utils.LogUtil
......@@ -29,7 +29,7 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
private var ksWeight = 0
init {
mAdFrameLayout = FrameLayout(wenshuApplication.getContext())
mAdFrameLayout = FrameLayout(WenshuApplication.getContext())
YlhPreLoadExpressManager.setListener(this)
TTPreLoadExpressManager.getInstance().setListener(this)
KsPreLoadExpressManager.setListener(this)
......@@ -96,7 +96,7 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
var randomWeight = r.nextInt(weight) + 1
LogUtil.d(TAG, "2、权重随机值EXPRESS:$randomWeight")
// ToastUtil.show(wenshuApplication.getContext(), "权重随机值EXPRESS:" + randomWeight);
// ToastUtil.show(WenshuApplication.getContext(), "权重随机值EXPRESS:" + randomWeight);
for (weightBean in weightList) {
randomWeight -= weightBean.weight
if (randomWeight <= 0) {
......
......@@ -8,7 +8,7 @@ import android.widget.FrameLayout;
import androidx.annotation.NonNull;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.manager.TTNativeExpressManager;
public class TTPreLoadCarrierExpressManager {
......@@ -75,7 +75,7 @@ public class TTPreLoadCarrierExpressManager {
}
private void loadTtFrameLayoutInThread(String codeId) {
Context context = wenshuApplication.getContext();
Context context = WenshuApplication.getContext();
ttFrameLayout = null;
try {
ttFrameLayout = new FrameLayout(context);
......@@ -106,7 +106,7 @@ public class TTPreLoadCarrierExpressManager {
public void loadTtFrameLayout(String codeId) {
// init();
// ToastUtil.showLong(wenshuApplication.getContext(), "通用信息流:" + codeId);
// ToastUtil.showLong(WenshuApplication.getContext(), "通用信息流:" + codeId);
if (mWorkHandler != null) {
Message msg = Message.obtain();
......
......@@ -3,7 +3,7 @@ package com.wenshu.youyou.ad.express;
import android.util.DisplayMetrics;
import android.widget.FrameLayout;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.manager.TTNativeExpressManager;
import com.wenshu.youyou.manager.TtCsjAdManager;
......@@ -39,7 +39,7 @@ public class TTPreLoadExpressManager {
}
private float getViewWidth() {
DisplayMetrics displayMetrics = wenshuApplication.getContext().getResources().getDisplayMetrics();
DisplayMetrics displayMetrics = WenshuApplication.getContext().getResources().getDisplayMetrics();
float density = displayMetrics.density;
float pxWidth = displayMetrics.widthPixels - (50 * density + 0.5f);
float dpWidth = pxWidth / density + 0.5f;
......
......@@ -3,7 +3,7 @@ package com.wenshu.youyou.ad.express;
import android.content.Context;
import android.widget.FrameLayout;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.common.AppConfig;
import com.wenshu.youyou.manager.TTNativeExpressManager;
import com.wenshu.youyou.manager.TtCsjAdManager;
......@@ -56,7 +56,7 @@ public class TTPreLoadExpressXmlyManager {
init();
Context context = wenshuApplication.getContext();
Context context = WenshuApplication.getContext();
ttFrameLayout = null;
try {
ttFrameLayout = new FrameLayout(context);
......
package com.wenshu.youyou.ad.express
import com.wenshu.youyou.BuildConfig
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.manager.YlhAdManager
import com.wenshu.youyou.utils.LogUtil
import com.qq.e.ads.nativ.ADSize
......@@ -25,7 +25,7 @@ object YlhPreLoadExpressManager {
fun loadYlhFrameLayout() {
try {
nativeExpressAD = NativeExpressAD(wenshuApplication.getContext(), ADSize(ADSize.FULL_WIDTH, ADSize.AUTO_HEIGHT), YlhAdManager.YLH_AD_NATIVEEXPRESS_AWARD, object : NativeExpressAD.NativeExpressADListener {
nativeExpressAD = NativeExpressAD(WenshuApplication.getContext(), ADSize(ADSize.FULL_WIDTH, ADSize.AUTO_HEIGHT), YlhAdManager.YLH_AD_NATIVEEXPRESS_AWARD, object : NativeExpressAD.NativeExpressADListener {
override fun onNoAD(p0: AdError?) {
if (BuildConfig.DEBUG) {
LogUtil.d("通用奖励 ylh:TTNativeExpressManager", "onError ${p0?.errorCode} ${p0?.errorMsg}")
......
......@@ -300,7 +300,7 @@ public class VideoAdingManager {
Random r = new Random();
int randomWeight = r.nextInt(weight) + 1;
LogUtil.d(TAG, "2、权重随机值:" + randomWeight);
// ToastUtil.show(wenshuApplication.getContext(),"权重随机值:" + randomWeight);
// ToastUtil.show(WenshuApplication.getContext(),"权重随机值:" + randomWeight);
for (WeightBean weightBean : weightList) {
randomWeight -= weightBean.getWeight();
if (randomWeight <= 0) {
......
......@@ -120,7 +120,7 @@ public class YlhVideoAdManager extends BaseVideoAd {
ylhPostId = YlhAdManager.INSTANCE.getYLH_AD_VEDIO_MOREDIALOG();
break;
}
// ToastUtil.show(wenshuApplication.getContext(), "ylh vedio:" + ylhPostId);
// ToastUtil.show(WenshuApplication.getContext(), "ylh vedio:" + ylhPostId);
if (rewardVideoAD != null) {
rewardVideoAD = null;
}
......
......@@ -17,7 +17,7 @@ import android.os.SystemClock
import android.provider.Settings
import android.telephony.TelephonyManager
import android.text.TextUtils
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.utils.SimUtils
import com.wenshu.youyou.utils.StorageQueryUtil
......@@ -35,7 +35,7 @@ import java.util.*
class DeviceInfo private constructor() {
private var mContext: Context? = null
private fun init() {
mContext = wenshuApplication.getContext()
mContext = WenshuApplication.getContext()
}
val proxyUrl: String?
......@@ -79,17 +79,17 @@ class DeviceInfo private constructor() {
// 判断是否使用单卡 (android10 获取不到双卡信息,只能获取单卡)
var needSingleSim = false
// 卡1
val simStateBySlotIdx1 = SimUtils.getSimStateBySlotIdx(wenshuApplication.getContext(), 0)
val simStateBySlotIdx1 = SimUtils.getSimStateBySlotIdx(WenshuApplication.getContext(), 0)
// 卡2
val simStateBySlotIdx2 = SimUtils.getSimStateBySlotIdx(wenshuApplication.getContext(), 1)
val simStateBySlotIdx2 = SimUtils.getSimStateBySlotIdx(WenshuApplication.getContext(), 1)
if (simStateBySlotIdx1) {
val providersName1 = SimUtils.getSimOperatorName2(wenshuApplication.getContext(), 0)
val providersName1 = SimUtils.getSimOperatorName2(WenshuApplication.getContext(), 0)
if (TextUtils.equals(providersName1, "unknown")) {
needSingleSim = true
sb.append(SimUtils.getSimOperatorNameBySingle(wenshuApplication.getContext()) + " ")
sb.append(SimUtils.getSimOperatorNameBySingle(WenshuApplication.getContext()) + " ")
} else {
sb.append("$providersName1 ")
}
......@@ -98,10 +98,10 @@ class DeviceInfo private constructor() {
}
if (simStateBySlotIdx2) {
val providersName2 = SimUtils.getSimOperatorName2(wenshuApplication.getContext(), 1)
val providersName2 = SimUtils.getSimOperatorName2(WenshuApplication.getContext(), 1)
if (TextUtils.equals(providersName2, "unknown") && !needSingleSim) {
sb.append(SimUtils.getSimOperatorNameBySingle(wenshuApplication.getContext()) + " ")
sb.append(SimUtils.getSimOperatorNameBySingle(WenshuApplication.getContext()) + " ")
} else {
sb.append("$providersName2")
}
......@@ -153,7 +153,7 @@ class DeviceInfo private constructor() {
*/
val totalStorage: String
get() {
return StorageQueryUtil.getTotalStorageSize(wenshuApplication.getContext())
return StorageQueryUtil.getTotalStorageSize(WenshuApplication.getContext())
}
/**
......
package com.wenshu.youyou.manager;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.library.net.neterror.HttpResponseFunc;
import com.wenshu.youyou.mvp.model.BaseResponse;
......@@ -20,11 +20,11 @@ public class AppHttpManager {
private static AppHttpManager _inst;
private wenshuApplication application;
private WenshuApplication application;
private Observable.Transformer exceptTransformer = null;
public synchronized static AppHttpManager getInstance(wenshuApplication application) {
public synchronized static AppHttpManager getInstance(WenshuApplication application) {
if (_inst != null) {
return _inst;
} else {
......@@ -33,7 +33,7 @@ public class AppHttpManager {
}
}
private AppHttpManager(wenshuApplication application) {
private AppHttpManager(WenshuApplication application) {
this.application = application;
return;
}
......
......@@ -3,7 +3,7 @@ package com.wenshu.youyou.manager
import android.app.Activity
import android.content.Context
import android.view.View
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.ui.widgets.CustomDialogAsApple
import com.wenshu.youyou.ui.widgets.DialogListener
......@@ -17,11 +17,11 @@ import java.lang.ref.WeakReference
object AppTryPlayManager {
fun toTryPlay(pkg: String) {
AppUtil.openThirdApp(wenshuApplication.getContext(), pkg)
AppUtil.openThirdApp(WenshuApplication.getContext(), pkg)
}
fun getTryPlayIsOK(pkg: String, useTime: Int): Boolean {
val timePkgUsed = AppUtil.getTimePkgUsed(wenshuApplication.getContext(), pkg)
val timePkgUsed = AppUtil.getTimePkgUsed(WenshuApplication.getContext(), pkg)
LogUtil.d("AppTryPlayManager -> " + timePkgUsed)
return timePkgUsed >= useTime
......
......@@ -9,7 +9,7 @@
//import com.dhcw.sdk.manager.BDAdvanceConfig
//import com.dhcw.sdk.manager.BDManager
//import com.wenshu.youyou.BuildConfig
//import com.wenshu.youyou.wenshuApplication
//import com.wenshu.youyou.WenshuApplication
//import com.wenshu.youyou.common.Constant
//
///**
......@@ -93,7 +93,7 @@
// */
// fun bindUserData() {
// try {
// BDManager.getStance().bindUserData(wenshuApplication.getContext(), APP_ID, "cuid=${UserManager.getInstance().userID}")
// BDManager.getStance().bindUserData(WenshuApplication.getContext(), APP_ID, "cuid=${UserManager.getInstance().userID}")
// } catch (e: Exception) {
// e.printStackTrace()
// }
......
package com.wenshu.youyou.manager
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.common.DeviceInfo
import com.wenshu.youyou.net.CpdService
......@@ -69,7 +69,7 @@ object CpdManager {
equipment.put("android_id", deviceInfo.androidId)
equipment.put("imei", deviceInfo.iMEI)
equipment.put("mac", deviceInfo.getMacAddress())
equipment.put("net_type", NetUtils.getNetworkStateForCpd(wenshuApplication.getContext()))
equipment.put("net_type", NetUtils.getNetworkStateForCpd(WenshuApplication.getContext()))
equipment.put("ip", ip)
equipment.put("brand", deviceInfo.brand)
equipment.put("model", deviceInfo.mobileModel)
......@@ -103,7 +103,7 @@ object CpdManager {
equipment.put("android_id", deviceInfo.androidId)
equipment.put("imei", deviceInfo.iMEI)
equipment.put("mac", deviceInfo.getMacAddress())
equipment.put("net_type", NetUtils.getNetworkStateForCpd(wenshuApplication.getContext()))
equipment.put("net_type", NetUtils.getNetworkStateForCpd(WenshuApplication.getContext()))
equipment.put("ip", ip)
equipment.put("brand", deviceInfo.brand)
equipment.put("model", deviceInfo.mobileModel)
......
......@@ -15,7 +15,7 @@ import androidx.core.content.FileProvider
import com.downloader.Error
import com.downloader.OnDownloadListener
import com.downloader.PRDownloader
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.ui.widgets.DownloadProgressDialog
import com.wenshu.youyou.utils.CacheUtil
......@@ -32,7 +32,7 @@ object DownloadApkManager {
private var mDownloadListener: OnMyDownloadListener? = null
private var apkName = ""
private var cachePath = wenshuApplication.getContext().externalCacheDir?.path + "/Download/"
private var cachePath = WenshuApplication.getContext().externalCacheDir?.path + "/Download/"
private var canOnceInstallApk = false//8.0以上系统 防止首次授权时 未安装apk调用
private var activity: Activity? = null
......@@ -85,7 +85,7 @@ object DownloadApkManager {
fun tryOnceInstallApk() {
try {
if (canOnceInstallApk && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val context = wenshuApplication.getContext()
val context = WenshuApplication.getContext()
val haveInstallPermission = context.packageManager.canRequestPackageInstalls()
if (haveInstallPermission) {
installApk()
......@@ -103,7 +103,7 @@ object DownloadApkManager {
downloadProgressDialog = DownloadProgressDialog(activity!!)
downloadProgressDialog!!.show()
val context = wenshuApplication.getContext()
val context = WenshuApplication.getContext()
PRDownloader.download(url, cachePath, apkName)
.build()
.setOnProgressListener { progress ->
......@@ -139,7 +139,7 @@ object DownloadApkManager {
*/
private fun preInstallApk() {
if (activity == null) return
val context = wenshuApplication.getContext()
val context = WenshuApplication.getContext()
// 8.0以上系统设置安装未知来源权限
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val haveInstallPermission = context.packageManager.canRequestPackageInstalls()
......
......@@ -6,7 +6,7 @@ import android.text.TextUtils;
import android.util.Log;
import com.google.gson.JsonObject;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.common.DeviceInfo;
import com.wenshu.youyou.mvp.model.BaseResponse;
import com.wenshu.youyou.mvp.model.Device;
......@@ -55,7 +55,7 @@ public class JpushManager {
}
private void init() {
c = wenshuApplication.getContext();
c = WenshuApplication.getContext();
}
/**
......@@ -115,7 +115,7 @@ public class JpushManager {
* @param jsondata
*/
public void userBindingJpush(String jsondata) {
wenshuApplication loanApplication = (wenshuApplication) this.c;
WenshuApplication loanApplication = (WenshuApplication) this.c;
LoanService loanService = loanApplication.getLoanService();
HashMap<String, Object> vo = new HashMap<>();
......
......@@ -25,16 +25,16 @@ public class MiitHelper implements IIdentifierListener {
long timee = System.currentTimeMillis();
long offset = timee - timeb;
// if (nres == ErrorCode.INIT_ERROR_DEVICE_NOSUPPORT) {//1008612 不支持的设备
// wenshuApplication.setIsSupportOaid(false, nres);
// WenshuApplication.setIsSupportOaid(false, nres);
// } else if (nres == ErrorCode.INIT_ERROR_LOAD_CONFIGFILE) {//1008613 加载配置文件出错
// wenshuApplication.setIsSupportOaid(false, nres);
// WenshuApplication.setIsSupportOaid(false, nres);
// } else if (nres == ErrorCode.INIT_ERROR_MANUFACTURER_NOSUPPORT) {//1008611 不支持的设备厂商
// wenshuApplication.setIsSupportOaid(false, nres);
// WenshuApplication.setIsSupportOaid(false, nres);
// } else if (nres == ErrorCode.INIT_ERROR_RESULT_DELAY) {//1008614 获取接口是异步的,结果会在回调中返回,回调执行的回调可能在工作线程
// //TODO 这种情况,还不清楚怎么解决呢。暂且先返false
// wenshuApplication.setIsSupportOaid(false, nres);
// WenshuApplication.setIsSupportOaid(false, nres);
// } else if (nres == ErrorCode.INIT_HELPER_CALL_ERROR) {//1008615 反射调用出错
// wenshuApplication.setIsSupportOaid(false, nres);
// WenshuApplication.setIsSupportOaid(false, nres);
// }
Log.d(getClass().getSimpleName(), "return value: " + String.valueOf(nres));
......@@ -66,7 +66,7 @@ public class MiitHelper implements IIdentifierListener {
builder.append("AAID: ").append(aaid).append("\n");
String idstext=builder.toString();*/
// wenshuApplication.setIsSupportOaid(isSupport);
// WenshuApplication.setIsSupportOaid(isSupport);
String oaid = _supplier.getOAID();
// _supplier.shutDown(); //关闭接口
......
......@@ -13,7 +13,7 @@ import android.widget.RemoteViews;
import androidx.core.app.NotificationCompat;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.R;
import com.wenshu.youyou.ui.activitys.MainActivity;
import com.wenshu.youyou.utils.SpanUtils;
......@@ -111,7 +111,7 @@ public class NotifyManager {
* @param step
*/
public void updateRemoteView(int water, int step) {
Context context = wenshuApplication.getContext();
Context context = WenshuApplication.getContext();
if (remoteViews != null && context != null) {
remoteViews.setTextViewText(R.id.notify_step,
new SpanUtils()
......
......@@ -5,7 +5,7 @@
//import com.fly.scenemodule.SceneUtil
//import com.fly.scenemodule.model.GDTInfo
//import com.fly.scenemodule.model.TTInfo
//import com.wenshu.youyou.wenshuApplication
//import com.wenshu.youyou.WenshuApplication
//import com.wenshu.youyou.common.AppConfig
//
///**
......@@ -22,7 +22,7 @@
// val userId = UserManager.getInstance().userID
//
// // 初始化聚乐云
// SceneUtil.initSdk(SCENE_CHANNEL_Id, userId, wenshuApplication.OAID)
// SceneUtil.initSdk(SCENE_CHANNEL_Id, userId, WenshuApplication.OAID)
//
// //穿山甲-------
// val ttInfo = TTInfo()
......@@ -46,7 +46,7 @@
// */
// fun signIn(activity: Activity) {
// if (!TextUtils.isEmpty(UserManager.getInstance().userID)) {
// SceneUtil.signIn(activity, SCENE_CHANNEL_Id, UserManager.getInstance().userID, wenshuApplication.OAID)
// SceneUtil.signIn(activity, SCENE_CHANNEL_Id, UserManager.getInstance().userID, WenshuApplication.OAID)
// AppConfig.scene_flag = true
// }
// }
......
......@@ -5,7 +5,7 @@ import android.content.Context;
import android.text.TextUtils;
import com.ishumei.smantifraud.SmAntiFraud;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
/**
* 描述:数美反欺诈
......@@ -48,7 +48,7 @@ public class ShumeiManager {
}
private void init() {
context = wenshuApplication.getContext();
context = WenshuApplication.getContext();
}
/**
......
......@@ -9,7 +9,7 @@ import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAdManager;
import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTNativeExpressAd;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.utils.LogUtil;
import java.util.List;
......@@ -36,7 +36,7 @@ public class TTNativeExpressManager {
* 穿山甲权限初始化
*/
public TTAdNative initTTAd(boolean permission) {
Context context= wenshuApplication.getContext();
Context context= WenshuApplication.getContext();
//step1:初始化sdk
TTAdManager ttAdManager = TtCsjAdManager.get();
//step2:(可选,强烈建议在合适的时机调用):申请部分权限,如read_phone_state,防止获取不了imei时候,下载类广告没有填充的问题。
......@@ -67,9 +67,9 @@ public class TTNativeExpressManager {
* @param viewHeight
*/
private void getTtNativeExpress(String codeId, FrameLayout view, float viewWidth, float viewHeight) {
// ToastUtil.showLong(wenshuApplication.getContext(), "奖励信息流:" + codeId);
// ToastUtil.showLong(WenshuApplication.getContext(), "奖励信息流:" + codeId);
// Context context= wenshuApplication.getContext();
// Context context= WenshuApplication.getContext();
//step4:创建广告请求参数AdSlot,具体参数含义参考文档
AdSlot adSlot = new AdSlot.Builder()
.setCodeId(codeId) //广告位id
......
......@@ -4,7 +4,7 @@ package com.wenshu.youyou.manager;
import android.app.Activity;
import android.text.TextUtils;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.common.AppConfig;
import com.wenshu.youyou.mvp.presenters.TrackPresenter;
......@@ -36,7 +36,7 @@ public class TrackManager {
private void init() {
trackPresenter = new TrackPresenter();
trackPresenter.attachView(wenshuApplication.getContext());
trackPresenter.attachView(WenshuApplication.getContext());
}
/**
......
package com.wenshu.youyou.manager
import android.app.Application
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.library.utils.CommonUtils
import com.tz.sdk.core.engine.ADEngine
import com.tz.sdk.core.engine.ADEngineConfig
......@@ -23,7 +23,7 @@ object TzManager {
.start(ADEngineConfig.Builder(application)
.appKey(APP_KEY)
.appSecret(APP_SECRET)
.appChannel(CommonUtils.getAppMetaData(wenshuApplication.getContext(), "CHANNEL_NAME"))
.appChannel(CommonUtils.getAppMetaData(WenshuApplication.getContext(), "CHANNEL_NAME"))
.forTest(false)
.build(),
object : IADEngineState {
......
......@@ -2,7 +2,7 @@ package com.wenshu.youyou.manager;
import android.text.TextUtils;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.mvp.model.UserBean;
import com.wenshu.youyou.utils.PreferencesService;
......@@ -97,7 +97,7 @@ public class UserManager {
}
private void init() {
ps = PreferencesService.getInstance(wenshuApplication.getContext());
ps = PreferencesService.getInstance(WenshuApplication.getContext());
}
/**
......
......@@ -5,7 +5,7 @@
//import android.text.TextUtils
//import com.component.dly.xzzq_ywsdk.YwSDK.Companion.setDebugMode
//import com.wenshu.youyou.BuildConfig
//import com.wenshu.youyou.wenshuApplication
//import com.wenshu.youyou.WenshuApplication
//
///**
// * 描述:鱼丸盒子游戏
......@@ -38,8 +38,8 @@
// }
// var oaid: String = ""
// if (Build.VERSION.SDK_INT > 28) {
// if (!TextUtils.isEmpty(wenshuApplication.OAID)) {
// oaid = wenshuApplication.OAID
// if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
// oaid = WenshuApplication.OAID
// }
// }
// setDebugMode()
......
package com.wenshu.youyou.mvp.model;
import java.util.List;
/**
* @author jyx
* @date 2021/3/22
* @des
*/
public class CashoutChallengeBean {
/**
* canRewardCoin : 0
* list : [{"needCount":10,"cash":0.1,"status":0,"coin":1000},{"needCount":50,"cash":0.5,"status":0,"coin":5000},{"needCount":100,"cash":1,"status":0,"coin":10000},{"needCount":500,"cash":5,"status":0,"coin":50000},{"needCount":1000,"cash":10,"status":0,"coin":100000}]
* complete : 0
*/
private Integer canRewardCoin;
private List<ListDTO> list;
private Integer complete;
public Integer getCanRewardCoin() {
return canRewardCoin;
}
public void setCanRewardCoin(Integer canRewardCoin) {
this.canRewardCoin = canRewardCoin;
}
public List<ListDTO> getList() {
return list;
}
public void setList(List<ListDTO> list) {
this.list = list;
}
public Integer getComplete() {
return complete;
}
public void setComplete(Integer complete) {
this.complete = complete;
}
public static class ListDTO {
public Integer getNeedCount() {
return needCount;
}
public void setNeedCount(Integer needCount) {
this.needCount = needCount;
}
public Double getCash() {
return cash;
}
public void setCash(Double cash) {
this.cash = cash;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getCoin() {
return coin;
}
public void setCoin(Integer coin) {
this.coin = coin;
}
/**
* needCount : 10
* cash : 0.1
* status : 0
* coin : 1000
*/
private Integer needCount;
private Double cash;
private Integer status;
private Integer coin;
}
}
......@@ -4,7 +4,7 @@ import android.text.TextUtils;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.common.Constant;
import com.wenshu.youyou.common.DeviceInfo;
import com.wenshu.youyou.manager.AppHttpManager;
......@@ -104,8 +104,8 @@ public class AwardPresenter extends BasePresenter<AwardView> {
vo.put("osversion", deviceInfo.getOSVersion());
vo.put("appversion", deviceInfo.getVersionName());
vo.put("appPkgList", getT());
if (!TextUtils.isEmpty(wenshuApplication.OAID)) {
vo.put("oaid", wenshuApplication.OAID);
if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
vo.put("oaid", WenshuApplication.OAID);
}
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
......@@ -226,7 +226,7 @@ public class AwardPresenter extends BasePresenter<AwardView> {
vo.put("operator", deviceInfo.getOperator());
vo.put("idfa", "");
vo.put("imei", deviceInfo.getIMEI());
vo.put("oaid", wenshuApplication.OAID);
vo.put("oaid", WenshuApplication.OAID);
AppHttpManager.getInstance(loanApplication)
.call(loanService.riskinfo(vo),
......
package com.wenshu.youyou.mvp.presenters;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.mvp.views.BaseView;
import com.wenshu.youyou.net.LoanService;
......@@ -14,7 +14,7 @@ import rx.Subscription;
*/
public class BasePresenter<V extends BaseView> implements Presenter<V> {
protected wenshuApplication loanApplication;
protected WenshuApplication loanApplication;
protected LoanService loanService;
protected V view;
......
package com.wenshu.youyou.mvp.presenters;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.net.LoanService;
import rx.Subscription;
......@@ -11,15 +11,15 @@ import rx.Subscription;
* 时间:2018/1/10 17:51
* 邮箱:mengcga@163.com
*/
public class BaseTrackPresenter implements Presenter<wenshuApplication> {
public class BaseTrackPresenter implements Presenter<WenshuApplication> {
protected wenshuApplication loanApplication;
protected WenshuApplication loanApplication;
protected LoanService loanService;
protected Subscription subscription;
@Override
public void attachView(wenshuApplication loanApplication) {
public void attachView(WenshuApplication loanApplication) {
this.loanApplication = loanApplication;
loanService = loanApplication.getLoanService();
}
......
......@@ -3,7 +3,7 @@ package com.wenshu.youyou.mvp.presenters;
import android.text.TextUtils;
import com.google.gson.JsonObject;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.common.Constant;
import com.wenshu.youyou.common.DeviceInfo;
import com.wenshu.youyou.manager.AppHttpManager;
......@@ -148,8 +148,8 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
vo.put("osversion", deviceInfo.getOSVersion());
vo.put("appversion", deviceInfo.getVersionName());
vo.put("appPkgList", getT());
if (!TextUtils.isEmpty(wenshuApplication.OAID)) {
vo.put("oaid", wenshuApplication.OAID);
if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
vo.put("oaid", WenshuApplication.OAID);
}
riskinfo(deviceInfo, getT());
......@@ -333,7 +333,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
vo.put("operator", deviceInfo.getOperator());
vo.put("idfa", "");
vo.put("imei", deviceInfo.getIMEI());
vo.put("oaid", wenshuApplication.OAID);
vo.put("oaid", WenshuApplication.OAID);
AppHttpManager.getInstance(loanApplication)
.call(loanService.riskinfo(vo),
......
......@@ -7,6 +7,7 @@ import com.wenshu.youyou.mvp.model.FriendHallMsgBean
import com.wenshu.youyou.mvp.views.FriendsView
import com.wenshu.library.net.neterror.BaseSubscriber
import com.wenshu.library.net.neterror.Throwable
import com.wenshu.youyou.mvp.model.CashoutChallengeBean
class FriendsPresenter : BasePresenter<FriendsView>() {
......@@ -15,7 +16,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
*/
fun getFriendHallMsg() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.friendHallMsg(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
.call(
loanService.friendHallMsg(),
object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
......@@ -47,7 +50,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
*/
fun getContributionLeaders() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.contributionLeaders(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
.call(
loanService.contributionLeaders(),
object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
......@@ -80,7 +85,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
*/
fun getContributionBigLeaders() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.contributionBigLeaders(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
.call(
loanService.contributionBigLeaders(),
object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
......@@ -112,7 +119,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
*/
fun getFriendsGiveTodayList() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.friendsGiveTodayList, object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
.call(
loanService.friendsGiveTodayList,
object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
......@@ -144,7 +153,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
*/
fun getContributionOutToCash() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.contributionOutToCash(), object : BaseSubscriber<BaseResponse<JsonObject>>() {
.call(
loanService.contributionOutToCash(),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
......@@ -171,6 +182,43 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
})
}
/**
* 新版分红逻辑
*/
fun sonCashoutChallengeMsg() {
AppHttpManager.getInstance(loanApplication)
.call(
loanService.sonCashoutChallengeMsg(),
object : BaseSubscriber<BaseResponse<CashoutChallengeBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.getSonCashoutChallengeMsgFail()
}
override fun onNext(baseResponse: BaseResponse<CashoutChallengeBean>) {
if (isLinkView) return
view.hideLoading()
when (baseResponse.status) {
200 -> {
view.getSonCashoutChallengeMsgSuc(baseResponse.data)
}
else -> {
view.getSonCashoutChallengeMsgFail()
view.showToast(baseResponse.message)
}
}
}
})
}
/**
* 设置邀请成功
*
......
package com.wenshu.youyou.mvp.presenters
import android.text.TextUtils
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.common.DeviceInfo
import com.wenshu.youyou.manager.AppHttpManager
......@@ -35,7 +35,7 @@ class HomePresenter : BasePresenter<HomeView>() {
vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI
vo["oaid"] = wenshuApplication.OAID
vo["oaid"] = WenshuApplication.OAID
vo["os"] = "android"
vo["model"] = deviceInfo.newModel
vo["uuid"] = DeviceUuidFactory().deviceUuid
......@@ -166,8 +166,8 @@ class HomePresenter : BasePresenter<HomeView>() {
vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI
if (!TextUtils.isEmpty(wenshuApplication.OAID)) {
vo["oaid"] = wenshuApplication.OAID
if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
vo["oaid"] = WenshuApplication.OAID
}
vo["os"] = "android"
vo["model"] = deviceInfo.newModel
......
package com.wenshu.youyou.mvp.presenters
import android.text.TextUtils
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.common.DeviceInfo
import com.wenshu.youyou.manager.AppHttpManager
......@@ -240,8 +240,8 @@ class LoginPresenter : BasePresenter<LoginView>() {
vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI
if (!TextUtils.isEmpty(wenshuApplication.OAID)) {
vo["oaid"] = wenshuApplication.OAID
if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
vo["oaid"] = WenshuApplication.OAID
}
vo["os"] = "android"
vo["model"] = deviceInfo.newModel
......@@ -303,7 +303,7 @@ class LoginPresenter : BasePresenter<LoginView>() {
vo["operator"] = deviceInfo.operator
vo["idfa"] = ""
vo["imei"] = deviceInfo.iMEI
vo["oaid"] = wenshuApplication.OAID
vo["oaid"] = WenshuApplication.OAID
AppHttpManager.getInstance(loanApplication)
.call(loanService.riskinfo(vo),
......
package com.wenshu.youyou.mvp.presenters
import android.text.TextUtils
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.common.DeviceInfo
import com.wenshu.youyou.manager.AppHttpManager
......@@ -21,27 +21,27 @@ open class MyPresenter : BasePresenter<MyView>() {
*/
open fun getSignInHomePageMsg() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.signInHomePageMsg,
object : BaseSubscriber<BaseResponse<SignCardBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
.call(loanService.signInHomePageMsg,
object : BaseSubscriber<BaseResponse<SignCardBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<SignCardBean>) {
if (isLinkView) return
override fun onNext(baseResponse: BaseResponse<SignCardBean>) {
if (isLinkView) return
when (baseResponse.status) {
200 -> view.getSignInHomePageMsgSuc(baseResponse.data)
}
}
})
when (baseResponse.status) {
200 -> view.getSignInHomePageMsgSuc(baseResponse.data)
}
}
})
}
/**
......@@ -50,26 +50,26 @@ open class MyPresenter : BasePresenter<MyView>() {
fun signInHomePage() {
view.showLoading("加载中...")
AppHttpManager.getInstance(loanApplication)
.call(loanService.signInHomePage(),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
.call(loanService.signInHomePage(),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
when (baseResponse.status) {
200 -> view.signInHomePageSuc()
}
}
})
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
when (baseResponse.status) {
200 -> view.signInHomePageSuc()
}
}
})
}
fun getAutoUserHallBaseMsg() {
......@@ -77,7 +77,9 @@ open class MyPresenter : BasePresenter<MyView>() {
vo["isAndroid10"] = TextUtils.isEmpty(DeviceInfo.instance.iMEI)
AppHttpManager.getInstance(loanApplication)
.call(loanService.getAutoUserHallBaseMsg(vo), object : BaseSubscriber<BaseResponse<MyInfo>>() {
.call(
loanService.getAutoUserHallBaseMsg(vo),
object : BaseSubscriber<BaseResponse<MyInfo>>() {
override fun onCompleted() {
if (isLinkView)
......@@ -123,24 +125,24 @@ open class MyPresenter : BasePresenter<MyView>() {
vo["os"] = "android"
vo["isShowYwhzGame"] = true
AppHttpManager.getInstance(loanApplication)
.call(loanService.myHotActivity(vo),
object : BaseSubscriber<BaseResponse<BannerBean?>>() {
override fun onCompleted() {
if (isLinkView) return
}
.call(loanService.myHotActivity(vo),
object : BaseSubscriber<BaseResponse<BannerBean?>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<BannerBean?>) {
if (isLinkView) return
val data: BannerBean? = baseResponse.data
if (data != null) {
view.getMyHotActivitySuc(data)
}
}
})
override fun onNext(baseResponse: BaseResponse<BannerBean?>) {
if (isLinkView) return
val data: BannerBean? = baseResponse.data
if (data != null) {
view.getMyHotActivitySuc(data)
}
}
})
}
/**
......@@ -151,28 +153,28 @@ open class MyPresenter : BasePresenter<MyView>() {
vo["shumeiId"] = ShumeiManager.getInstance().shumeiDeviceId
vo["device"] = DeviceUuidFactory().deviceUuid.toString()
AppHttpManager.getInstance(loanApplication)
.call(loanService.visitorlogin(vo),
object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onCompleted() {
}
.call(loanService.visitorlogin(vo),
object : BaseSubscriber<BaseResponse<UserBean>>() {
override fun onCompleted() {
}
override fun onError(e: Throwable) {
}
override fun onError(e: Throwable) {
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
val data: UserBean? = baseResponse.data
when (code) {
200 -> if (data != null) {
UserManager.getInstance().saveUserInfo(data)
saveTerminalInfo()
}
else -> view.showToast(message)
}
override fun onNext(baseResponse: BaseResponse<UserBean>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
val data: UserBean? = baseResponse.data
when (code) {
200 -> if (data != null) {
UserManager.getInstance().saveUserInfo(data)
saveTerminalInfo()
}
})
else -> view.showToast(message)
}
}
})
}
/**
......@@ -189,8 +191,8 @@ open class MyPresenter : BasePresenter<MyView>() {
vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI
if (!TextUtils.isEmpty(wenshuApplication.OAID)) {
vo["oaid"] = wenshuApplication.OAID
if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
vo["oaid"] = WenshuApplication.OAID
}
vo["os"] = "android"
vo["model"] = deviceInfo.newModel
......@@ -199,24 +201,24 @@ open class MyPresenter : BasePresenter<MyView>() {
vo["appversion"] = deviceInfo.versionName
vo["shumeiId"] = ShumeiManager.getInstance().shumeiDeviceId
AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
.call(loanService.saveTerminalInfo(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
val code = baseResponse.status
when (code) {
200 -> view.userLoginSuc()
}
}
})
override fun onNext(baseResponse: BaseResponse<Any>) {
if (isLinkView) return
val code = baseResponse.status
when (code) {
200 -> view.userLoginSuc()
}
}
})
}
/**
......@@ -228,7 +230,9 @@ open class MyPresenter : BasePresenter<MyView>() {
vo["carrierType"] = Constant.CHALLENGE_SHAREFRIEND
vo["value"] = "1"
AppHttpManager.getInstance(loanApplication)
.call(loanService.setStatusInOneDayByCarrierType(vo), object : BaseSubscriber<BaseResponse<Any>>() {
.call(
loanService.setStatusInOneDayByCarrierType(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
......@@ -247,7 +251,7 @@ open class MyPresenter : BasePresenter<MyView>() {
}
fun setHighTaskType(carrierType: String, value: String) {
this.setHighTaskType(carrierType,value,"")
this.setHighTaskType(carrierType, value, "")
}
/**
......@@ -263,7 +267,9 @@ open class MyPresenter : BasePresenter<MyView>() {
vo["key"] = key
}
AppHttpManager.getInstance(loanApplication)
.call(loanService.setStatusInOneDayByCarrierType(vo), object : BaseSubscriber<BaseResponse<Any>>() {
.call(
loanService.setStatusInOneDayByCarrierType(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() {
if (isLinkView) return
}
......@@ -287,26 +293,50 @@ open class MyPresenter : BasePresenter<MyView>() {
fun getHallBaseMsg() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.hallBaseMsg,
object : BaseSubscriber<BaseResponse<UserTaskMsgBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
.call(loanService.hallBaseMsg,
object : BaseSubscriber<BaseResponse<UserTaskMsgBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<UserTaskMsgBean>) {
if (isLinkView) return
val code = baseResponse.getStatus()
when (code) {
200 -> view.getHallBaseMsgSuc(baseResponse.getData())
}
}
})
override fun onNext(baseResponse: BaseResponse<UserTaskMsgBean>) {
if (isLinkView) return
val code = baseResponse.getStatus()
when (code) {
200 -> view.getHallBaseMsgSuc(baseResponse.getData())
}
}
})
}
fun addContributionByCompeteCoinTarget() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.addContributionByCompeteCoinTarget(),
object : BaseSubscriber<BaseResponse<UserTaskMsgBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<UserTaskMsgBean>) {
if (isLinkView) return
val code = baseResponse.getStatus()
when (code) {
200 -> view.showToast("领取成功!")
}
}
})
}
}
\ No newline at end of file
package com.wenshu.youyou.mvp.presenters
import android.text.TextUtils
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.common.DeviceInfo
import com.wenshu.library.net.neterror.BaseSubscriber
import com.wenshu.library.net.neterror.Throwable
......@@ -63,8 +63,8 @@ class PanPresenter : BasePresenter<PanView>() {
vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI
if (!TextUtils.isEmpty(wenshuApplication.OAID)) {
vo["oaid"] = wenshuApplication.OAID
if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
vo["oaid"] = WenshuApplication.OAID
}
vo["os"] = "android"
vo["model"] = deviceInfo.newModel
......
......@@ -3,7 +3,7 @@ package com.wenshu.youyou.mvp.presenters;
import android.app.Activity;
import com.google.gson.JsonObject;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.common.AppConfig;
import com.wenshu.youyou.common.Constant;
import com.wenshu.youyou.manager.AppHttpManager;
......@@ -284,7 +284,7 @@ public class TrackPresenter extends BaseTrackPresenter {
if (activity == null)
return;
loanApplication = (wenshuApplication) activity.getApplication();
loanApplication = (WenshuApplication) activity.getApplication();
loanService = loanApplication.getLoanService();
subscription = loanService.reportAddCoinMsg(vo)
......
package com.wenshu.youyou.mvp.presenters
import android.app.Activity
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.mvp.model.BaseResponse
import com.wenshu.youyou.mvp.views.VideoAdManagerView
import com.wenshu.library.net.neterror.BaseSubscriber
......@@ -13,7 +13,7 @@ class TzVideoAdPresenter : BasePresenter<VideoAdManagerView>() {
fun reportAddCoinMsg(activity: Activity?, vo: HashMap<String, Any>) {
if (activity == null) return
loanApplication = activity.application as wenshuApplication
loanApplication = activity.application as WenshuApplication
loanService = loanApplication.loanService
subscription = loanService.reportAddCoinMsg(vo)
.observeOn(AndroidSchedulers.mainThread())
......
......@@ -20,7 +20,7 @@ import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.R;
import com.wenshu.youyou.common.AppConfig;
import com.wenshu.youyou.common.Constant;
......@@ -49,7 +49,7 @@ import rx.android.schedulers.AndroidSchedulers;
*/
public class VersionUpdatePresenter {
private wenshuApplication loanApplication;
private WenshuApplication loanApplication;
private LoanService loanService;
private AlertDialog dialogDetails;
private String version;
......@@ -66,13 +66,13 @@ public class VersionUpdatePresenter {
return;
this.activity = activity;
loanApplication = (wenshuApplication) activity.getApplication();
loanApplication = (WenshuApplication) activity.getApplication();
version = ConstantUtil.getVersionName(loanApplication);
if (dialogDetails == null || !dialogDetails.isShowing()) {
loanApplication = (wenshuApplication) activity.getApplication();
loanApplication = (WenshuApplication) activity.getApplication();
loanService = loanApplication.getLoanService();
HashMap<String, Object> vo = new HashMap<>();
......@@ -313,7 +313,7 @@ public class VersionUpdatePresenter {
activity.startActivity(intent);
} else {
if (AppUtils.isServiceRunning(loanApplication, loanApplication.getPackageName() + ".service.UpdateService")) {
ToastUtil.show(wenshuApplication.getContext(), "app正在后台下载,可以在通知栏中查看下载进度");
ToastUtil.show(WenshuApplication.getContext(), "app正在后台下载,可以在通知栏中查看下载进度");
} else {
Context applicationContext = loanApplication.getApplicationContext();
Intent updateIntent = new Intent(applicationContext, UpdateService.class);
......@@ -322,7 +322,7 @@ public class VersionUpdatePresenter {
updateIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
applicationContext.bindService(updateIntent, conn, Context.BIND_AUTO_CREATE);
ToastUtil.show(wenshuApplication.getContext(), "正在后台更新中...");
ToastUtil.show(WenshuApplication.getContext(), "正在后台更新中...");
}
}
}
......
package com.wenshu.youyou.mvp.presenters
import android.app.Activity
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.mvp.model.BaseResponse
import com.wenshu.youyou.mvp.views.VideoAdManagerView
import com.wenshu.library.net.neterror.BaseSubscriber
......@@ -13,7 +13,7 @@ class WnVideoAdPresenter : BasePresenter<VideoAdManagerView>() {
fun reportAddCoinMsg(activity: Activity?, vo: HashMap<String, Any>) {
if (activity == null) return
loanApplication = activity.application as wenshuApplication
loanApplication = activity.application as WenshuApplication
loanService = loanApplication.loanService
subscription = loanService.reportAddCoinMsg(vo)
.observeOn(AndroidSchedulers.mainThread())
......
......@@ -2,7 +2,7 @@ package com.wenshu.youyou.mvp.presenters;
import android.app.Activity;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.mvp.model.BaseResponse;
import com.wenshu.youyou.mvp.views.VideoAdManagerView;
import com.wenshu.youyou.net.LoanService;
......@@ -16,7 +16,7 @@ import rx.android.schedulers.AndroidSchedulers;
public class YlhVideoAdPresenter extends BasePresenter<VideoAdManagerView> {
private wenshuApplication loanApplication;
private WenshuApplication loanApplication;
private LoanService loanService;
private Subscription subscription;
......@@ -24,7 +24,7 @@ public class YlhVideoAdPresenter extends BasePresenter<VideoAdManagerView> {
if (activity == null)
return;
loanApplication = (wenshuApplication) activity.getApplication();
loanApplication = (WenshuApplication) activity.getApplication();
loanService = loanApplication.getLoanService();
subscription = loanService.reportAddCoinMsg(vo)
......
package com.wenshu.youyou.mvp.views;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
/**
* 描述:BaseView
......@@ -14,7 +14,7 @@ public interface BaseView {
*
* @return
*/
wenshuApplication getBaseApplication();
WenshuApplication getBaseApplication();
/**
* show loading message
......
package com.wenshu.youyou.mvp.views
import com.wenshu.youyou.mvp.model.CashoutChallengeBean
import com.wenshu.youyou.mvp.model.FriendHallMsgBean
interface FriendsView : BaseView {
......@@ -18,4 +19,8 @@ interface FriendsView : BaseView {
fun getContributionOutToCashSuc()
fun getSonCashoutChallengeMsgSuc(data: CashoutChallengeBean)
fun getSonCashoutChallengeMsgFail()
}
......@@ -7,6 +7,7 @@ import com.wenshu.youyou.BuildConfig;
import com.wenshu.youyou.mvp.model.AccountMsgBean;
import com.wenshu.youyou.mvp.model.BannerBean;
import com.wenshu.youyou.mvp.model.BaseResponse;
import com.wenshu.youyou.mvp.model.CashoutChallengeBean;
import com.wenshu.youyou.mvp.model.CommonParamBean;
import com.wenshu.youyou.mvp.model.DrawcashBean;
import com.wenshu.youyou.mvp.model.DrawcashRecordBean;
......@@ -577,6 +578,22 @@ public interface LoanService {
@POST("common/baseCarrierAdcodeConfig")
Observable<BaseResponse<ServerAdBean>> baseCarrierAdcodeConfig();
/**
* 完成任务增加贡献值接口
*
* @return
*/
@POST("api//addContributionByCompeteCoinTarget")
Observable<BaseResponse<JsonObject>> addContributionByCompeteCoinTarget();
/**
* 新版分红逻辑
*
* @return
*/
@POST("api/sonCashoutChallengeMsg")
Observable<BaseResponse<CashoutChallengeBean>> sonCashoutChallengeMsg();
/**
* 默认http工厂
*/
......
......@@ -5,7 +5,7 @@ import android.text.TextUtils;
import com.bytedance.hume.readapk.HumeSDK;
import com.google.gson.Gson;
import com.wenshu.youyou.BuildConfig;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.manager.UserManager;
import com.wenshu.youyou.mvp.model.AppRequest;
import com.wenshu.youyou.utils.AESUtils;
......@@ -44,10 +44,10 @@ public class OkHttpInterceptor implements Interceptor {
long time = System.currentTimeMillis();
String channel = CommonUtils.getAppMetaData(wenshuApplication.getContext(), "CHANNEL_NAME");
String channel = CommonUtils.getAppMetaData(WenshuApplication.getContext(), "CHANNEL_NAME");
try {
// 穿山甲分包渠道
String ttChannel = HumeSDK.getChannel(wenshuApplication.getContext());
String ttChannel = HumeSDK.getChannel(WenshuApplication.getContext());
if (!TextUtils.isEmpty(ttChannel)) {
// 此处方式不能修改,已和后端约定
channel = channel + "_" + ttChannel;
......
......@@ -16,7 +16,7 @@ import androidx.core.app.NotificationCompat;
import androidx.core.content.FileProvider;
import android.widget.RemoteViews;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.R;
import com.wenshu.youyou.common.Constant;
import com.wenshu.youyou.ui.activitys.MainActivity;
......@@ -211,7 +211,7 @@ public class UpdateService extends Service {
if (updateFile != null) {
autoInstallApk(updateFile);
} else {
ToastUtil.show(wenshuApplication.getContext(), "安装失败!");
ToastUtil.show(WenshuApplication.getContext(), "安装失败!");
System.exit(0);
}
}
......
......@@ -4,7 +4,7 @@ import android.annotation.SuppressLint
import android.os.Bundle
import android.view.View
import com.bytedance.hume.readapk.HumeSDK
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.common.AppConfig
import com.wenshu.youyou.common.Constant
......@@ -34,7 +34,7 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
ivAboutasIcon.setOnLongClickListener {
ToastUtil.showLong(wenshuApplication.getContext(), "自有渠道:" + CommonUtils.getAppMetaData(wenshuApplication.getContext(), "CHANNEL_NAME") +
ToastUtil.showLong(WenshuApplication.getContext(), "自有渠道:" + CommonUtils.getAppMetaData(WenshuApplication.getContext(), "CHANNEL_NAME") +
"\n 广告代码位:" + AppConfig.user_channel_ad +
"\n 头条渠道:" + HumeSDK.getChannel(context))
true
......
......@@ -6,7 +6,7 @@ import android.text.TextUtils
import android.view.View
import android.widget.ImageView
import androidx.viewpager.widget.ViewPager.OnPageChangeListener
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.manager.UserManager
......@@ -41,11 +41,11 @@ class GuideActivity : BaseActivity() {
}
private fun readyGoMain() {
val instance = AppPreferences(wenshuApplication.getContext())
val instance = AppPreferences(WenshuApplication.getContext())
val customVersion: Int = instance.getInt(Constant.CUSTOM_VERSION, 0)
instance.put(Constant.ISFIRSTENTER + customVersion, false)
val channel = CommonUtils.getAppMetaData(wenshuApplication.getContext(), "CHANNEL_NAME")
val channel = CommonUtils.getAppMetaData(WenshuApplication.getContext(), "CHANNEL_NAME")
if (TextUtils.equals(channel, Constant.CHANNEL_SHARE) && !UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java)
} else {
......
......@@ -48,7 +48,7 @@ class SplashADActivity : BaseActivity(), SplashADListener {
try {
container = findViewById<View>(R.id.splash_container) as ViewGroup
// ToastUtil.showLong(wenshuApplication.getContext(), "ylh splash:$YlhAdManager.YLH_AD_SPLASH_POSTID")
// ToastUtil.showLong(WenshuApplication.getContext(), "ylh splash:$YlhAdManager.YLH_AD_SPLASH_POSTID")
fetchSplashAD(this, container, skipView, YlhAdManager.YLH_AD_SPLASH_POSTID, this, 0)
} catch (e: Exception) {
......
......@@ -8,7 +8,7 @@ import android.view.KeyEvent
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.common.DeviceInfo
......@@ -197,7 +197,7 @@ class SplashYlhActivity : BaseActivity(), SplashADListener {
if (isFirstEnter) {
readyGoThenKill(GuideActivity::class.java)
} else {
val channel = CommonUtils.getAppMetaData(wenshuApplication.getContext(), "CHANNEL_NAME")
val channel = CommonUtils.getAppMetaData(WenshuApplication.getContext(), "CHANNEL_NAME")
if (TextUtils.equals(channel, Constant.CHANNEL_SHARE) && !UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java)
} else {
......
......@@ -9,7 +9,7 @@ import android.view.KeyEvent
import android.view.View
import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.login.LoginApi
......@@ -53,7 +53,7 @@ class WxLoginActivity : BaseActivity()
override fun initViewsAndEvents() {
loginPresenter.attachView(this)
channel = CommonUtils.getAppMetaData(wenshuApplication.getContext(), "CHANNEL_NAME")
channel = CommonUtils.getAppMetaData(WenshuApplication.getContext(), "CHANNEL_NAME")
initView()
initListener()
}
......
......@@ -5,7 +5,7 @@ import android.view.View
import android.widget.SeekBar
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.ad.express.TTPreLoadExpressXmlyManager
import com.wenshu.youyou.common.AppConfig
......@@ -104,7 +104,7 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O
mPlayerManager = XmPlayerManager.getInstance(this)
val mNotification = XmNotificationCreater.getInstanse(this)
.initNotification(wenshuApplication.getContext(), XmlyPlayActivity::class.java)
.initNotification(WenshuApplication.getContext(), XmlyPlayActivity::class.java)
mPlayerManager.init(System.currentTimeMillis().toInt(), mNotification)
mPlayerManager.addPlayerStatusListener(mPlayerStatusListener)
......
......@@ -16,7 +16,7 @@ import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.R;
import com.wenshu.youyou.common.Constant;
import com.wenshu.youyou.mvp.views.BaseView;
......@@ -60,8 +60,8 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
}
@Override
public wenshuApplication getBaseApplication() {
return (wenshuApplication) getApplication();
public WenshuApplication getBaseApplication() {
return (WenshuApplication) getApplication();
}
public Context getContext() {
......@@ -190,7 +190,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
@Override
public void showToast(String msg) {
if (!TextUtils.isEmpty(msg))
ToastUtil.show(wenshuApplication.getContext(), msg);
ToastUtil.show(WenshuApplication.getContext(), msg);
}
/**
......@@ -200,7 +200,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
IntentFilter filter = new IntentFilter();
filter.addAction(Constant.ACTION_EXIT_APP);
filter.addCategory(Intent.CATEGORY_DEFAULT);
wenshuApplication.getLocalBroadcastManager().registerReceiver(mExitReceiver, filter);
WenshuApplication.getLocalBroadcastManager().registerReceiver(mExitReceiver, filter);
}
private BroadcastReceiver mExitReceiver = new BroadcastReceiver() {
......@@ -221,7 +221,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
IntentFilter filter = new IntentFilter();
filter.addAction(Constant.ACTION_EXIT_APP);
filter.addCategory(Intent.CATEGORY_DEFAULT);
wenshuApplication.getLocalBroadcastManager().unregisterReceiver(mExitReceiver);
WenshuApplication.getLocalBroadcastManager().unregisterReceiver(mExitReceiver);
}
}
......@@ -60,6 +60,9 @@ class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean>
// 其他下载应用
const val TO_DOWNLOADS = "TO_DOWNLOADS"
// 完成任务增加贡献值
const val TO_ADDCONTRIBUTION = "TO_ADDCONTRIBUTION"
}
private var mContext: Context = context
......
......@@ -22,14 +22,12 @@ import com.wenshu.youyou.ui.activitys.WxLoginActivity
import com.wenshu.youyou.ui.adapter.FriendsPagerAdapter
import com.wenshu.youyou.ui.adapter.InvitedAdapter
import com.wenshu.youyou.ui.fragment.base.BaseFragment
import com.wenshu.youyou.ui.widgets.BonusDialog
import com.wenshu.youyou.ui.widgets.CustomDialogAsApple
import com.wenshu.youyou.ui.widgets.DialogListener
import com.wenshu.youyou.ui.widgets.ShareDialog
import com.wenshu.youyou.ui.widgets.seekbar.BubbleUtils
import com.wenshu.youyou.utils.SpanUtils
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import com.wenshu.youyou.mvp.model.CashoutChallengeBean
import com.wenshu.youyou.ui.widgets.*
import kotlinx.android.synthetic.main.fragment_main_friends.*
import kotlinx.android.synthetic.main.header_layout.*
import net.grandcentrix.tray.AppPreferences
......@@ -40,7 +38,8 @@ import java.math.BigDecimal
* 作者:孟崔广
* 时间:2020/9/20 17:30
*/
class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), FriendsView, OnRefreshListener, View.OnClickListener {
class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), FriendsView,
OnRefreshListener, View.OnClickListener, ProgressLayout.BoxListener {
private val friendsPresenter by lazy { FriendsPresenter() }
......@@ -58,6 +57,9 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
private var yesterdayData: MutableList<FriendHallMsgBean.ListBean> = mutableListOf()
private var yesterdayAdapter: InvitedAdapter? = null
// 分红规则数据
private var cashoutChallengeBean: CashoutChallengeBean? = null
private val recyList: MutableList<RecyclerView> = mutableListOf()
private var mFriendsHallMsgBean: FriendHallMsgBean? = null
......@@ -100,8 +102,7 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
tv_right_subtitle.setOnClickListener(this)
btn_invite.setOnClickListener(this)
tv_detail.setOnClickListener(this)
// tv_friends_directly.setOnClickListener(this)
// tv_friends_indirect.setOnClickListener(this)
tv_invited_info.setOnClickListener(this)
}
private fun initRecy() {
......@@ -111,7 +112,12 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
recyAll.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL))
recyToday.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL))
recyYesterday.addItemDecoration(DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL))
recyYesterday.addItemDecoration(
DividerItemDecoration(
mContext,
DividerItemDecoration.VERTICAL
)
)
allAdapter = InvitedAdapter(mContext, allData)
yesterdayAdapter = InvitedAdapter(mContext, yesterdayData)
......@@ -129,7 +135,11 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
viewPagerAdapter = FriendsPagerAdapter(titleList, recyList)
view_pager_friends.adapter = viewPagerAdapter
view_pager_friends.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
override fun onPageScrolled(
position: Int,
positionOffset: Float,
positionOffsetPixels: Int
) {
}
override fun onPageSelected(position: Int) {
......@@ -172,6 +182,8 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
// 刷新分红数据
friendsPresenter.getFriendHallMsg()
friendsPresenter.sonCashoutChallengeMsg()
when (view_pager_friends.currentItem) {
0 -> {
friendsPresenter.getContributionBigLeaders()
......@@ -237,9 +249,9 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
fun showRedbox(view: View?) {
rope = null
rope = YoYo.with(Techniques.Pulse).duration(1200)
.interpolate(AccelerateDecelerateInterpolator())
.repeat(-1)
.playOn(view)
.interpolate(AccelerateDecelerateInterpolator())
.repeat(-1)
.playOn(view)
}
fun stopRedbox() {
......@@ -249,9 +261,6 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
}
private fun generateData(data: FriendHallMsgBean) {
// friends_sum.text = "" + data.friendCount
// friends_directly_sum.text = "" + data.directFriendsCount
// friends_indirect_sum.text = "" + data.indirectFriendsCount
btn_get_bonus.text = data.button
btn_get_bonus.isEnabled = data.status == 0 && data.cash > 0
......@@ -268,59 +277,76 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
tv_bonus_date.text = data.periods
tv_bonus_sum.text = SpanUtils()
.append("今日奖池 ").setForegroundColor(resources.getColor(R.color.black))
.append(data.titleMsg).setFontSize(BubbleUtils.dp2px(28)).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append(" 元").setForegroundColor(resources.getColor(R.color.black))
.create()
.append("今日奖池 ").setForegroundColor(resources.getColor(R.color.black))
.append(data.titleMsg).setFontSize(BubbleUtils.dp2px(28))
.setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append(" 元").setForegroundColor(resources.getColor(R.color.black))
.create()
tv_yesterday_bonus.text = SpanUtils()
.append(data.contribution_yesterday.toString()).setForegroundColor(resources.getColor(R.color.color_FF7C00))
.create()
.append(data.contribution_yesterday.toString())
.setForegroundColor(resources.getColor(R.color.color_FF7C00))
.create()
tv_today_bonus.text = SpanUtils()
.append(data.contribution_today.toString()).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.create()
.append(data.contribution_today.toString())
.setForegroundColor(resources.getColor(R.color.color_E72C2B))
.create()
tv_bonus_money.text = SpanUtils()
.append(data.cash.toString()).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append("元").setFontSize(BubbleUtils.dp2px(14)).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.create()
.append(data.cash.toString())
.setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append("元").setFontSize(BubbleUtils.dp2px(14))
.setForegroundColor(resources.getColor(R.color.color_E72C2B))
.create()
tv_bonus_rate.text = SpanUtils()
.append("昨日汇率:").setForegroundColor(resources.getColor(R.color.black))
.append(data.rate).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.create()
.append("昨日汇率:").setForegroundColor(resources.getColor(R.color.black))
.append(data.rate).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.create()
tv_bonus_hint.text = data.remark
}
private fun hintDialog(flag: Boolean) {
private fun hintDialog(status: Int, content: String, btnStr: String) {
bonusDialog = BonusDialog(requireActivity(), object : DialogListener() {
override fun onClick(v: View) {
when (v.id) {
R.id.btn_submit -> {
if (activity != null && !activity!!.isFinishing &&
bonusDialog != null && bonusDialog!!.isShowing
bonusDialog != null && bonusDialog!!.isShowing
) {
bonusDialog!!.dismiss()
}
if (status == -1) {
inviteFriends()
}
}
}
}
})
bonusDialog?.let {
if (flag) {
it.setTitle("什么是直接亲友?")
it.setContent("经你本人直接邀请的亲友,就是你的直接亲友。")
it.setBtnStr("知道了")
} else {
it.setTitle("什么是间接亲友?")
it.setContent("经你直接亲友邀请的亲友,就是你的间接亲友。")
it.setBtnStr("知道了")
}
it.setContent(content)
it.setBtnStr(btnStr)
it.show()
}
}
private fun inviteFriends(){
// 邀请好友
if (!UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java)
return
}
if (!ps.getBoolean(Constant.FIRST_SHARE_INVITED, false)) {
// 第一次邀请提示弹框
firstWeChatInvite()
} else {
shareImgDialog()
}
}
private fun ruleDialog() {
if (mFriendsHallMsgBean?.rules != null) {
bonusDialog = BonusDialog(requireActivity(), object : DialogListener() {
......@@ -328,7 +354,7 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
when (v.id) {
R.id.btn_submit -> {
if (activity != null && !activity!!.isFinishing &&
bonusDialog != null && bonusDialog!!.isShowing
bonusDialog != null && bonusDialog!!.isShowing
) {
bonusDialog!!.dismiss()
}
......@@ -351,28 +377,13 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
// 亲友团详情
readyGo(FriendsActivity::class.java)
}
// R.id.tv_friends_directly -> {
// // 直接亲友弹框
// hintDialog(true)
// }
// R.id.tv_friends_indirect -> {
// // 间接亲友弹框
// hintDialog(false)
// }
R.id.tv_invited_info -> {
// 邀请好友提示
hintDialog(0, "每邀请1个人,并累计提现大于等于1元,算完成1个邀请", "知道了")
}
R.id.btn_invite -> {
// 邀请好友
if (!UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java)
return
}
if (!ps.getBoolean(Constant.FIRST_SHARE_INVITED, false)) {
// 第一次邀请提示弹框
firstWeChatInvite()
} else {
shareImgDialog()
}
inviteFriends()
}
R.id.tv_right_subtitle -> {
// 玩法规则
......@@ -437,7 +448,7 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
when (v.id) {
R.id.btn_submit -> {
if (activity != null && !activity!!.isFinishing &&
bonusDialog != null && bonusDialog!!.isShowing
bonusDialog != null && bonusDialog!!.isShowing
) {
readyGo(DrawcashActivity::class.java)
bonusDialog!!.dismiss()
......@@ -454,6 +465,44 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
}
}
override fun getSonCashoutChallengeMsgSuc(data: CashoutChallengeBean) {
cashoutChallengeBean = data
tv_invited_info.text = "您已邀请" + data.complete + "人"
progress_layout.visibility = View.VISIBLE
progress_layout.setBoxListener(this)
progress_layout.setStatus(data.list)
progress_layout.setProgress(data.complete)
}
override fun getSonCashoutChallengeMsgFail() {}
override fun clickBox(position: Int, status: Int) {
when (status) {
0 -> {
hintDialog(
-1, "您还需邀请" +
(cashoutChallengeBean!!.list[position].needCount - cashoutChallengeBean?.complete!!) +
"位好友才可领取奖励",
"邀请好友"
)
}
1 -> {
hintDialog(
0, "恭喜您,已获得" + cashoutChallengeBean!!.list[position].cash +
"元奖励(已转为金币存入您的账户)",
"知道了"
)
}
2 -> {
hintDialog(
0,"您已经领取过本阶段奖励",
"知道了"
)
}
}
}
/**
* 图片分享
*/
......@@ -463,7 +512,10 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
if (userManager.wxName.isEmpty()) {
var mobile = userManager.mobile
if (mobile.isNotEmpty()) {
mobile = mobile.substring(0, 3) + "****" + mobile.substring(mobile.length - 4, mobile.length)
mobile = mobile.substring(0, 3) + "****" + mobile.substring(
mobile.length - 4,
mobile.length
)
}
title = "Hi,我是$mobile"
} else {
......@@ -487,13 +539,16 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
if (userManager.wxName.isEmpty()) {
var mobile = userManager.mobile
if (mobile.isNotEmpty()) {
mobile = mobile.substring(0, 3) + "****" + mobile.substring(mobile.length - 4, mobile.length)
mobile = mobile.substring(0, 3) + "****" + mobile.substring(
mobile.length - 4,
mobile.length
)
}
title = "Hi,我是$mobile"
} else {
title = "Hi,我是" + userManager.wxName
}
var sumCoin = if (TextUtils.isEmpty(userManager.userSumGold)) {
val sumCoin = if (TextUtils.isEmpty(userManager.userSumGold)) {
"0"
} else {
val allcoinBig = BigDecimal(userManager.userSumGold)
......@@ -501,12 +556,14 @@ class FriendsFragment(private var isResume: Boolean = false) : BaseFragment(), F
allcoinBig.divide(rateBig).setScale(2, BigDecimal.ROUND_DOWN).toString()
}
val content = SpanUtils()
.append("我已在尤友赚了")
.append(sumCoin).setFontSize(BubbleUtils.dp2px(10)).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append("元 ,快来跟我一起赚钱吧,满")
.append("0.3").setFontSize(BubbleUtils.dp2px(10)).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append("元就可以提现")
.create()
.append("我已在尤友赚了")
.append(sumCoin).setFontSize(BubbleUtils.dp2px(10))
.setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append("元 ,快来跟我一起赚钱吧,满")
.append("0.3").setFontSize(BubbleUtils.dp2px(10))
.setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append("元就可以提现")
.create()
shareDialog.run {
setOnShareCompleteListener(object : ShareDialog.OnShareCompleteListener {
override fun onShareComplete() {
......
......@@ -12,7 +12,7 @@ import androidx.fragment.app.FragmentTransaction
import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo
import com.daimajia.androidanimations.library.YoYo.YoYoString
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.ad.express.PreLoadExpressManager
import com.wenshu.youyou.ad.express.TTPreLoadExpressXmlyManager
......@@ -91,8 +91,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
videoAdingManager = VideoAdingManager.getInstance(activity)
// 奖励页预加载 信息流广告
// PreLoadExpressManager.loadADFrameLayout()
//
PreLoadExpressManager.loadADFrameLayout()
// // 刷新喜马拉雅信息流
// TTPreLoadExpressXmlyManager.getInstance().loadTtFrameLayout()
......@@ -320,8 +320,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
//闪电盒子传入oaid
if (!TextUtils.isEmpty(wenshuApplication.OAID)) {
WnManager.setOaid(wenshuApplication.OAID)
if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
WnManager.setOaid(WenshuApplication.OAID)
}
}
......@@ -555,7 +555,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
ShumeiManager.getInstance().initShumei()
// 游客首次提示1500新人奖励 且 不是分享包
val channel = CommonUtils.getAppMetaData(wenshuApplication.getContext(), "CHANNEL_NAME")
val channel = CommonUtils.getAppMetaData(WenshuApplication.getContext(), "CHANNEL_NAME")
if (!TextUtils.equals(channel, Constant.CHANNEL_SHARE) && ps.getBoolean(Constant.FIRST_VISITOR_FLAG, true)) {
ps.put(Constant.FIRST_VISITOR_FLAG, false)
val bundle = Bundle()
......
......@@ -290,7 +290,6 @@ class MyFragment : BaseFragment(),
}
override fun userLoginSuc() {
// SceneManager.signIn(requireActivity())
RsNewsManager.init(baseApplication)
myPresenter.getAutoUserHallBaseMsg()
......@@ -542,6 +541,18 @@ class MyFragment : BaseFragment(),
readyGo(TaskCpdActivity::class.java)
}
// 完成分红任务增加贡献值
MainMyAdapter.TO_ADDCONTRIBUTION -> {
if (!UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java)
return
}
if (taskBean.otherConfig != null && taskBean.otherConfig.status == 1) {
myPresenter.addContributionByCompeteCoinTarget()
} else {
showToast("请先完成任务")
}
}
// 跳转高额视频
MainMyAdapter.APP_HiGH_ACTIVITY -> {
if (!UserManager.getInstance().userIsLogin()) {
......
......@@ -9,7 +9,7 @@ import cn.sharesdk.framework.PlatformActionListener
import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat
import cn.sharesdk.wechat.moments.WechatMoments
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.common.AppConfig
import com.wenshu.youyou.common.Constant
......@@ -142,7 +142,7 @@ class WzFragment(private var isResume: Boolean = false) : BaseFragment(), BaseVi
}
wechatTarget.share(wechatSp)
} else {
ToastUtil.show(wenshuApplication.getContext(), "请先安装微信")
ToastUtil.show(WenshuApplication.getContext(), "请先安装微信")
}
}
}
......
......@@ -11,7 +11,7 @@ import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.R;
import com.wenshu.youyou.ui.widgets.LoadingDialog;
import com.wenshu.youyou.utils.ToastUtil;
......@@ -32,8 +32,8 @@ public abstract class BaseFragment extends BaseAppFragment {
super.onCreate(savedInstanceState);
}
public wenshuApplication getBaseApplication() {
return (wenshuApplication) getActivity().getApplication();
public WenshuApplication getBaseApplication() {
return (WenshuApplication) getActivity().getApplication();
}
public Context getContext() {
......@@ -113,7 +113,7 @@ public abstract class BaseFragment extends BaseAppFragment {
*/
public void showToast(String msg) {
if (!TextUtils.isEmpty(msg))
ToastUtil.show(wenshuApplication.getContext(), msg);
ToastUtil.show(WenshuApplication.getContext(), msg);
}
/**
......
......@@ -10,7 +10,7 @@ import android.view.View
import android.view.WindowManager
import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.login.LoginApi
......@@ -142,7 +142,7 @@ class BindWxDialog(context: Activity) :
}
override fun getBaseApplication(): wenshuApplication {
return wenshuApplication.getContext() as wenshuApplication
override fun getBaseApplication(): WenshuApplication {
return WenshuApplication.getContext() as WenshuApplication
}
}
\ No newline at end of file
......@@ -10,7 +10,7 @@ import android.widget.ImageView
import android.widget.TextView
import com.downloader.PRDownloader
import com.downloader.Progress
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.utils.CacheUtil
import com.wenshu.youyou.utils.Utils
......@@ -49,7 +49,7 @@ class DownloadProgressDialog(context: Context) :
when (v.id) {
R.id.iv_download_quit -> {
PRDownloader.cancelAll()
CacheUtil.clearAllCache(wenshuApplication.getContext())
CacheUtil.clearAllCache(WenshuApplication.getContext())
dismiss()
}
......
package com.wenshu.youyou.ui.widgets
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.FrameLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.wenshu.youyou.R
import com.wenshu.youyou.mvp.model.CashoutChallengeBean
import com.wenshu.library.utils.nodoubleclick.AntiShake
/**
*
* @author jyx
* @date 2021/3/22
* @des
*/
class ProgressLayout : FrameLayout, View.OnClickListener {
constructor(ctx: Context) : this(ctx, null)
constructor(ctx: Context, attrs: AttributeSet?) : this(ctx, attrs, 0)
constructor(ctx: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
ctx,
attrs,
defStyleAttr
)
private var titleView1: TextView
private var titleView2: TextView
private var titleView3: TextView
private var titleView4: TextView
private var titleView5: TextView
private var tickProgress: TickProgress
private var mBoxListener: BoxListener? = null
init {
val rootView = inflate(context, R.layout.layout_progress, this)
titleView1 = rootView.findViewById(R.id.tv_box1)
titleView2 = rootView.findViewById(R.id.tv_box2)
titleView3 = rootView.findViewById(R.id.tv_box3)
titleView4 = rootView.findViewById(R.id.tv_box4)
titleView5 = rootView.findViewById(R.id.tv_box5)
tickProgress = rootView.findViewById(R.id.tick_progress)
initListener()
}
private fun initListener() {
titleView1.setOnClickListener(this)
titleView2.setOnClickListener(this)
titleView3.setOnClickListener(this)
titleView4.setOnClickListener(this)
titleView5.setOnClickListener(this)
}
fun setStatus(dataList: List<CashoutChallengeBean.ListDTO>) {
for (i in dataList.indices) {
setSingleStatus(i, dataList[i].status, dataList[i].needCount)
}
}
fun setSingleStatus(position: Int, status: Int, needCount: Int) {
val boxView = getBoxView(position)
boxView?.text = needCount.toString() + "人"
boxView?.tag = status
when (status) {
0 -> {
boxView?.setCompoundDrawablesWithIntrinsicBounds(
null,
null,
null,
ContextCompat.getDrawable(context, R.mipmap.ic_box_gray)
)
}
1 -> {
boxView?.setCompoundDrawablesWithIntrinsicBounds(
null,
null,
null,
ContextCompat.getDrawable(context, R.mipmap.ic_box_close)
)
}
2 -> {
boxView?.setCompoundDrawablesWithIntrinsicBounds(
null,
null,
null,
ContextCompat.getDrawable(context, R.mipmap.ic_box_open)
)
}
}
}
private fun getBoxView(position: Int): TextView? {
when (position) {
0 -> {
return titleView1
}
1 -> {
return titleView2
}
2 -> {
return titleView3
}
3 -> {
return titleView4
}
4 -> {
return titleView5
}
else -> {
return null
}
}
}
/**
* @param complete 0-1000人
*/
fun setProgress(complete: Int) {
val progress: Float = when (complete) {
in 0..10 -> 0.1f * (complete / 10f)
in 11..50 -> 0.1f + 0.1f * ((complete - 10) / 50f)
in 51..100 -> 0.2f + 0.1f * ((complete - 50) / 50f)
in 101..500 -> 0.3f + 0.3f * ((complete - 100) / 400f)
in 501..1000 -> 0.6f + 0.4f * ((complete - 500) / 500f)
else -> 0f
}
tickProgress.setProgress(progress)
}
fun setBoxListener(boxListener: BoxListener) {
mBoxListener = boxListener
}
interface BoxListener {
/**
* 点击宝箱
*
* @param position 下标
* @param status 状态
*/
fun clickBox(position: Int, status: Int)
}
override fun onClick(v: View?) {
if (AntiShake.check(v)) return
when (v?.id) {
R.id.tv_box1 -> {
mBoxListener?.clickBox(0, v.tag.toString().toInt())
}
R.id.tv_box2 -> {
mBoxListener?.clickBox(1, v.tag.toString().toInt())
}
R.id.tv_box3 -> {
mBoxListener?.clickBox(2, v.tag.toString().toInt())
}
R.id.tv_box4 -> {
mBoxListener?.clickBox(3, v.tag.toString().toInt())
}
R.id.tv_box5 -> {
mBoxListener?.clickBox(4, v.tag.toString().toInt())
}
}
}
}
\ No newline at end of file
......@@ -18,7 +18,7 @@ import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat
import cn.sharesdk.wechat.moments.WechatMoments
import com.wenshu.youyou.BuildConfig
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R
import com.wenshu.youyou.manager.UserManager
import com.wenshu.youyou.ui.adapter.SharePagerAdapter
......@@ -209,7 +209,7 @@ class ShareDialog(context: Context) : Dialog(context, R.style.dialog) {
mOnShareOKListener?.onShareOk()
wechat.share(wechatSp)
} else {
ToastUtil.show(wenshuApplication.getContext(), "请先安装微信")
ToastUtil.show(WenshuApplication.getContext(), "请先安装微信")
}
Timer().schedule(1000) {
......@@ -245,7 +245,7 @@ class ShareDialog(context: Context) : Dialog(context, R.style.dialog) {
mOnShareOKListener?.onShareOk()
wechatMoments.share(wechatSp)
} else {
ToastUtil.show(wenshuApplication.getContext(), "请先安装微信")
ToastUtil.show(WenshuApplication.getContext(), "请先安装微信")
}
Timer().schedule(1000) {
......
package com.wenshu.youyou.ui.widgets;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathMeasure;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.RectF;
import android.graphics.Shader;
import android.util.AttributeSet;
import android.view.View;
import com.wenshu.youyou.ui.widgets.seekbar.BubbleUtils;
import com.wenshu.youyou.utils.LogUtil;
@SuppressLint("DrawAllocation")
public class TickProgress extends View {
private static final long DURATION = 200;
private int mViewWidth;
private int mViewHeight;
private int mStrokeWidth;
private int mProgressWidth;
private Paint mBgPaint;
private Paint mProgressPaint;
private Paint mMackTickPaint;
private int mStrokeColor = Color.parseColor("#FB7C27");
private ValueAnimator.AnimatorUpdateListener mUpdateListener;
private ValueAnimator mAnimator;
// 动画数值(用于控制动画状态,因为同一时间内只允许有一种状态出现,具体数值处理取决于当前状态)
private float mAnimatorValue;
public TickProgress(Context context) {
this(context, null);
}
public TickProgress(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
private Paint mStrokePaint;
private int mHeight;
public TickProgress(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mHeight = BubbleUtils.dp2px(15);
mStrokeWidth = BubbleUtils.dp2px(1);
mBgPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mBgPaint.setStyle(Paint.Style.FILL);
mBgPaint.setStrokeWidth(mHeight);
mBgPaint.setColor(Color.parseColor("#D8D8D8"));
mStrokePaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mStrokePaint.setStyle(Paint.Style.STROKE);
mStrokePaint.setStrokeWidth(mStrokeWidth);
mStrokePaint.setColor(mStrokeColor);
mProgressPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mProgressPaint.setStrokeWidth(mHeight);
mProgressPaint.setStyle(Paint.Style.FILL);
mMackTickPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mMackTickPaint.setStyle(Paint.Style.STROKE);
mMackTickPaint.setStrokeWidth(mStrokeWidth);
mMackTickPaint.setColor(mStrokeColor);
setLayerType(LAYER_TYPE_HARDWARE, null);
}
private int mMackTickWidth;
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mViewHeight = h;
mViewWidth = w;
mMackTickWidth = w / 5;
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
setMeasuredDimension(widthMeasureSpec, mHeight);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
RectF rectF2 = new RectF(mStrokeWidth, mStrokeWidth, mViewWidth - mStrokeWidth, mHeight - mStrokeWidth);
canvas.drawRoundRect(rectF2, mHeight / 2, mHeight / 2, mBgPaint);
// canvas.drawRoundRect(rectF2, mHeight / 2, mHeight / 2, mStrokePaint);
RectF rectF1 = new RectF(mStrokeWidth / 2, mStrokeWidth / 2, mProgressWidth - mStrokeWidth / 2, mViewHeight - mStrokeWidth / 2);
Path path = new Path();
Path dstPath = new Path();
PathMeasure pathMeasure = new PathMeasure();
path.moveTo(0, 0);
path.lineTo(mViewWidth, 0);
pathMeasure.setPath(path, false);
pathMeasure.getSegment(0, pathMeasure.getLength() * mAnimatorValue, dstPath, true);
//渐变
Shader mShader = new LinearGradient(mStrokeWidth / 2, mStrokeWidth / 2, mProgressWidth, mHeight - mStrokeWidth / 2, Color.parseColor("#FBB643"), Color.parseColor("#FC802B"), Shader.TileMode.REPEAT);
//遮罩
mProgressPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
mProgressPaint.setShader(mShader);
canvas.drawRect(rectF1, mProgressPaint);
mProgressPaint.setXfermode(null);
//刻度
// for (int i = 0; i < 4; i++) {
// canvas.drawLine((i + 1) * mMackTickWidth, mStrokeWidth / 2, (i + 1) * mMackTickWidth, mViewHeight - mStrokeWidth / 2, mMackTickPaint);
// }
}
/**
* 0--1
*/
public void setProgress(float progress) {
if (progress < 0) {
progress = 0;
} else if (progress > 1) {
progress = 1;
}
int delta = (int) (progress / 0.1);
LogUtil.d("delta:" + delta);
delta = delta == 0 ? 1 : delta;
mProgressWidth = (int) (progress * mViewWidth);
mAnimator = ValueAnimator.ofFloat(0, progress).setDuration(delta * DURATION);
mUpdateListener = new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mAnimatorValue = (float) animation.getAnimatedValue();
mProgressWidth = (int) (mAnimatorValue * mViewWidth);
invalidate();
}
};
mAnimator.addUpdateListener(mUpdateListener);
mAnimator.start();
}
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ import android.content.pm.PackageManager
import android.os.Build
import android.provider.Settings
import android.text.TextUtils
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
/**
......@@ -38,7 +38,7 @@ object AppUtil {
* @return flag
*/
fun isHasUsageStats(): Boolean {
val packageManager: PackageManager = wenshuApplication.getContext().packageManager
val packageManager: PackageManager = WenshuApplication.getContext().packageManager
val intent = Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS)
val list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY)
return list.size > 0
......@@ -52,7 +52,7 @@ object AppUtil {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
val ts = System.currentTimeMillis()
val usageStatsManager =
wenshuApplication.getContext().getSystemService(Service.USAGE_STATS_SERVICE) as UsageStatsManager
WenshuApplication.getContext().getSystemService(Service.USAGE_STATS_SERVICE) as UsageStatsManager
val queryUsageStats = usageStatsManager.queryUsageStats(
UsageStatsManager.INTERVAL_BEST, 0, ts)
if (queryUsageStats == null || queryUsageStats.isEmpty()) {
......
......@@ -81,7 +81,7 @@ public class CacheUtil {
double kiloByte = size / 1024;
if (kiloByte < 1) {
// return size + "Byte";
return "0K";
return "0KB";
}
double megaByte = kiloByte / 1024;
......
......@@ -5,7 +5,7 @@ import android.content.SharedPreferences;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import java.io.UnsupportedEncodingException;
import java.util.UUID;
......@@ -23,7 +23,7 @@ public class DeviceUuidFactory {
protected static UUID uuid;
public DeviceUuidFactory() {
Context context= wenshuApplication.getContext();
Context context= WenshuApplication.getContext();
if (uuid == null) {
synchronized (DeviceUuidFactory.class) {
if (uuid == null) {
......
......@@ -3,7 +3,7 @@ package com.wenshu.youyou.utils
import android.app.Activity
import android.content.Intent
import android.net.Uri
import com.wenshu.youyou.wenshuApplication
import com.wenshu.youyou.WenshuApplication
object QQJumpUtil {
......@@ -21,7 +21,7 @@ object QQJumpUtil {
activity.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
} catch (e: Exception) {
// 未安装手Q或安装的版本不支持
ToastUtil.show(wenshuApplication.getContext(), "您还没有安装QQ,请先安装软件")
ToastUtil.show(WenshuApplication.getContext(), "您还没有安装QQ,请先安装软件")
}
}
......@@ -41,7 +41,7 @@ object QQJumpUtil {
activity.startActivity(intent)
} catch (e: java.lang.Exception) {
// 未安装手Q或安装的版本不支持
ToastUtil.show(wenshuApplication.getContext(), "您还没有安装QQ,请先安装软件")
ToastUtil.show(WenshuApplication.getContext(), "您还没有安装QQ,请先安装软件")
}
}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@ package com.wenshu.youyou.utils;
import android.content.Context;
import android.content.SharedPreferences;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import java.util.Map;
import java.util.Set;
......@@ -35,7 +35,7 @@ public class SPUtil {
public static SPUtil getInstance() {
if (spUtil == null) {
mContext = wenshuApplication.getContext();
mContext = WenshuApplication.getContext();
spUtil = new SPUtil();
mPreferences = mContext.getSharedPreferences(mShareName, Context.MODE_PRIVATE);
}
......
......@@ -5,7 +5,7 @@ import android.content.Context;
import android.media.MediaPlayer;
import android.media.SoundPool;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.R;
......@@ -17,7 +17,7 @@ public class SoundPoolUtil {
//单例模式
public static SoundPoolUtil getInstance() {
SoundPoolUtil.context = wenshuApplication.getContext();
SoundPoolUtil.context = WenshuApplication.getContext();
if (soundPoolUtil == null)
soundPoolUtil = new SoundPoolUtil(context);
return soundPoolUtil;
......
......@@ -30,7 +30,7 @@ import android.view.Window;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager;
import com.wenshu.youyou.wenshuApplication;
import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.common.Constant;
import java.io.File;
......@@ -114,7 +114,7 @@ public final class Utils {
* @return
*/
public static boolean isStartAccessibilityService() {
Context context = wenshuApplication.getContext();
Context context = WenshuApplication.getContext();
AccessibilityManager am = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
List<AccessibilityServiceInfo> serviceInfos = am.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC);
for (AccessibilityServiceInfo info : serviceInfos) {
......
......@@ -30,7 +30,7 @@
android:layout_height="wrap_content"
android:background="@color/color_F8F8F8"
android:stateListAnimator="@animator/appbar_elevation"
app:layout_behavior=".ui.widgets.FlingBehavior">
app:layout_behavior="com.wenshu.youyou.ui.widgets.FlingBehavior">
<LinearLayout
android:layout_width="match_parent"
......@@ -245,135 +245,6 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginStart="15dp"-->
<!-- android:layout_marginEnd="15dp"-->
<!-- android:layout_marginBottom="10dp"-->
<!-- android:background="@drawable/shape_gold_card"-->
<!-- android:elevation="2dip"-->
<!-- android:padding="15dp">-->
<!-- <TextView-->
<!-- android:id="@+id/textView"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="5dp"-->
<!-- android:text="亲友团成员"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="18sp"-->
<!-- app:layout_constraintBottom_toTopOf="@+id/line"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_detail"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="详情 >"-->
<!-- app:layout_constraintBottom_toBottomOf="@+id/textView"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="@+id/textView" />-->
<!-- <View-->
<!-- android:id="@+id/line"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="1dp"-->
<!-- android:layout_marginTop="15dp"-->
<!-- android:background="@color/color_F8F8F8"-->
<!-- app:layout_constraintTop_toBottomOf="@id/textView" />-->
<!-- <TextView-->
<!-- android:id="@+id/friends_sum"-->
<!-- android:layout_width="100dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="15dp"-->
<!-- android:gravity="center"-->
<!-- android:text="@string/dot"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="20sp"-->
<!-- app:layout_constraintEnd_toStartOf="@id/friends_directly_sum"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@id/line" />-->
<!-- <TextView-->
<!-- android:id="@+id/friends_tv"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="6dp"-->
<!-- android:text="总人数"-->
<!-- app:layout_constraintEnd_toEndOf="@+id/friends_sum"-->
<!-- app:layout_constraintStart_toStartOf="@+id/friends_sum"-->
<!-- app:layout_constraintTop_toBottomOf="@id/friends_sum" />-->
<!-- <TextView-->
<!-- android:id="@+id/friends_directly_sum"-->
<!-- android:layout_width="100dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="15dp"-->
<!-- android:gravity="center"-->
<!-- android:text="@string/dot"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="20sp"-->
<!-- app:layout_constraintEnd_toStartOf="@id/friends_indirect_sum"-->
<!-- app:layout_constraintStart_toEndOf="@id/friends_sum"-->
<!-- app:layout_constraintTop_toBottomOf="@id/line" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_friends_directly"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="6dp"-->
<!-- android:drawableEnd="@mipmap/ic_question"-->
<!-- android:drawablePadding="6dp"-->
<!-- android:text="直接亲友"-->
<!-- app:layout_constraintEnd_toEndOf="@+id/friends_directly_sum"-->
<!-- app:layout_constraintStart_toStartOf="@+id/friends_directly_sum"-->
<!-- app:layout_constraintTop_toBottomOf="@id/friends_directly_sum" />-->
<!-- <TextView-->
<!-- android:id="@+id/friends_indirect_sum"-->
<!-- android:layout_width="100dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="15dp"-->
<!-- android:gravity="center"-->
<!-- android:text="@string/dot"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="20sp"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toEndOf="@id/friends_directly_sum"-->
<!-- app:layout_constraintTop_toBottomOf="@id/line" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_friends_indirect"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="6dp"-->
<!-- android:drawablePadding="6dp"-->
<!-- android:text="间接亲友"-->
<!-- app:drawableEndCompat="@mipmap/ic_question"-->
<!-- app:layout_constraintEnd_toEndOf="@+id/friends_indirect_sum"-->
<!-- app:layout_constraintStart_toStartOf="@+id/friends_indirect_sum"-->
<!-- app:layout_constraintTop_toBottomOf="@id/friends_indirect_sum" />-->
<!-- <Button-->
<!-- android:id="@+id/btn_invite"-->
<!-- android:layout_width="160dp"-->
<!-- android:layout_height="40dp"-->
<!-- android:layout_marginTop="15dp"-->
<!-- android:layout_marginBottom="6dp"-->
<!-- android:background="@drawable/shape_btn_switch"-->
<!-- android:text="邀请亲友"-->
<!-- android:textColor="@color/white"-->
<!-- android:textSize="16sp"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@id/tv_friends_directly" />-->
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/inviteLayout"
......@@ -422,7 +293,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:drawablePadding="6dp"
android:text="您已邀请--人"
android:text="您已邀请-人"
android:textColor="@color/black"
app:drawableEndCompat="@mipmap/ic_question"
app:layout_constraintEnd_toEndOf="parent"
......@@ -454,7 +325,6 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<com.androidkun.xtablayout.XTabLayout
......
......@@ -16,8 +16,8 @@ org.gradle.jvmargs=-Xmx1536m
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#DEBUG_URL="http://39.97.65.143:9082/yy-api/"
DEBUG_URL="http://192.168.31.194:8101/"
DEBUG_URL="http://39.97.65.143:9082/yy-api/"
#DEBUG_URL="http://192.168.31.194:8101/"
RELEASE_URL="https://api.wenshu-id.com/yy-api/"
RELEASE_KEY_PASSWORD=mints.youyou
......
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