Commit a24c1beb authored by jyx's avatar jyx

代码优化

parent f48885ec
...@@ -24,7 +24,6 @@ android { ...@@ -24,7 +24,6 @@ android {
//配置so文件 //配置so文件
ndk { ndk {
abiFilters "armeabi", "armeabi-v7a", "x86", "mips" abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
// abiFilters "armeabi", "armeabi-v7a"
} }
manifestPlaceholders = [CHANNEL_NAME_VALUE: "goodmoney", manifestPlaceholders = [CHANNEL_NAME_VALUE: "goodmoney",
...@@ -132,7 +131,7 @@ android { ...@@ -132,7 +131,7 @@ android {
dependencies { dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0' implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0' implementation 'com.google.android.material:material:1.0.0'
...@@ -146,7 +145,7 @@ dependencies { ...@@ -146,7 +145,7 @@ dependencies {
implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3' implementation 'com.readystatesoftware.systembartint:systembartint:1.0.3'
implementation 'com.gyf.immersionbar:immersionbar:2.3.3-beta15' implementation 'com.gyf.immersionbar:immersionbar:2.3.3-beta15'
// okhttp3日志 // okhttp3日志
implementation 'com.squareup.okhttp3:logging-interceptor:4.0.0' implementation 'com.squareup.okhttp3:logging-interceptor:4.1.0'
implementation 'com.squareup.okhttp3:okhttp:4.1.0' implementation 'com.squareup.okhttp3:okhttp:4.1.0'
implementation 'com.orhanobut:logger:2.2.0' implementation 'com.orhanobut:logger:2.2.0'
// 权限 // 权限
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:largeHeap="true"
android:networkSecurityConfig="@xml/network_security_config" android:networkSecurityConfig="@xml/network_security_config"
android:requestLegacyExternalStorage="true" android:requestLegacyExternalStorage="true"
android:supportsRtl="true" android:supportsRtl="true"
...@@ -87,23 +88,23 @@ ...@@ -87,23 +88,23 @@
android:name="JPUSH_CHANNEL" android:name="JPUSH_CHANNEL"
android:value="${JPUSH_CHANNEL}" /> android:value="${JPUSH_CHANNEL}" />
<!-- <activity--> <!-- <activity-->
<!-- android:configChanges="keyboard|orientation|screenSize"--> <!-- android:configChanges="keyboard|orientation|screenSize"-->
<!-- android:windowSoftInputMode="adjustPan|stateHidden"--> <!-- android:windowSoftInputMode="adjustPan|stateHidden"-->
<!-- android:theme="@style/Theme.ActivitySplash"--> <!-- android:theme="@style/Theme.ActivitySplash"-->
<!-- android:name=".ui.activitys.SplashYlhActivity"--> <!-- android:name=".ui.activitys.SplashYlhActivity"-->
<!-- android:screenOrientation="portrait">--> <!-- android:screenOrientation="portrait">-->
<!-- <intent-filter>--> <!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.MAIN" />--> <!-- <action android:name="android.intent.action.MAIN" />-->
<!-- <category android:name="android.intent.category.LAUNCHER" />--> <!-- <category android:name="android.intent.category.LAUNCHER" />-->
<!-- </intent-filter>--> <!-- </intent-filter>-->
<!-- </activity>--> <!-- </activity>-->
<activity <activity
android:name=".ui.activitys.SplashYlhActivity" android:name=".ui.activitys.SplashYlhActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/Theme.NoDisplay"> android:theme="@style/NormalSplash">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
......
...@@ -34,7 +34,7 @@ import rx.schedulers.Schedulers; ...@@ -34,7 +34,7 @@ import rx.schedulers.Schedulers;
*/ */
public class MintsApplication extends MultiDexApplication { public class MintsApplication extends MultiDexApplication {
private static Context mContext; private static MintsApplication mContext;
public static String OAID = ""; public static String OAID = "";
private static LocalBroadcastManager mLocalBroadcatManager; private static LocalBroadcastManager mLocalBroadcatManager;
...@@ -42,14 +42,15 @@ public class MintsApplication extends MultiDexApplication { ...@@ -42,14 +42,15 @@ public class MintsApplication extends MultiDexApplication {
private LoanService loanService; private LoanService loanService;
public static Context getContext() { public static MintsApplication getContext() {
return mContext; return mContext;
} }
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
mContext = this.getApplicationContext();
mContext = this;
// 判断应用是否在前台 // 判断应用是否在前台
ForegroundOrBackground.init(this); ForegroundOrBackground.init(this);
// 9.0之后不可多进程使用一个目录下的WebView,写在SDK初始化之前 // 9.0之后不可多进程使用一个目录下的WebView,写在SDK初始化之前
...@@ -175,9 +176,11 @@ public class MintsApplication extends MultiDexApplication { ...@@ -175,9 +176,11 @@ public class MintsApplication extends MultiDexApplication {
private String getProcessName(Context context) { private String getProcessName(Context context) {
if (context == null) return null; if (context == null) return null;
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
for (ActivityManager.RunningAppProcessInfo processInfo : manager.getRunningAppProcesses()) { if (manager != null) {
if (processInfo.pid == android.os.Process.myPid()) { for (ActivityManager.RunningAppProcessInfo processInfo : manager.getRunningAppProcesses()) {
return processInfo.processName; if (processInfo.pid == android.os.Process.myPid()) {
return processInfo.processName;
}
} }
} }
return null; return null;
......
...@@ -20,7 +20,7 @@ object YwhzManager { ...@@ -20,7 +20,7 @@ object YwhzManager {
private const val APPID_RELEASE = "1726" private const val APPID_RELEASE = "1726"
private const val APPSECRET_RELEASE = "g4fuod79v6e7cw4liw91iwfm5qryvz1u" private const val APPSECRET_RELEASE = "g4fuod79v6e7cw4liw91iwfm5qryvz1u"
fun init(application: Application){ fun init(application: Application) {
val userManager = UserManager.getInstance() val userManager = UserManager.getInstance()
var userID = userManager.userID var userID = userManager.userID
if (!userManager.userIsLogin() || TextUtils.isEmpty(userID)) { if (!userManager.userIsLogin() || TextUtils.isEmpty(userID)) {
...@@ -39,7 +39,9 @@ object YwhzManager { ...@@ -39,7 +39,9 @@ object YwhzManager {
} }
var oaid: String = "" var oaid: String = ""
if (Build.VERSION.SDK_INT > 28) { if (Build.VERSION.SDK_INT > 28) {
oaid = MintsApplication.OAID if (!TextUtils.isEmpty(MintsApplication.OAID)) {
oaid = MintsApplication.OAID
}
} }
setDebugMode() setDebugMode()
init(application, appSecret, appid, userID, "1", oaid) init(application, appSecret, appid, userID, "1", oaid)
......
...@@ -113,7 +113,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> { ...@@ -113,7 +113,7 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
/** /**
* 提交设备信息 * 提交设备信息
*/ */
public void saveTerminalInfo( double curCash) { public void saveTerminalInfo(double curCash) {
view.showLoading("加载中..."); view.showLoading("加载中...");
HashMap<String, Object> vo = new HashMap<>(); HashMap<String, Object> vo = new HashMap<>();
...@@ -133,7 +133,9 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> { ...@@ -133,7 +133,9 @@ public class DrawcashPresenter extends BasePresenter<DrawcashView> {
vo.put("uuid", new DeviceUuidFactory().getDeviceUuid()); vo.put("uuid", new DeviceUuidFactory().getDeviceUuid());
vo.put("osversion", deviceInfo.getOSVersion()); vo.put("osversion", deviceInfo.getOSVersion());
vo.put("appversion", deviceInfo.getVersionName()); vo.put("appversion", deviceInfo.getVersionName());
vo.put("oaid", MintsApplication.OAID); if (!TextUtils.isEmpty(MintsApplication.OAID)) {
vo.put("oaid", MintsApplication.OAID);
}
AppHttpManager.getInstance(loanApplication) AppHttpManager.getInstance(loanApplication)
.call(loanService.saveTerminalInfo(vo), .call(loanService.saveTerminalInfo(vo),
......
package com.mints.goodmoney.mvp.presenters package com.mints.goodmoney.mvp.presenters
import android.text.TextUtils
import com.mints.goodmoney.MintsApplication import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.common.DeviceInfo import com.mints.goodmoney.common.DeviceInfo
...@@ -160,7 +161,9 @@ class HomePresenter : BasePresenter<HomeView>() { ...@@ -160,7 +161,9 @@ 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"] = MintsApplication.OAID if (!TextUtils.isEmpty(MintsApplication.OAID)) {
vo["oaid"] = MintsApplication.OAID
}
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel
vo["uuid"] = DeviceUuidFactory().deviceUuid vo["uuid"] = DeviceUuidFactory().deviceUuid
......
package com.mints.goodmoney.mvp.presenters package com.mints.goodmoney.mvp.presenters
import android.text.TextUtils
import com.mints.goodmoney.MintsApplication import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.common.DeviceInfo import com.mints.goodmoney.common.DeviceInfo
...@@ -192,7 +193,9 @@ class LoginPresenter : BasePresenter<LoginView>() { ...@@ -192,7 +193,9 @@ 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
vo["oaid"] = MintsApplication.OAID if (!TextUtils.isEmpty(MintsApplication.OAID)) {
vo["oaid"] = MintsApplication.OAID
}
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel
vo["uuid"] = DeviceUuidFactory().deviceUuid vo["uuid"] = DeviceUuidFactory().deviceUuid
......
package com.mints.goodmoney.mvp.presenters package com.mints.goodmoney.mvp.presenters
import android.text.TextUtils
import com.mints.goodmoney.MintsApplication import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.common.DeviceInfo import com.mints.goodmoney.common.DeviceInfo
...@@ -187,7 +188,9 @@ class MyPresenter : BasePresenter<MyView>() { ...@@ -187,7 +188,9 @@ 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
vo["oaid"] = MintsApplication.OAID if (!TextUtils.isEmpty(MintsApplication.OAID)) {
vo["oaid"] = MintsApplication.OAID
}
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel
vo["uuid"] = DeviceUuidFactory().deviceUuid vo["uuid"] = DeviceUuidFactory().deviceUuid
......
...@@ -65,7 +65,9 @@ class PanPresenter : BasePresenter<PanView>() { ...@@ -65,7 +65,9 @@ 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
vo["oaid"] = MintsApplication.OAID if (!TextUtils.isEmpty(MintsApplication.OAID)) {
vo["oaid"] = MintsApplication.OAID
}
vo["os"] = "android" vo["os"] = "android"
vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel vo["model"] = deviceInfo.brand + " " + deviceInfo.mobileModel
vo["uuid"] = DeviceUuidFactory().deviceUuid vo["uuid"] = DeviceUuidFactory().deviceUuid
......
...@@ -4,7 +4,6 @@ import android.os.Bundle ...@@ -4,7 +4,6 @@ import android.os.Bundle
import android.view.View import android.view.View
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TTNativeExpressManager
import com.mints.goodmoney.manager.TTPreLoadCarrierExpressManager import com.mints.goodmoney.manager.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.manager.TtCsjAdManager import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.mvp.model.MealBean import com.mints.goodmoney.mvp.model.MealBean
...@@ -24,7 +23,6 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie ...@@ -24,7 +23,6 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
private val foodSubsidyPresenter by lazy { FoodSubsidyPresenter() } private val foodSubsidyPresenter by lazy { FoodSubsidyPresenter() }
private val ttNativeExpressManager by lazy { TTNativeExpressManager() }
private var curCoin = 0//点击的汽泡金币 private var curCoin = 0//点击的汽泡金币
private var buttonCoin = 0//点击的汽泡金币 private var buttonCoin = 0//点击的汽泡金币
...@@ -40,11 +38,6 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie ...@@ -40,11 +38,6 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
initListener() initListener()
} }
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ttNativeExpressManager.initTTAd(false)
}
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
...@@ -57,7 +50,6 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie ...@@ -57,7 +50,6 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
svWalk?.destoryAnim() svWalk?.destoryAnim()
flSubsidykAd?.removeAllViews() flSubsidykAd?.removeAllViews()
ttNativeExpressManager.onTTAdDestroy()
foodSubsidyPresenter.detachView() foodSubsidyPresenter.detachView()
} }
...@@ -104,13 +96,6 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie ...@@ -104,13 +96,6 @@ class FoodSubsidyActivity : BaseActivity(), View.OnClickListener, FoodSubsidyVie
* 初始化信息iyc * 初始化信息iyc
*/ */
private fun initExpress() { private fun initExpress() {
// try {
// ttNativeExpressManager.initTTAd(false)
// ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_EAT, flSubsidykAd, 320f, 0f)
// } catch (e: Exception) {
// e.printStackTrace()
// }
try { try {
if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) { if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) {
if (flSubsidykAd != null) { if (flSubsidykAd != null) {
......
...@@ -6,7 +6,6 @@ import androidx.recyclerview.widget.GridLayoutManager ...@@ -6,7 +6,6 @@ import androidx.recyclerview.widget.GridLayoutManager
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.ad.video.VedioAdingManager import com.mints.goodmoney.ad.video.VedioAdingManager
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TTNativeExpressManager
import com.mints.goodmoney.manager.TTPreLoadCarrierExpressManager import com.mints.goodmoney.manager.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.manager.TtCsjAdManager import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.mvp.model.MorningClockBean import com.mints.goodmoney.mvp.model.MorningClockBean
...@@ -27,7 +26,6 @@ class MorningClockActivity : BaseActivity() ...@@ -27,7 +26,6 @@ class MorningClockActivity : BaseActivity()
, View.OnClickListener, MorningClockView { , View.OnClickListener, MorningClockView {
private val morningClockPresenter by lazy { MorningClockPresenter() } private val morningClockPresenter by lazy { MorningClockPresenter() }
private val ttNativeExpressManager by lazy { TTNativeExpressManager() }
private lateinit var morningClockAdapter: MorningClockAdapter private lateinit var morningClockAdapter: MorningClockAdapter
private var morningClockList: MutableList<MorningClockBean.MorningClockTargetBean>? = null private var morningClockList: MutableList<MorningClockBean.MorningClockTargetBean>? = null
...@@ -55,7 +53,6 @@ class MorningClockActivity : BaseActivity() ...@@ -55,7 +53,6 @@ class MorningClockActivity : BaseActivity()
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
flMorningClockAd?.removeAllViews() flMorningClockAd?.removeAllViews()
ttNativeExpressManager.onTTAdDestroy()
morningClockPresenter.detachView() morningClockPresenter.detachView()
} }
...@@ -180,13 +177,6 @@ class MorningClockActivity : BaseActivity() ...@@ -180,13 +177,6 @@ class MorningClockActivity : BaseActivity()
* 初始化信息iyc * 初始化信息iyc
*/ */
private fun initExpress() { private fun initExpress() {
// try {
// ttNativeExpressManager.initTTAd(false)
// ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_MORNINGCLOCK, flMorningClockAd, 320f, 0f)
// } catch (e: Exception) {
// e.printStackTrace()
// }
try { try {
if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) { if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) {
if (flMorningClockAd != null) { if (flMorningClockAd != null) {
......
...@@ -23,7 +23,6 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St ...@@ -23,7 +23,6 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
private val walkPresenter by lazy { WalkPresenter() } private val walkPresenter by lazy { WalkPresenter() }
// private val ttNativeExpressManager by lazy { TTNativeExpressManager() }
private var curCoin = 0//点击的汽泡金币 private var curCoin = 0//点击的汽泡金币
override fun getContentViewLayoutID() = R.layout.activity_walk override fun getContentViewLayoutID() = R.layout.activity_walk
...@@ -48,7 +47,6 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St ...@@ -48,7 +47,6 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
svWalk?.destoryAnim() svWalk?.destoryAnim()
flWalkAd?.removeAllViews() flWalkAd?.removeAllViews()
// ttNativeExpressManager.onTTAdDestroy()
walkPresenter.detachView() walkPresenter.detachView()
} }
...@@ -109,13 +107,6 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St ...@@ -109,13 +107,6 @@ class WalkActivity : BaseActivity(), View.OnClickListener, WalkView, StepView.St
* 初始化信息iyc * 初始化信息iyc
*/ */
private fun initExpress() { private fun initExpress() {
// try {
// ttNativeExpressManager.initTTAd(false)
// ttNativeExpressManager.getNativeExpressInit(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK, flWalkAd, 320f, 0f)
// } catch (e: Exception) {
// e.printStackTrace()
// }
try { try {
if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) { if (TTPreLoadCarrierExpressManager.getInstance().ttFrameLayout != null) {
if (flWalkAd != null) { if (flWalkAd != null) {
......
...@@ -52,7 +52,6 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL ...@@ -52,7 +52,6 @@ class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewL
wvWater?.closeWaterViewTime() wvWater?.closeWaterViewTime()
flWaterAd?.removeAllViews() flWaterAd?.removeAllViews()
// ttNativeExpressManager.onTTAdDestroy()
waterPresenter.detachView() waterPresenter.detachView()
} }
......
...@@ -22,6 +22,7 @@ import com.mints.goodmoney.mvp.presenters.FriendsPresenter ...@@ -22,6 +22,7 @@ import com.mints.goodmoney.mvp.presenters.FriendsPresenter
import com.mints.goodmoney.mvp.views.FriendsView import com.mints.goodmoney.mvp.views.FriendsView
import com.mints.goodmoney.ui.activitys.DrawcashActivity import com.mints.goodmoney.ui.activitys.DrawcashActivity
import com.mints.goodmoney.ui.activitys.FriendsActivity import com.mints.goodmoney.ui.activitys.FriendsActivity
import com.mints.goodmoney.ui.activitys.LoginActivity
import com.mints.goodmoney.ui.adapter.FriendsPagerAdapter import com.mints.goodmoney.ui.adapter.FriendsPagerAdapter
import com.mints.goodmoney.ui.adapter.InvitedAdapter import com.mints.goodmoney.ui.adapter.InvitedAdapter
import com.mints.goodmoney.ui.fragment.base.BaseFragment import com.mints.goodmoney.ui.fragment.base.BaseFragment
...@@ -29,6 +30,7 @@ import com.mints.goodmoney.ui.widgets.BonusDialog ...@@ -29,6 +30,7 @@ import com.mints.goodmoney.ui.widgets.BonusDialog
import com.mints.goodmoney.ui.widgets.CustomDialogAsApple import com.mints.goodmoney.ui.widgets.CustomDialogAsApple
import com.mints.goodmoney.ui.widgets.DialogListener import com.mints.goodmoney.ui.widgets.DialogListener
import com.mints.goodmoney.ui.widgets.ShareDialog import com.mints.goodmoney.ui.widgets.ShareDialog
import com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils
import com.mints.goodmoney.utils.ImageUtil import com.mints.goodmoney.utils.ImageUtil
import com.mints.goodmoney.utils.SpanUtils import com.mints.goodmoney.utils.SpanUtils
import com.scwang.smartrefresh.layout.api.RefreshLayout import com.scwang.smartrefresh.layout.api.RefreshLayout
...@@ -269,7 +271,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC ...@@ -269,7 +271,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
tv_bonus_sum.text = SpanUtils() tv_bonus_sum.text = SpanUtils()
.append("今日奖池 ").setForegroundColor(resources.getColor(R.color.black)) .append("今日奖池 ").setForegroundColor(resources.getColor(R.color.black))
.append(data.titleMsg).setFontSize(60).setForegroundColor(resources.getColor(R.color.color_E72C2B)) .append(data.titleMsg).setFontSize(BubbleUtils.dp2px(28)).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append(" 元").setForegroundColor(resources.getColor(R.color.black)) .append(" 元").setForegroundColor(resources.getColor(R.color.black))
.create() .create()
...@@ -283,7 +285,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC ...@@ -283,7 +285,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
tv_bonus_money.text = SpanUtils() tv_bonus_money.text = SpanUtils()
.append(data.cash.toString()).setForegroundColor(resources.getColor(R.color.color_E72C2B)) .append(data.cash.toString()).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.append("元").setFontSize(22).setForegroundColor(resources.getColor(R.color.color_E72C2B)) .append("元").setFontSize(BubbleUtils.dp2px(14)).setForegroundColor(resources.getColor(R.color.color_E72C2B))
.create() .create()
tv_bonus_rate.text = SpanUtils() tv_bonus_rate.text = SpanUtils()
...@@ -361,8 +363,13 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC ...@@ -361,8 +363,13 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
} }
R.id.btn_invite -> { R.id.btn_invite -> {
// 邀请好友 // 邀请好友
// shareImgDialog() // shareImgDialog()
if (!UserManager.getInstance().userIsLogin()) {
readyGo(LoginActivity::class.java)
return
}
if (!ps.getBoolean(Constant.FIRST_SHARE_INVITED, false)) { if (!ps.getBoolean(Constant.FIRST_SHARE_INVITED, false)) {
// 第一次邀请提示弹框 // 第一次邀请提示弹框
firstWeChatInvite() firstWeChatInvite()
...@@ -503,7 +510,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC ...@@ -503,7 +510,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
} }
}) })
cdaa!!.setTitle("提示") cdaa!!.setTitle("提示")
cdaa!!.setContent("分享用户需登录才能获得贡献值") cdaa!!.setContent("被邀请人需要登录才能获得贡献值")
cdaa!!.setLeft("取消") cdaa!!.setLeft("取消")
cdaa!!.setRight("打开微信") cdaa!!.setRight("打开微信")
cdaa!!.show() cdaa!!.show()
......
...@@ -439,6 +439,10 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -439,6 +439,10 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
if (taskBean.otherConfig != null) { if (taskBean.otherConfig != null) {
when (taskBean.otherConfig.status) { when (taskBean.otherConfig.status) {
0 -> { 0 -> {
if (!userManager.userIsLogin()) {
readyGo(LoginActivity::class.java)
}
if (!ps.getBoolean(Constant.FIRST_SHARE_MY, false)) { if (!ps.getBoolean(Constant.FIRST_SHARE_MY, false)) {
// 第一次邀请提示弹框 // 第一次邀请提示弹框
firstWeChatInvite() firstWeChatInvite()
...@@ -467,6 +471,10 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -467,6 +471,10 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
readyGo(AwardActivity::class.java, bundle) readyGo(AwardActivity::class.java, bundle)
} }
2 -> { 2 -> {
if (!userManager.userIsLogin()) {
readyGo(LoginActivity::class.java)
}
if (!ps.getBoolean(Constant.FIRST_SHARE_MY, false)) { if (!ps.getBoolean(Constant.FIRST_SHARE_MY, false)) {
// 第一次邀请提示弹框 // 第一次邀请提示弹框
firstWeChatInvite() firstWeChatInvite()
...@@ -559,7 +567,6 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -559,7 +567,6 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
} }
R.id.iv_right_icon2 -> { R.id.iv_right_icon2 -> {
// 跳转QQ客服 // 跳转QQ客服
// jumpQQ()
jumpQQGroup() jumpQQGroup()
} }
R.id.item_customer_service -> { R.id.item_customer_service -> {
...@@ -823,7 +830,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi ...@@ -823,7 +830,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
} }
}) })
cdaa!!.setTitle("提示") cdaa!!.setTitle("提示")
cdaa!!.setContent("分享用户需登录才能获得贡献值") cdaa!!.setContent("被邀请人需要登录才能获得贡献值")
cdaa!!.setLeft("取消") cdaa!!.setLeft("取消")
cdaa!!.setRight("打开微信") cdaa!!.setRight("打开微信")
cdaa!!.show() cdaa!!.show()
......
...@@ -46,7 +46,7 @@ class ZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChan ...@@ -46,7 +46,7 @@ class ZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChan
override fun onFragmentResume() { override fun onFragmentResume() {
super.onFragmentResume() super.onFragmentResume()
if (AppConfig.fragmentClickFlag === Constant.FRAGMENT_CLICK_MAIN) { if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_MAIN) {
bookPresenter.getReadInfo() bookPresenter.getReadInfo()
} }
} }
...@@ -55,7 +55,6 @@ class ZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChan ...@@ -55,7 +55,6 @@ class ZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChan
super.onDestroy() super.onDestroy()
IreaderApi.setReadChangeListener(null) IreaderApi.setReadChangeListener(null)
bookPresenter.detachView() bookPresenter.detachView()
} }
...@@ -89,14 +88,13 @@ class ZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChan ...@@ -89,14 +88,13 @@ class ZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChan
//阅读{10}分钟,奖励{xx}金币,已读{x}分钟 //阅读{10}分钟,奖励{xx}金币,已读{x}分钟
tvZhangContent.visibility = View.VISIBLE tvZhangContent.visibility = View.VISIBLE
if (readTime >= sumTime) { if (readTime >= sumTime) {
tvZhangContent.setText("今日阅读任务已完成") tvZhangContent.text = "今日阅读任务已完成"
} else { } else {
tvZhangContent.setText( tvZhangContent.text = SpanUtils()
SpanUtils() .append("阅读").append("${sumTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.main_mints)).append("分钟, ")
.append("阅读").append("${sumTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.main_mints)).append("分钟, ") .append("奖励").append("${sumCoin}").setForegroundColor(mContext.resources.getColor(R.color.red)).append("金币, ")
.append("奖励").append("${sumCoin}").setForegroundColor(mContext.resources.getColor(R.color.red)).append("金币, ") .append("已读").append("${readTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.main_mints)).append("分钟")
.append("已读").append("${readTime / 60}").setForegroundColor(mContext.resources.getColor(R.color.main_mints)).append("分钟") .create()
.create())
} }
} }
} }
\ No newline at end of file
...@@ -2,6 +2,7 @@ package com.mints.goodmoney.ui.widgets ...@@ -2,6 +2,7 @@ package com.mints.goodmoney.ui.widgets
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
import android.graphics.Color
import android.view.Gravity import android.view.Gravity
import android.view.KeyEvent import android.view.KeyEvent
import android.view.View import android.view.View
...@@ -40,13 +41,14 @@ class BonusDialog(context: Context, private val listener: DialogListener) : ...@@ -40,13 +41,14 @@ class BonusDialog(context: Context, private val listener: DialogListener) :
lp.gravity = Gravity.CENTER lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.MATCH_PARENT lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.windowAnimations = R.style.DialogAnimBottom lp.windowAnimations = R.style.DialogAnimBottom
// lp.dimAmount = 0; // 去背景遮盖
// lp.alpha = 1.0f;//透明效果
window!!.attributes = lp window!!.attributes = lp
// 设置外部不可关闭 // 设置外部不可关闭
setCancelable(true) setCancelable(false)
setCanceledOnTouchOutside(true) setCanceledOnTouchOutside(false)
setOnKeyListener { _, i, _ ->
i == KeyEvent.KEYCODE_BACK
}
// 查找View // 查找View
tv_dialogper_title = tv_dialogper_title =
......
...@@ -4,6 +4,7 @@ import android.app.Dialog ...@@ -4,6 +4,7 @@ import android.app.Dialog
import android.content.Context import android.content.Context
import android.graphics.Bitmap import android.graphics.Bitmap
import android.view.Gravity import android.view.Gravity
import android.view.KeyEvent
import android.view.View import android.view.View
import android.view.WindowManager import android.view.WindowManager
import android.widget.ImageView import android.widget.ImageView
...@@ -22,7 +23,6 @@ import com.mints.goodmoney.utils.ImageUtil ...@@ -22,7 +23,6 @@ import com.mints.goodmoney.utils.ImageUtil
import com.mints.goodmoney.utils.QRCodeUtil import com.mints.goodmoney.utils.QRCodeUtil
import com.mints.goodmoney.utils.ToastUtil import com.mints.goodmoney.utils.ToastUtil
class ShareDialog(context: Context) : class ShareDialog(context: Context) :
Dialog(context, R.style.dialog) { Dialog(context, R.style.dialog) {
...@@ -42,15 +42,14 @@ class ShareDialog(context: Context) : ...@@ -42,15 +42,14 @@ class ShareDialog(context: Context) :
lp.width = WindowManager.LayoutParams.MATCH_PARENT lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT lp.height = WindowManager.LayoutParams.WRAP_CONTENT
lp.windowAnimations = R.style.DialogAnimBottom lp.windowAnimations = R.style.DialogAnimBottom
// lp.alpha = 1.0f;//透明效果
window!!.attributes = lp window!!.attributes = lp
// 设置外部不可关闭 // 设置外部不可关闭
// setCancelable(false) setCancelable(false)
// setCanceledOnTouchOutside(false) setCanceledOnTouchOutside(false)
// setOnKeyListener { _, i, _ -> setOnKeyListener { _, i, _ ->
// i == KeyEvent.KEYCODE_BACK i == KeyEvent.KEYCODE_BACK
// } }
// 查找View // 查找View
llDialogShareWx = findViewById<View>(R.id.llDialogShareWx) as LinearLayout llDialogShareWx = findViewById<View>(R.id.llDialogShareWx) as LinearLayout
...@@ -67,6 +66,10 @@ class ShareDialog(context: Context) : ...@@ -67,6 +66,10 @@ class ShareDialog(context: Context) :
shareWechat() shareWechat()
} }
tvDialogShareNext.setOnClickListener {
dismiss()
}
val QRCode = QRCodeUtil.createQRCode(Constant.SHARE_URL, 100) val QRCode = QRCodeUtil.createQRCode(Constant.SHARE_URL, 100)
imgQrCode.setImageBitmap(QRCode) imgQrCode.setImageBitmap(QRCode)
} }
...@@ -74,11 +77,6 @@ class ShareDialog(context: Context) : ...@@ -74,11 +77,6 @@ class ShareDialog(context: Context) :
private fun shareWechat() { private fun shareWechat() {
rlView.isDrawingCacheEnabled = true rlView.isDrawingCacheEnabled = true
rlView.drawingCacheQuality = View.DRAWING_CACHE_QUALITY_HIGH rlView.drawingCacheQuality = View.DRAWING_CACHE_QUALITY_HIGH
//测量在屏幕上宽和高
// rlView.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
// View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED))
//确定View的大小和位置的,然后将其绘制出来
// rlView.layout(0, 0, rlView.measuredWidth, rlView.measuredHeight)
rlView.buildDrawingCache() rlView.buildDrawingCache()
val bitmap: Bitmap = rlView.drawingCache val bitmap: Bitmap = rlView.drawingCache
......
...@@ -9,7 +9,7 @@ import java.io.FileInputStream; ...@@ -9,7 +9,7 @@ import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.util.Properties; import java.util.Properties;
class BubbleUtils { public class BubbleUtils {
private static final File BUILD_PROP_FILE = new File(Environment.getRootDirectory(), "build.prop"); private static final File BUILD_PROP_FILE = new File(Environment.getRootDirectory(), "build.prop");
private static Properties sBuildProperties; private static Properties sBuildProperties;
...@@ -33,12 +33,12 @@ class BubbleUtils { ...@@ -33,12 +33,12 @@ class BubbleUtils {
return getBuildProperties().containsKey("ro.miui.ui.version.name"); return getBuildProperties().containsKey("ro.miui.ui.version.name");
} }
static int dp2px(int dp) { public static int dp2px(int dp) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
Resources.getSystem().getDisplayMetrics()); Resources.getSystem().getDisplayMetrics());
} }
static int sp2px(int sp) { public static int sp2px(int sp) {
return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp, return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, sp,
Resources.getSystem().getDisplayMetrics()); Resources.getSystem().getDisplayMetrics());
} }
......
...@@ -26,11 +26,11 @@ ...@@ -26,11 +26,11 @@
<!-- 注意:如需要这个Logo区域,建议开发者使用自己的Logo资源,而不是联盟的Logo资源@drawable/gdt_splash_logo,资源规格可参照@drawable/gdt_splash_logo --> <!-- 注意:如需要这个Logo区域,建议开发者使用自己的Logo资源,而不是联盟的Logo资源@drawable/gdt_splash_logo,资源规格可参照@drawable/gdt_splash_logo -->
<ImageView <ImageView
android:id="@+id/app_logo" android:id="@+id/app_logo"
android:layout_marginTop="10dp"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:src="@drawable/splash_bg" /> android:src="@drawable/splash_bg" />
<!-- 2.预设开屏图片区域: --> <!-- 2.预设开屏图片区域: -->
......
...@@ -3,21 +3,20 @@ ...@@ -3,21 +3,20 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical"> android:orientation="vertical">
<com.androidkun.xtablayout.XTabLayout <com.androidkun.xtablayout.XTabLayout
android:id="@+id/xtFragmentMoney" android:id="@+id/xtFragmentMoney"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="30dp" android:layout_marginTop="25dp"
app:xTabIndicatorColor="#F28335" app:xTabIndicatorColor="#F28335"
app:xTabIndicatorHeight="4dp" app:xTabIndicatorHeight="4dp"
app:xTabIndicatorWidth="10dp"
app:xTabMode="scrollable" app:xTabMode="scrollable"
app:xTabSelectedTextColor="@color/main_mints" app:xTabSelectedTextColor="@color/main_mints"
app:xTabSelectedTextSize="22sp" app:xTabSelectedTextSize="22sp"
app:xTabTextColor="#000" app:xTabTextColor="#000"
app:xTabIndicatorWidth="10dp"
app:xTabTextSize="18sp" /> app:xTabTextSize="18sp" />
<com.mints.goodmoney.ui.widgets.MyViewPager <com.mints.goodmoney.ui.widgets.MyViewPager
......
...@@ -3,26 +3,25 @@ ...@@ -3,26 +3,25 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <FrameLayout
android:id="@+id/fragment" android:id="@+id/fragment"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1"></FrameLayout> android:layout_weight="1" />
<TextView <TextView
android:id="@+id/tvZhangContent" android:id="@+id/tvZhangContent"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="40dp"
android:background="@color/my_color_gray" android:background="@color/my_color_gray"
android:drawableLeft="@mipmap/ic_voice"
android:drawablePadding="5dp" android:drawablePadding="5dp"
android:paddingLeft="14dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingStart="14dp"
android:textSize="14sp" android:textSize="14sp"
android:visibility="gone"></TextView> android:visibility="gone"
app:drawableStartCompat="@mipmap/ic_voice" />
</LinearLayout> </LinearLayout>
...@@ -33,12 +33,9 @@ ...@@ -33,12 +33,9 @@
<item name="android:backgroundDimEnabled">true</item> <item name="android:backgroundDimEnabled">true</item>
</style> </style>
<style name="Theme.NoDisplay" parent="Theme.AppCompat.Light.NoActionBar"> <style name="NormalSplash" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@null</item> <item name="android:windowBackground">@drawable/splash_bg</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item> <item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowAnimationStyle">@null</item>
<item name="android:windowDisablePreview">true</item>
<item name="android:windowNoDisplay">false</item>
</style> </style>
</resources> </resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment