Commit 45d3998f authored by jyx's avatar jyx

更换引导页

parent dc2b8731
...@@ -224,6 +224,21 @@ dependencies { ...@@ -224,6 +224,21 @@ dependencies {
// BASE64Decoder(已集成) // BASE64Decoder(已集成)
// 三方接入 // 三方接入
// 一览视频
implementation("com.yilan.sdk:ui:3.3.3.6") {
exclude group: 'com.yilan.sdk', module: 'yb_extra'
exclude group: 'com.yilan.sdk', module: 'gdt'
exclude group: 'com.yilan.sdk', module: 'ks'
}
implementation('com.aliyun.ams:alicloud-android-httpdns:1.2.3@aar') {
transitive true
}
implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.8'
// leakcanary // leakcanary
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4' debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
// 极光推送 // 极光推送
...@@ -256,12 +271,12 @@ dependencies { ...@@ -256,12 +271,12 @@ dependencies {
implementation(name: 'tzsdk_core-3.0.0-20200807131516-release', ext: 'aar') implementation(name: 'tzsdk_core-3.0.0-20200807131516-release', ext: 'aar')
implementation(name: 'tzsdk_reporter-3.0.0-20200807131516-release', ext: 'aar') implementation(name: 'tzsdk_reporter-3.0.0-20200807131516-release', ext: 'aar')
// 快手 // 快手
implementation(name: 'kssdk-all--3.3.16-publishRelease-9ffe2b94e', ext: 'aar') implementation(name: 'kssdk-ad-3.3.9', ext: 'aar')
// 穿山甲 GroMore // 穿山甲 GroMore
// mediation_ad_sdk // mediation_ad_sdk
implementation(name: 'mediation_ad_sdk_2.7.1.2', ext: 'aar') implementation(name: 'mediation_ad_sdk_2.8.0.2', ext: 'aar')
implementation(name: 'gdt_adapter_4.351.1221.1', ext: 'aar') implementation(name: 'gdt_adapter_4.351.1221.3', ext: 'aar')
implementation(name: 'ks_adapter_3.3.9.0', ext: 'aar') implementation(name: 'ks_adapter_3.3.9.2', ext: 'aar')
// 穿山甲广告 版本3.6.1.3 // 穿山甲广告 版本3.6.1.3
implementation(name: 'open_ad_sdk_3.6.1.3', ext: 'aar') implementation(name: 'open_ad_sdk_3.6.1.3', ext: 'aar')
// 广点通广告 腾讯 // 广点通广告 腾讯
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
package="com.mints.flowbox"> package="com.mints.flowbox">
<uses-permission android:name="android.permission.GET_PACKAGE_SIZE" /> <uses-permission android:name="android.permission.GET_PACKAGE_SIZE" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" />
...@@ -53,7 +52,7 @@ ...@@ -53,7 +52,7 @@
android:allowBackup="false" android:allowBackup="false"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher_main" android:icon="@drawable/ic_launcher_main"
android:label="@string/app_name" android:label="@string/appName"
android:largeHeap="true" android:largeHeap="true"
android:maxAspectRatio="3" android:maxAspectRatio="3"
android:networkSecurityConfig="@xml/network_security_config" android:networkSecurityConfig="@xml/network_security_config"
...@@ -304,10 +303,6 @@ ...@@ -304,10 +303,6 @@
<!-- 常驻通知栏service --> <!-- 常驻通知栏service -->
<service android:name="com.mints.flowbox.keepalive.NotificationService" /> <service android:name="com.mints.flowbox.keepalive.NotificationService" />
<service
android:name=".clean.CleanerService"
android:exported="false" />
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -18,12 +18,15 @@ import com.activityutil.ActivityManagerProxyImpl; ...@@ -18,12 +18,15 @@ import com.activityutil.ActivityManagerProxyImpl;
import com.ad.AdHelper; import com.ad.AdHelper;
import com.hjq.toast.ToastUtils; import com.hjq.toast.ToastUtils;
import com.mints.flowbox.common.Constant; import com.mints.flowbox.common.Constant;
import com.mints.flowbox.keepalive.BatteryWatch;
import com.mints.flowbox.keepalive.DemoEventLogger; import com.mints.flowbox.keepalive.DemoEventLogger;
import com.mints.flowbox.keepalive.NotificationService; import com.mints.flowbox.keepalive.NotificationService;
import com.mints.flowbox.keepalive.NotificationUtil; import com.mints.flowbox.keepalive.NotificationUtil;
import com.mints.flowbox.keepalive.PackageWatch;
import com.mints.flowbox.keepalive.ServiceUtil; import com.mints.flowbox.keepalive.ServiceUtil;
import com.mints.flowbox.keepalive.ScreenWatch; import com.mints.flowbox.keepalive.ScreenWatch;
import com.mints.flowbox.manager.CsjGroMoreManager; import com.mints.flowbox.manager.CsjGroMoreManager;
import com.mints.flowbox.manager.YlVideoManager;
import com.mints.flowbox.manager.ad.KsManager; import com.mints.flowbox.manager.ad.KsManager;
import com.mints.flowbox.manager.ad.MhManager; import com.mints.flowbox.manager.ad.MhManager;
import com.mints.flowbox.manager.MiitHelper; import com.mints.flowbox.manager.MiitHelper;
...@@ -108,6 +111,8 @@ public class MintsApplication extends BaseApp { ...@@ -108,6 +111,8 @@ public class MintsApplication extends BaseApp {
if (isMainProcess || (processName != null && processName.endsWith(":channel"))) { if (isMainProcess || (processName != null && processName.endsWith(":channel"))) {
if (BuildConfig.DEBUG) Log.w(TAG, "init: umeng init"); if (BuildConfig.DEBUG) Log.w(TAG, "init: umeng init");
System.out.println("mints ------------> umengConfig <------------");
// UmengHelper.init(this, channel); // UmengHelper.init(this, channel);
} }
...@@ -176,12 +181,53 @@ public class MintsApplication extends BaseApp { ...@@ -176,12 +181,53 @@ public class MintsApplication extends BaseApp {
Toast.makeText(this, "测试:主进程重启成功", Toast.LENGTH_LONG).show(); Toast.makeText(this, "测试:主进程重启成功", Toast.LENGTH_LONG).show();
} }
new ScreenWatch(MintsApplication.this) // 监听锁屏状态
.begin(() -> { ScreenWatch.getInstance(this).begin(() -> {
Intent intent = new Intent(MintsApplication.getContext(), ScreenActivity.class); Intent intent = new Intent(MintsApplication.getContext(), ScreenActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
MintsApplication.this.startActivity(intent); MintsApplication.this.startActivity(intent);
});
ToastUtils.show("--> 唤醒屏幕 <--");
});
// 监听充电状态
BatteryWatch.getInstance(this).begin(new BatteryWatch.BatteryStateListener() {
@Override
public void onCharging() {
Intent intent = new Intent(MintsApplication.getContext(), ScreenActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
MintsApplication.this.startActivity(intent);
ToastUtils.show("--> 正在充电 <--");
}
@Override
public void onUnCharging() {
Intent intent = new Intent(MintsApplication.getContext(), ScreenActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
MintsApplication.this.startActivity(intent);
ToastUtils.show("--> 停止充电 <--");
}
});
PackageWatch.getInstance(this).begin(new PackageWatch.InstallStateListener() {
@Override
public void onAdded() {
ToastUtils.show("--> APK安装 <--");
}
@Override
public void onReplaced() {
ToastUtils.show("--> APK卸载 <--");
}
@Override
public void onRemoved() {
ToastUtils.show("--> APK移除 <--");
}
});
} }
// 保活: 保活最后一步 // 保活: 保活最后一步
...@@ -226,7 +272,8 @@ public class MintsApplication extends BaseApp { ...@@ -226,7 +272,8 @@ public class MintsApplication extends BaseApp {
* 三方配置 * 三方配置
*/ */
private void thirdConfig() { private void thirdConfig() {
Log.d(TAG, "thirdConfig");
System.out.println("mints ------------> thirdConfig <------------");
// 初始化toast // 初始化toast
initToast(); initToast();
...@@ -261,6 +308,9 @@ public class MintsApplication extends BaseApp { ...@@ -261,6 +308,9 @@ public class MintsApplication extends BaseApp {
// 喜马拉雅 // 喜马拉雅
XmManager.INSTANCE.init(this); XmManager.INSTANCE.init(this);
// 一览视频
YlVideoManager.INSTANCE.init(this);
// 自定义logger // 自定义logger
bindLogger(); bindLogger();
......
...@@ -12,7 +12,6 @@ import com.bytedance.msdk.api.* ...@@ -12,7 +12,6 @@ import com.bytedance.msdk.api.*
import com.bytedance.msdk.api.nativeAd.* import com.bytedance.msdk.api.nativeAd.*
import com.mints.flowbox.MintsApplication import com.mints.flowbox.MintsApplication
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant import com.mints.flowbox.common.Constant
import com.mints.flowbox.manager.CsjGroMoreManager import com.mints.flowbox.manager.CsjGroMoreManager
import com.mints.flowbox.manager.TrackManager import com.mints.flowbox.manager.TrackManager
...@@ -152,7 +151,7 @@ class GroMoreExpressManager : TTSettingConfigCallback { ...@@ -152,7 +151,7 @@ class GroMoreExpressManager : TTSettingConfigCallback {
}) })
} }
fun getADFrameLayout(): FrameLayout? { fun getADFrameLayout(): FrameLayout {
return sAdFrameLayout return sAdFrameLayout
} }
...@@ -205,7 +204,7 @@ class GroMoreExpressManager : TTSettingConfigCallback { ...@@ -205,7 +204,7 @@ class GroMoreExpressManager : TTSettingConfigCallback {
} }
//渲染模板广告 //渲染模板广告
private fun getExpressAdView(ad: TTNativeAd): View? { private fun getExpressAdView(ad: TTNativeAd): View {
val adViewHolder: ExpressAdViewHolder val adViewHolder: ExpressAdViewHolder
val convertView = LayoutInflater.from(MintsApplication.getContext()) val convertView = LayoutInflater.from(MintsApplication.getContext())
.inflate(R.layout.listitem_ad_native_express, null, false) .inflate(R.layout.listitem_ad_native_express, null, false)
...@@ -248,9 +247,7 @@ class GroMoreExpressManager : TTSettingConfigCallback { ...@@ -248,9 +247,7 @@ class GroMoreExpressManager : TTSettingConfigCallback {
LogUtil.d(TAG, "onRenderFail code=$code,msg=$msg") LogUtil.d(TAG, "onRenderFail code=$code,msg=$msg")
} }
// ** 注意点 ** 不要在广告加载成功回调里进行广告view展示,要在onRenderSucces进行广告view展示,否则会导致广告无法展示。 override fun onRenderSuccess(width: Float, height: Float) {
// 另外,不要直接使用参数view,而是通过ad.getExpressView()来获取广告view。
override fun onRenderSuccess(view: View, width: Float, height: Float) {
LogUtil.d(TAG, "onRenderSuccess") LogUtil.d(TAG, "onRenderSuccess")
//回调渲染成功后将模板布局添加的父View中 //回调渲染成功后将模板布局添加的父View中
if (adViewHolder.mAdContainerView != null) { if (adViewHolder.mAdContainerView != null) {
...@@ -262,7 +259,7 @@ class GroMoreExpressManager : TTSettingConfigCallback { ...@@ -262,7 +259,7 @@ class GroMoreExpressManager : TTSettingConfigCallback {
sWidth = FrameLayout.LayoutParams.MATCH_PARENT sWidth = FrameLayout.LayoutParams.MATCH_PARENT
sHeight = FrameLayout.LayoutParams.WRAP_CONTENT sHeight = FrameLayout.LayoutParams.WRAP_CONTENT
} else { } else {
sWidth = UIUtils.getScreenWidth(MintsApplication.getContext()).toInt() sWidth = UIUtils.getScreenWidth(MintsApplication.getContext())
sHeight = (sWidth * height / width).toInt() sHeight = (sWidth * height / width).toInt()
} }
if (video != null) { if (video != null) {
...@@ -274,6 +271,7 @@ class GroMoreExpressManager : TTSettingConfigCallback { ...@@ -274,6 +271,7 @@ class GroMoreExpressManager : TTSettingConfigCallback {
} }
} }
} }
}) })
...@@ -310,7 +308,7 @@ class GroMoreExpressManager : TTSettingConfigCallback { ...@@ -310,7 +308,7 @@ class GroMoreExpressManager : TTSettingConfigCallback {
* @param ad * @param ad
* @return * @return
*/ */
private fun getVerticalAdView(ad: TTNativeAd): View? { private fun getVerticalAdView(ad: TTNativeAd): View {
val convertView = LayoutInflater.from(MintsApplication.getContext()) val convertView = LayoutInflater.from(MintsApplication.getContext())
.inflate(R.layout.listitem_ad_vertical_pic, null, false) .inflate(R.layout.listitem_ad_vertical_pic, null, false)
val adViewHolder = VerticalAdViewHolder() val adViewHolder = VerticalAdViewHolder()
...@@ -413,7 +411,7 @@ class GroMoreExpressManager : TTSettingConfigCallback { ...@@ -413,7 +411,7 @@ class GroMoreExpressManager : TTSettingConfigCallback {
return convertView return convertView
} }
private fun getLargeAdView(ad: TTNativeAd): View? { private fun getLargeAdView(ad: TTNativeAd): View {
val convertView = LayoutInflater.from(MintsApplication.getContext()) val convertView = LayoutInflater.from(MintsApplication.getContext())
.inflate(R.layout.listitem_ad_large_pic, null, false) .inflate(R.layout.listitem_ad_large_pic, null, false)
val adViewHolder = LargeAdViewHolder() val adViewHolder = LargeAdViewHolder()
...@@ -451,7 +449,7 @@ class GroMoreExpressManager : TTSettingConfigCallback { ...@@ -451,7 +449,7 @@ class GroMoreExpressManager : TTSettingConfigCallback {
return convertView return convertView
} }
private fun getGroupAdView(ad: TTNativeAd): View? { private fun getGroupAdView(ad: TTNativeAd): View {
val convertView = LayoutInflater.from(MintsApplication.getContext()) val convertView = LayoutInflater.from(MintsApplication.getContext())
.inflate(R.layout.listitem_ad_group_pic, null, false) .inflate(R.layout.listitem_ad_group_pic, null, false)
val adViewHolder = GroupAdViewHolder() val adViewHolder = GroupAdViewHolder()
...@@ -501,7 +499,7 @@ class GroMoreExpressManager : TTSettingConfigCallback { ...@@ -501,7 +499,7 @@ class GroMoreExpressManager : TTSettingConfigCallback {
return convertView return convertView
} }
private fun getSmallAdView(ad: TTNativeAd): View? { private fun getSmallAdView(ad: TTNativeAd): View {
val convertView = LayoutInflater.from(MintsApplication.getContext()) val convertView = LayoutInflater.from(MintsApplication.getContext())
.inflate(R.layout.listitem_ad_small_pic, null, false) .inflate(R.layout.listitem_ad_small_pic, null, false)
val adViewHolder = SmallAdViewHolder() val adViewHolder = SmallAdViewHolder()
......
...@@ -61,7 +61,7 @@ public class TaskAsyncTack extends AsyncTask<Void, Void, List<CacheListItem>> { ...@@ -61,7 +61,7 @@ public class TaskAsyncTack extends AsyncTask<Void, Void, List<CacheListItem>> {
Thread.sleep(1000); Thread.sleep(1000);
break; break;
case TASK_TYPE_UNUSEPKG: case TASK_TYPE_UNUSEPKG:
FileScanManager.INSTANCE.getSuffixFiles(filePaths -> { FileScanManager.INSTANCE.getSuffixFilesAsync(filePaths -> {
for (String filePath : filePaths) { for (String filePath : filePaths) {
cacheListItems.add(AppUtil.INSTANCE.getApkInfo(MintsApplication.getContext(), filePath)); cacheListItems.add(AppUtil.INSTANCE.getApkInfo(MintsApplication.getContext(), filePath));
} }
......
...@@ -336,7 +336,7 @@ class DeviceInfo private constructor() { ...@@ -336,7 +336,7 @@ class DeviceInfo private constructor() {
get() { get() {
var appName = "" var appName = ""
try { try {
appName = mContext!!.resources.getString(R.string.app_name) appName = mContext!!.resources.getString(R.string.appName)
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
} }
......
package com.mints.flowbox.keepalive;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.BatteryManager;
import com.mints.flowbox.MintsApplication;
/**
* @author jyx
* @date 2021/6/18
* @des 电池监听
*/
public class BatteryWatch {
private static BatteryWatch instance;
public static BatteryWatch getInstance(Context context) {
if (instance == null) instance = new BatteryWatch(context);
return instance;
}
private final Context mContext;
private final BroadcastReceiver mReceiver;
private BatteryStateListener mStateListener;
private BatteryWatch(Context context) {
mContext = context;
mReceiver = new BatteryBroadcastReceiver();
}
/**
* 电池状态广播接收者
*/
private class BatteryBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
if (status == BatteryManager.BATTERY_STATUS_CHARGING || status == BatteryManager.BATTERY_STATUS_FULL) {
mStateListener.onCharging();
} else {
mStateListener.onUnCharging();
}
}
}
/**
* 开始监听电池状态
*/
public void begin(BatteryStateListener listener) {
mStateListener = listener;
registerListener();
}
/**
* 停止充电状态监听
*/
public void unregisterListener() {
mContext.unregisterReceiver(mReceiver);
}
/**
* 启动充电状态广播接收器
*/
private void registerListener() {
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_POWER_CONNECTED);
filter.addAction(Intent.ACTION_POWER_DISCONNECTED);
mContext.registerReceiver(mReceiver, filter);
}
public interface BatteryStateListener {// 返回给调用者屏幕状态信息
void onCharging();
void onUnCharging();
}
}
package com.mints.flowbox.keepalive;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
/**
* @author jyx
* @date 2021/6/18
* @des app 安装卸载重装
*/
public class PackageWatch {
private static PackageWatch instance;
public static PackageWatch getInstance(Context context) {
if (instance == null) instance = new PackageWatch(context);
return instance;
}
private final Context mContext;
private final BroadcastReceiver mReceiver;
private InstallStateListener mStateListener;
private PackageWatch(Context context) {
mContext = context;
mReceiver = new InstallBroadcastReceiver();
}
/**
* app安装卸载广播接收者
*/
private class InstallBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
PackageManager manager = context.getPackageManager();
if (intent.getAction().equals(Intent.ACTION_PACKAGE_ADDED)) {
String packageName = intent.getData().getSchemeSpecificPart();
mStateListener.onAdded();
}
if (intent.getAction().equals(Intent.ACTION_PACKAGE_REMOVED)) {
String packageName = intent.getData().getSchemeSpecificPart();
mStateListener.onRemoved();
}
if (intent.getAction().equals(Intent.ACTION_PACKAGE_REPLACED)) {
String packageName = intent.getData().getSchemeSpecificPart();
mStateListener.onReplaced();
}
}
}
/**
* 开始监听apk安装卸载重装相应状态
*/
public void begin(InstallStateListener listener) {
mStateListener = listener;
registerListener();
}
/**
* 停止apk安装卸载重装相应状态
*/
public void unregisterListener() {
mContext.unregisterReceiver(mReceiver);
}
/**
* 启动apk安装卸载重装广播接收器
*/
private void registerListener() {
IntentFilter filter = new IntentFilter();
filter.addAction("android.intent.action.PACKAGE_ADDED");
filter.addAction("android.intent.action.PACKAGE_REPLACED");
filter.addAction("android.intent.action.PACKAGE_REMOVED");
filter.addDataScheme("package");
mContext.registerReceiver(mReceiver, filter);
}
public interface InstallStateListener {
void onAdded();
void onReplaced();
void onRemoved();
}
}
...@@ -5,21 +5,31 @@ import android.content.Context; ...@@ -5,21 +5,31 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import com.mints.flowbox.MintsApplication;
/** /**
* @author jyx * @author jyx
* @date 2021/6/18 * @date 2021/6/18
* @des 锁屏监听 * @des 锁屏监听
*/ */
public class ScreenWatch { public class ScreenWatch {
private Context mContext;
private ScreenBroadcastReceiver mScreenReceiver; private final Context mContext;
private final ScreenBroadcastReceiver mScreenReceiver;
private ScreenStateListener mScreenStateListener; private ScreenStateListener mScreenStateListener;
public ScreenWatch(Context context) { private ScreenWatch(Context context) {
mContext = context; mContext = context;
mScreenReceiver = new ScreenBroadcastReceiver(); mScreenReceiver = new ScreenBroadcastReceiver();
} }
private static ScreenWatch instance;
public static ScreenWatch getInstance(Context context) {
if (instance == null) instance = new ScreenWatch(context);
return instance;
}
/** /**
* screen状态广播接收者 * screen状态广播接收者
*/ */
...@@ -34,8 +44,6 @@ public class ScreenWatch { ...@@ -34,8 +44,6 @@ public class ScreenWatch {
/** /**
* 开始监听screen状态 * 开始监听screen状态
*
* @param listener
*/ */
public void begin(ScreenStateListener listener) { public void begin(ScreenStateListener listener) {
mScreenStateListener = listener; mScreenStateListener = listener;
......
package com.mints.flowbox.keepalive;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.BatteryManager;
/**
* @author jyx
* @date 2021/6/18
* @des 电池监听
*/
public class WifiStateWatch {
private static WifiStateWatch instance;
public static WifiStateWatch getInstance(Context context) {
if (instance == null) instance = new WifiStateWatch(context);
return instance;
}
private final Context mContext;
private final BroadcastReceiver mReceiver;
private WifiStateListener mStateListener;
private WifiStateWatch(Context context) {
mContext = context;
mReceiver = new WifiBroadcastReceiver();
}
/**
* 电池状态广播接收者
*/
private class WifiBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
if (status == BatteryManager.BATTERY_STATUS_CHARGING || status == BatteryManager.BATTERY_STATUS_FULL) {
mStateListener.onWifiOpen();
} else {
mStateListener.onWifiClose();
}
}
}
/**
* 开始监听电池状态
*/
public void begin(WifiStateListener listener) {
mStateListener = listener;
registerListener();
}
/**
* 停止充电状态监听
*/
public void unregisterListener() {
mContext.unregisterReceiver(mReceiver);
}
/**
* 启动充电状态广播接收器
*/
private void registerListener() {
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_POWER_CONNECTED);
filter.addAction(Intent.ACTION_POWER_DISCONNECTED);
mContext.registerReceiver(mReceiver, filter);
}
public interface WifiStateListener {// 返回给调用者屏幕状态信息
void onWifiOpen();
void onWifiClose();
}
}
...@@ -28,9 +28,13 @@ object FileScanManager { ...@@ -28,9 +28,13 @@ object FileScanManager {
mEligibleFiles.clear() mEligibleFiles.clear()
val sdDir = Environment.getExternalStorageDirectory() val sdDir = Environment.getExternalStorageDirectory()
val listFiles = sdDir.listFiles() val listFiles = sdDir.listFiles()
getSuffixFile(listFiles, *suffixs) if (listFiles != null) {
getSuffixFile(listFiles, *suffixs)
callback.onSuccess(mEligibleFiles) callback.onSuccess(mEligibleFiles)
} else {
callback.onSuccess(mEligibleFiles)
}
} }
/** /**
......
...@@ -79,11 +79,7 @@ public class TtCsjAdManager { ...@@ -79,11 +79,7 @@ public class TtCsjAdManager {
private static TTAdConfig buildConfig(Context context) { private static TTAdConfig buildConfig(Context context) {
boolean logFlag; boolean logFlag;
if (BuildConfig.DEBUG) { logFlag = BuildConfig.DEBUG;
logFlag = true;
} else {
logFlag = false;
}
return new TTAdConfig.Builder() return new TTAdConfig.Builder()
.appId(TT_AD_APPID) .appId(TT_AD_APPID)
......
package com.mints.flowbox.manager
import android.app.Application
import com.yilan.sdk.ui.YLUIInit
import com.yilan.sdk.ui.configs.CommentConfig
import com.yilan.sdk.ui.configs.FeedConfig
import com.yilan.sdk.ui.configs.YLUIConfig
/**
* 描述:一览视频(好兔)
* 作者:孟崔广
*/
object YlVideoManager {
private const val ACCESSKEY = "ylyv7qukd06q"
private const val ACCESSTOKEN = "nb055b7cu61wt0zt291cmafi6qwkrvsv"
fun init(application: Application) {
YLUIInit.getInstance()
.setCrashOpen(false)
.setApplication(application)
.setAccessKey(ACCESSKEY)
.setAccessToken(ACCESSTOKEN)
.build()
//页面个性化配置
YLUIConfig.getInstance() //抖音样式小视频配置
.littleLikeShow(true) //是否显示点赞
.littleShareShow(false) //是否显示分享
.littleShowGuide(true) //是否显示新手引导滑动浮层(第一次安装进入显示)
.littleComment(CommentConfig.CommentType.DISMISS_COMMENT) //评论,参数详见文档;
//feed流短视频样式配置
.videoComment(CommentConfig.CommentType.DISMISS_COMMENT) //评论,参数详见文档;
.videoLikeShow(false) //是否显示点赞
.videoShareShow(false) //是否显示分享
.followAvailable(false) //关注功能是否可用
.feedAvatarClickable(true) //头像是否支持点击跳转到作者页面
.feedPlayAuto(true) //feed自动播放
.feedSwipeRefreshEnable(true) //feed是否可以下拉刷新
FeedConfig.getInstance().playerStyle = FeedConfig.STYLE_FEED_PLAY //FeedConfig.STYLE_FEED_PLAY当前页面播放
}
}
\ No newline at end of file
...@@ -32,7 +32,7 @@ class AboutusActivity : BaseActivity(), View.OnClickListener { ...@@ -32,7 +32,7 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
tvAboutasVersion.text = tvAboutasVersion.text =
getString(R.string.app_name) + " v" + ConstantUtil.getVersionName(context) getString(R.string.appName) + " v" + ConstantUtil.getVersionName(context)
tv_title.text = "关于我们" tv_title.text = "关于我们"
iv_left_icon.visibility = View.VISIBLE iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back) iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
...@@ -48,20 +48,6 @@ class AboutusActivity : BaseActivity(), View.OnClickListener { ...@@ -48,20 +48,6 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
true true
} }
var step = 0
val timer = Timer()
timer.schedule(object : TimerTask() {
override fun run() {
runOnUiThread {
step++
pb.setProgress(step)
}
}
}, 50, 50)
initListener() initListener()
} }
......
...@@ -13,7 +13,6 @@ import com.mints.flowbox.ui.activitys.base.BaseActivity ...@@ -13,7 +13,6 @@ import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.ui.adapter.clean.CleanExpandAdapter import com.mints.flowbox.ui.adapter.clean.CleanExpandAdapter
import com.mints.flowbox.ui.adapter.clean.ExpandInfo import com.mints.flowbox.ui.adapter.clean.ExpandInfo
import com.mints.flowbox.ui.adapter.clean.ExpandInfo.ChildInfo import com.mints.flowbox.ui.adapter.clean.ExpandInfo.ChildInfo
import com.mints.flowbox.utils.LogUtil
import kotlinx.android.synthetic.main.activity_clean.* import kotlinx.android.synthetic.main.activity_clean.*
import kotlinx.android.synthetic.main.header_layout.* import kotlinx.android.synthetic.main.header_layout.*
import kotlinx.android.synthetic.main.view_title.* import kotlinx.android.synthetic.main.view_title.*
...@@ -45,6 +44,8 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -45,6 +44,8 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
private var isCleanCompleted = false private var isCleanCompleted = false
private var isItemCleanOk = true private var isItemCleanOk = true
private var mScanTimer: Timer? = null
private var mCleanTimer: Timer? = null
override fun getContentViewLayoutID() = R.layout.activity_clean override fun getContentViewLayoutID() = R.layout.activity_clean
...@@ -60,15 +61,27 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -60,15 +61,27 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
/** 开始扫描 */ /** 开始扫描 */
private fun startScan() { private fun startScan() {
var taskType = 0 var taskType = 0
isScaning = true isScaning = true
val scanTimer = Timer() // 拦截滑动事件
scanTimer.schedule(object : TimerTask() { elv_clean.isIntercept(isScaning)
// 开始按钮动画
btnClean.startCycle()
mScanTimer = Timer()
mScanTimer?.schedule(object : TimerTask() {
override fun run() { override fun run() {
runOnUiThread { runOnUiThread {
if (!isItemCleanOk || taskType == 5) {
return@runOnUiThread
}
TaskAsyncTack(taskType, object : TaskAsyncTack.OnActionListener { TaskAsyncTack(taskType, object : TaskAsyncTack.OnActionListener {
override fun onStart() { override fun onStart() {
isItemCleanOk = false
when (taskType) { when (taskType) {
0 -> btnClean.text = "正在扫描 运行程序..." 0 -> btnClean.text = "正在扫描 运行程序..."
1 -> btnClean.text = "正在扫描 系统缓存..." 1 -> btnClean.text = "正在扫描 系统缓存..."
...@@ -82,6 +95,8 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -82,6 +95,8 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
override fun onCompleted(data: MutableList<CacheListItem>?) { override fun onCompleted(data: MutableList<CacheListItem>?) {
data?.let { data?.let {
isItemCleanOk = true
for (cacheListItem in it) { for (cacheListItem in it) {
val childInfo = ChildInfo() val childInfo = ChildInfo()
childInfo.name = cacheListItem.applicationName childInfo.name = cacheListItem.applicationName
...@@ -93,11 +108,19 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -93,11 +108,19 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
} }
mCleanExpandAdapter?.notifyDataSetChanged() mCleanExpandAdapter?.notifyDataSetChanged()
if (taskType == 4) {
// 放开滑动事件
elv_clean.isIntercept(false)
elv_clean.smoothScrollToPosition(elv_clean.count)
}
} }
taskType++ taskType++
if (taskType == 4) { if (taskType == 5) {
scanTimer.cancel()
mScanTimer?.cancel()
btnClean.pauseCycle()
btnClean.text = "开始清理" btnClean.text = "开始清理"
isScaning = false isScaning = false
} }
...@@ -113,12 +136,14 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -113,12 +136,14 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
private fun startClean() { private fun startClean() {
// 滚动到顶部 // 滚动到顶部
elv_clean.setSelectedGroup(0) elv_clean.setSelectedGroup(0)
btnClean.startCycle()
var taskType = 0 var taskType = 0
isCleaning = true isCleaning = true
isItemCleanOk = true
val cleanTimer = Timer() mCleanTimer = Timer()
cleanTimer.schedule(object : TimerTask() { mCleanTimer?.schedule(object : TimerTask() {
override fun run() { override fun run() {
runOnUiThread { runOnUiThread {
...@@ -154,11 +179,15 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -154,11 +179,15 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
} }
taskType++ taskType++
if (taskType == 4) { if (taskType == 5) {
// 防止下标越界
taskType--
btnClean.pauseCycle()
btnClean.text = "清理完成" btnClean.text = "清理完成"
isCleaning = false isCleaning = false
isCleanCompleted = true isCleanCompleted = true
cleanTimer.cancel() mCleanTimer?.cancel()
} }
} }
} }
...@@ -261,7 +290,6 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -261,7 +290,6 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
private fun remove(groupPosition: Int, removeIndex: Int, removeChildInfo: ChildInfo?) { private fun remove(groupPosition: Int, removeIndex: Int, removeChildInfo: ChildInfo?) {
if (removeIndex == -1 || removeChildInfo == null) return if (removeIndex == -1 || removeChildInfo == null) return
LogUtil.d("CCC -> " + removeIndex)
var currentRemoveIndex = 0 var currentRemoveIndex = 0
// 删除索引 = 组索引 + 1 + 子项删除索引 // 删除索引 = 组索引 + 1 + 子项删除索引
for (i in 0..groupPosition) { for (i in 0..groupPosition) {
...@@ -329,6 +357,11 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -329,6 +357,11 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
} }
override fun onDestroy() { override fun onDestroy() {
mScanTimer?.cancel()
mScanTimer = null
mCleanTimer?.cancel()
mCleanTimer = null
super.onDestroy() super.onDestroy()
} }
} }
...@@ -76,7 +76,6 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -76,7 +76,6 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
//super.onSaveInstanceState(outState); //super.onSaveInstanceState(outState);
} }
var oldTime: Long = 0
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean { override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
when (keyCode) { when (keyCode) {
KeyEvent.KEYCODE_VOLUME_UP -> { KeyEvent.KEYCODE_VOLUME_UP -> {
...@@ -96,14 +95,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -96,14 +95,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
return true return true
} }
KeyEvent.KEYCODE_BACK -> { KeyEvent.KEYCODE_BACK -> {
// 设置为后台 // 移动至后台运行
val currentTime = System.currentTimeMillis() moveTaskToBack(true)
if (currentTime - oldTime < 2 * 1000) {
baseApplication.exitApp()
} else {
showToast("再次点击退出" + getString(R.string.app_name))
oldTime = currentTime
}
} }
} }
return true return true
......
...@@ -84,7 +84,7 @@ class CoinRecordAdapter(context: Context, coinData: MutableList<GoldRecordBean.L ...@@ -84,7 +84,7 @@ class CoinRecordAdapter(context: Context, coinData: MutableList<GoldRecordBean.L
holder.tv_goldrecord_cash_type.text = "钻石" holder.tv_goldrecord_cash_type.text = "钻石"
} }
holder.tv_goldrecord_cash.text = "-" + coinData.unitCoin holder.tv_goldrecord_cash.text = "-" + coinData.unitCoin
holder.tv_goldrecord_cash.setTextColor(ContextCompat.getColor(mContext, R.color.color_4BB93F)) holder.tv_goldrecord_cash.setTextColor(ContextCompat.getColor(mContext, R.color.color_00FA9A))
} }
} }
} }
......
...@@ -14,7 +14,10 @@ import com.mints.flowbox.ui.adapter.listener.OnItemClickListener ...@@ -14,7 +14,10 @@ import com.mints.flowbox.ui.adapter.listener.OnItemClickListener
import com.mints.flowbox.utils.TimeRender import com.mints.flowbox.utils.TimeRender
import java.util.* import java.util.*
class DrawcashRecordAdapter(context: Context, invitedData: MutableList<DrawcashRecordBean.RecordsBean>) : RecyclerView.Adapter<RecyclerView.ViewHolder>() { class DrawcashRecordAdapter(
context: Context,
invitedData: MutableList<DrawcashRecordBean.RecordsBean>
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
companion object { companion object {
const val HOLDER_TYPE_EMPTY = 0 const val HOLDER_TYPE_EMPTY = 0
...@@ -28,11 +31,13 @@ class DrawcashRecordAdapter(context: Context, invitedData: MutableList<DrawcashR ...@@ -28,11 +31,13 @@ class DrawcashRecordAdapter(context: Context, invitedData: MutableList<DrawcashR
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if (viewType == HOLDER_TYPE_EMPTY) { if (viewType == HOLDER_TYPE_EMPTY) {
val emptyView = LayoutInflater.from(parent.context).inflate(R.layout.item_empty, parent, false) val emptyView =
LayoutInflater.from(parent.context).inflate(R.layout.item_empty, parent, false)
return EmptyHolder(emptyView) return EmptyHolder(emptyView)
} }
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_list_drawcashrecord, parent, false) val view = LayoutInflater.from(parent.context)
.inflate(R.layout.item_list_drawcashrecord, parent, false)
return ViewHolder(view) return ViewHolder(view)
} }
...@@ -46,15 +51,26 @@ class DrawcashRecordAdapter(context: Context, invitedData: MutableList<DrawcashR ...@@ -46,15 +51,26 @@ class DrawcashRecordAdapter(context: Context, invitedData: MutableList<DrawcashR
val data: DrawcashRecordBean.RecordsBean = mDarwcashData[position] val data: DrawcashRecordBean.RecordsBean = mDarwcashData[position]
holder.tv_drawcashrecord_applyno.text = "订单号:" + data.cashId holder.tv_drawcashrecord_applyno.text = "订单号:" + data.cashId
viewHolder.tv_drawcashrecord_date.text = TimeRender.formatDate(Date(data.createTime), TimeRender.DEFAULT_FORMAT_SHOW) viewHolder.tv_drawcashrecord_date.text =
TimeRender.formatDate(Date(data.createTime), TimeRender.DEFAULT_FORMAT_SHOW)
viewHolder.tv_drawcashrecord_money.text = "¥" + String.format("%.2f", data.cash) + "元" viewHolder.tv_drawcashrecord_money.text = "¥" + String.format("%.2f", data.cash) + "元"
// viewHolder.tv_drawcashrecord_account.setText("支付宝账户:" + data.getAccount()); // viewHolder.tv_drawcashrecord_account.setText("支付宝账户:" + data.getAccount());
if (TextUtils.equals(data.payChannel, "ALIPAY")) { if (TextUtils.equals(data.payChannel, "ALIPAY")) {
viewHolder.tv_drawcashrecord_account.text = "提现账户:支付宝" viewHolder.tv_drawcashrecord_account.text = "提现账户:支付宝"
viewHolder.tv_drawcashrecord_account.setTextColor(ContextCompat.getColor(mContext, R.color.color_7EE2FF)) viewHolder.tv_drawcashrecord_account.setTextColor(
ContextCompat.getColor(
mContext,
R.color.color_7EE2FF
)
)
} else { } else {
viewHolder.tv_drawcashrecord_account.text = "提现账户:微信" viewHolder.tv_drawcashrecord_account.text = "提现账户:微信"
viewHolder.tv_drawcashrecord_account.setTextColor(ContextCompat.getColor(mContext, R.color.color_4BB93F)) viewHolder.tv_drawcashrecord_account.setTextColor(
ContextCompat.getColor(
mContext,
R.color.color_00FA9A
)
)
} }
val errormsg: String = data.errormsg val errormsg: String = data.errormsg
if (TextUtils.isEmpty(errormsg)) { if (TextUtils.isEmpty(errormsg)) {
...@@ -66,19 +82,39 @@ class DrawcashRecordAdapter(context: Context, invitedData: MutableList<DrawcashR ...@@ -66,19 +82,39 @@ class DrawcashRecordAdapter(context: Context, invitedData: MutableList<DrawcashR
when (data.status) { when (data.status) {
0, 1 -> { 0, 1 -> {
viewHolder.tv_drawcashrecord_status.text = "处理中" viewHolder.tv_drawcashrecord_status.text = "处理中"
viewHolder.tv_drawcashrecord_status.setTextColor(ContextCompat.getColor(mContext, R.color.color_454A69)) viewHolder.tv_drawcashrecord_status.setTextColor(
ContextCompat.getColor(
mContext,
R.color.color_454A69
)
)
} }
2 -> { 2 -> {
viewHolder.tv_drawcashrecord_status.text = "已提现" viewHolder.tv_drawcashrecord_status.text = "已提现"
viewHolder.tv_drawcashrecord_status.setTextColor(ContextCompat.getColor(mContext, R.color.color_BEC2CC)) viewHolder.tv_drawcashrecord_status.setTextColor(
ContextCompat.getColor(
mContext,
R.color.color_BEC2CC
)
)
} }
3, 4 -> { 3, 4 -> {
viewHolder.tv_drawcashrecord_status.text = "提现失败" viewHolder.tv_drawcashrecord_status.text = "提现失败"
viewHolder.tv_drawcashrecord_status.setTextColor(ContextCompat.getColor(mContext, R.color.color_FF5E5E)) viewHolder.tv_drawcashrecord_status.setTextColor(
ContextCompat.getColor(
mContext,
R.color.color_FF5E5E
)
)
} }
else -> { else -> {
viewHolder.tv_drawcashrecord_status.text = "未知" viewHolder.tv_drawcashrecord_status.text = "未知"
viewHolder.tv_drawcashrecord_status.setTextColor(ContextCompat.getColor(mContext, R.color.color_454A69)) viewHolder.tv_drawcashrecord_status.setTextColor(
ContextCompat.getColor(
mContext,
R.color.color_454A69
)
)
} }
} }
} }
......
package com.mints.flowbox.ui.widgets;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.ViewGroup;
import android.widget.ExpandableListView;
import android.widget.GridView;
public class MyExpandListView extends ExpandableListView {
boolean isIntercept = true;
public boolean isInterceptTouch() {
return isIntercept;
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
return isIntercept;
}
public MyExpandListView(Context context) {
super(context);
}
public MyExpandListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyExpandListView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public void isIntercept(boolean isIntercept) {
this.isIntercept = isIntercept;
}
}
...@@ -7,12 +7,13 @@ import android.graphics.drawable.GradientDrawable; ...@@ -7,12 +7,13 @@ import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet; import android.util.AttributeSet;
import androidx.appcompat.widget.AppCompatButton; import androidx.appcompat.widget.AppCompatButton;
import androidx.core.content.ContextCompat;
import com.mints.flowbox.R; import com.mints.flowbox.R;
public class ProgressButton extends AppCompatButton { public class ProgressButton extends AppCompatButton {
private float mCornerRadius = 0; private float mCornerRadius = 15;
private float mProgressMargin = 0; private float mProgressMargin = 0;
private boolean mFinish; private boolean mFinish;
...@@ -21,6 +22,8 @@ public class ProgressButton extends AppCompatButton { ...@@ -21,6 +22,8 @@ public class ProgressButton extends AppCompatButton {
private int mMaxProgress = 100; private int mMaxProgress = 100;
private int mMinProgress = 0; private int mMinProgress = 0;
private boolean isCycle = false;
private GradientDrawable mDrawableButton; private GradientDrawable mDrawableButton;
private GradientDrawable mDrawableProgressBackground; private GradientDrawable mDrawableProgressBackground;
private GradientDrawable mDrawableProgress; private GradientDrawable mDrawableProgress;
...@@ -40,9 +43,9 @@ public class ProgressButton extends AppCompatButton { ...@@ -40,9 +43,9 @@ public class ProgressButton extends AppCompatButton {
mDrawableProgress = new GradientDrawable(); mDrawableProgress = new GradientDrawable();
mDrawableButton = new GradientDrawable(); mDrawableButton = new GradientDrawable();
int defaultButtonColor = getResources().getColor(R.color.gray, null); int defaultButtonColor = ContextCompat.getColor(context, R.color.color_00FA9A);
int defaultProgressColor = getResources().getColor(R.color.color_main, null); int defaultProgressColor = ContextCompat.getColor(context, R.color.color_10000000);
int defaultBackColor = getResources().getColor(R.color.gray, null); int defaultBackColor = ContextCompat.getColor(context, R.color.color_00FA9A);
TypedArray attr = context.obtainStyledAttributes(attrs, R.styleable.ProgressButton); TypedArray attr = context.obtainStyledAttributes(attrs, R.styleable.ProgressButton);
...@@ -84,7 +87,14 @@ public class ProgressButton extends AppCompatButton { ...@@ -84,7 +87,14 @@ public class ProgressButton extends AppCompatButton {
@Override @Override
protected void onDraw(Canvas canvas) { protected void onDraw(Canvas canvas) {
if (mProgress > mMinProgress && mProgress <= mMaxProgress && !mFinish) { if (isCycle) {
if (mProgress >= 100) {
mProgress = 0;
}
mProgress++;
postInvalidateDelayed(10);
}
if (mProgress > mMinProgress && mProgress <= mMaxProgress) {
float progressWidth = float progressWidth =
(float) getMeasuredWidth() * ((float) (mProgress - mMinProgress) / mMaxProgress - mMinProgress); (float) getMeasuredWidth() * ((float) (mProgress - mMinProgress) / mMaxProgress - mMinProgress);
if (progressWidth < mCornerRadius * 2) { if (progressWidth < mCornerRadius * 2) {
...@@ -96,12 +106,24 @@ public class ProgressButton extends AppCompatButton { ...@@ -96,12 +106,24 @@ public class ProgressButton extends AppCompatButton {
if (mProgress == mMaxProgress) { if (mProgress == mMaxProgress) {
setBackgroundDrawable(mDrawableButton); setBackgroundDrawable(mDrawableButton);
mFinish = true; // mFinish = true;
} }
} }
super.onDraw(canvas); super.onDraw(canvas);
} }
public void startCycle() {
isCycle = true;
mProgress = 0;
invalidate();
}
public void pauseCycle() {
isCycle = false;
mProgress = 0;
invalidate();
}
/** /**
* Set current progress * Set current progress
*/ */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<!-- 填充的颜色 --> <!-- 填充的颜色 -->
<solid android:color="@color/color_4BB93F" /> <solid android:color="@color/color_00FA9A" />
<!-- 设置按钮的四个角为弧形 --> <!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 --> <!-- android:radius 弧形的半径 -->
<corners android:radius="30dip" /> <corners android:radius="30dip" />
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp" android:layout_marginTop="30dp"
android:layout_marginBottom="15dp" android:layout_marginBottom="15dp"
android:text="@string/app_name" android:text="@string/appName"
android:textColor="@color/color_454A69" android:textColor="@color/color_454A69"
android:textSize="13sp" /> android:textSize="13sp" />
...@@ -37,13 +37,6 @@ ...@@ -37,13 +37,6 @@
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:src="@drawable/ic_launcher_main" /> android:src="@drawable/ic_launcher_main" />
<com.mints.flowbox.ui.widgets.ProgressButton
android:id="@+id/pb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:maxProgress="100"
app:minProgress="0" />
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
android:layout_marginBottom="60dp" android:layout_marginBottom="60dp"
android:src="@mipmap/ic_clean" /> android:src="@mipmap/ic_clean" />
<ExpandableListView <com.mints.flowbox.ui.widgets.MyExpandListView
android:id="@+id/elv_clean" android:id="@+id/elv_clean"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<!-- </androidx.core.widget.NestedScrollView>--> <!-- </androidx.core.widget.NestedScrollView>-->
<Button <com.mints.flowbox.ui.widgets.ProgressButton
android:id="@+id/btnClean" android:id="@+id/btnClean"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="40dp"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:padding="15dp" android:padding="15dp"
android:src="@mipmap/ic_close" /> android:src="@mipmap/ic_arrow_back_white" />
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:padding="15dp" android:padding="15dp"
android:src="@mipmap/ic_close" /> android:src="@mipmap/ic_arrow_back_white" />
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:padding="15dp" android:padding="15dp"
android:src="@mipmap/ic_close" /> android:src="@mipmap/ic_arrow_back_white" />
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
android:layout_toEndOf="@id/appCompatImageView" android:layout_toEndOf="@id/appCompatImageView"
android:text="@string/app_name" android:text="@string/appName"
android:textColor="@color/color_main" /> android:textColor="@color/color_main" />
<TextView <TextView
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
android:layout_toStartOf="@id/tv_speed_test" android:layout_toStartOf="@id/tv_speed_test"
android:drawableTop="@mipmap/ic_rubbish" android:drawableTop="@mipmap/ic_rubbish"
android:drawablePadding="6dp" android:drawablePadding="6dp"
android:text="内存清理" android:text="垃圾清理"
android:textColor="@color/black" /> android:textColor="@color/black" />
<TextView <TextView
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/app_name" android:text="@string/appName"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/font_size_14" /> android:textSize="@dimen/font_size_14" />
......
app/src/main/res/mipmap-xhdpi/bg_guide2.png

16.6 KB | W: | H:

app/src/main/res/mipmap-xhdpi/bg_guide2.png

64.2 KB | W: | H:

app/src/main/res/mipmap-xhdpi/bg_guide2.png
app/src/main/res/mipmap-xhdpi/bg_guide2.png
app/src/main/res/mipmap-xhdpi/bg_guide2.png
app/src/main/res/mipmap-xhdpi/bg_guide2.png
  • 2-up
  • Swipe
  • Onion skin
app/src/main/res/mipmap-xhdpi/bg_guide3.png

20 KB | W: | H:

app/src/main/res/mipmap-xhdpi/bg_guide3.png

46.6 KB | W: | H:

app/src/main/res/mipmap-xhdpi/bg_guide3.png
app/src/main/res/mipmap-xhdpi/bg_guide3.png
app/src/main/res/mipmap-xhdpi/bg_guide3.png
app/src/main/res/mipmap-xhdpi/bg_guide3.png
  • 2-up
  • Swipe
  • Onion skin
app/src/main/res/mipmap-xhdpi/bg_guide4.png

31.4 KB | W: | H:

app/src/main/res/mipmap-xhdpi/bg_guide4.png

57.7 KB | W: | H:

app/src/main/res/mipmap-xhdpi/bg_guide4.png
app/src/main/res/mipmap-xhdpi/bg_guide4.png
app/src/main/res/mipmap-xhdpi/bg_guide4.png
app/src/main/res/mipmap-xhdpi/bg_guide4.png
  • 2-up
  • Swipe
  • Onion skin
app/src/main/res/mipmap-xhdpi/ic_rubbish.png

906 Bytes | W: | H:

app/src/main/res/mipmap-xhdpi/ic_rubbish.png

972 Bytes | W: | H:

app/src/main/res/mipmap-xhdpi/ic_rubbish.png
app/src/main/res/mipmap-xhdpi/ic_rubbish.png
app/src/main/res/mipmap-xhdpi/ic_rubbish.png
app/src/main/res/mipmap-xhdpi/ic_rubbish.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<color name="color_ccc">#cccccc</color> <color name="color_ccc">#cccccc</color>
<color name="color_AAA">#AAAAAA</color> <color name="color_AAA">#AAAAAA</color>
<color name="color_0000">#00000000</color> <color name="color_0000">#00000000</color>
<color name="color_10000000">#10000000</color>
<color name="color_20000000">#20000000</color> <color name="color_20000000">#20000000</color>
<color name="color_60000000">#60000000</color> <color name="color_60000000">#60000000</color>
<color name="transparent">#00000000</color> <color name="transparent">#00000000</color>
...@@ -26,7 +27,8 @@ ...@@ -26,7 +27,8 @@
<color name="color_666">#666666</color> <color name="color_666">#666666</color>
<color name="color_454A69">#454A69</color> <color name="color_454A69">#454A69</color>
<color name="color_333">#333333</color> <color name="color_333">#333333</color>
<color name="color_4BB93F">#4BB93F</color> <color name="color_00FA9A">#00FA9A</color>
<color name="color_7FFFAA">#7FFFAA</color>
<color name="color_FEB63D">#FEB63D</color> <color name="color_FEB63D">#FEB63D</color>
<color name="color_FFF7CB">#FFF7CB</color> <color name="color_FFF7CB">#FFF7CB</color>
<color name="color_FF5E5E">#FF5E5E</color> <color name="color_FF5E5E">#FF5E5E</color>
......
<resources> <resources>
<string name="app_name">流量宝盒</string> <string name="appName">流量宝盒</string>
<string name="dot">--</string> <string name="dot">--</string>
......
...@@ -13,13 +13,14 @@ buildscript { ...@@ -13,13 +13,14 @@ buildscript {
println("initApplicationScript() appConfig = $param") println("initApplicationScript() appConfig = $param")
def properties = rootProject.getProperties() def properties = rootProject.getProperties()
properties.forEach() { properties.forEach() {
key, value -> if (key.startsWith("GLOBAL") && value != null && value instanceof String) { key, value ->
println("info: 生成BuildConfig::$key = [${rootProject.getProperty(key)}]") if (key.startsWith("GLOBAL") && value != null && value instanceof String) {
param.buildConfigField("String", key, "\"${value}\"") println("info: 生成BuildConfig::$key = [${rootProject.getProperty(key)}]")
} param.buildConfigField("String", key, "\"${value}\"")
}
} }
// param.resValue("string", "app_name", "${rootProject.APPLICATION_NAME}") param.resValue("string", "app_name", "${rootProject.APPLICATION_NAME}")
param.resValue("string", "access_name", "★ ${rootProject.APPLICATION_NAME}") param.resValue("string", "access_name", "★ ${rootProject.APPLICATION_NAME}")
println("info: build_target = $build_target") println("info: build_target = $build_target")
...@@ -34,6 +35,15 @@ buildscript { ...@@ -34,6 +35,15 @@ buildscript {
jcenter() jcenter()
maven { url 'https://dl.bintray.com/umsdk/release' } maven { url 'https://dl.bintray.com/umsdk/release' }
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
//添加一览视频 maven地址
maven {
url 'http://nexus.1lan.tv/repository/maven-releases/'
}
maven {
url 'http://maven.aliyun.com/nexus/content/repositories/releases/'
}
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.0.1' classpath 'com.android.tools.build:gradle:4.0.1'
...@@ -47,6 +57,14 @@ allprojects { ...@@ -47,6 +57,14 @@ allprojects {
jcenter() jcenter()
maven { url 'https://dl.bintray.com/umsdk/release' } maven { url 'https://dl.bintray.com/umsdk/release' }
maven { url "https://jitpack.io" } maven { url "https://jitpack.io" }
//添加一览 maven地址
maven {
url 'http://nexus.1lan.tv/repository/maven-releases/'
}
maven {
url 'http://maven.aliyun.com/nexus/content/repositories/releases/'
}
} }
} }
...@@ -82,8 +100,6 @@ def initConfigurationWonderKingdom = { projectTarget, projectSource -> ...@@ -82,8 +100,6 @@ def initConfigurationWonderKingdom = { projectTarget, projectSource ->
} // end of function } // end of function
if (!projectSource.hasProperty('BUILD_TARGET')) { if (!projectSource.hasProperty('BUILD_TARGET')) {
throw new InvalidParameterException("BUG! 检查 gradle.properties 文件,缺少 BUILD_TARGET 这个变量") throw new InvalidParameterException("BUG! 检查 gradle.properties 文件,缺少 BUILD_TARGET 这个变量")
} }
......
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