Commit 805a33c2 authored by jyx's avatar jyx

分红代码修改

parent f187d649
...@@ -6,7 +6,7 @@ android { ...@@ -6,7 +6,7 @@ android {
compileSdkVersion rootProject.ext.androidCompileSdkVersion compileSdkVersion rootProject.ext.androidCompileSdkVersion
buildToolsVersion rootProject.ext.androidBuildToolsVersion buildToolsVersion rootProject.ext.androidBuildToolsVersion
defaultConfig { defaultConfig {
applicationId "com.mints.youyou" applicationId "com.wenshu.youyou"
minSdkVersion rootProject.ext.androidMinSdkVersion minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 3 versionCode 3
...@@ -235,7 +235,6 @@ dependencies { ...@@ -235,7 +235,6 @@ dependencies {
// 瑞狮新闻 // 瑞狮新闻
implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+' implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
implementation(name: 'xrsdk-release_tbs', ext: 'aar') implementation(name: 'xrsdk-release_tbs', ext: 'aar')
// implementation(name: 'xrsharesdk-release_tbs', ext: 'aar')
implementation(name: 'windAd-2.25.0', 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-layout-kernel:2.0.3'
implementation 'com.scwang.smart:refresh-header-classics:2.0.3' implementation 'com.scwang.smart:refresh-header-classics:2.0.3'
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<uses-permission android:name="${applicationId}.permission.KW_SDK_BROADCAST" /> <uses-permission android:name="${applicationId}.permission.KW_SDK_BROADCAST" />
<application <application
android:name="com.wenshu.youyou.wenshuApplication" android:name="com.wenshu.youyou.WenshuApplication"
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher_main" android:icon="@mipmap/ic_launcher_main"
android:label="@string/app_name" android:label="@string/app_name"
......
...@@ -46,9 +46,9 @@ import rx.schedulers.Schedulers; ...@@ -46,9 +46,9 @@ import rx.schedulers.Schedulers;
* 作者:孟崔广 * 作者:孟崔广
* 时间:2020/10/09 11:40 * 时间: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 = ""; public static String OAID = "";
private static LocalBroadcastManager mLocalBroadcastManager; private static LocalBroadcastManager mLocalBroadcastManager;
...@@ -56,7 +56,7 @@ public class wenshuApplication extends MultiDexApplication { ...@@ -56,7 +56,7 @@ public class wenshuApplication extends MultiDexApplication {
private LoanService loanService; private LoanService loanService;
public static wenshuApplication getContext() { public static WenshuApplication getContext() {
return mContext; return mContext;
} }
...@@ -206,7 +206,7 @@ public class wenshuApplication extends MultiDexApplication { ...@@ -206,7 +206,7 @@ public class wenshuApplication extends MultiDexApplication {
* 参数4:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机。 * 参数4:设备类型,必须参数,传参数为UMConfigure.DEVICE_TYPE_PHONE则表示手机;传参数为UMConfigure.DEVICE_TYPE_BOX则表示盒子;默认为手机。
* 参数5:Push推送业务的secret,需要集成Push功能时必须传入Push的secret,否则传空。 * 参数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); UMConfigure.setLogEnabled(BuildConfig.DEBUG);
MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.LEGACY_MANUAL); MobclickAgent.setPageCollectionMode(MobclickAgent.PageMode.LEGACY_MANUAL);
} catch (Exception e) { } catch (Exception e) {
...@@ -221,7 +221,7 @@ public class wenshuApplication extends MultiDexApplication { ...@@ -221,7 +221,7 @@ public class wenshuApplication extends MultiDexApplication {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setAction(Constant.ACTION_EXIT_APP); intent.setAction(Constant.ACTION_EXIT_APP);
intent.addCategory(Intent.CATEGORY_DEFAULT); intent.addCategory(Intent.CATEGORY_DEFAULT);
wenshuApplication.getLocalBroadcastManager().sendBroadcast(intent); WenshuApplication.getLocalBroadcastManager().sendBroadcast(intent);
System.gc(); System.gc();
} }
......
...@@ -5,7 +5,7 @@ import android.widget.FrameLayout ...@@ -5,7 +5,7 @@ import android.widget.FrameLayout
import com.bytedance.sdk.openadsdk.AdSlot import com.bytedance.sdk.openadsdk.AdSlot
import com.bytedance.sdk.openadsdk.TTAdNative import com.bytedance.sdk.openadsdk.TTAdNative
import com.bytedance.sdk.openadsdk.TTNativeExpressAd 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.manager.TtCsjAdManager
import com.wenshu.youyou.utils.LogUtil import com.wenshu.youyou.utils.LogUtil
...@@ -18,17 +18,17 @@ object BannerManager { ...@@ -18,17 +18,17 @@ object BannerManager {
private var mTTAd: TTNativeExpressAd? = null private var mTTAd: TTNativeExpressAd? = null
fun init() { 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宽高 * 获取view宽高
*/ */
private fun getViewWidth(): Float { private fun getViewWidth(): Float {
val displayMetrics = wenshuApplication.getContext().resources.displayMetrics val displayMetrics = WenshuApplication.getContext().resources.displayMetrics
val density = displayMetrics.density val density = displayMetrics.density
// 屏幕宽度 - margin宽度 // 屏幕宽度 - margin宽度
val pxWidth = displayMetrics.widthPixels - (20 * density + 0.5f) val pxWidth = displayMetrics.widthPixels - (20 * density + 0.5f)
...@@ -49,7 +49,7 @@ object BannerManager { ...@@ -49,7 +49,7 @@ object BannerManager {
} }
} }
// ToastUtil.showLong(wenshuApplication.getContext(), "csj banner:$codeId") // ToastUtil.showLong(WenshuApplication.getContext(), "csj banner:$codeId")
adNative?.let { adNative?.let {
val adSlot = AdSlot.Builder() val adSlot = AdSlot.Builder()
......
...@@ -2,7 +2,7 @@ package com.wenshu.youyou.ad.download; ...@@ -2,7 +2,7 @@ package com.wenshu.youyou.ad.download;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.common.Constant; import com.wenshu.youyou.common.Constant;
import com.wenshu.youyou.manager.UserManager; import com.wenshu.youyou.manager.UserManager;
import com.wenshu.youyou.utils.LogUtil; import com.wenshu.youyou.utils.LogUtil;
...@@ -42,7 +42,7 @@ public final class CoralDownload { ...@@ -42,7 +42,7 @@ public final class CoralDownload {
// } // }
type = RELEASE_TASK_TYPE_RELEASE; type = RELEASE_TASK_TYPE_RELEASE;
new ADLoader(wenshuApplication.getContext()) new ADLoader(WenshuApplication.getContext())
.get(ADType.APP_DOWNLOAD) .get(ADType.APP_DOWNLOAD)
.from(ADSource.CORAL) .from(ADSource.CORAL)
.count(1) .count(1)
......
...@@ -12,7 +12,7 @@ import android.widget.TextView ...@@ -12,7 +12,7 @@ import android.widget.TextView
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.kwad.sdk.api.* import com.kwad.sdk.api.*
import com.kwad.sdk.api.KsNativeAd.VideoPlayListener 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.R
import com.wenshu.youyou.manager.KsManager import com.wenshu.youyou.manager.KsManager
import com.wenshu.youyou.utils.LogUtil import com.wenshu.youyou.utils.LogUtil
...@@ -25,7 +25,7 @@ object KsPreLoadExpressManager { ...@@ -25,7 +25,7 @@ object KsPreLoadExpressManager {
private var mADLoadSuccessListener: KSADLoadSuccessListener? = null private var mADLoadSuccessListener: KSADLoadSuccessListener? = null
private var mContext = wenshuApplication.getContext() private var mContext = WenshuApplication.getContext()
fun setListener(adLoadSuccessListener: KSADLoadSuccessListener?) { fun setListener(adLoadSuccessListener: KSADLoadSuccessListener?) {
mADLoadSuccessListener = adLoadSuccessListener mADLoadSuccessListener = adLoadSuccessListener
...@@ -183,7 +183,7 @@ object KsPreLoadExpressManager { ...@@ -183,7 +183,7 @@ object KsPreLoadExpressManager {
object : KsNativeAd.AdInteractionListener { object : KsNativeAd.AdInteractionListener {
override fun onAdClicked(view: View, ad: KsNativeAd) { override fun onAdClicked(view: View, ad: KsNativeAd) {
if (ad != null) { 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 { ...@@ -225,7 +225,7 @@ object KsPreLoadExpressManager {
adBaseViewHolder.mAppIcon.visibility = View.GONE adBaseViewHolder.mAppIcon.visibility = View.GONE
} else { } else {
adBaseViewHolder.mAppIcon.visibility = View.VISIBLE 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名称 // app名称
if (!TextUtils.isEmpty(ad.appName)) { if (!TextUtils.isEmpty(ad.appName)) {
......
...@@ -3,7 +3,7 @@ package com.wenshu.youyou.ad.express ...@@ -3,7 +3,7 @@ package com.wenshu.youyou.ad.express
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.FrameLayout import android.widget.FrameLayout
import com.wenshu.youyou.wenshuApplication import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.common.Constant import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.mvp.model.WeightBean import com.wenshu.youyou.mvp.model.WeightBean
import com.wenshu.youyou.utils.LogUtil import com.wenshu.youyou.utils.LogUtil
...@@ -29,7 +29,7 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener ...@@ -29,7 +29,7 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
private var ksWeight = 0 private var ksWeight = 0
init { init {
mAdFrameLayout = FrameLayout(wenshuApplication.getContext()) mAdFrameLayout = FrameLayout(WenshuApplication.getContext())
YlhPreLoadExpressManager.setListener(this) YlhPreLoadExpressManager.setListener(this)
TTPreLoadExpressManager.getInstance().setListener(this) TTPreLoadExpressManager.getInstance().setListener(this)
KsPreLoadExpressManager.setListener(this) KsPreLoadExpressManager.setListener(this)
...@@ -96,7 +96,7 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener ...@@ -96,7 +96,7 @@ object PreLoadExpressManager : TTADLoadSuccessListener, YLHADLoadSuccessListener
var randomWeight = r.nextInt(weight) + 1 var randomWeight = r.nextInt(weight) + 1
LogUtil.d(TAG, "2、权重随机值EXPRESS:$randomWeight") LogUtil.d(TAG, "2、权重随机值EXPRESS:$randomWeight")
// ToastUtil.show(wenshuApplication.getContext(), "权重随机值EXPRESS:" + randomWeight); // ToastUtil.show(WenshuApplication.getContext(), "权重随机值EXPRESS:" + randomWeight);
for (weightBean in weightList) { for (weightBean in weightList) {
randomWeight -= weightBean.weight randomWeight -= weightBean.weight
if (randomWeight <= 0) { if (randomWeight <= 0) {
......
...@@ -8,7 +8,7 @@ import android.widget.FrameLayout; ...@@ -8,7 +8,7 @@ import android.widget.FrameLayout;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.manager.TTNativeExpressManager; import com.wenshu.youyou.manager.TTNativeExpressManager;
public class TTPreLoadCarrierExpressManager { public class TTPreLoadCarrierExpressManager {
...@@ -75,7 +75,7 @@ public class TTPreLoadCarrierExpressManager { ...@@ -75,7 +75,7 @@ public class TTPreLoadCarrierExpressManager {
} }
private void loadTtFrameLayoutInThread(String codeId) { private void loadTtFrameLayoutInThread(String codeId) {
Context context = wenshuApplication.getContext(); Context context = WenshuApplication.getContext();
ttFrameLayout = null; ttFrameLayout = null;
try { try {
ttFrameLayout = new FrameLayout(context); ttFrameLayout = new FrameLayout(context);
...@@ -106,7 +106,7 @@ public class TTPreLoadCarrierExpressManager { ...@@ -106,7 +106,7 @@ public class TTPreLoadCarrierExpressManager {
public void loadTtFrameLayout(String codeId) { public void loadTtFrameLayout(String codeId) {
// init(); // init();
// ToastUtil.showLong(wenshuApplication.getContext(), "通用信息流:" + codeId); // ToastUtil.showLong(WenshuApplication.getContext(), "通用信息流:" + codeId);
if (mWorkHandler != null) { if (mWorkHandler != null) {
Message msg = Message.obtain(); Message msg = Message.obtain();
......
...@@ -3,7 +3,7 @@ package com.wenshu.youyou.ad.express; ...@@ -3,7 +3,7 @@ package com.wenshu.youyou.ad.express;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.widget.FrameLayout; 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.TTNativeExpressManager;
import com.wenshu.youyou.manager.TtCsjAdManager; import com.wenshu.youyou.manager.TtCsjAdManager;
...@@ -39,7 +39,7 @@ public class TTPreLoadExpressManager { ...@@ -39,7 +39,7 @@ public class TTPreLoadExpressManager {
} }
private float getViewWidth() { private float getViewWidth() {
DisplayMetrics displayMetrics = wenshuApplication.getContext().getResources().getDisplayMetrics(); DisplayMetrics displayMetrics = WenshuApplication.getContext().getResources().getDisplayMetrics();
float density = displayMetrics.density; float density = displayMetrics.density;
float pxWidth = displayMetrics.widthPixels - (50 * density + 0.5f); float pxWidth = displayMetrics.widthPixels - (50 * density + 0.5f);
float dpWidth = pxWidth / density + 0.5f; float dpWidth = pxWidth / density + 0.5f;
......
...@@ -3,7 +3,7 @@ package com.wenshu.youyou.ad.express; ...@@ -3,7 +3,7 @@ package com.wenshu.youyou.ad.express;
import android.content.Context; import android.content.Context;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.common.AppConfig; import com.wenshu.youyou.common.AppConfig;
import com.wenshu.youyou.manager.TTNativeExpressManager; import com.wenshu.youyou.manager.TTNativeExpressManager;
import com.wenshu.youyou.manager.TtCsjAdManager; import com.wenshu.youyou.manager.TtCsjAdManager;
...@@ -56,7 +56,7 @@ public class TTPreLoadExpressXmlyManager { ...@@ -56,7 +56,7 @@ public class TTPreLoadExpressXmlyManager {
init(); init();
Context context = wenshuApplication.getContext(); Context context = WenshuApplication.getContext();
ttFrameLayout = null; ttFrameLayout = null;
try { try {
ttFrameLayout = new FrameLayout(context); ttFrameLayout = new FrameLayout(context);
......
package com.wenshu.youyou.ad.express package com.wenshu.youyou.ad.express
import com.wenshu.youyou.BuildConfig 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.manager.YlhAdManager
import com.wenshu.youyou.utils.LogUtil import com.wenshu.youyou.utils.LogUtil
import com.qq.e.ads.nativ.ADSize import com.qq.e.ads.nativ.ADSize
...@@ -25,7 +25,7 @@ object YlhPreLoadExpressManager { ...@@ -25,7 +25,7 @@ object YlhPreLoadExpressManager {
fun loadYlhFrameLayout() { fun loadYlhFrameLayout() {
try { 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?) { override fun onNoAD(p0: AdError?) {
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
LogUtil.d("通用奖励 ylh:TTNativeExpressManager", "onError ${p0?.errorCode} ${p0?.errorMsg}") LogUtil.d("通用奖励 ylh:TTNativeExpressManager", "onError ${p0?.errorCode} ${p0?.errorMsg}")
......
...@@ -300,7 +300,7 @@ public class VideoAdingManager { ...@@ -300,7 +300,7 @@ public class VideoAdingManager {
Random r = new Random(); Random r = new Random();
int randomWeight = r.nextInt(weight) + 1; int randomWeight = r.nextInt(weight) + 1;
LogUtil.d(TAG, "2、权重随机值:" + randomWeight); LogUtil.d(TAG, "2、权重随机值:" + randomWeight);
// ToastUtil.show(wenshuApplication.getContext(),"权重随机值:" + randomWeight); // ToastUtil.show(WenshuApplication.getContext(),"权重随机值:" + randomWeight);
for (WeightBean weightBean : weightList) { for (WeightBean weightBean : weightList) {
randomWeight -= weightBean.getWeight(); randomWeight -= weightBean.getWeight();
if (randomWeight <= 0) { if (randomWeight <= 0) {
......
...@@ -120,7 +120,7 @@ public class YlhVideoAdManager extends BaseVideoAd { ...@@ -120,7 +120,7 @@ public class YlhVideoAdManager extends BaseVideoAd {
ylhPostId = YlhAdManager.INSTANCE.getYLH_AD_VEDIO_MOREDIALOG(); ylhPostId = YlhAdManager.INSTANCE.getYLH_AD_VEDIO_MOREDIALOG();
break; break;
} }
// ToastUtil.show(wenshuApplication.getContext(), "ylh vedio:" + ylhPostId); // ToastUtil.show(WenshuApplication.getContext(), "ylh vedio:" + ylhPostId);
if (rewardVideoAD != null) { if (rewardVideoAD != null) {
rewardVideoAD = null; rewardVideoAD = null;
} }
......
...@@ -17,7 +17,7 @@ import android.os.SystemClock ...@@ -17,7 +17,7 @@ import android.os.SystemClock
import android.provider.Settings import android.provider.Settings
import android.telephony.TelephonyManager import android.telephony.TelephonyManager
import android.text.TextUtils import android.text.TextUtils
import com.wenshu.youyou.wenshuApplication import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R import com.wenshu.youyou.R
import com.wenshu.youyou.utils.SimUtils import com.wenshu.youyou.utils.SimUtils
import com.wenshu.youyou.utils.StorageQueryUtil import com.wenshu.youyou.utils.StorageQueryUtil
...@@ -35,7 +35,7 @@ import java.util.* ...@@ -35,7 +35,7 @@ import java.util.*
class DeviceInfo private constructor() { class DeviceInfo private constructor() {
private var mContext: Context? = null private var mContext: Context? = null
private fun init() { private fun init() {
mContext = wenshuApplication.getContext() mContext = WenshuApplication.getContext()
} }
val proxyUrl: String? val proxyUrl: String?
...@@ -79,17 +79,17 @@ class DeviceInfo private constructor() { ...@@ -79,17 +79,17 @@ class DeviceInfo private constructor() {
// 判断是否使用单卡 (android10 获取不到双卡信息,只能获取单卡) // 判断是否使用单卡 (android10 获取不到双卡信息,只能获取单卡)
var needSingleSim = false var needSingleSim = false
// 卡1 // 卡1
val simStateBySlotIdx1 = SimUtils.getSimStateBySlotIdx(wenshuApplication.getContext(), 0) val simStateBySlotIdx1 = SimUtils.getSimStateBySlotIdx(WenshuApplication.getContext(), 0)
// 卡2 // 卡2
val simStateBySlotIdx2 = SimUtils.getSimStateBySlotIdx(wenshuApplication.getContext(), 1) val simStateBySlotIdx2 = SimUtils.getSimStateBySlotIdx(WenshuApplication.getContext(), 1)
if (simStateBySlotIdx1) { if (simStateBySlotIdx1) {
val providersName1 = SimUtils.getSimOperatorName2(wenshuApplication.getContext(), 0) val providersName1 = SimUtils.getSimOperatorName2(WenshuApplication.getContext(), 0)
if (TextUtils.equals(providersName1, "unknown")) { if (TextUtils.equals(providersName1, "unknown")) {
needSingleSim = true needSingleSim = true
sb.append(SimUtils.getSimOperatorNameBySingle(wenshuApplication.getContext()) + " ") sb.append(SimUtils.getSimOperatorNameBySingle(WenshuApplication.getContext()) + " ")
} else { } else {
sb.append("$providersName1 ") sb.append("$providersName1 ")
} }
...@@ -98,10 +98,10 @@ class DeviceInfo private constructor() { ...@@ -98,10 +98,10 @@ class DeviceInfo private constructor() {
} }
if (simStateBySlotIdx2) { if (simStateBySlotIdx2) {
val providersName2 = SimUtils.getSimOperatorName2(wenshuApplication.getContext(), 1) val providersName2 = SimUtils.getSimOperatorName2(WenshuApplication.getContext(), 1)
if (TextUtils.equals(providersName2, "unknown") && !needSingleSim) { if (TextUtils.equals(providersName2, "unknown") && !needSingleSim) {
sb.append(SimUtils.getSimOperatorNameBySingle(wenshuApplication.getContext()) + " ") sb.append(SimUtils.getSimOperatorNameBySingle(WenshuApplication.getContext()) + " ")
} else { } else {
sb.append("$providersName2") sb.append("$providersName2")
} }
...@@ -153,7 +153,7 @@ class DeviceInfo private constructor() { ...@@ -153,7 +153,7 @@ class DeviceInfo private constructor() {
*/ */
val totalStorage: String val totalStorage: String
get() { get() {
return StorageQueryUtil.getTotalStorageSize(wenshuApplication.getContext()) return StorageQueryUtil.getTotalStorageSize(WenshuApplication.getContext())
} }
/** /**
......
package com.wenshu.youyou.manager; 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.library.net.neterror.HttpResponseFunc;
import com.wenshu.youyou.mvp.model.BaseResponse; import com.wenshu.youyou.mvp.model.BaseResponse;
...@@ -20,11 +20,11 @@ public class AppHttpManager { ...@@ -20,11 +20,11 @@ public class AppHttpManager {
private static AppHttpManager _inst; private static AppHttpManager _inst;
private wenshuApplication application; private WenshuApplication application;
private Observable.Transformer exceptTransformer = null; private Observable.Transformer exceptTransformer = null;
public synchronized static AppHttpManager getInstance(wenshuApplication application) { public synchronized static AppHttpManager getInstance(WenshuApplication application) {
if (_inst != null) { if (_inst != null) {
return _inst; return _inst;
} else { } else {
...@@ -33,7 +33,7 @@ public class AppHttpManager { ...@@ -33,7 +33,7 @@ public class AppHttpManager {
} }
} }
private AppHttpManager(wenshuApplication application) { private AppHttpManager(WenshuApplication application) {
this.application = application; this.application = application;
return; return;
} }
......
...@@ -3,7 +3,7 @@ package com.wenshu.youyou.manager ...@@ -3,7 +3,7 @@ package com.wenshu.youyou.manager
import android.app.Activity import android.app.Activity
import android.content.Context import android.content.Context
import android.view.View import android.view.View
import com.wenshu.youyou.wenshuApplication import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R import com.wenshu.youyou.R
import com.wenshu.youyou.ui.widgets.CustomDialogAsApple import com.wenshu.youyou.ui.widgets.CustomDialogAsApple
import com.wenshu.youyou.ui.widgets.DialogListener import com.wenshu.youyou.ui.widgets.DialogListener
...@@ -17,11 +17,11 @@ import java.lang.ref.WeakReference ...@@ -17,11 +17,11 @@ import java.lang.ref.WeakReference
object AppTryPlayManager { object AppTryPlayManager {
fun toTryPlay(pkg: String) { fun toTryPlay(pkg: String) {
AppUtil.openThirdApp(wenshuApplication.getContext(), pkg) AppUtil.openThirdApp(WenshuApplication.getContext(), pkg)
} }
fun getTryPlayIsOK(pkg: String, useTime: Int): Boolean { 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) LogUtil.d("AppTryPlayManager -> " + timePkgUsed)
return timePkgUsed >= useTime return timePkgUsed >= useTime
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
//import com.dhcw.sdk.manager.BDAdvanceConfig //import com.dhcw.sdk.manager.BDAdvanceConfig
//import com.dhcw.sdk.manager.BDManager //import com.dhcw.sdk.manager.BDManager
//import com.wenshu.youyou.BuildConfig //import com.wenshu.youyou.BuildConfig
//import com.wenshu.youyou.wenshuApplication //import com.wenshu.youyou.WenshuApplication
//import com.wenshu.youyou.common.Constant //import com.wenshu.youyou.common.Constant
// //
///** ///**
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
// */ // */
// fun bindUserData() { // fun bindUserData() {
// try { // 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) { // } catch (e: Exception) {
// e.printStackTrace() // e.printStackTrace()
// } // }
......
package com.wenshu.youyou.manager 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.Constant
import com.wenshu.youyou.common.DeviceInfo import com.wenshu.youyou.common.DeviceInfo
import com.wenshu.youyou.net.CpdService import com.wenshu.youyou.net.CpdService
...@@ -69,7 +69,7 @@ object CpdManager { ...@@ -69,7 +69,7 @@ object CpdManager {
equipment.put("android_id", deviceInfo.androidId) equipment.put("android_id", deviceInfo.androidId)
equipment.put("imei", deviceInfo.iMEI) equipment.put("imei", deviceInfo.iMEI)
equipment.put("mac", deviceInfo.getMacAddress()) 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("ip", ip)
equipment.put("brand", deviceInfo.brand) equipment.put("brand", deviceInfo.brand)
equipment.put("model", deviceInfo.mobileModel) equipment.put("model", deviceInfo.mobileModel)
...@@ -103,7 +103,7 @@ object CpdManager { ...@@ -103,7 +103,7 @@ object CpdManager {
equipment.put("android_id", deviceInfo.androidId) equipment.put("android_id", deviceInfo.androidId)
equipment.put("imei", deviceInfo.iMEI) equipment.put("imei", deviceInfo.iMEI)
equipment.put("mac", deviceInfo.getMacAddress()) 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("ip", ip)
equipment.put("brand", deviceInfo.brand) equipment.put("brand", deviceInfo.brand)
equipment.put("model", deviceInfo.mobileModel) equipment.put("model", deviceInfo.mobileModel)
......
...@@ -15,7 +15,7 @@ import androidx.core.content.FileProvider ...@@ -15,7 +15,7 @@ import androidx.core.content.FileProvider
import com.downloader.Error import com.downloader.Error
import com.downloader.OnDownloadListener import com.downloader.OnDownloadListener
import com.downloader.PRDownloader import com.downloader.PRDownloader
import com.wenshu.youyou.wenshuApplication import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R import com.wenshu.youyou.R
import com.wenshu.youyou.ui.widgets.DownloadProgressDialog import com.wenshu.youyou.ui.widgets.DownloadProgressDialog
import com.wenshu.youyou.utils.CacheUtil import com.wenshu.youyou.utils.CacheUtil
...@@ -32,7 +32,7 @@ object DownloadApkManager { ...@@ -32,7 +32,7 @@ object DownloadApkManager {
private var mDownloadListener: OnMyDownloadListener? = null private var mDownloadListener: OnMyDownloadListener? = null
private var apkName = "" 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 canOnceInstallApk = false//8.0以上系统 防止首次授权时 未安装apk调用
private var activity: Activity? = null private var activity: Activity? = null
...@@ -85,7 +85,7 @@ object DownloadApkManager { ...@@ -85,7 +85,7 @@ object DownloadApkManager {
fun tryOnceInstallApk() { fun tryOnceInstallApk() {
try { try {
if (canOnceInstallApk && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (canOnceInstallApk && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val context = wenshuApplication.getContext() val context = WenshuApplication.getContext()
val haveInstallPermission = context.packageManager.canRequestPackageInstalls() val haveInstallPermission = context.packageManager.canRequestPackageInstalls()
if (haveInstallPermission) { if (haveInstallPermission) {
installApk() installApk()
...@@ -103,7 +103,7 @@ object DownloadApkManager { ...@@ -103,7 +103,7 @@ object DownloadApkManager {
downloadProgressDialog = DownloadProgressDialog(activity!!) downloadProgressDialog = DownloadProgressDialog(activity!!)
downloadProgressDialog!!.show() downloadProgressDialog!!.show()
val context = wenshuApplication.getContext() val context = WenshuApplication.getContext()
PRDownloader.download(url, cachePath, apkName) PRDownloader.download(url, cachePath, apkName)
.build() .build()
.setOnProgressListener { progress -> .setOnProgressListener { progress ->
...@@ -139,7 +139,7 @@ object DownloadApkManager { ...@@ -139,7 +139,7 @@ object DownloadApkManager {
*/ */
private fun preInstallApk() { private fun preInstallApk() {
if (activity == null) return if (activity == null) return
val context = wenshuApplication.getContext() val context = WenshuApplication.getContext()
// 8.0以上系统设置安装未知来源权限 // 8.0以上系统设置安装未知来源权限
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val haveInstallPermission = context.packageManager.canRequestPackageInstalls() val haveInstallPermission = context.packageManager.canRequestPackageInstalls()
......
...@@ -6,7 +6,7 @@ import android.text.TextUtils; ...@@ -6,7 +6,7 @@ import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import com.google.gson.JsonObject; 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.common.DeviceInfo;
import com.wenshu.youyou.mvp.model.BaseResponse; import com.wenshu.youyou.mvp.model.BaseResponse;
import com.wenshu.youyou.mvp.model.Device; import com.wenshu.youyou.mvp.model.Device;
...@@ -55,7 +55,7 @@ public class JpushManager { ...@@ -55,7 +55,7 @@ public class JpushManager {
} }
private void init() { private void init() {
c = wenshuApplication.getContext(); c = WenshuApplication.getContext();
} }
/** /**
...@@ -115,7 +115,7 @@ public class JpushManager { ...@@ -115,7 +115,7 @@ public class JpushManager {
* @param jsondata * @param jsondata
*/ */
public void userBindingJpush(String jsondata) { public void userBindingJpush(String jsondata) {
wenshuApplication loanApplication = (wenshuApplication) this.c; WenshuApplication loanApplication = (WenshuApplication) this.c;
LoanService loanService = loanApplication.getLoanService(); LoanService loanService = loanApplication.getLoanService();
HashMap<String, Object> vo = new HashMap<>(); HashMap<String, Object> vo = new HashMap<>();
......
...@@ -25,16 +25,16 @@ public class MiitHelper implements IIdentifierListener { ...@@ -25,16 +25,16 @@ public class MiitHelper implements IIdentifierListener {
long timee = System.currentTimeMillis(); long timee = System.currentTimeMillis();
long offset = timee - timeb; long offset = timee - timeb;
// if (nres == ErrorCode.INIT_ERROR_DEVICE_NOSUPPORT) {//1008612 不支持的设备 // 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 加载配置文件出错 // } 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 不支持的设备厂商 // } 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 获取接口是异步的,结果会在回调中返回,回调执行的回调可能在工作线程 // } else if (nres == ErrorCode.INIT_ERROR_RESULT_DELAY) {//1008614 获取接口是异步的,结果会在回调中返回,回调执行的回调可能在工作线程
// //TODO 这种情况,还不清楚怎么解决呢。暂且先返false // //TODO 这种情况,还不清楚怎么解决呢。暂且先返false
// wenshuApplication.setIsSupportOaid(false, nres); // WenshuApplication.setIsSupportOaid(false, nres);
// } else if (nres == ErrorCode.INIT_HELPER_CALL_ERROR) {//1008615 反射调用出错 // } 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)); Log.d(getClass().getSimpleName(), "return value: " + String.valueOf(nres));
...@@ -66,7 +66,7 @@ public class MiitHelper implements IIdentifierListener { ...@@ -66,7 +66,7 @@ public class MiitHelper implements IIdentifierListener {
builder.append("AAID: ").append(aaid).append("\n"); builder.append("AAID: ").append(aaid).append("\n");
String idstext=builder.toString();*/ String idstext=builder.toString();*/
// wenshuApplication.setIsSupportOaid(isSupport); // WenshuApplication.setIsSupportOaid(isSupport);
String oaid = _supplier.getOAID(); String oaid = _supplier.getOAID();
// _supplier.shutDown(); //关闭接口 // _supplier.shutDown(); //关闭接口
......
...@@ -13,7 +13,7 @@ import android.widget.RemoteViews; ...@@ -13,7 +13,7 @@ import android.widget.RemoteViews;
import androidx.core.app.NotificationCompat; import androidx.core.app.NotificationCompat;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.R; import com.wenshu.youyou.R;
import com.wenshu.youyou.ui.activitys.MainActivity; import com.wenshu.youyou.ui.activitys.MainActivity;
import com.wenshu.youyou.utils.SpanUtils; import com.wenshu.youyou.utils.SpanUtils;
...@@ -111,7 +111,7 @@ public class NotifyManager { ...@@ -111,7 +111,7 @@ public class NotifyManager {
* @param step * @param step
*/ */
public void updateRemoteView(int water, int step) { public void updateRemoteView(int water, int step) {
Context context = wenshuApplication.getContext(); Context context = WenshuApplication.getContext();
if (remoteViews != null && context != null) { if (remoteViews != null && context != null) {
remoteViews.setTextViewText(R.id.notify_step, remoteViews.setTextViewText(R.id.notify_step,
new SpanUtils() new SpanUtils()
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
//import com.fly.scenemodule.SceneUtil //import com.fly.scenemodule.SceneUtil
//import com.fly.scenemodule.model.GDTInfo //import com.fly.scenemodule.model.GDTInfo
//import com.fly.scenemodule.model.TTInfo //import com.fly.scenemodule.model.TTInfo
//import com.wenshu.youyou.wenshuApplication //import com.wenshu.youyou.WenshuApplication
//import com.wenshu.youyou.common.AppConfig //import com.wenshu.youyou.common.AppConfig
// //
///** ///**
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
// val userId = UserManager.getInstance().userID // val userId = UserManager.getInstance().userID
// //
// // 初始化聚乐云 // // 初始化聚乐云
// SceneUtil.initSdk(SCENE_CHANNEL_Id, userId, wenshuApplication.OAID) // SceneUtil.initSdk(SCENE_CHANNEL_Id, userId, WenshuApplication.OAID)
// //
// //穿山甲------- // //穿山甲-------
// val ttInfo = TTInfo() // val ttInfo = TTInfo()
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
// */ // */
// fun signIn(activity: Activity) { // fun signIn(activity: Activity) {
// if (!TextUtils.isEmpty(UserManager.getInstance().userID)) { // 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 // AppConfig.scene_flag = true
// } // }
// } // }
......
...@@ -5,7 +5,7 @@ import android.content.Context; ...@@ -5,7 +5,7 @@ import android.content.Context;
import android.text.TextUtils; import android.text.TextUtils;
import com.ishumei.smantifraud.SmAntiFraud; import com.ishumei.smantifraud.SmAntiFraud;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
/** /**
* 描述:数美反欺诈 * 描述:数美反欺诈
...@@ -48,7 +48,7 @@ public class ShumeiManager { ...@@ -48,7 +48,7 @@ public class ShumeiManager {
} }
private void init() { private void init() {
context = wenshuApplication.getContext(); context = WenshuApplication.getContext();
} }
/** /**
......
...@@ -9,7 +9,7 @@ import com.bytedance.sdk.openadsdk.TTAdConstant; ...@@ -9,7 +9,7 @@ import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTAdManager; import com.bytedance.sdk.openadsdk.TTAdManager;
import com.bytedance.sdk.openadsdk.TTAdNative; import com.bytedance.sdk.openadsdk.TTAdNative;
import com.bytedance.sdk.openadsdk.TTNativeExpressAd; import com.bytedance.sdk.openadsdk.TTNativeExpressAd;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.utils.LogUtil; import com.wenshu.youyou.utils.LogUtil;
import java.util.List; import java.util.List;
...@@ -36,7 +36,7 @@ public class TTNativeExpressManager { ...@@ -36,7 +36,7 @@ public class TTNativeExpressManager {
* 穿山甲权限初始化 * 穿山甲权限初始化
*/ */
public TTAdNative initTTAd(boolean permission) { public TTAdNative initTTAd(boolean permission) {
Context context= wenshuApplication.getContext(); Context context= WenshuApplication.getContext();
//step1:初始化sdk //step1:初始化sdk
TTAdManager ttAdManager = TtCsjAdManager.get(); TTAdManager ttAdManager = TtCsjAdManager.get();
//step2:(可选,强烈建议在合适的时机调用):申请部分权限,如read_phone_state,防止获取不了imei时候,下载类广告没有填充的问题。 //step2:(可选,强烈建议在合适的时机调用):申请部分权限,如read_phone_state,防止获取不了imei时候,下载类广告没有填充的问题。
...@@ -67,9 +67,9 @@ public class TTNativeExpressManager { ...@@ -67,9 +67,9 @@ public class TTNativeExpressManager {
* @param viewHeight * @param viewHeight
*/ */
private void getTtNativeExpress(String codeId, FrameLayout view, float viewWidth, float 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,具体参数含义参考文档 //step4:创建广告请求参数AdSlot,具体参数含义参考文档
AdSlot adSlot = new AdSlot.Builder() AdSlot adSlot = new AdSlot.Builder()
.setCodeId(codeId) //广告位id .setCodeId(codeId) //广告位id
......
...@@ -4,7 +4,7 @@ package com.wenshu.youyou.manager; ...@@ -4,7 +4,7 @@ package com.wenshu.youyou.manager;
import android.app.Activity; import android.app.Activity;
import android.text.TextUtils; import android.text.TextUtils;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.common.AppConfig; import com.wenshu.youyou.common.AppConfig;
import com.wenshu.youyou.mvp.presenters.TrackPresenter; import com.wenshu.youyou.mvp.presenters.TrackPresenter;
...@@ -36,7 +36,7 @@ public class TrackManager { ...@@ -36,7 +36,7 @@ public class TrackManager {
private void init() { private void init() {
trackPresenter = new TrackPresenter(); trackPresenter = new TrackPresenter();
trackPresenter.attachView(wenshuApplication.getContext()); trackPresenter.attachView(WenshuApplication.getContext());
} }
/** /**
......
package com.wenshu.youyou.manager package com.wenshu.youyou.manager
import android.app.Application import android.app.Application
import com.wenshu.youyou.wenshuApplication import com.wenshu.youyou.WenshuApplication
import com.wenshu.library.utils.CommonUtils import com.wenshu.library.utils.CommonUtils
import com.tz.sdk.core.engine.ADEngine import com.tz.sdk.core.engine.ADEngine
import com.tz.sdk.core.engine.ADEngineConfig import com.tz.sdk.core.engine.ADEngineConfig
...@@ -23,7 +23,7 @@ object TzManager { ...@@ -23,7 +23,7 @@ object TzManager {
.start(ADEngineConfig.Builder(application) .start(ADEngineConfig.Builder(application)
.appKey(APP_KEY) .appKey(APP_KEY)
.appSecret(APP_SECRET) .appSecret(APP_SECRET)
.appChannel(CommonUtils.getAppMetaData(wenshuApplication.getContext(), "CHANNEL_NAME")) .appChannel(CommonUtils.getAppMetaData(WenshuApplication.getContext(), "CHANNEL_NAME"))
.forTest(false) .forTest(false)
.build(), .build(),
object : IADEngineState { object : IADEngineState {
......
...@@ -2,7 +2,7 @@ package com.wenshu.youyou.manager; ...@@ -2,7 +2,7 @@ package com.wenshu.youyou.manager;
import android.text.TextUtils; 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.mvp.model.UserBean;
import com.wenshu.youyou.utils.PreferencesService; import com.wenshu.youyou.utils.PreferencesService;
...@@ -97,7 +97,7 @@ public class UserManager { ...@@ -97,7 +97,7 @@ public class UserManager {
} }
private void init() { private void init() {
ps = PreferencesService.getInstance(wenshuApplication.getContext()); ps = PreferencesService.getInstance(WenshuApplication.getContext());
} }
/** /**
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
//import android.text.TextUtils //import android.text.TextUtils
//import com.component.dly.xzzq_ywsdk.YwSDK.Companion.setDebugMode //import com.component.dly.xzzq_ywsdk.YwSDK.Companion.setDebugMode
//import com.wenshu.youyou.BuildConfig //import com.wenshu.youyou.BuildConfig
//import com.wenshu.youyou.wenshuApplication //import com.wenshu.youyou.WenshuApplication
// //
///** ///**
// * 描述:鱼丸盒子游戏 // * 描述:鱼丸盒子游戏
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
// } // }
// var oaid: String = "" // var oaid: String = ""
// if (Build.VERSION.SDK_INT > 28) { // if (Build.VERSION.SDK_INT > 28) {
// if (!TextUtils.isEmpty(wenshuApplication.OAID)) { // if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
// oaid = wenshuApplication.OAID // oaid = WenshuApplication.OAID
// } // }
// } // }
// setDebugMode() // 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; ...@@ -4,7 +4,7 @@ import android.text.TextUtils;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; 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.Constant;
import com.wenshu.youyou.common.DeviceInfo; import com.wenshu.youyou.common.DeviceInfo;
import com.wenshu.youyou.manager.AppHttpManager; import com.wenshu.youyou.manager.AppHttpManager;
...@@ -104,8 +104,8 @@ public class AwardPresenter extends BasePresenter<AwardView> { ...@@ -104,8 +104,8 @@ public class AwardPresenter extends BasePresenter<AwardView> {
vo.put("osversion", deviceInfo.getOSVersion()); vo.put("osversion", deviceInfo.getOSVersion());
vo.put("appversion", deviceInfo.getVersionName()); vo.put("appversion", deviceInfo.getVersionName());
vo.put("appPkgList", getT()); vo.put("appPkgList", getT());
if (!TextUtils.isEmpty(wenshuApplication.OAID)) { if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
vo.put("oaid", wenshuApplication.OAID); vo.put("oaid", WenshuApplication.OAID);
} }
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo), .call(loanService.saveTerminalInfo(vo),
...@@ -226,7 +226,7 @@ public class AwardPresenter extends BasePresenter<AwardView> { ...@@ -226,7 +226,7 @@ public class AwardPresenter extends BasePresenter<AwardView> {
vo.put("operator", deviceInfo.getOperator()); vo.put("operator", deviceInfo.getOperator());
vo.put("idfa", ""); vo.put("idfa", "");
vo.put("imei", deviceInfo.getIMEI()); vo.put("imei", deviceInfo.getIMEI());
vo.put("oaid", wenshuApplication.OAID); vo.put("oaid", WenshuApplication.OAID);
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.riskinfo(vo), .call(loanService.riskinfo(vo),
......
package com.wenshu.youyou.mvp.presenters; 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.mvp.views.BaseView;
import com.wenshu.youyou.net.LoanService; import com.wenshu.youyou.net.LoanService;
...@@ -14,7 +14,7 @@ import rx.Subscription; ...@@ -14,7 +14,7 @@ import rx.Subscription;
*/ */
public class BasePresenter<V extends BaseView> implements Presenter<V> { public class BasePresenter<V extends BaseView> implements Presenter<V> {
protected wenshuApplication loanApplication; protected WenshuApplication loanApplication;
protected LoanService loanService; protected LoanService loanService;
protected V view; protected V view;
......
package com.wenshu.youyou.mvp.presenters; package com.wenshu.youyou.mvp.presenters;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.net.LoanService; import com.wenshu.youyou.net.LoanService;
import rx.Subscription; import rx.Subscription;
...@@ -11,15 +11,15 @@ import rx.Subscription; ...@@ -11,15 +11,15 @@ import rx.Subscription;
* 时间:2018/1/10 17:51 * 时间:2018/1/10 17:51
* 邮箱:mengcga@163.com * 邮箱: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 LoanService loanService;
protected Subscription subscription; protected Subscription subscription;
@Override @Override
public void attachView(wenshuApplication loanApplication) { public void attachView(WenshuApplication loanApplication) {
this.loanApplication = loanApplication; this.loanApplication = loanApplication;
loanService = loanApplication.getLoanService(); loanService = loanApplication.getLoanService();
} }
......
...@@ -3,7 +3,7 @@ package com.wenshu.youyou.mvp.presenters; ...@@ -3,7 +3,7 @@ package com.wenshu.youyou.mvp.presenters;
import android.text.TextUtils; import android.text.TextUtils;
import com.google.gson.JsonObject; 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.Constant;
import com.wenshu.youyou.common.DeviceInfo; import com.wenshu.youyou.common.DeviceInfo;
import com.wenshu.youyou.manager.AppHttpManager; import com.wenshu.youyou.manager.AppHttpManager;
...@@ -148,8 +148,8 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> { ...@@ -148,8 +148,8 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
vo.put("osversion", deviceInfo.getOSVersion()); vo.put("osversion", deviceInfo.getOSVersion());
vo.put("appversion", deviceInfo.getVersionName()); vo.put("appversion", deviceInfo.getVersionName());
vo.put("appPkgList", getT()); vo.put("appPkgList", getT());
if (!TextUtils.isEmpty(wenshuApplication.OAID)) { if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
vo.put("oaid", wenshuApplication.OAID); vo.put("oaid", WenshuApplication.OAID);
} }
riskinfo(deviceInfo, getT()); riskinfo(deviceInfo, getT());
...@@ -333,7 +333,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> { ...@@ -333,7 +333,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
vo.put("operator", deviceInfo.getOperator()); vo.put("operator", deviceInfo.getOperator());
vo.put("idfa", ""); vo.put("idfa", "");
vo.put("imei", deviceInfo.getIMEI()); vo.put("imei", deviceInfo.getIMEI());
vo.put("oaid", wenshuApplication.OAID); vo.put("oaid", WenshuApplication.OAID);
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.riskinfo(vo), .call(loanService.riskinfo(vo),
......
...@@ -7,6 +7,7 @@ import com.wenshu.youyou.mvp.model.FriendHallMsgBean ...@@ -7,6 +7,7 @@ import com.wenshu.youyou.mvp.model.FriendHallMsgBean
import com.wenshu.youyou.mvp.views.FriendsView import com.wenshu.youyou.mvp.views.FriendsView
import com.wenshu.library.net.neterror.BaseSubscriber import com.wenshu.library.net.neterror.BaseSubscriber
import com.wenshu.library.net.neterror.Throwable import com.wenshu.library.net.neterror.Throwable
import com.wenshu.youyou.mvp.model.CashoutChallengeBean
class FriendsPresenter : BasePresenter<FriendsView>() { class FriendsPresenter : BasePresenter<FriendsView>() {
...@@ -15,7 +16,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() { ...@@ -15,7 +16,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
*/ */
fun getFriendHallMsg() { fun getFriendHallMsg() {
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.friendHallMsg(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() { .call(
loanService.friendHallMsg(),
object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
...@@ -47,7 +50,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() { ...@@ -47,7 +50,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
*/ */
fun getContributionLeaders() { fun getContributionLeaders() {
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.contributionLeaders(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() { .call(
loanService.contributionLeaders(),
object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
...@@ -80,7 +85,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() { ...@@ -80,7 +85,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
*/ */
fun getContributionBigLeaders() { fun getContributionBigLeaders() {
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.contributionBigLeaders(), object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() { .call(
loanService.contributionBigLeaders(),
object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
...@@ -112,7 +119,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() { ...@@ -112,7 +119,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
*/ */
fun getFriendsGiveTodayList() { fun getFriendsGiveTodayList() {
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.friendsGiveTodayList, object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() { .call(
loanService.friendsGiveTodayList,
object : BaseSubscriber<BaseResponse<FriendHallMsgBean>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
...@@ -144,7 +153,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() { ...@@ -144,7 +153,9 @@ class FriendsPresenter : BasePresenter<FriendsView>() {
*/ */
fun getContributionOutToCash() { fun getContributionOutToCash() {
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.contributionOutToCash(), object : BaseSubscriber<BaseResponse<JsonObject>>() { .call(
loanService.contributionOutToCash(),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
view.hideLoading() view.hideLoading()
...@@ -171,6 +182,43 @@ class FriendsPresenter : BasePresenter<FriendsView>() { ...@@ -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 package com.wenshu.youyou.mvp.presenters
import android.text.TextUtils 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.Constant
import com.wenshu.youyou.common.DeviceInfo import com.wenshu.youyou.common.DeviceInfo
import com.wenshu.youyou.manager.AppHttpManager import com.wenshu.youyou.manager.AppHttpManager
...@@ -35,7 +35,7 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -35,7 +35,7 @@ class HomePresenter : BasePresenter<HomeView>() {
vo["mac1"] = macAddress vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null) vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI vo["imei"] = deviceInfo.iMEI
vo["oaid"] = wenshuApplication.OAID vo["oaid"] = WenshuApplication.OAID
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.newModel vo["model"] = deviceInfo.newModel
vo["uuid"] = DeviceUuidFactory().deviceUuid vo["uuid"] = DeviceUuidFactory().deviceUuid
...@@ -166,8 +166,8 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -166,8 +166,8 @@ class HomePresenter : BasePresenter<HomeView>() {
vo["mac1"] = macAddress vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null) vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI vo["imei"] = deviceInfo.iMEI
if (!TextUtils.isEmpty(wenshuApplication.OAID)) { if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
vo["oaid"] = wenshuApplication.OAID vo["oaid"] = WenshuApplication.OAID
} }
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.newModel vo["model"] = deviceInfo.newModel
......
package com.wenshu.youyou.mvp.presenters package com.wenshu.youyou.mvp.presenters
import android.text.TextUtils 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.Constant
import com.wenshu.youyou.common.DeviceInfo import com.wenshu.youyou.common.DeviceInfo
import com.wenshu.youyou.manager.AppHttpManager import com.wenshu.youyou.manager.AppHttpManager
...@@ -240,8 +240,8 @@ class LoginPresenter : BasePresenter<LoginView>() { ...@@ -240,8 +240,8 @@ class LoginPresenter : BasePresenter<LoginView>() {
vo["mac1"] = macAddress vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null) vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI vo["imei"] = deviceInfo.iMEI
if (!TextUtils.isEmpty(wenshuApplication.OAID)) { if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
vo["oaid"] = wenshuApplication.OAID vo["oaid"] = WenshuApplication.OAID
} }
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.newModel vo["model"] = deviceInfo.newModel
...@@ -303,7 +303,7 @@ class LoginPresenter : BasePresenter<LoginView>() { ...@@ -303,7 +303,7 @@ class LoginPresenter : BasePresenter<LoginView>() {
vo["operator"] = deviceInfo.operator vo["operator"] = deviceInfo.operator
vo["idfa"] = "" vo["idfa"] = ""
vo["imei"] = deviceInfo.iMEI vo["imei"] = deviceInfo.iMEI
vo["oaid"] = wenshuApplication.OAID vo["oaid"] = WenshuApplication.OAID
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.riskinfo(vo), .call(loanService.riskinfo(vo),
......
package com.wenshu.youyou.mvp.presenters package com.wenshu.youyou.mvp.presenters
import android.text.TextUtils 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.Constant
import com.wenshu.youyou.common.DeviceInfo import com.wenshu.youyou.common.DeviceInfo
import com.wenshu.youyou.manager.AppHttpManager import com.wenshu.youyou.manager.AppHttpManager
...@@ -77,7 +77,9 @@ open class MyPresenter : BasePresenter<MyView>() { ...@@ -77,7 +77,9 @@ open class MyPresenter : BasePresenter<MyView>() {
vo["isAndroid10"] = TextUtils.isEmpty(DeviceInfo.instance.iMEI) vo["isAndroid10"] = TextUtils.isEmpty(DeviceInfo.instance.iMEI)
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.getAutoUserHallBaseMsg(vo), object : BaseSubscriber<BaseResponse<MyInfo>>() { .call(
loanService.getAutoUserHallBaseMsg(vo),
object : BaseSubscriber<BaseResponse<MyInfo>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) if (isLinkView)
...@@ -189,8 +191,8 @@ open class MyPresenter : BasePresenter<MyView>() { ...@@ -189,8 +191,8 @@ open class MyPresenter : BasePresenter<MyView>() {
vo["mac1"] = macAddress vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null) vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI vo["imei"] = deviceInfo.iMEI
if (!TextUtils.isEmpty(wenshuApplication.OAID)) { if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
vo["oaid"] = wenshuApplication.OAID vo["oaid"] = WenshuApplication.OAID
} }
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.newModel vo["model"] = deviceInfo.newModel
...@@ -228,7 +230,9 @@ open class MyPresenter : BasePresenter<MyView>() { ...@@ -228,7 +230,9 @@ open class MyPresenter : BasePresenter<MyView>() {
vo["carrierType"] = Constant.CHALLENGE_SHAREFRIEND vo["carrierType"] = Constant.CHALLENGE_SHAREFRIEND
vo["value"] = "1" vo["value"] = "1"
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.setStatusInOneDayByCarrierType(vo), object : BaseSubscriber<BaseResponse<Any>>() { .call(
loanService.setStatusInOneDayByCarrierType(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
} }
...@@ -247,7 +251,7 @@ open class MyPresenter : BasePresenter<MyView>() { ...@@ -247,7 +251,7 @@ open class MyPresenter : BasePresenter<MyView>() {
} }
fun setHighTaskType(carrierType: String, value: String) { fun setHighTaskType(carrierType: String, value: String) {
this.setHighTaskType(carrierType,value,"") this.setHighTaskType(carrierType, value, "")
} }
/** /**
...@@ -263,7 +267,9 @@ open class MyPresenter : BasePresenter<MyView>() { ...@@ -263,7 +267,9 @@ open class MyPresenter : BasePresenter<MyView>() {
vo["key"] = key vo["key"] = key
} }
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.setStatusInOneDayByCarrierType(vo), object : BaseSubscriber<BaseResponse<Any>>() { .call(
loanService.setStatusInOneDayByCarrierType(vo),
object : BaseSubscriber<BaseResponse<Any>>() {
override fun onCompleted() { override fun onCompleted() {
if (isLinkView) return if (isLinkView) return
} }
...@@ -309,4 +315,28 @@ open class MyPresenter : BasePresenter<MyView>() { ...@@ -309,4 +315,28 @@ open class MyPresenter : BasePresenter<MyView>() {
}) })
} }
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 package com.wenshu.youyou.mvp.presenters
import android.text.TextUtils import android.text.TextUtils
import com.wenshu.youyou.wenshuApplication import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.common.DeviceInfo import com.wenshu.youyou.common.DeviceInfo
import com.wenshu.library.net.neterror.BaseSubscriber import com.wenshu.library.net.neterror.BaseSubscriber
import com.wenshu.library.net.neterror.Throwable import com.wenshu.library.net.neterror.Throwable
...@@ -63,8 +63,8 @@ class PanPresenter : BasePresenter<PanView>() { ...@@ -63,8 +63,8 @@ class PanPresenter : BasePresenter<PanView>() {
vo["mac1"] = macAddress vo["mac1"] = macAddress
vo["androidid"] = deviceInfo.getAndroidId(null) vo["androidid"] = deviceInfo.getAndroidId(null)
vo["imei"] = deviceInfo.iMEI vo["imei"] = deviceInfo.iMEI
if (!TextUtils.isEmpty(wenshuApplication.OAID)) { if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
vo["oaid"] = wenshuApplication.OAID vo["oaid"] = WenshuApplication.OAID
} }
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.newModel vo["model"] = deviceInfo.newModel
......
...@@ -3,7 +3,7 @@ package com.wenshu.youyou.mvp.presenters; ...@@ -3,7 +3,7 @@ package com.wenshu.youyou.mvp.presenters;
import android.app.Activity; import android.app.Activity;
import com.google.gson.JsonObject; 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.AppConfig;
import com.wenshu.youyou.common.Constant; import com.wenshu.youyou.common.Constant;
import com.wenshu.youyou.manager.AppHttpManager; import com.wenshu.youyou.manager.AppHttpManager;
...@@ -284,7 +284,7 @@ public class TrackPresenter extends BaseTrackPresenter { ...@@ -284,7 +284,7 @@ public class TrackPresenter extends BaseTrackPresenter {
if (activity == null) if (activity == null)
return; return;
loanApplication = (wenshuApplication) activity.getApplication(); loanApplication = (WenshuApplication) activity.getApplication();
loanService = loanApplication.getLoanService(); loanService = loanApplication.getLoanService();
subscription = loanService.reportAddCoinMsg(vo) subscription = loanService.reportAddCoinMsg(vo)
......
package com.wenshu.youyou.mvp.presenters package com.wenshu.youyou.mvp.presenters
import android.app.Activity 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.model.BaseResponse
import com.wenshu.youyou.mvp.views.VideoAdManagerView import com.wenshu.youyou.mvp.views.VideoAdManagerView
import com.wenshu.library.net.neterror.BaseSubscriber import com.wenshu.library.net.neterror.BaseSubscriber
...@@ -13,7 +13,7 @@ class TzVideoAdPresenter : BasePresenter<VideoAdManagerView>() { ...@@ -13,7 +13,7 @@ class TzVideoAdPresenter : BasePresenter<VideoAdManagerView>() {
fun reportAddCoinMsg(activity: Activity?, vo: HashMap<String, Any>) { fun reportAddCoinMsg(activity: Activity?, vo: HashMap<String, Any>) {
if (activity == null) return if (activity == null) return
loanApplication = activity.application as wenshuApplication loanApplication = activity.application as WenshuApplication
loanService = loanApplication.loanService loanService = loanApplication.loanService
subscription = loanService.reportAddCoinMsg(vo) subscription = loanService.reportAddCoinMsg(vo)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
......
...@@ -20,7 +20,7 @@ import android.widget.ImageView; ...@@ -20,7 +20,7 @@ import android.widget.ImageView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.R; import com.wenshu.youyou.R;
import com.wenshu.youyou.common.AppConfig; import com.wenshu.youyou.common.AppConfig;
import com.wenshu.youyou.common.Constant; import com.wenshu.youyou.common.Constant;
...@@ -49,7 +49,7 @@ import rx.android.schedulers.AndroidSchedulers; ...@@ -49,7 +49,7 @@ import rx.android.schedulers.AndroidSchedulers;
*/ */
public class VersionUpdatePresenter { public class VersionUpdatePresenter {
private wenshuApplication loanApplication; private WenshuApplication loanApplication;
private LoanService loanService; private LoanService loanService;
private AlertDialog dialogDetails; private AlertDialog dialogDetails;
private String version; private String version;
...@@ -66,13 +66,13 @@ public class VersionUpdatePresenter { ...@@ -66,13 +66,13 @@ public class VersionUpdatePresenter {
return; return;
this.activity = activity; this.activity = activity;
loanApplication = (wenshuApplication) activity.getApplication(); loanApplication = (WenshuApplication) activity.getApplication();
version = ConstantUtil.getVersionName(loanApplication); version = ConstantUtil.getVersionName(loanApplication);
if (dialogDetails == null || !dialogDetails.isShowing()) { if (dialogDetails == null || !dialogDetails.isShowing()) {
loanApplication = (wenshuApplication) activity.getApplication(); loanApplication = (WenshuApplication) activity.getApplication();
loanService = loanApplication.getLoanService(); loanService = loanApplication.getLoanService();
HashMap<String, Object> vo = new HashMap<>(); HashMap<String, Object> vo = new HashMap<>();
...@@ -313,7 +313,7 @@ public class VersionUpdatePresenter { ...@@ -313,7 +313,7 @@ public class VersionUpdatePresenter {
activity.startActivity(intent); activity.startActivity(intent);
} else { } else {
if (AppUtils.isServiceRunning(loanApplication, loanApplication.getPackageName() + ".service.UpdateService")) { if (AppUtils.isServiceRunning(loanApplication, loanApplication.getPackageName() + ".service.UpdateService")) {
ToastUtil.show(wenshuApplication.getContext(), "app正在后台下载,可以在通知栏中查看下载进度"); ToastUtil.show(WenshuApplication.getContext(), "app正在后台下载,可以在通知栏中查看下载进度");
} else { } else {
Context applicationContext = loanApplication.getApplicationContext(); Context applicationContext = loanApplication.getApplicationContext();
Intent updateIntent = new Intent(applicationContext, UpdateService.class); Intent updateIntent = new Intent(applicationContext, UpdateService.class);
...@@ -322,7 +322,7 @@ public class VersionUpdatePresenter { ...@@ -322,7 +322,7 @@ public class VersionUpdatePresenter {
updateIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); updateIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
applicationContext.bindService(updateIntent, conn, Context.BIND_AUTO_CREATE); applicationContext.bindService(updateIntent, conn, Context.BIND_AUTO_CREATE);
ToastUtil.show(wenshuApplication.getContext(), "正在后台更新中..."); ToastUtil.show(WenshuApplication.getContext(), "正在后台更新中...");
} }
} }
} }
......
package com.wenshu.youyou.mvp.presenters package com.wenshu.youyou.mvp.presenters
import android.app.Activity 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.model.BaseResponse
import com.wenshu.youyou.mvp.views.VideoAdManagerView import com.wenshu.youyou.mvp.views.VideoAdManagerView
import com.wenshu.library.net.neterror.BaseSubscriber import com.wenshu.library.net.neterror.BaseSubscriber
...@@ -13,7 +13,7 @@ class WnVideoAdPresenter : BasePresenter<VideoAdManagerView>() { ...@@ -13,7 +13,7 @@ class WnVideoAdPresenter : BasePresenter<VideoAdManagerView>() {
fun reportAddCoinMsg(activity: Activity?, vo: HashMap<String, Any>) { fun reportAddCoinMsg(activity: Activity?, vo: HashMap<String, Any>) {
if (activity == null) return if (activity == null) return
loanApplication = activity.application as wenshuApplication loanApplication = activity.application as WenshuApplication
loanService = loanApplication.loanService loanService = loanApplication.loanService
subscription = loanService.reportAddCoinMsg(vo) subscription = loanService.reportAddCoinMsg(vo)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
......
...@@ -2,7 +2,7 @@ package com.wenshu.youyou.mvp.presenters; ...@@ -2,7 +2,7 @@ package com.wenshu.youyou.mvp.presenters;
import android.app.Activity; 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.model.BaseResponse;
import com.wenshu.youyou.mvp.views.VideoAdManagerView; import com.wenshu.youyou.mvp.views.VideoAdManagerView;
import com.wenshu.youyou.net.LoanService; import com.wenshu.youyou.net.LoanService;
...@@ -16,7 +16,7 @@ import rx.android.schedulers.AndroidSchedulers; ...@@ -16,7 +16,7 @@ import rx.android.schedulers.AndroidSchedulers;
public class YlhVideoAdPresenter extends BasePresenter<VideoAdManagerView> { public class YlhVideoAdPresenter extends BasePresenter<VideoAdManagerView> {
private wenshuApplication loanApplication; private WenshuApplication loanApplication;
private LoanService loanService; private LoanService loanService;
private Subscription subscription; private Subscription subscription;
...@@ -24,7 +24,7 @@ public class YlhVideoAdPresenter extends BasePresenter<VideoAdManagerView> { ...@@ -24,7 +24,7 @@ public class YlhVideoAdPresenter extends BasePresenter<VideoAdManagerView> {
if (activity == null) if (activity == null)
return; return;
loanApplication = (wenshuApplication) activity.getApplication(); loanApplication = (WenshuApplication) activity.getApplication();
loanService = loanApplication.getLoanService(); loanService = loanApplication.getLoanService();
subscription = loanService.reportAddCoinMsg(vo) subscription = loanService.reportAddCoinMsg(vo)
......
package com.wenshu.youyou.mvp.views; package com.wenshu.youyou.mvp.views;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
/** /**
* 描述:BaseView * 描述:BaseView
...@@ -14,7 +14,7 @@ public interface BaseView { ...@@ -14,7 +14,7 @@ public interface BaseView {
* *
* @return * @return
*/ */
wenshuApplication getBaseApplication(); WenshuApplication getBaseApplication();
/** /**
* show loading message * show loading message
......
package com.wenshu.youyou.mvp.views package com.wenshu.youyou.mvp.views
import com.wenshu.youyou.mvp.model.CashoutChallengeBean
import com.wenshu.youyou.mvp.model.FriendHallMsgBean import com.wenshu.youyou.mvp.model.FriendHallMsgBean
interface FriendsView : BaseView { interface FriendsView : BaseView {
...@@ -18,4 +19,8 @@ interface FriendsView : BaseView { ...@@ -18,4 +19,8 @@ interface FriendsView : BaseView {
fun getContributionOutToCashSuc() fun getContributionOutToCashSuc()
fun getSonCashoutChallengeMsgSuc(data: CashoutChallengeBean)
fun getSonCashoutChallengeMsgFail()
} }
...@@ -7,6 +7,7 @@ import com.wenshu.youyou.BuildConfig; ...@@ -7,6 +7,7 @@ import com.wenshu.youyou.BuildConfig;
import com.wenshu.youyou.mvp.model.AccountMsgBean; import com.wenshu.youyou.mvp.model.AccountMsgBean;
import com.wenshu.youyou.mvp.model.BannerBean; import com.wenshu.youyou.mvp.model.BannerBean;
import com.wenshu.youyou.mvp.model.BaseResponse; 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.CommonParamBean;
import com.wenshu.youyou.mvp.model.DrawcashBean; import com.wenshu.youyou.mvp.model.DrawcashBean;
import com.wenshu.youyou.mvp.model.DrawcashRecordBean; import com.wenshu.youyou.mvp.model.DrawcashRecordBean;
...@@ -577,6 +578,22 @@ public interface LoanService { ...@@ -577,6 +578,22 @@ public interface LoanService {
@POST("common/baseCarrierAdcodeConfig") @POST("common/baseCarrierAdcodeConfig")
Observable<BaseResponse<ServerAdBean>> baseCarrierAdcodeConfig(); Observable<BaseResponse<ServerAdBean>> baseCarrierAdcodeConfig();
/**
* 完成任务增加贡献值接口
*
* @return
*/
@POST("api//addContributionByCompeteCoinTarget")
Observable<BaseResponse<JsonObject>> addContributionByCompeteCoinTarget();
/**
* 新版分红逻辑
*
* @return
*/
@POST("api/sonCashoutChallengeMsg")
Observable<BaseResponse<CashoutChallengeBean>> sonCashoutChallengeMsg();
/** /**
* 默认http工厂 * 默认http工厂
*/ */
......
...@@ -5,7 +5,7 @@ import android.text.TextUtils; ...@@ -5,7 +5,7 @@ import android.text.TextUtils;
import com.bytedance.hume.readapk.HumeSDK; import com.bytedance.hume.readapk.HumeSDK;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.wenshu.youyou.BuildConfig; 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.manager.UserManager;
import com.wenshu.youyou.mvp.model.AppRequest; import com.wenshu.youyou.mvp.model.AppRequest;
import com.wenshu.youyou.utils.AESUtils; import com.wenshu.youyou.utils.AESUtils;
...@@ -44,10 +44,10 @@ public class OkHttpInterceptor implements Interceptor { ...@@ -44,10 +44,10 @@ public class OkHttpInterceptor implements Interceptor {
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
String channel = CommonUtils.getAppMetaData(wenshuApplication.getContext(), "CHANNEL_NAME"); String channel = CommonUtils.getAppMetaData(WenshuApplication.getContext(), "CHANNEL_NAME");
try { try {
// 穿山甲分包渠道 // 穿山甲分包渠道
String ttChannel = HumeSDK.getChannel(wenshuApplication.getContext()); String ttChannel = HumeSDK.getChannel(WenshuApplication.getContext());
if (!TextUtils.isEmpty(ttChannel)) { if (!TextUtils.isEmpty(ttChannel)) {
// 此处方式不能修改,已和后端约定 // 此处方式不能修改,已和后端约定
channel = channel + "_" + ttChannel; channel = channel + "_" + ttChannel;
......
...@@ -16,7 +16,7 @@ import androidx.core.app.NotificationCompat; ...@@ -16,7 +16,7 @@ import androidx.core.app.NotificationCompat;
import androidx.core.content.FileProvider; import androidx.core.content.FileProvider;
import android.widget.RemoteViews; import android.widget.RemoteViews;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.R; import com.wenshu.youyou.R;
import com.wenshu.youyou.common.Constant; import com.wenshu.youyou.common.Constant;
import com.wenshu.youyou.ui.activitys.MainActivity; import com.wenshu.youyou.ui.activitys.MainActivity;
...@@ -211,7 +211,7 @@ public class UpdateService extends Service { ...@@ -211,7 +211,7 @@ public class UpdateService extends Service {
if (updateFile != null) { if (updateFile != null) {
autoInstallApk(updateFile); autoInstallApk(updateFile);
} else { } else {
ToastUtil.show(wenshuApplication.getContext(), "安装失败!"); ToastUtil.show(WenshuApplication.getContext(), "安装失败!");
System.exit(0); System.exit(0);
} }
} }
......
...@@ -4,7 +4,7 @@ import android.annotation.SuppressLint ...@@ -4,7 +4,7 @@ import android.annotation.SuppressLint
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import com.bytedance.hume.readapk.HumeSDK 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.R
import com.wenshu.youyou.common.AppConfig import com.wenshu.youyou.common.AppConfig
import com.wenshu.youyou.common.Constant import com.wenshu.youyou.common.Constant
...@@ -34,7 +34,7 @@ class AboutusActivity : BaseActivity(), View.OnClickListener { ...@@ -34,7 +34,7 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back) iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
ivAboutasIcon.setOnLongClickListener { 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 广告代码位:" + AppConfig.user_channel_ad +
"\n 头条渠道:" + HumeSDK.getChannel(context)) "\n 头条渠道:" + HumeSDK.getChannel(context))
true true
......
...@@ -6,7 +6,7 @@ import android.text.TextUtils ...@@ -6,7 +6,7 @@ import android.text.TextUtils
import android.view.View import android.view.View
import android.widget.ImageView import android.widget.ImageView
import androidx.viewpager.widget.ViewPager.OnPageChangeListener 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.R
import com.wenshu.youyou.common.Constant import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.manager.UserManager import com.wenshu.youyou.manager.UserManager
...@@ -41,11 +41,11 @@ class GuideActivity : BaseActivity() { ...@@ -41,11 +41,11 @@ class GuideActivity : BaseActivity() {
} }
private fun readyGoMain() { private fun readyGoMain() {
val instance = AppPreferences(wenshuApplication.getContext()) val instance = AppPreferences(WenshuApplication.getContext())
val customVersion: Int = instance.getInt(Constant.CUSTOM_VERSION, 0) val customVersion: Int = instance.getInt(Constant.CUSTOM_VERSION, 0)
instance.put(Constant.ISFIRSTENTER + customVersion, false) 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()) { if (TextUtils.equals(channel, Constant.CHANNEL_SHARE) && !UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java) readyGo(WxLoginActivity::class.java)
} else { } else {
......
...@@ -48,7 +48,7 @@ class SplashADActivity : BaseActivity(), SplashADListener { ...@@ -48,7 +48,7 @@ class SplashADActivity : BaseActivity(), SplashADListener {
try { try {
container = findViewById<View>(R.id.splash_container) as ViewGroup 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) fetchSplashAD(this, container, skipView, YlhAdManager.YLH_AD_SPLASH_POSTID, this, 0)
} catch (e: Exception) { } catch (e: Exception) {
......
...@@ -8,7 +8,7 @@ import android.view.KeyEvent ...@@ -8,7 +8,7 @@ import android.view.KeyEvent
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.TextView import android.widget.TextView
import com.wenshu.youyou.wenshuApplication import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R import com.wenshu.youyou.R
import com.wenshu.youyou.common.Constant import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.common.DeviceInfo import com.wenshu.youyou.common.DeviceInfo
...@@ -197,7 +197,7 @@ class SplashYlhActivity : BaseActivity(), SplashADListener { ...@@ -197,7 +197,7 @@ class SplashYlhActivity : BaseActivity(), SplashADListener {
if (isFirstEnter) { if (isFirstEnter) {
readyGoThenKill(GuideActivity::class.java) readyGoThenKill(GuideActivity::class.java)
} else { } 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()) { if (TextUtils.equals(channel, Constant.CHANNEL_SHARE) && !UserManager.getInstance().userIsLogin()) {
readyGo(WxLoginActivity::class.java) readyGo(WxLoginActivity::class.java)
} else { } else {
......
...@@ -9,7 +9,7 @@ import android.view.KeyEvent ...@@ -9,7 +9,7 @@ import android.view.KeyEvent
import android.view.View import android.view.View
import cn.sharesdk.framework.ShareSDK import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat 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.R
import com.wenshu.youyou.common.Constant import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.login.LoginApi import com.wenshu.youyou.login.LoginApi
...@@ -53,7 +53,7 @@ class WxLoginActivity : BaseActivity() ...@@ -53,7 +53,7 @@ class WxLoginActivity : BaseActivity()
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
loginPresenter.attachView(this) loginPresenter.attachView(this)
channel = CommonUtils.getAppMetaData(wenshuApplication.getContext(), "CHANNEL_NAME") channel = CommonUtils.getAppMetaData(WenshuApplication.getContext(), "CHANNEL_NAME")
initView() initView()
initListener() initListener()
} }
......
...@@ -5,7 +5,7 @@ import android.view.View ...@@ -5,7 +5,7 @@ import android.view.View
import android.widget.SeekBar import android.widget.SeekBar
import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.wenshu.youyou.wenshuApplication import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R import com.wenshu.youyou.R
import com.wenshu.youyou.ad.express.TTPreLoadExpressXmlyManager import com.wenshu.youyou.ad.express.TTPreLoadExpressXmlyManager
import com.wenshu.youyou.common.AppConfig import com.wenshu.youyou.common.AppConfig
...@@ -104,7 +104,7 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O ...@@ -104,7 +104,7 @@ class XmlyPlayActivity : BaseActivity(), View.OnClickListener, XmlyPlayAdapter.O
mPlayerManager = XmPlayerManager.getInstance(this) mPlayerManager = XmPlayerManager.getInstance(this)
val mNotification = XmNotificationCreater.getInstanse(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.init(System.currentTimeMillis().toInt(), mNotification)
mPlayerManager.addPlayerStatusListener(mPlayerStatusListener) mPlayerManager.addPlayerStatusListener(mPlayerStatusListener)
......
...@@ -16,7 +16,7 @@ import android.view.KeyEvent; ...@@ -16,7 +16,7 @@ import android.view.KeyEvent;
import android.view.View; import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.R; import com.wenshu.youyou.R;
import com.wenshu.youyou.common.Constant; import com.wenshu.youyou.common.Constant;
import com.wenshu.youyou.mvp.views.BaseView; import com.wenshu.youyou.mvp.views.BaseView;
...@@ -60,8 +60,8 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base ...@@ -60,8 +60,8 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
} }
@Override @Override
public wenshuApplication getBaseApplication() { public WenshuApplication getBaseApplication() {
return (wenshuApplication) getApplication(); return (WenshuApplication) getApplication();
} }
public Context getContext() { public Context getContext() {
...@@ -190,7 +190,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base ...@@ -190,7 +190,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
@Override @Override
public void showToast(String msg) { public void showToast(String msg) {
if (!TextUtils.isEmpty(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 ...@@ -200,7 +200,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
IntentFilter filter = new IntentFilter(); IntentFilter filter = new IntentFilter();
filter.addAction(Constant.ACTION_EXIT_APP); filter.addAction(Constant.ACTION_EXIT_APP);
filter.addCategory(Intent.CATEGORY_DEFAULT); filter.addCategory(Intent.CATEGORY_DEFAULT);
wenshuApplication.getLocalBroadcastManager().registerReceiver(mExitReceiver, filter); WenshuApplication.getLocalBroadcastManager().registerReceiver(mExitReceiver, filter);
} }
private BroadcastReceiver mExitReceiver = new BroadcastReceiver() { private BroadcastReceiver mExitReceiver = new BroadcastReceiver() {
...@@ -221,7 +221,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base ...@@ -221,7 +221,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements Base
IntentFilter filter = new IntentFilter(); IntentFilter filter = new IntentFilter();
filter.addAction(Constant.ACTION_EXIT_APP); filter.addAction(Constant.ACTION_EXIT_APP);
filter.addCategory(Intent.CATEGORY_DEFAULT); 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> ...@@ -60,6 +60,9 @@ class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean>
// 其他下载应用 // 其他下载应用
const val TO_DOWNLOADS = "TO_DOWNLOADS" const val TO_DOWNLOADS = "TO_DOWNLOADS"
// 完成任务增加贡献值
const val TO_ADDCONTRIBUTION = "TO_ADDCONTRIBUTION"
} }
private var mContext: Context = context private var mContext: Context = context
......
...@@ -12,7 +12,7 @@ import androidx.fragment.app.FragmentTransaction ...@@ -12,7 +12,7 @@ import androidx.fragment.app.FragmentTransaction
import com.daimajia.androidanimations.library.Techniques import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo import com.daimajia.androidanimations.library.YoYo
import com.daimajia.androidanimations.library.YoYo.YoYoString 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.R
import com.wenshu.youyou.ad.express.PreLoadExpressManager import com.wenshu.youyou.ad.express.PreLoadExpressManager
import com.wenshu.youyou.ad.express.TTPreLoadExpressXmlyManager import com.wenshu.youyou.ad.express.TTPreLoadExpressXmlyManager
...@@ -91,8 +91,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -91,8 +91,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
videoAdingManager = VideoAdingManager.getInstance(activity) videoAdingManager = VideoAdingManager.getInstance(activity)
// 奖励页预加载 信息流广告 // 奖励页预加载 信息流广告
// PreLoadExpressManager.loadADFrameLayout() PreLoadExpressManager.loadADFrameLayout()
//
// // 刷新喜马拉雅信息流 // // 刷新喜马拉雅信息流
// TTPreLoadExpressXmlyManager.getInstance().loadTtFrameLayout() // TTPreLoadExpressXmlyManager.getInstance().loadTtFrameLayout()
...@@ -320,8 +320,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -320,8 +320,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
} }
//闪电盒子传入oaid //闪电盒子传入oaid
if (!TextUtils.isEmpty(wenshuApplication.OAID)) { if (!TextUtils.isEmpty(WenshuApplication.OAID)) {
WnManager.setOaid(wenshuApplication.OAID) WnManager.setOaid(WenshuApplication.OAID)
} }
} }
...@@ -555,7 +555,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener { ...@@ -555,7 +555,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
ShumeiManager.getInstance().initShumei() ShumeiManager.getInstance().initShumei()
// 游客首次提示1500新人奖励 且 不是分享包 // 游客首次提示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)) { if (!TextUtils.equals(channel, Constant.CHANNEL_SHARE) && ps.getBoolean(Constant.FIRST_VISITOR_FLAG, true)) {
ps.put(Constant.FIRST_VISITOR_FLAG, false) ps.put(Constant.FIRST_VISITOR_FLAG, false)
val bundle = Bundle() val bundle = Bundle()
......
...@@ -290,7 +290,6 @@ class MyFragment : BaseFragment(), ...@@ -290,7 +290,6 @@ class MyFragment : BaseFragment(),
} }
override fun userLoginSuc() { override fun userLoginSuc() {
// SceneManager.signIn(requireActivity())
RsNewsManager.init(baseApplication) RsNewsManager.init(baseApplication)
myPresenter.getAutoUserHallBaseMsg() myPresenter.getAutoUserHallBaseMsg()
...@@ -542,6 +541,18 @@ class MyFragment : BaseFragment(), ...@@ -542,6 +541,18 @@ class MyFragment : BaseFragment(),
readyGo(TaskCpdActivity::class.java) 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 -> { MainMyAdapter.APP_HiGH_ACTIVITY -> {
if (!UserManager.getInstance().userIsLogin()) { if (!UserManager.getInstance().userIsLogin()) {
......
...@@ -9,7 +9,7 @@ import cn.sharesdk.framework.PlatformActionListener ...@@ -9,7 +9,7 @@ import cn.sharesdk.framework.PlatformActionListener
import cn.sharesdk.framework.ShareSDK import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat import cn.sharesdk.wechat.friends.Wechat
import cn.sharesdk.wechat.moments.WechatMoments 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.R
import com.wenshu.youyou.common.AppConfig import com.wenshu.youyou.common.AppConfig
import com.wenshu.youyou.common.Constant import com.wenshu.youyou.common.Constant
...@@ -142,7 +142,7 @@ class WzFragment(private var isResume: Boolean = false) : BaseFragment(), BaseVi ...@@ -142,7 +142,7 @@ class WzFragment(private var isResume: Boolean = false) : BaseFragment(), BaseVi
} }
wechatTarget.share(wechatSp) wechatTarget.share(wechatSp)
} else { } else {
ToastUtil.show(wenshuApplication.getContext(), "请先安装微信") ToastUtil.show(WenshuApplication.getContext(), "请先安装微信")
} }
} }
} }
......
...@@ -11,7 +11,7 @@ import android.text.TextUtils; ...@@ -11,7 +11,7 @@ import android.text.TextUtils;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View; import android.view.View;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.R; import com.wenshu.youyou.R;
import com.wenshu.youyou.ui.widgets.LoadingDialog; import com.wenshu.youyou.ui.widgets.LoadingDialog;
import com.wenshu.youyou.utils.ToastUtil; import com.wenshu.youyou.utils.ToastUtil;
...@@ -32,8 +32,8 @@ public abstract class BaseFragment extends BaseAppFragment { ...@@ -32,8 +32,8 @@ public abstract class BaseFragment extends BaseAppFragment {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
} }
public wenshuApplication getBaseApplication() { public WenshuApplication getBaseApplication() {
return (wenshuApplication) getActivity().getApplication(); return (WenshuApplication) getActivity().getApplication();
} }
public Context getContext() { public Context getContext() {
...@@ -113,7 +113,7 @@ public abstract class BaseFragment extends BaseAppFragment { ...@@ -113,7 +113,7 @@ public abstract class BaseFragment extends BaseAppFragment {
*/ */
public void showToast(String msg) { public void showToast(String msg) {
if (!TextUtils.isEmpty(msg)) if (!TextUtils.isEmpty(msg))
ToastUtil.show(wenshuApplication.getContext(), msg); ToastUtil.show(WenshuApplication.getContext(), msg);
} }
/** /**
......
...@@ -10,7 +10,7 @@ import android.view.View ...@@ -10,7 +10,7 @@ import android.view.View
import android.view.WindowManager import android.view.WindowManager
import cn.sharesdk.framework.ShareSDK import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat 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.R
import com.wenshu.youyou.common.Constant import com.wenshu.youyou.common.Constant
import com.wenshu.youyou.login.LoginApi import com.wenshu.youyou.login.LoginApi
...@@ -142,7 +142,7 @@ class BindWxDialog(context: Activity) : ...@@ -142,7 +142,7 @@ class BindWxDialog(context: Activity) :
} }
override fun getBaseApplication(): wenshuApplication { override fun getBaseApplication(): WenshuApplication {
return wenshuApplication.getContext() as wenshuApplication return WenshuApplication.getContext() as WenshuApplication
} }
} }
\ No newline at end of file
...@@ -10,7 +10,7 @@ import android.widget.ImageView ...@@ -10,7 +10,7 @@ import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import com.downloader.PRDownloader import com.downloader.PRDownloader
import com.downloader.Progress import com.downloader.Progress
import com.wenshu.youyou.wenshuApplication import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R import com.wenshu.youyou.R
import com.wenshu.youyou.utils.CacheUtil import com.wenshu.youyou.utils.CacheUtil
import com.wenshu.youyou.utils.Utils import com.wenshu.youyou.utils.Utils
...@@ -49,7 +49,7 @@ class DownloadProgressDialog(context: Context) : ...@@ -49,7 +49,7 @@ class DownloadProgressDialog(context: Context) :
when (v.id) { when (v.id) {
R.id.iv_download_quit -> { R.id.iv_download_quit -> {
PRDownloader.cancelAll() PRDownloader.cancelAll()
CacheUtil.clearAllCache(wenshuApplication.getContext()) CacheUtil.clearAllCache(WenshuApplication.getContext())
dismiss() 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 ...@@ -18,7 +18,7 @@ import cn.sharesdk.framework.ShareSDK
import cn.sharesdk.wechat.friends.Wechat import cn.sharesdk.wechat.friends.Wechat
import cn.sharesdk.wechat.moments.WechatMoments import cn.sharesdk.wechat.moments.WechatMoments
import com.wenshu.youyou.BuildConfig import com.wenshu.youyou.BuildConfig
import com.wenshu.youyou.wenshuApplication import com.wenshu.youyou.WenshuApplication
import com.wenshu.youyou.R import com.wenshu.youyou.R
import com.wenshu.youyou.manager.UserManager import com.wenshu.youyou.manager.UserManager
import com.wenshu.youyou.ui.adapter.SharePagerAdapter import com.wenshu.youyou.ui.adapter.SharePagerAdapter
...@@ -209,7 +209,7 @@ class ShareDialog(context: Context) : Dialog(context, R.style.dialog) { ...@@ -209,7 +209,7 @@ class ShareDialog(context: Context) : Dialog(context, R.style.dialog) {
mOnShareOKListener?.onShareOk() mOnShareOKListener?.onShareOk()
wechat.share(wechatSp) wechat.share(wechatSp)
} else { } else {
ToastUtil.show(wenshuApplication.getContext(), "请先安装微信") ToastUtil.show(WenshuApplication.getContext(), "请先安装微信")
} }
Timer().schedule(1000) { Timer().schedule(1000) {
...@@ -245,7 +245,7 @@ class ShareDialog(context: Context) : Dialog(context, R.style.dialog) { ...@@ -245,7 +245,7 @@ class ShareDialog(context: Context) : Dialog(context, R.style.dialog) {
mOnShareOKListener?.onShareOk() mOnShareOKListener?.onShareOk()
wechatMoments.share(wechatSp) wechatMoments.share(wechatSp)
} else { } else {
ToastUtil.show(wenshuApplication.getContext(), "请先安装微信") ToastUtil.show(WenshuApplication.getContext(), "请先安装微信")
} }
Timer().schedule(1000) { 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 ...@@ -12,7 +12,7 @@ import android.content.pm.PackageManager
import android.os.Build import android.os.Build
import android.provider.Settings import android.provider.Settings
import android.text.TextUtils import android.text.TextUtils
import com.wenshu.youyou.wenshuApplication import com.wenshu.youyou.WenshuApplication
/** /**
...@@ -38,7 +38,7 @@ object AppUtil { ...@@ -38,7 +38,7 @@ object AppUtil {
* @return flag * @return flag
*/ */
fun isHasUsageStats(): Boolean { fun isHasUsageStats(): Boolean {
val packageManager: PackageManager = wenshuApplication.getContext().packageManager val packageManager: PackageManager = WenshuApplication.getContext().packageManager
val intent = Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS) val intent = Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS)
val list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY) val list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY)
return list.size > 0 return list.size > 0
...@@ -52,7 +52,7 @@ object AppUtil { ...@@ -52,7 +52,7 @@ object AppUtil {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
val ts = System.currentTimeMillis() val ts = System.currentTimeMillis()
val usageStatsManager = val usageStatsManager =
wenshuApplication.getContext().getSystemService(Service.USAGE_STATS_SERVICE) as UsageStatsManager WenshuApplication.getContext().getSystemService(Service.USAGE_STATS_SERVICE) as UsageStatsManager
val queryUsageStats = usageStatsManager.queryUsageStats( val queryUsageStats = usageStatsManager.queryUsageStats(
UsageStatsManager.INTERVAL_BEST, 0, ts) UsageStatsManager.INTERVAL_BEST, 0, ts)
if (queryUsageStats == null || queryUsageStats.isEmpty()) { if (queryUsageStats == null || queryUsageStats.isEmpty()) {
......
...@@ -81,7 +81,7 @@ public class CacheUtil { ...@@ -81,7 +81,7 @@ public class CacheUtil {
double kiloByte = size / 1024; double kiloByte = size / 1024;
if (kiloByte < 1) { if (kiloByte < 1) {
// return size + "Byte"; // return size + "Byte";
return "0K"; return "0KB";
} }
double megaByte = kiloByte / 1024; double megaByte = kiloByte / 1024;
......
...@@ -5,7 +5,7 @@ import android.content.SharedPreferences; ...@@ -5,7 +5,7 @@ import android.content.SharedPreferences;
import android.provider.Settings; import android.provider.Settings;
import android.telephony.TelephonyManager; import android.telephony.TelephonyManager;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.UUID; import java.util.UUID;
...@@ -23,7 +23,7 @@ public class DeviceUuidFactory { ...@@ -23,7 +23,7 @@ public class DeviceUuidFactory {
protected static UUID uuid; protected static UUID uuid;
public DeviceUuidFactory() { public DeviceUuidFactory() {
Context context= wenshuApplication.getContext(); Context context= WenshuApplication.getContext();
if (uuid == null) { if (uuid == null) {
synchronized (DeviceUuidFactory.class) { synchronized (DeviceUuidFactory.class) {
if (uuid == null) { if (uuid == null) {
......
...@@ -3,7 +3,7 @@ package com.wenshu.youyou.utils ...@@ -3,7 +3,7 @@ package com.wenshu.youyou.utils
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import com.wenshu.youyou.wenshuApplication import com.wenshu.youyou.WenshuApplication
object QQJumpUtil { object QQJumpUtil {
...@@ -21,7 +21,7 @@ object QQJumpUtil { ...@@ -21,7 +21,7 @@ object QQJumpUtil {
activity.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url))) activity.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
} catch (e: Exception) { } catch (e: Exception) {
// 未安装手Q或安装的版本不支持 // 未安装手Q或安装的版本不支持
ToastUtil.show(wenshuApplication.getContext(), "您还没有安装QQ,请先安装软件") ToastUtil.show(WenshuApplication.getContext(), "您还没有安装QQ,请先安装软件")
} }
} }
...@@ -41,7 +41,7 @@ object QQJumpUtil { ...@@ -41,7 +41,7 @@ object QQJumpUtil {
activity.startActivity(intent) activity.startActivity(intent)
} catch (e: java.lang.Exception) { } catch (e: java.lang.Exception) {
// 未安装手Q或安装的版本不支持 // 未安装手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; ...@@ -3,7 +3,7 @@ package com.wenshu.youyou.utils;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
...@@ -35,7 +35,7 @@ public class SPUtil { ...@@ -35,7 +35,7 @@ public class SPUtil {
public static SPUtil getInstance() { public static SPUtil getInstance() {
if (spUtil == null) { if (spUtil == null) {
mContext = wenshuApplication.getContext(); mContext = WenshuApplication.getContext();
spUtil = new SPUtil(); spUtil = new SPUtil();
mPreferences = mContext.getSharedPreferences(mShareName, Context.MODE_PRIVATE); mPreferences = mContext.getSharedPreferences(mShareName, Context.MODE_PRIVATE);
} }
......
...@@ -5,7 +5,7 @@ import android.content.Context; ...@@ -5,7 +5,7 @@ import android.content.Context;
import android.media.MediaPlayer; import android.media.MediaPlayer;
import android.media.SoundPool; import android.media.SoundPool;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.R; import com.wenshu.youyou.R;
...@@ -17,7 +17,7 @@ public class SoundPoolUtil { ...@@ -17,7 +17,7 @@ public class SoundPoolUtil {
//单例模式 //单例模式
public static SoundPoolUtil getInstance() { public static SoundPoolUtil getInstance() {
SoundPoolUtil.context = wenshuApplication.getContext(); SoundPoolUtil.context = WenshuApplication.getContext();
if (soundPoolUtil == null) if (soundPoolUtil == null)
soundPoolUtil = new SoundPoolUtil(context); soundPoolUtil = new SoundPoolUtil(context);
return soundPoolUtil; return soundPoolUtil;
......
...@@ -30,7 +30,7 @@ import android.view.Window; ...@@ -30,7 +30,7 @@ import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityManager;
import com.wenshu.youyou.wenshuApplication; import com.wenshu.youyou.WenshuApplication;
import com.wenshu.youyou.common.Constant; import com.wenshu.youyou.common.Constant;
import java.io.File; import java.io.File;
...@@ -114,7 +114,7 @@ public final class Utils { ...@@ -114,7 +114,7 @@ public final class Utils {
* @return * @return
*/ */
public static boolean isStartAccessibilityService() { public static boolean isStartAccessibilityService() {
Context context = wenshuApplication.getContext(); Context context = WenshuApplication.getContext();
AccessibilityManager am = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE); AccessibilityManager am = (AccessibilityManager) context.getSystemService(Context.ACCESSIBILITY_SERVICE);
List<AccessibilityServiceInfo> serviceInfos = am.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC); List<AccessibilityServiceInfo> serviceInfos = am.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC);
for (AccessibilityServiceInfo info : serviceInfos) { for (AccessibilityServiceInfo info : serviceInfos) {
......
...@@ -16,8 +16,8 @@ org.gradle.jvmargs=-Xmx1536m ...@@ -16,8 +16,8 @@ org.gradle.jvmargs=-Xmx1536m
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true # org.gradle.parallel=true
#DEBUG_URL="http://39.97.65.143:9082/yy-api/" DEBUG_URL="http://39.97.65.143:9082/yy-api/"
DEBUG_URL="http://192.168.31.194:8101/" #DEBUG_URL="http://192.168.31.194:8101/"
RELEASE_URL="https://api.wenshu-id.com/yy-api/" RELEASE_URL="https://api.wenshu-id.com/yy-api/"
RELEASE_KEY_PASSWORD=mints.youyou 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