Commit 60aa978b authored by mengcuiguang2's avatar mengcuiguang2
parents 0d89b226 6824b0f8
...@@ -159,6 +159,7 @@ dependencies { ...@@ -159,6 +159,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.recyclerview:recyclerview:1.1.0' implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.2.1' implementation 'com.google.android.material:material:1.2.1'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
// 网络请求 // 网络请求
implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:retrofit:2.9.0'
...@@ -179,6 +180,7 @@ dependencies { ...@@ -179,6 +180,7 @@ dependencies {
implementation 'com.github.bumptech.glide:glide:4.11.0' implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0' implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.documentfile:documentfile:1.0.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
// 65536 // 65536
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'
......
...@@ -277,7 +277,8 @@ ...@@ -277,7 +277,8 @@
# 避免影响升级功能,需要keep住support包的类 # 避免影响升级功能,需要keep住support包的类
-keep class android.support.**{*;} -keep class android.support.**{*;}
# 避免清理aidl
-keep class android.content.pm.** { *; }
# ===================== shareSDK START ================ # ===================== shareSDK START ================
-dontwarn com.mob.** -dontwarn com.mob.**
......
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<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.CHANGE_WIFI_STATE" /> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<uses-permission android:name="android.permission.READ_CALL_LOG" /> <uses-permission android:name="android.permission.READ_CALL_LOG" />
<uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.CALL_PHONE" />
...@@ -23,8 +25,6 @@ ...@@ -23,8 +25,6 @@
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" /> <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="android.permission.READ_LOGS" /> <uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<permission android:name="com.mints.flowbox.permission.JPUSH_MESSAGE" /> <permission android:name="com.mints.flowbox.permission.JPUSH_MESSAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
...@@ -199,10 +199,18 @@ ...@@ -199,10 +199,18 @@
<activity <activity
android:name=".ui.activitys.keepalive.TransparentActivity" android:name=".ui.activitys.keepalive.TransparentActivity"
android:excludeFromRecents="true"
android:exported="false"
android:finishOnTaskLaunch="false"
android:launchMode="singleInstance"
android:theme="@style/CustomerTransparentTheme" /> android:theme="@style/CustomerTransparentTheme" />
<activity <activity
android:name=".ui.activitys.keepalive.BoostFastActivity" android:name=".ui.activitys.keepalive.BoostFastActivity"
android:excludeFromRecents="true"
android:exported="false"
android:finishOnTaskLaunch="false"
android:launchMode="singleInstance"
android:theme="@style/CustomerTransparentTheme" /> android:theme="@style/CustomerTransparentTheme" />
<service <service
......
package android.content.pm;
/**
* API for package data change related callbacks from the Package Manager.
* Some usage scenarios include deletion of cache directory, generate
* statistics related to code, data, cache usage(TODO)
* {@hide}
*/
oneway interface IPackageDataObserver {
void onRemoveCompleted(in String packageName, boolean succeeded);
}
\ No newline at end of file
package android.content.pm;
import android.content.pm.PackageStats;
/**
* API for package data change related callbacks from the Package Manager.
* Some usage scenarios include deletion of cache directory, generate
* statistics related to code, data, cache usage(TODO)
* {@hide}
*/
oneway interface IPackageStatsObserver {
void onGetStatsCompleted(in PackageStats pStats, boolean succeeded);
}
\ No newline at end of file
package android.content.pm;
parcelable PackageStats;
\ No newline at end of file
...@@ -28,6 +28,7 @@ import com.mints.flowbox.keepalive.ScreenWatch; ...@@ -28,6 +28,7 @@ import com.mints.flowbox.keepalive.ScreenWatch;
import com.mints.flowbox.keepalive.WifiStateWatch; import com.mints.flowbox.keepalive.WifiStateWatch;
import com.mints.flowbox.manager.CsjGroMoreManager; import com.mints.flowbox.manager.CsjGroMoreManager;
import com.mints.flowbox.manager.MiitHelper; import com.mints.flowbox.manager.MiitHelper;
import com.mints.flowbox.manager.TrackManager;
import com.mints.flowbox.manager.ad.OwManager; import com.mints.flowbox.manager.ad.OwManager;
import com.mints.flowbox.manager.ad.TzManager; import com.mints.flowbox.manager.ad.TzManager;
import com.mints.flowbox.manager.ad.WnManager; import com.mints.flowbox.manager.ad.WnManager;
...@@ -35,6 +36,7 @@ import com.mints.flowbox.manager.wifi.WifiDataManager; ...@@ -35,6 +36,7 @@ import com.mints.flowbox.manager.wifi.WifiDataManager;
import com.mints.flowbox.net.LoanService; import com.mints.flowbox.net.LoanService;
import com.mints.flowbox.ui.activitys.keepalive.TriggerActivity; import com.mints.flowbox.ui.activitys.keepalive.TriggerActivity;
import com.mints.flowbox.utils.ForegroundOrBackground; import com.mints.flowbox.utils.ForegroundOrBackground;
import com.mints.flowbox.utils.LogUtil;
import com.mints.flowbox.utils.SystemUtils; import com.mints.flowbox.utils.SystemUtils;
import com.mints.flowbox.utils.keepalive.ScreenLockerUtils; import com.mints.flowbox.utils.keepalive.ScreenLockerUtils;
import com.module.legacy.oreo.RegisterJobUtils; import com.module.legacy.oreo.RegisterJobUtils;
...@@ -186,13 +188,11 @@ public class MintsApplication extends BaseApp { ...@@ -186,13 +188,11 @@ public class MintsApplication extends BaseApp {
// Toast.makeText(this, "测试:主进程重启成功", Toast.LENGTH_LONG).show(); // Toast.makeText(this, "测试:主进程重启成功", Toast.LENGTH_LONG).show();
// } // }
TrackManager.getInstance().getOuterAdConfig();
WifiStateWatch.getInstance(this).begin(new WifiStateWatch.WifiStateListener() { WifiStateWatch.getInstance(this).begin(new WifiStateWatch.WifiStateListener() {
@Override @Override
public void onWifiOpen() { public void onWifiOpen() {
// 应用在前台,则不展示
if (ForegroundOrBackground.isForeground2()) {
return;
}
if (WifiDataManager.INSTANCE.getWifiOn()) { if (WifiDataManager.INSTANCE.getWifiOn()) {
// 跳转去wifi加速 // 跳转去wifi加速
OutAppRouter.INSTANCE.showTriggerActivity(TriggerActivity.TRIGGER_TYPE_WIFI_BOOST); OutAppRouter.INSTANCE.showTriggerActivity(TriggerActivity.TRIGGER_TYPE_WIFI_BOOST);
...@@ -201,10 +201,6 @@ public class MintsApplication extends BaseApp { ...@@ -201,10 +201,6 @@ public class MintsApplication extends BaseApp {
@Override @Override
public void onWifiClose() { public void onWifiClose() {
// 应用在前台,则不展示
if (ForegroundOrBackground.isForeground2()) {
return;
}
if (WifiDataManager.INSTANCE.getWifiOff()) { if (WifiDataManager.INSTANCE.getWifiOff()) {
// 跳转网络测速 // 跳转网络测速
OutAppRouter.INSTANCE.showTriggerActivity(TriggerActivity.TRIGGER_TYPE_WIFI_DISCONNECT_TEST); OutAppRouter.INSTANCE.showTriggerActivity(TriggerActivity.TRIGGER_TYPE_WIFI_DISCONNECT_TEST);
...@@ -220,13 +216,7 @@ public class MintsApplication extends BaseApp { ...@@ -220,13 +216,7 @@ public class MintsApplication extends BaseApp {
@Override @Override
public void onScreenOff() { public void onScreenOff() {
// 检测应用是否在前台 if (!ScreenLockerUtils.INSTANCE.canShowScreenLocker(mContext)) {
if (ForegroundOrBackground.isForeground2()) {
return;
}
// 检测屏幕是否亮起
if (!ScreenLockerUtils.INSTANCE.canShowScreenLocker(MintsApplication.getContext())) {
return; return;
} }
...@@ -269,7 +259,6 @@ public class MintsApplication extends BaseApp { ...@@ -269,7 +259,6 @@ public class MintsApplication extends BaseApp {
// }); // });
// 监听电话状态 // 监听电话状态
PhoneWatch.getInstance(this).begin(new PhoneWatch.PhoneStateListener() { PhoneWatch.getInstance(this).begin(new PhoneWatch.PhoneStateListener() {
@Override @Override
public void onIdle(String phoneNum, int time) { public void onIdle(String phoneNum, int time) {
...@@ -283,7 +272,7 @@ public class MintsApplication extends BaseApp { ...@@ -283,7 +272,7 @@ public class MintsApplication extends BaseApp {
BatteryWatch.getInstance(this).begin(new BatteryWatch.BatteryStateListener() { BatteryWatch.getInstance(this).begin(new BatteryWatch.BatteryStateListener() {
@Override @Override
public void onCharging() { public void onCharging() {
if (ForegroundOrBackground.isForeground2()) { if (ScreenLockerUtils.INSTANCE.canShowScreenLocker(mContext)) {
return; return;
} }
if (WifiDataManager.INSTANCE.getBatteryOn()) { if (WifiDataManager.INSTANCE.getBatteryOn()) {
...@@ -293,9 +282,6 @@ public class MintsApplication extends BaseApp { ...@@ -293,9 +282,6 @@ public class MintsApplication extends BaseApp {
@Override @Override
public void onUnCharging() { public void onUnCharging() {
if (ForegroundOrBackground.isForeground2()) {
return;
}
if (WifiDataManager.INSTANCE.getBatteryOff()) { if (WifiDataManager.INSTANCE.getBatteryOff()) {
// 跳转省电 // 跳转省电
OutAppRouter.INSTANCE.showTriggerActivity(TriggerActivity.TRIGGER_TYPE_SAVE_ELE); OutAppRouter.INSTANCE.showTriggerActivity(TriggerActivity.TRIGGER_TYPE_SAVE_ELE);
...@@ -307,9 +293,6 @@ public class MintsApplication extends BaseApp { ...@@ -307,9 +293,6 @@ public class MintsApplication extends BaseApp {
PackageWatch.getInstance(this).begin(new PackageWatch.InstallStateListener() { PackageWatch.getInstance(this).begin(new PackageWatch.InstallStateListener() {
@Override @Override
public void onAdded(String pkgName) { public void onAdded(String pkgName) {
if (ForegroundOrBackground.isForeground2()) {
return;
}
if (WifiDataManager.INSTANCE.getInstallApk()) { if (WifiDataManager.INSTANCE.getInstallApk()) {
OutAppRouter.INSTANCE.showApkActivity(0, pkgName); OutAppRouter.INSTANCE.showApkActivity(0, pkgName);
} }
...@@ -317,9 +300,6 @@ public class MintsApplication extends BaseApp { ...@@ -317,9 +300,6 @@ public class MintsApplication extends BaseApp {
@Override @Override
public void onReplaced(String pkgName) { public void onReplaced(String pkgName) {
if (ForegroundOrBackground.isForeground2()) {
return;
}
if (WifiDataManager.INSTANCE.getUpdateApk()) { if (WifiDataManager.INSTANCE.getUpdateApk()) {
OutAppRouter.INSTANCE.showApkActivity(1, pkgName); OutAppRouter.INSTANCE.showApkActivity(1, pkgName);
} }
...@@ -327,9 +307,6 @@ public class MintsApplication extends BaseApp { ...@@ -327,9 +307,6 @@ public class MintsApplication extends BaseApp {
@Override @Override
public void onRemoved(String pkgName) { public void onRemoved(String pkgName) {
if (ForegroundOrBackground.isForeground2()) {
return;
}
if (WifiDataManager.INSTANCE.getUnInstallApk()) { if (WifiDataManager.INSTANCE.getUnInstallApk()) {
OutAppRouter.INSTANCE.showApkActivity(2, pkgName); OutAppRouter.INSTANCE.showApkActivity(2, pkgName);
} }
...@@ -491,4 +468,4 @@ public class MintsApplication extends BaseApp { ...@@ -491,4 +468,4 @@ public class MintsApplication extends BaseApp {
} }
} }
} }
\ No newline at end of file
...@@ -125,8 +125,6 @@ class AppOutGroMoreCarrierExpressManager : TTSettingConfigCallback { ...@@ -125,8 +125,6 @@ class AppOutGroMoreCarrierExpressManager : TTSettingConfigCallback {
mTTAdNative?.loadAd(adSlot, object : TTNativeAdLoadCallback { mTTAdNative?.loadAd(adSlot, object : TTNativeAdLoadCallback {
override fun onAdLoadedFial(adError: AdError?) { override fun onAdLoadedFial(adError: AdError?) {
LogUtil.e(TAG, "load feed ad error : " + adError?.code + ", " + adError?.message) LogUtil.e(TAG, "load feed ad error : " + adError?.code + ", " + adError?.message)
AppConfig.isPreExpressAwardActivity = false
} }
override fun onAdLoaded(ads: MutableList<TTNativeAd>?) { override fun onAdLoaded(ads: MutableList<TTNativeAd>?) {
......
...@@ -39,23 +39,25 @@ object KsPreLoadExpressManager { ...@@ -39,23 +39,25 @@ object KsPreLoadExpressManager {
try { try {
var ksNativeAd: KsNativeAd? var ksNativeAd: KsNativeAd?
val scene = KsScene val scene = KsScene
.Builder(KsManager.KS_AD_NATIVEEXPRESS_AWARD) .Builder(KsManager.KS_AD_NATIVEEXPRESS_AWARD)
.adNum(1) .adNum(1)
.build() .build()
KsAdSDK.getLoadManager().loadNativeAd(scene, object : KsLoadManager.NativeAdListener { KsAdSDK.getLoadManager().loadNativeAd(scene, object : KsLoadManager.NativeAdListener {
override fun onError(p0: Int, p1: String?) { override fun onError(p0: Int, p1: String?) {
LogUtil.d("$p0 -> $p1") LogUtil.d("$p0 -> $p1")
AppConfig.isPreExpressAwardActivity=false AppConfig.isPreExpressAwardActivity = false
} }
override fun onNativeAdLoad(p0: MutableList<KsNativeAd>?) { override fun onNativeAdLoad(p0: MutableList<KsNativeAd>?) {
AppConfig.isPreExpressAwardActivity = true
ksNativeAd = p0?.get(0) ksNativeAd = p0?.get(0)
mADLoadSuccessListener?.onKSAdLoadSuc(returnAdView(parent, ksNativeAd!!)) mADLoadSuccessListener?.onKSAdLoadSuc(returnAdView(parent, ksNativeAd!!))
} }
}) })
} catch (e: Exception) { } catch (e: Exception) {
AppConfig.isPreExpressAwardActivity=false AppConfig.isPreExpressAwardActivity = false
e.printStackTrace() e.printStackTrace()
} }
} }
...@@ -88,7 +90,8 @@ object KsPreLoadExpressManager { ...@@ -88,7 +90,8 @@ object KsPreLoadExpressManager {
* 使用SDK渲染的播放控件 * 使用SDK渲染的播放控件
*/ */
private fun getVideoItemView(parent: ViewGroup, ksNativeAd: KsNativeAd): View? { private fun getVideoItemView(parent: ViewGroup, ksNativeAd: KsNativeAd): View? {
val convertView: View = LayoutInflater.from(mContext).inflate(R.layout.native_item_video, parent, false) val convertView: View =
LayoutInflater.from(mContext).inflate(R.layout.native_item_video, parent, false)
val videoViewHolder = AdVideoViewHolder(convertView) val videoViewHolder = AdVideoViewHolder(convertView)
// 设置广告数据 // 设置广告数据
...@@ -108,9 +111,9 @@ object KsPreLoadExpressManager { ...@@ -108,9 +111,9 @@ object KsPreLoadExpressManager {
// SDK默认渲染的视频view // SDK默认渲染的视频view
val videoPlayConfig = KsAdVideoPlayConfig.Builder() val videoPlayConfig = KsAdVideoPlayConfig.Builder()
.videoSoundEnable(true) // 有声播放 .videoSoundEnable(true) // 有声播放
.dataFlowAutoStart(false) // 流量下自动播放 .dataFlowAutoStart(false) // 流量下自动播放
.build() .build()
val videoView = ksNativeAd.getVideoView(mContext, videoPlayConfig) val videoView = ksNativeAd.getVideoView(mContext, videoPlayConfig)
if (videoView != null && videoView.parent == null) { if (videoView != null && videoView.parent == null) {
videoViewHolder.mAdVideoContainer.removeAllViews() videoViewHolder.mAdVideoContainer.removeAllViews()
...@@ -123,7 +126,8 @@ object KsPreLoadExpressManager { ...@@ -123,7 +126,8 @@ object KsPreLoadExpressManager {
* 自定义的单图广告 * 自定义的单图广告
*/ */
private fun getSingleImageItemView(parent: ViewGroup, ksNativeAd: KsNativeAd): View? { private fun getSingleImageItemView(parent: ViewGroup, ksNativeAd: KsNativeAd): View? {
val convertView: View = LayoutInflater.from(mContext).inflate(R.layout.native_item_single_image, parent, false) val convertView: View =
LayoutInflater.from(mContext).inflate(R.layout.native_item_single_image, parent, false)
val viewHolder = AdSingleImageViewHolder(convertView) val viewHolder = AdSingleImageViewHolder(convertView)
bindCommonData(convertView as ViewGroup, viewHolder, ksNativeAd) bindCommonData(convertView as ViewGroup, viewHolder, ksNativeAd)
...@@ -141,7 +145,8 @@ object KsPreLoadExpressManager { ...@@ -141,7 +145,8 @@ object KsPreLoadExpressManager {
* 自定义的组图广告 * 自定义的组图广告
*/ */
private fun getGroupImageItemView(parent: ViewGroup, ksNativeAd: KsNativeAd): View? { private fun getGroupImageItemView(parent: ViewGroup, ksNativeAd: KsNativeAd): View? {
val convertView: View = LayoutInflater.from(mContext).inflate(R.layout.native_item_group_image, parent, false) val convertView: View =
LayoutInflater.from(mContext).inflate(R.layout.native_item_group_image, parent, false)
val viewHolder = AdGroupImageViewHolder(convertView) val viewHolder = AdGroupImageViewHolder(convertView)
bindCommonData(convertView as ViewGroup, viewHolder, ksNativeAd) bindCommonData(convertView as ViewGroup, viewHolder, ksNativeAd)
...@@ -170,14 +175,17 @@ object KsPreLoadExpressManager { ...@@ -170,14 +175,17 @@ object KsPreLoadExpressManager {
@SuppressLint("DefaultLocale") @SuppressLint("DefaultLocale")
private fun getNormalItemView(parent: ViewGroup): View? { private fun getNormalItemView(parent: ViewGroup): View? {
val convertView: View = LayoutInflater.from(mContext).inflate(R.layout.native_item_normal, parent, false) val convertView: View =
LayoutInflater.from(mContext).inflate(R.layout.native_item_normal, parent, false)
val normalViewHolder = NormalViewHolder(convertView) val normalViewHolder = NormalViewHolder(convertView)
normalViewHolder.textView.text = "没有广告" normalViewHolder.textView.text = "没有广告"
return convertView return convertView
} }
private fun bindCommonData(convertView: ViewGroup, adBaseViewHolder: AdBaseViewHolder, private fun bindCommonData(
ad: KsNativeAd) { convertView: ViewGroup, adBaseViewHolder: AdBaseViewHolder,
ad: KsNativeAd
) {
// 点击转换view的集合,传入的view点击时会触发转换操作:app下载, 打开h5页面 // 点击转换view的集合,传入的view点击时会触发转换操作:app下载, 打开h5页面
val clickViewList: MutableList<View> = ArrayList() val clickViewList: MutableList<View> = ArrayList()
clickViewList.add(convertView) // 点击整个view都可触发转换 clickViewList.add(convertView) // 点击整个view都可触发转换
...@@ -186,23 +194,23 @@ object KsPreLoadExpressManager { ...@@ -186,23 +194,23 @@ object KsPreLoadExpressManager {
// 注册View的点击,点击后触发转化 // 注册View的点击,点击后触发转化
ad.registerViewForInteraction(convertView, clickViewList, ad.registerViewForInteraction(convertView, clickViewList,
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(MintsApplication.getContext(), "广告" + ad.appName + "被点击", Toast.LENGTH_SHORT).show() // Toast.makeText(MintsApplication.getContext(), "广告" + ad.appName + "被点击", Toast.LENGTH_SHORT).show()
}
} }
}
override fun onAdShow(ad: KsNativeAd) { override fun onAdShow(ad: KsNativeAd) {
if (ad != null) { if (ad != null) {
// Toast.makeText(mContext, "广告" + ad.appName + "展示", Toast.LENGTH_SHORT).show() // Toast.makeText(mContext, "广告" + ad.appName + "展示", Toast.LENGTH_SHORT).show()
}
} }
}
override fun handleDownloadDialog(p0: DialogInterface.OnClickListener?): Boolean { override fun handleDownloadDialog(p0: DialogInterface.OnClickListener?): Boolean {
return false return false
} }
}) })
// 广告描述 // 广告描述
adBaseViewHolder.mAdDes.text = ad.adDescription adBaseViewHolder.mAdDes.text = ad.adDescription
...@@ -235,7 +243,8 @@ object KsPreLoadExpressManager { ...@@ -235,7 +243,8 @@ 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(MintsApplication.getContext()).load(ad.appIconUrl).into(adBaseViewHolder.mAppIcon) Glide.with(MintsApplication.getContext()).load(ad.appIconUrl)
.into(adBaseViewHolder.mAppIcon)
} }
// app名称 // app名称
if (!TextUtils.isEmpty(ad.appName)) { if (!TextUtils.isEmpty(ad.appName)) {
......
...@@ -27,54 +27,60 @@ object YlhPreLoadExpressManager { ...@@ -27,54 +27,60 @@ object YlhPreLoadExpressManager {
fun loadYlhFrameLayout() { fun loadYlhFrameLayout() {
try { try {
nativeExpressAD = NativeExpressAD(MintsApplication.getContext(), ADSize(ADSize.FULL_WIDTH, ADSize.AUTO_HEIGHT), YlhAdManager.YLH_AD_NATIVEEXPRESS_AWARD, object : NativeExpressAD.NativeExpressADListener { nativeExpressAD = NativeExpressAD(
override fun onNoAD(p0: AdError?) { MintsApplication.getContext(),
AppConfig.isPreExpressAwardActivity=false ADSize(ADSize.FULL_WIDTH, ADSize.AUTO_HEIGHT),
} YlhAdManager.YLH_AD_NATIVEEXPRESS_AWARD,
object : NativeExpressAD.NativeExpressADListener {
override fun onNoAD(p0: AdError?) {
AppConfig.isPreExpressAwardActivity = false
}
override fun onADClicked(p0: NativeExpressADView?) { override fun onADClicked(p0: NativeExpressADView?) {
} }
override fun onADCloseOverlay(p0: NativeExpressADView?) { override fun onADCloseOverlay(p0: NativeExpressADView?) {
} }
override fun onADClosed(p0: NativeExpressADView?) { override fun onADClosed(p0: NativeExpressADView?) {
} }
override fun onADExposure(p0: NativeExpressADView?) { override fun onADExposure(p0: NativeExpressADView?) {
} }
override fun onADLeftApplication(p0: NativeExpressADView?) { override fun onADLeftApplication(p0: NativeExpressADView?) {
} }
override fun onADLoaded(p0: MutableList<NativeExpressADView>?) { override fun onADLoaded(p0: MutableList<NativeExpressADView>?) {
// 释放前一个展示的NativeExpressADView的资源 AppConfig.isPreExpressAwardActivity = true
nativeExpressADView?.destroy()
nativeExpressADView = p0?.get(0) // 释放前一个展示的NativeExpressADView的资源
nativeExpressADView?.destroy()
// 广告可见才会产生曝光,否则将无法产生收益。 nativeExpressADView = p0?.get(0)
mADLoadSuccessListener?.onYlhAdLoadSuc(nativeExpressADView)
nativeExpressADView?.render() // 广告可见才会产生曝光,否则将无法产生收益。
} mADLoadSuccessListener?.onYlhAdLoadSuc(nativeExpressADView)
override fun onADOpenOverlay(p0: NativeExpressADView?) { nativeExpressADView?.render()
} }
override fun onRenderFail(p0: NativeExpressADView?) { override fun onADOpenOverlay(p0: NativeExpressADView?) {
AppConfig.isPreExpressAwardActivity=false }
}
override fun onRenderSuccess(p0: NativeExpressADView?) { override fun onRenderFail(p0: NativeExpressADView?) {
} AppConfig.isPreExpressAwardActivity = false
}
}) override fun onRenderSuccess(p0: NativeExpressADView?) {
}
})
nativeExpressAD?.loadAD(1) nativeExpressAD?.loadAD(1)
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
AppConfig.isPreExpressAwardActivity=false AppConfig.isPreExpressAwardActivity = false
} }
} }
......
...@@ -216,7 +216,10 @@ public class FullGroManager { ...@@ -216,7 +216,10 @@ public class FullGroManager {
} }
} }
public void showFullAd(Activity _activity) { public void showFullAd(Activity _activity, WifiAdStatusListener wifiAdStatusListener) {
if (wifiAdStatusListener != null) {
this.wifiAdStatusListener = wifiAdStatusListener;
}
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
LogUtil.d(TAG, "showFullAd isLoadSuccess=" + isLoadSuccess + " isReady=" + mTTFullVideoAd.isReady()); LogUtil.d(TAG, "showFullAd isLoadSuccess=" + isLoadSuccess + " isReady=" + mTTFullVideoAd.isReady());
} }
...@@ -240,7 +243,7 @@ public class FullGroManager { ...@@ -240,7 +243,7 @@ public class FullGroManager {
/** /**
* 激励视频交互回调 * 激励视频交互回调
*/ */
private TTFullVideoAdListener mTTFullVideoAdListener = new TTFullVideoAdListener() { private final TTFullVideoAdListener mTTFullVideoAdListener = new TTFullVideoAdListener() {
@Override @Override
public void onFullVideoAdShow() { public void onFullVideoAdShow() {
......
...@@ -106,6 +106,7 @@ class WifiAdManager private constructor() { ...@@ -106,6 +106,7 @@ class WifiAdManager private constructor() {
//// interstitialGroManager?.showInteractionAd() //// interstitialGroManager?.showInteractionAd()
//// } //// }
// Constant.GROMORE_FULL_AD -> { // Constant.GROMORE_FULL_AD -> {
fullGroManager?.setWifiAdStatusListener(wifiAdStatusListener)
fullGroManager?.showFullAd() fullGroManager?.showFullAd()
// } // }
// } // }
...@@ -133,7 +134,7 @@ class WifiAdManager private constructor() { ...@@ -133,7 +134,7 @@ class WifiAdManager private constructor() {
// interstitialGroManager?.showInteractionAd(_activity) // interstitialGroManager?.showInteractionAd(_activity)
// } // }
// Constant.GROMORE_FULL_AD -> { // Constant.GROMORE_FULL_AD -> {
fullGroManager?.showFullAd(_activity) fullGroManager?.showFullAd(_activity,wifiAdStatusListener)
// } // }
// } // }
} }
......
...@@ -118,7 +118,7 @@ public class CleanUtils { ...@@ -118,7 +118,7 @@ public class CleanUtils {
} else { } else {
uuid = UUID.fromString(uuidStr); uuid = UUID.fromString(uuidStr);
} }
int uid = getUid(context, "com.mints.cleaner"); int uid = getUid(context, "com.mints.camera");
//通过包名获取uid //通过包名获取uid
StorageStats storageStats = null; StorageStats storageStats = null;
try { try {
......
...@@ -11,6 +11,9 @@ import com.mints.flowbox.manager.wifi.WifiDataManager; ...@@ -11,6 +11,9 @@ import com.mints.flowbox.manager.wifi.WifiDataManager;
import com.mints.flowbox.ui.activitys.keepalive.TransparentActivity; import com.mints.flowbox.ui.activitys.keepalive.TransparentActivity;
import com.mints.flowbox.utils.ForegroundOrBackground; import com.mints.flowbox.utils.ForegroundOrBackground;
import com.mints.flowbox.utils.keepalive.IntentUtils; import com.mints.flowbox.utils.keepalive.IntentUtils;
import com.mints.flowbox.utils.keepalive.ScreenLockerUtils;
import net.phone.PhoneBrandUtils;
/** /**
* 描述:应用外广告定时器 * 描述:应用外广告定时器
...@@ -91,7 +94,7 @@ public class AlarmManager implements WeakHandler.IHandler { ...@@ -91,7 +94,7 @@ public class AlarmManager implements WeakHandler.IHandler {
if (userTime % APP_OUT_TIMING_MINTER == 0) { if (userTime % APP_OUT_TIMING_MINTER == 0) {
// 应用在前台时,不弹出应用外广告 // 应用在前台时,不弹出应用外广告
if (ForegroundOrBackground.isForeground2()) { if (ForegroundOrBackground.isForeground2() || ScreenLockerUtils.INSTANCE.canShowScreenLocker(MintsApplication.getContext())) {
return; return;
} }
...@@ -128,14 +131,22 @@ public class AlarmManager implements WeakHandler.IHandler { ...@@ -128,14 +131,22 @@ public class AlarmManager implements WeakHandler.IHandler {
* 展示定时页面 * 展示定时页面
*/ */
private void showTimingActivity() { private void showTimingActivity() {
if (ForegroundOrBackground.isForeground2() || ScreenLockerUtils.INSTANCE.canShowScreenLocker(MintsApplication.getContext())) {
return;
}
if (currentType > 5) { if (currentType > 5) {
currentType = 0; currentType = 0;
} }
Intent intent = new Intent(MintsApplication.getContext(), TransparentActivity.class); Intent intent = new Intent(MintsApplication.getContext(), TransparentActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_ANIMATION);
intent.putExtra(TransparentActivity.TIMING_TYPE, currentType++); intent.putExtra(TransparentActivity.TIMING_TYPE, currentType++);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); if (PhoneBrandUtils.isLockScreenProtected()) {
IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent); IntentUtils.startActivity(intent);
} else {
IntentUtils.startActivity2(intent);
}
} }
public void setAppOutTimingMinter(int timingMinter) { public void setAppOutTimingMinter(int timingMinter) {
......
package com.mints.flowbox.keepalive package com.mints.flowbox.keepalive
import android.R.attr.phoneNumber
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.mints.flowbox.MintsApplication import com.mints.flowbox.MintsApplication
import com.mints.flowbox.ad.express.ExpressManager import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ui.activitys.keepalive.ApkActivity import com.mints.flowbox.ui.activitys.keepalive.ApkActivity
import com.mints.flowbox.ui.activitys.keepalive.BoostActivity
import com.mints.flowbox.ui.activitys.keepalive.ScreenActivity import com.mints.flowbox.ui.activitys.keepalive.ScreenActivity
import com.mints.flowbox.ui.activitys.keepalive.TriggerActivity import com.mints.flowbox.ui.activitys.keepalive.TriggerActivity
import com.mints.flowbox.utils.ForegroundOrBackground import com.mints.flowbox.utils.ForegroundOrBackground
import com.mints.flowbox.utils.keepalive.IntentUtils import com.mints.flowbox.utils.keepalive.IntentUtils
import com.mints.flowbox.utils.keepalive.ScreenLockerUtils.canShowScreenLocker
import net.phone.PhoneBrandUtils import net.phone.PhoneBrandUtils
/** /**
* *
* @author jyx * @author jyx
...@@ -30,6 +28,10 @@ object OutAppRouter { ...@@ -30,6 +28,10 @@ object OutAppRouter {
* @param pkgName 包名 * @param pkgName 包名
*/ */
fun showApkActivity(state: Int, pkgName: String) { fun showApkActivity(state: Int, pkgName: String) {
if (ForegroundOrBackground.isForeground2() || canShowScreenLocker(MintsApplication.getContext())) {
return
}
// 预加载信息流 // 预加载信息流
ExpressManager.loadAppOutExpress() ExpressManager.loadAppOutExpress()
...@@ -41,7 +43,11 @@ object OutAppRouter { ...@@ -41,7 +43,11 @@ object OutAppRouter {
intent.putExtra(ApkActivity.APK_STATE, state) intent.putExtra(ApkActivity.APK_STATE, state)
intent.putExtra(ApkActivity.APK_PKG_NAME, pkgName) intent.putExtra(ApkActivity.APK_PKG_NAME, pkgName)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_NO_ANIMATION intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_NO_ANIMATION
IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent) if (PhoneBrandUtils.isLockScreenProtected()) {
IntentUtils.startActivity(intent)
} else {
IntentUtils.startActivity2(intent)
}
} }
/** /**
...@@ -50,12 +56,23 @@ object OutAppRouter { ...@@ -50,12 +56,23 @@ object OutAppRouter {
fun showScreenActivity() { fun showScreenActivity() {
// 预加载信息流 // 预加载信息流
ExpressManager.loadAppOutExpress() ExpressManager.loadAppOutExpress()
val intent = Intent(MintsApplication.getContext(), ScreenActivity::class.java) val intent = Intent(MintsApplication.getContext(), ScreenActivity::class.java)
if (!PhoneBrandUtils.isOppo()) { if (!PhoneBrandUtils.isOppo()) {
intent.flags = Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT intent.flags = Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT
} }
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_NO_ANIMATION intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_NO_ANIMATION
IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent)
if (PhoneBrandUtils.isHuaweiHonor()) {
IntentUtils.startActivity(intent)
return
}
if (PhoneBrandUtils.isLockScreenProtected()) {
IntentUtils.startActivity(intent)
} else {
IntentUtils.startActivity2(intent)
}
} }
/** /**
...@@ -64,7 +81,7 @@ object OutAppRouter { ...@@ -64,7 +81,7 @@ object OutAppRouter {
fun goToCall(activity: Activity, phone: String?) { fun goToCall(activity: Activity, phone: String?) {
val intent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:${phone}")) val intent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:${phone}"))
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
ForegroundOrBackground.getMain_activity().startActivity(intent); activity.startActivity(intent);
} }
/** /**
...@@ -73,24 +90,29 @@ object OutAppRouter { ...@@ -73,24 +90,29 @@ object OutAppRouter {
fun goToSms(activity: Activity, phone: String?) { fun goToSms(activity: Activity, phone: String?) {
val uri = Uri.parse("smsto:${phone}") val uri = Uri.parse("smsto:${phone}")
val intent = Intent(Intent.ACTION_SENDTO, uri) val intent = Intent(Intent.ACTION_SENDTO, uri)
ForegroundOrBackground.getMain_activity().startActivity(intent); activity.startActivity(intent);
} }
/** /**
* 展示加速页面 * 展示加速页面
*/ */
fun showBoostActivity() { // fun showBoostActivity() {
// 预加载信息流 // // 预加载信息流
ExpressManager.loadAppOutExpress() // ExpressManager.loadAppOutExpress()
val intent = Intent(MintsApplication.getContext(), BoostActivity::class.java) // val intent = Intent(MintsApplication.getContext(), BoostActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_NO_ANIMATION // intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_NO_ANIMATION
IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent) // IntentUtils.startActivity2(intent)
} // }
/** /**
* 展示弹出页面 * 展示弹出页面
*/ */
fun showTriggerActivity(currentType: Int, phone: String, time: Int) { fun showTriggerActivity(currentType: Int, phone: String, time: Int) {
// 应用在前台,则不展示
if (ForegroundOrBackground.isForeground2() || canShowScreenLocker(MintsApplication.getContext())) {
return
}
// 预加载信息流 // 预加载信息流
ExpressManager.loadAppOutExpress() ExpressManager.loadAppOutExpress()
...@@ -98,14 +120,23 @@ object OutAppRouter { ...@@ -98,14 +120,23 @@ object OutAppRouter {
intent.putExtra(TriggerActivity.TRIGGER_TYPE, currentType) intent.putExtra(TriggerActivity.TRIGGER_TYPE, currentType)
intent.putExtra(TriggerActivity.CALL_PHONE_TIME, time) intent.putExtra(TriggerActivity.CALL_PHONE_TIME, time)
intent.putExtra(TriggerActivity.CALL_PHONE_NUM, phone) intent.putExtra(TriggerActivity.CALL_PHONE_NUM, phone)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_NO_ANIMATION
IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent) if (PhoneBrandUtils.isLockScreenProtected()) {
IntentUtils.startActivity(intent)
} else {
IntentUtils.startActivity2(intent)
}
} }
/** /**
* 展示弹出页面 * 展示弹出页面
*/ */
fun showTriggerActivity(currentType: Int) { fun showTriggerActivity(currentType: Int) {
// 应用在前台,则不展示
if (ForegroundOrBackground.isForeground2() || canShowScreenLocker(MintsApplication.getContext())) {
return
}
// 预加载信息流 // 预加载信息流
ExpressManager.loadAppOutExpress() ExpressManager.loadAppOutExpress()
...@@ -123,8 +154,12 @@ object OutAppRouter { ...@@ -123,8 +154,12 @@ object OutAppRouter {
val intent = Intent(MintsApplication.getContext(), TriggerActivity::class.java) val intent = Intent(MintsApplication.getContext(), TriggerActivity::class.java)
intent.putExtra(TriggerActivity.TRIGGER_TYPE, realType) intent.putExtra(TriggerActivity.TRIGGER_TYPE, realType)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_NO_ANIMATION
IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent) if (PhoneBrandUtils.isLockScreenProtected()) {
IntentUtils.startActivity(intent)
} else {
IntentUtils.startActivity2(intent)
}
} }
private var mWifiConnectType = TriggerActivity.TRIGGER_TYPE_WIFI_BOOST - 1 private var mWifiConnectType = TriggerActivity.TRIGGER_TYPE_WIFI_BOOST - 1
......
package com.mints.flowbox.ui.activitys package com.mints.flowbox.ui.activitys
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.ActivityManager
import android.content.Context import android.content.Context
import android.graphics.Color import android.graphics.Color
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import android.view.WindowManager import android.view.WindowManager
...@@ -26,6 +28,7 @@ import com.mints.flowbox.utils.SpanUtils ...@@ -26,6 +28,7 @@ import com.mints.flowbox.utils.SpanUtils
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.*
import java.lang.Exception
import java.util.* import java.util.*
/** /**
...@@ -139,6 +142,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -139,6 +142,7 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
childInfo.headId = cacheListItem.applicationIcon childInfo.headId = cacheListItem.applicationIcon
childInfo.fileSize = cacheListItem.cacheSize childInfo.fileSize = cacheListItem.cacheSize
childInfo.filePath = cacheListItem.filePath childInfo.filePath = cacheListItem.filePath
childInfo.pkgName = cacheListItem.packageName
childInfo.tint = "建议清理" childInfo.tint = "建议清理"
childInfo.isChecked = true childInfo.isChecked = true
mCleanList[taskType].childList.add(childInfo) mCleanList[taskType].childList.add(childInfo)
...@@ -208,7 +212,6 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -208,7 +212,6 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
mCleanTimer = Timer() mCleanTimer = Timer()
mCleanTimer?.schedule(object : TimerTask() { mCleanTimer?.schedule(object : TimerTask() {
override fun run() { override fun run() {
runOnUiThread { runOnUiThread {
// 单项清理清理完成或没有继续清理的 // 单项清理清理完成或没有继续清理的
if (!isItemCleanOk) { if (!isItemCleanOk) {
...@@ -240,21 +243,15 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -240,21 +243,15 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
var removeIndex = -1 var removeIndex = -1
var removeChildInfo: ChildInfo? = null var removeChildInfo: ChildInfo? = null
// 清理动画 if (taskType == 0) {
for (i in 0 until mCleanList[taskType].childList.size) { cleaningOperation(mContext, mCleanList[taskType].childList)
if (mCleanList[taskType].childList[i].isChecked) {
removeChildInfo = mCleanList[taskType].childList[i]
removeIndex = i
break
}
}
if (removeIndex >= 0) {
isItemCleanOk = false
remove(taskType, removeIndex, removeChildInfo)
} }
if (taskType == 0) { if (taskType == 1) {
// cleaningOperation(mContext) if (Build.VERSION.SDK_INT > Build.VERSION_CODES.R) {
// TODO 清理缓存
// CleanRDataUtil.getAndroidDataCacheUri()
}
} }
if (taskType == 4) { if (taskType == 4) {
...@@ -265,6 +262,19 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -265,6 +262,19 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
} }
} }
} }
// 清理动画
for (i in 0 until mCleanList[taskType].childList.size) {
if (mCleanList[taskType].childList[i].isChecked) {
removeChildInfo = mCleanList[taskType].childList[i]
removeIndex = i
break
}
}
if (removeIndex >= 0) {
isItemCleanOk = false
remove(taskType, removeIndex, removeChildInfo)
}
} }
taskType++ taskType++
...@@ -479,41 +489,17 @@ class CleanActivity : BaseActivity(), View.OnClickListener { ...@@ -479,41 +489,17 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
} }
/** 清理内存 */ /** 清理内存 */
private fun cleaningOperation(ctx: Context) { private fun cleaningOperation(ctx: Context, list: List<ChildInfo>) {
// val infoList = am.runningAppProcesses try {
// val serviceInfos = am.getRunningServices(100) val am = ctx.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
// var count = 0 for (childInfo in list) {
// if (infoList != null) { if (childInfo.pkgName != Constant.MINTS_PKG_NAME) {
// for (i in infoList.indices) { am.killBackgroundProcesses(childInfo.pkgName)
// val appProcessInfo = infoList[i] }
// Log.e("TAGDD1", "process name : ----------" + appProcessInfo.processName) }
// //importance 该进程的重要程度 分为几个级别,数值越低就越重要。 } catch (e: Exception) {
// Log.e("TAGDD2", "importance : -----------" + appProcessInfo.importance) e.printStackTrace()
// // 一般数值大于RunningAppProcessInfo.IMPORTANCE_SERVICE的进程都长时间没用或者空进程了 }
// // 一般数值大于RunningAppProcessInfo.IMPORTANCE_VISIBLE的进程都是非可见进程,也就是在后台运行着
// if (appProcessInfo.importance > ActivityManager.RunningAppProcessInfo.IMPORTANCE_SERVICE) {
// val pkgList = appProcessInfo.pkgList
// for (j in pkgList.indices) {//pkgList 得到该进程下运行的包名
// Log.e("TAGDD4", "It will be killed, package name : " + pkgList[j])
// if (pkgList[j] != Constant.MINTS_PKG_NAME) {
// am.killBackgroundProcesses(pkgList[j])
// count++
// Log.e("TAGDD4", "count : ----------$count")
// }
// }
// }
// //只要不是com.example.hasee.a1011ceshi这个包名的进程,其余进程全部禁止
//// if (appProcessInfo.processName != Constant.MINTS_PKG_NAME) {
//// val pkgList = appProcessInfo.pkgList
//// for (j in pkgList.indices) { //pkgList 得到该进程下运行的包名
//// Log.e("TAGDD3", "It will be killed, package name : ----------" + pkgList[j])
//// am.killBackgroundProcesses(pkgList[j])
//// count++
//// Log.e("TAGDD4", "count : ----------$count")
//// }
//// }
// }
// }
} }
} }
...@@ -58,7 +58,6 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -58,7 +58,6 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
// 奖励页预加载 信息流广告 // 奖励页预加载 信息流广告
ExpressManager.loadExpress(true) ExpressManager.loadExpress(true)
PreLoadExpressManager.loadADFrameLayout()
mainPresenter.attachView(this) mainPresenter.attachView(this)
......
...@@ -24,6 +24,7 @@ import com.mints.flowbox.ui.activitys.base.BaseActivity ...@@ -24,6 +24,7 @@ import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.ui.widgets.dialog.DialogListener import com.mints.flowbox.ui.widgets.dialog.DialogListener
import com.mints.flowbox.ui.widgets.dialog.DialogUtils import com.mints.flowbox.ui.widgets.dialog.DialogUtils
import com.mints.flowbox.utils.DecodeCodeTools import com.mints.flowbox.utils.DecodeCodeTools
import com.mints.flowbox.utils.LogUtil
import com.mints.flowbox.utils.WifiUtils import com.mints.flowbox.utils.WifiUtils
import kotlinx.android.synthetic.main.activity_scan.* import kotlinx.android.synthetic.main.activity_scan.*
import java.nio.ByteBuffer import java.nio.ByteBuffer
...@@ -188,6 +189,8 @@ class ScanActivity : BaseActivity(), View.OnClickListener { ...@@ -188,6 +189,8 @@ class ScanActivity : BaseActivity(), View.OnClickListener {
* *
*/ */
private fun autoConnectWifi(wifiStr: String?) { private fun autoConnectWifi(wifiStr: String?) {
LogUtil.d(wifiStr)
if (TextUtils.isEmpty(wifiStr)) { if (TextUtils.isEmpty(wifiStr)) {
ToastUtils.show("无效的WIFI二维码!") ToastUtils.show("无效的WIFI二维码!")
return return
...@@ -196,7 +199,7 @@ class ScanActivity : BaseActivity(), View.OnClickListener { ...@@ -196,7 +199,7 @@ class ScanActivity : BaseActivity(), View.OnClickListener {
var ssid = "" var ssid = ""
var psw = "" var psw = ""
wifiStr?.let { wifiStr?.let {
if (!it.contains("WIFI") or !it.contains("wifi")) { if (!it.contains("WIFI")) {
ToastUtils.show("无效的WIFI二维码!") ToastUtils.show("无效的WIFI二维码!")
return return
} }
...@@ -219,23 +222,21 @@ class ScanActivity : BaseActivity(), View.OnClickListener { ...@@ -219,23 +222,21 @@ class ScanActivity : BaseActivity(), View.OnClickListener {
override fun onClick(dialog: Dialog?, v: View?) { override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v) super.onClick(dialog, v)
Handler(Looper.getMainLooper()).postDelayed({
if (TextUtils.equals(
ssid,
WifiUtils.getInstance(this@ScanActivity).connectionWifiInfo.ssid
)
) {
ToastUtils.show("连接成功...")
finish()
} else {
ToastUtils.show("连接失败...")
startActivity(Intent(Settings.ACTION_WIFI_SETTINGS))
}
}, 3000)
ToastUtils.show("正在连接中...") ToastUtils.show("正在连接中...")
WifiUtils.getInstance(this@ScanActivity).connectWifiPws(ssid, psw)
WifiUtils.getInstance(this@ScanActivity)
.connectWifiPws(ssid, psw, object : WifiUtils.CallBack {
override fun onSuccess() {
ToastUtils.show("连接成功...")
finish()
}
override fun onFail() {
ToastUtils.show("连接失败...")
startActivity(Intent(Settings.ACTION_WIFI_SETTINGS))
}
})
dialog?.dismiss() dialog?.dismiss()
} }
}) })
......
...@@ -123,7 +123,7 @@ public class SplashGroMoreActivity extends BaseActivity { ...@@ -123,7 +123,7 @@ public class SplashGroMoreActivity extends BaseActivity {
// mTTSplashAd.loadAd(adSlot, new TTSplashAdLoadCallback() { // mTTSplashAd.loadAd(adSlot, new TTSplashAdLoadCallback() {
@Override @Override
public void onSplashAdLoadFail(AdError adError) { public void onSplashAdLoadFail(AdError adError) {
mProgressBar.setComplete(); mProgressBar.post(() -> mProgressBar.setComplete());
mMainHandler.postDelayed(() -> { mMainHandler.postDelayed(() -> {
LogUtil.d(TAG, adError.message); LogUtil.d(TAG, adError.message);
...@@ -140,7 +140,7 @@ public class SplashGroMoreActivity extends BaseActivity { ...@@ -140,7 +140,7 @@ public class SplashGroMoreActivity extends BaseActivity {
@Override @Override
public void onSplashAdLoadSuccess() { public void onSplashAdLoadSuccess() {
mProgressBar.setComplete(); mProgressBar.post(() -> mProgressBar.setComplete());
mMainHandler.postDelayed(() -> { mMainHandler.postDelayed(() -> {
...@@ -165,7 +165,7 @@ public class SplashGroMoreActivity extends BaseActivity { ...@@ -165,7 +165,7 @@ public class SplashGroMoreActivity extends BaseActivity {
@Override @Override
public void onAdLoadTimeout() { public void onAdLoadTimeout() {
mProgressBar.setComplete(); mProgressBar.post(() -> mProgressBar.setComplete());
mMainHandler.postDelayed(() -> { mMainHandler.postDelayed(() -> {
mHasLoaded = true; mHasLoaded = true;
......
...@@ -41,16 +41,10 @@ abstract class OutAppActivity : BaseSwipeBackCompatActivity() { ...@@ -41,16 +41,10 @@ abstract class OutAppActivity : BaseSwipeBackCompatActivity() {
resetWindowTransparentBackground() resetWindowTransparentBackground()
// 设置锁屏页全屏 // 设置锁屏页全屏
val isUsingShowWhenLockedFlag = !ScreenLockerUtils.isLockScreenProtected(this) // val isUsingShowWhenLockedFlag = !ScreenLockerUtils.isLockScreenProtected(this)
if (isUsingShowWhenLockedFlag) { // if (isUsingShowWhenLockedFlag) {
ScreenLockerUtils.updateWindowFlags(window.decorView) // ScreenLockerUtils.updateWindowFlags(window.decorView)
} else { // }
ScreenLockerUtils.makeLockWindowFullScreen(
this,
this.window.attributes,
isUsingShowWhenLockedFlag
)
}
} }
private fun resetWindowTransparentBackground() { private fun resetWindowTransparentBackground() {
...@@ -61,7 +55,7 @@ abstract class OutAppActivity : BaseSwipeBackCompatActivity() { ...@@ -61,7 +55,7 @@ abstract class OutAppActivity : BaseSwipeBackCompatActivity() {
Manifest.permission.WRITE_EXTERNAL_STORAGE Manifest.permission.WRITE_EXTERNAL_STORAGE
) != 0 ) != 0
) { ) {
window.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT)) window.setBackgroundDrawable(ColorDrawable(Color.BLACK))
} else { } else {
val wallpaperManager = WallpaperManager.getInstance(this) val wallpaperManager = WallpaperManager.getInstance(this)
val wallpaperDrawable: Drawable = wallpaperManager.drawable val wallpaperDrawable: Drawable = wallpaperManager.drawable
......
...@@ -9,14 +9,17 @@ import android.os.Bundle ...@@ -9,14 +9,17 @@ import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.view.View import android.view.View
import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo
import com.mints.flowbox.R import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ad.wifi.WifiAdManager import com.mints.flowbox.ad.wifi.WifiAdManager
import com.mints.flowbox.ad.wifi.WifiAdStatusListener
import com.mints.flowbox.ui.activitys.base.BaseActivity import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.utils.ForegroundOrBackground
import com.mints.flowbox.utils.LogUtil
import kotlinx.android.synthetic.main.activity_boost_fast.* import kotlinx.android.synthetic.main.activity_boost_fast.*
import kotlinx.android.synthetic.main.activity_boost_fast.iv_close import kotlinx.android.synthetic.main.activity_boost_fast.iv_close
import net.phone.PhoneBrandUtils
import java.util.*
import kotlin.random.Random import kotlin.random.Random
/** /**
...@@ -79,38 +82,25 @@ class BoostFastActivity : BaseActivity() { ...@@ -79,38 +82,25 @@ class BoostFastActivity : BaseActivity() {
Handler(Looper.getMainLooper()).postDelayed( Handler(Looper.getMainLooper()).postDelayed(
{ {
YoYo.with(Techniques.FadeOut).duration(500).playOn(container) WifiAdManager.instance.setWifiAdStatusListener(object : WifiAdStatusListener {
YoYo.with(Techniques.FadeOut).duration(500).playOn(ccav_speed) override fun adSuccess() {
WifiAdManager.instance.showInterstitial(this)
},
2500
)
Handler(Looper.getMainLooper()).postDelayed(
{
ccav_speed.stopAnimation()
ccav_speed.visibility = View.GONE
container.visibility = View.GONE
adContainer.visibility = View.VISIBLE
when (mType) {
TransparentActivity.TIMING_TYPE_BOOST -> tvContent.text = "手机速度已达最佳"
TransparentActivity.TIMING_TYPE_CLEAN -> {
tvContent.text = "已为您清理" + (10 + Random.nextInt(20)) + "MB垃圾" + "\n垃圾清理已完成"
} }
TransparentActivity.TIMING_TYPE_SAVE_ELE -> {
tvContent.text = "已为您延长待机时间" + (10 + Random.nextInt(20)) + "分钟~" override fun adFail() {
} }
TransparentActivity.TIMING_TYPE_COOL -> {
tvContent.text = "手机已降温" + (3 + Random.nextInt(3)) + "°C" override fun adClose() {
} }
TransparentActivity.TIMING_TYPE_SAFE -> tvContent.text = "当前网络环境良好"
TransparentActivity.TIMING_TYPE_PRICARY -> tvContent.text = "当前使用环境安全"
}
}, 3000 })
WifiAdManager.instance.showInterstitial(this@BoostFastActivity)
},
2500
) )
Handler(Looper.getMainLooper()).postDelayed({ updataUi() }, 3000)
colorAnim.addListener(object : Animator.AnimatorListener { colorAnim.addListener(object : Animator.AnimatorListener {
override fun onAnimationStart(animation: Animator?) {} override fun onAnimationStart(animation: Animator?) {}
...@@ -122,6 +112,28 @@ class BoostFastActivity : BaseActivity() { ...@@ -122,6 +112,28 @@ class BoostFastActivity : BaseActivity() {
}) })
} }
private fun updataUi() {
ccav_speed.stopAnimation()
ccav_speed.visibility = View.GONE
container.visibility = View.GONE
adContainer.visibility = View.VISIBLE
when (mType) {
TransparentActivity.TIMING_TYPE_BOOST -> tvContent.text = "手机速度已达最佳"
TransparentActivity.TIMING_TYPE_CLEAN -> {
tvContent.text = "已为您清理" + (10 + Random.nextInt(20)) + "MB垃圾" + "\n垃圾清理已完成"
}
TransparentActivity.TIMING_TYPE_SAVE_ELE -> {
tvContent.text = "已为您延长待机时间" + (10 + Random.nextInt(20)) + "分钟~"
}
TransparentActivity.TIMING_TYPE_COOL -> {
tvContent.text = "手机已降温" + (3 + Random.nextInt(3)) + "°C"
}
TransparentActivity.TIMING_TYPE_SAFE -> tvContent.text = "当前网络环境良好"
TransparentActivity.TIMING_TYPE_PRICARY -> tvContent.text = "当前使用环境安全"
}
}
private fun initView() { private fun initView() {
iv_close.setOnClickListener { iv_close.setOnClickListener {
finish() finish()
...@@ -129,6 +141,11 @@ class BoostFastActivity : BaseActivity() { ...@@ -129,6 +141,11 @@ class BoostFastActivity : BaseActivity() {
} }
} }
override fun onDestroy() {
WifiAdManager.instance.onDestroy()
super.onDestroy()
}
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
initExpress() initExpress()
......
...@@ -54,6 +54,7 @@ class TransparentActivity : BaseActivity() { ...@@ -54,6 +54,7 @@ class TransparentActivity : BaseActivity() {
ExpressManager.loadAppOutExpress() ExpressManager.loadAppOutExpress()
val intent = Intent(MintsApplication.getContext(), BoostFastActivity::class.java) val intent = Intent(MintsApplication.getContext(), BoostFastActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_NO_ANIMATION
intent.putExtra(TIMING_TYPE, mType) intent.putExtra(TIMING_TYPE, mType)
startActivity(intent) startActivity(intent)
finish() finish()
......
...@@ -4,6 +4,7 @@ import android.content.Context ...@@ -4,6 +4,7 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.provider.Settings import android.provider.Settings
import android.text.TextUtils
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
...@@ -29,8 +30,6 @@ class MainWifiAdapter(val context: Context, val taskData: MutableList<WifiListBe ...@@ -29,8 +30,6 @@ class MainWifiAdapter(val context: Context, val taskData: MutableList<WifiListBe
mOnItemClickListener = onItemClickListener mOnItemClickListener = onItemClickListener
} }
// fun set
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if (viewType == FriendsInvitedAdapter.HOLDER_TYPE_EMPTY) { if (viewType == FriendsInvitedAdapter.HOLDER_TYPE_EMPTY) {
val emptyView = val emptyView =
...@@ -83,6 +82,18 @@ class MainWifiAdapter(val context: Context, val taskData: MutableList<WifiListBe ...@@ -83,6 +82,18 @@ class MainWifiAdapter(val context: Context, val taskData: MutableList<WifiListBe
wifiHolder.btnConnect.setBackgroundResource(R.drawable.shape_tv_gold_gury) wifiHolder.btnConnect.setBackgroundResource(R.drawable.shape_tv_gold_gury)
} }
when {
TextUtils.equals(taskData[position].wifiSignal, "很强") -> {
wifiHolder.ivWifiSignal.setImageResource(R.mipmap.ic_main_wifi_signal_level_1)
}
TextUtils.equals(taskData[position].wifiSignal, "较强") -> {
wifiHolder.ivWifiSignal.setImageResource(R.mipmap.ic_main_wifi_signal_level_2)
}
else -> {
wifiHolder.ivWifiSignal.setImageResource(R.mipmap.ic_main_wifi_signal_level_3)
}
}
wifiHolder.btnConnect.setOnClickListener { wifiHolder.btnConnect.setOnClickListener {
mOnItemClickListener?.onItemClick(it, position) mOnItemClickListener?.onItemClick(it, position)
} }
......
...@@ -47,6 +47,15 @@ public class ExpandInfo { ...@@ -47,6 +47,15 @@ public class ExpandInfo {
public String tint; // 提示 public String tint; // 提示
public String filePath; // 路径 public String filePath; // 路径
public boolean isChecked; // 是否选中 public boolean isChecked; // 是否选中
public String pkgName; // 包名
public String isPkgName() {
return pkgName;
}
public void setPkgName(String pkgName) {
this.pkgName = pkgName;
}
public Object getHeadId() { public Object getHeadId() {
return headId; return headId;
......
...@@ -11,7 +11,9 @@ import android.os.Bundle ...@@ -11,7 +11,9 @@ import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import android.view.Gravity import android.view.Gravity
import android.view.View import android.view.View
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.DividerItemDecoration
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.mints.flowbox.BuildConfig import com.mints.flowbox.BuildConfig
import com.mints.flowbox.MintsApplication import com.mints.flowbox.MintsApplication
import com.mints.library.net.netstatus.NetUtils import com.mints.library.net.netstatus.NetUtils
...@@ -39,6 +41,7 @@ import com.mints.flowbox.ui.widgets.dialog.ShareDialog ...@@ -39,6 +41,7 @@ import com.mints.flowbox.ui.widgets.dialog.ShareDialog
import com.mints.flowbox.ui.widgets.seekbar.BubbleUtils import com.mints.flowbox.ui.widgets.seekbar.BubbleUtils
import com.mints.flowbox.utils.AppUtil import com.mints.flowbox.utils.AppUtil
import com.mints.flowbox.utils.SpanUtils import com.mints.flowbox.utils.SpanUtils
import com.mints.flowbox.utils.ToolUtil
import com.mints.library.utils.CommonUtils import com.mints.library.utils.CommonUtils
import com.mints.library.utils.GlideUtils import com.mints.library.utils.GlideUtils
import kotlinx.android.synthetic.main.fragment_main_my.* import kotlinx.android.synthetic.main.fragment_main_my.*
...@@ -59,7 +62,7 @@ private val TAG = MyFragment::class.java.simpleName ...@@ -59,7 +62,7 @@ private val TAG = MyFragment::class.java.simpleName
class MyFragment : BaseFragment(), class MyFragment : BaseFragment(),
MyView, MyView,
OnItemChildClickListener, OnItemChildClickListener,
View.OnClickListener { View.OnClickListener, SwipeRefreshLayout.OnRefreshListener {
private val myPresenter by lazy { MyPresenter() } private val myPresenter by lazy { MyPresenter() }
private val userManager by lazy { UserManager.getInstance() } private val userManager by lazy { UserManager.getInstance() }
...@@ -162,6 +165,8 @@ class MyFragment : BaseFragment(), ...@@ -162,6 +165,8 @@ class MyFragment : BaseFragment(),
} }
override fun getUserTaskMsgSuc(data: MyInfo?) { override fun getUserTaskMsgSuc(data: MyInfo?) {
swipeRefreshLayout.isRefreshing = false
if (data == null) { if (data == null) {
userConfig = null userConfig = null
return return
...@@ -731,6 +736,13 @@ class MyFragment : BaseFragment(), ...@@ -731,6 +736,13 @@ class MyFragment : BaseFragment(),
iv_right_icon.visibility = View.VISIBLE iv_right_icon.visibility = View.VISIBLE
iv_right_icon.setImageResource(R.mipmap.ic_settings) iv_right_icon.setImageResource(R.mipmap.ic_settings)
line.visibility = View.GONE line.visibility = View.GONE
swipeRefreshLayout.setProgressViewEndTarget(true, ToolUtil.dp2px(mContext, 100))
swipeRefreshLayout.setColorSchemeColors(
ContextCompat.getColor(
mContext,
R.color.color_main
)
)
tv_left_subtitle.setOnClickListener(this) tv_left_subtitle.setOnClickListener(this)
item_title_id.setOnClickListener(this) item_title_id.setOnClickListener(this)
...@@ -739,6 +751,7 @@ class MyFragment : BaseFragment(), ...@@ -739,6 +751,7 @@ class MyFragment : BaseFragment(),
btn_coinRecord.setOnClickListener(this) btn_coinRecord.setOnClickListener(this)
item_title_friends.setOnClickListener(this) item_title_friends.setOnClickListener(this)
ll_my_login.setOnClickListener(this) ll_my_login.setOnClickListener(this)
swipeRefreshLayout.setOnRefreshListener(this)
} }
/** 初始化任务列表 */ /** 初始化任务列表 */
...@@ -908,4 +921,8 @@ class MyFragment : BaseFragment(), ...@@ -908,4 +921,8 @@ class MyFragment : BaseFragment(),
mReceiverBroadcastReceiver = null mReceiverBroadcastReceiver = null
} }
} }
override fun onRefresh() {
onResume()
}
} }
\ No newline at end of file
...@@ -16,6 +16,7 @@ import android.view.View ...@@ -16,6 +16,7 @@ import android.view.View
import androidx.core.app.ActivityCompat import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.DividerItemDecoration
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
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.hjq.toast.ToastUtils import com.hjq.toast.ToastUtils
...@@ -44,6 +45,7 @@ import com.mints.library.net.netstatus.NetUtils ...@@ -44,6 +45,7 @@ import com.mints.library.net.netstatus.NetUtils
import com.mints.library.utils.nodoubleclick.AntiShake import com.mints.library.utils.nodoubleclick.AntiShake
import com.tbruyelle.rxpermissions.RxPermissions import com.tbruyelle.rxpermissions.RxPermissions
import kotlinx.android.synthetic.main.fragment_wifi.* import kotlinx.android.synthetic.main.fragment_wifi.*
import kotlinx.android.synthetic.main.fragment_wifi.swipeRefreshLayout
import rx.Observable import rx.Observable
import java.util.* import java.util.*
import kotlin.random.Random import kotlin.random.Random
...@@ -57,7 +59,7 @@ private val TAG = WifiFragment::class.java.simpleName ...@@ -57,7 +59,7 @@ private val TAG = WifiFragment::class.java.simpleName
* @des 福利页 * @des 福利页
*/ */
class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
WifiStateManager.WifiStateCallback { WifiStateManager.WifiStateCallback, SwipeRefreshLayout.OnRefreshListener {
private var mMainWifiAdapter: MainWifiAdapter? = null private var mMainWifiAdapter: MainWifiAdapter? = null
private val mWifiList: MutableList<WifiListBean> = mutableListOf() private val mWifiList: MutableList<WifiListBean> = mutableListOf()
...@@ -90,6 +92,12 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -90,6 +92,12 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
openGpsSettings() openGpsSettings()
} }
updateUiState()
btn_signal.postDelayed({
rope = YoYo.with(Techniques.Pulse).duration(500).repeat(-1).playOn(btn_signal)
}, 200)
// 防止banner刷新太快 // 防止banner刷新太快
// if (AntiShake.check(fl_wifi_banner?.id)) return // if (AntiShake.check(fl_wifi_banner?.id)) return
// BannerManager.instance.getTtBanner(TtCsjAdManager.TT_AD_BANNER_MY, fl_wifi_banner) // BannerManager.instance.getTtBanner(TtCsjAdManager.TT_AD_BANNER_MY, fl_wifi_banner)
...@@ -118,14 +126,9 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -118,14 +126,9 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
/** 重置wifi数据 */ /** 重置wifi数据 */
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
private fun loadWifiData() { private fun loadWifiData() {
btn_signal.postDelayed({ mWifiList.clear()
rope = YoYo.with(Techniques.Pulse).duration(500).repeat(-1).playOn(btn_signal)
}, 200)
if (wifiUtils.isWifiEnable) { if (wifiUtils.isWifiEnable) {
mWifiList.clear()
updateUiState()
val connectionWifiInfo = wifiUtils.connectionWifiInfo val connectionWifiInfo = wifiUtils.connectionWifiInfo
// 校验是否有定位权限 // 校验是否有定位权限
...@@ -146,6 +149,9 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -146,6 +149,9 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
btn_signal.text = "打开设置" btn_signal.text = "打开设置"
imageView2.setImageResource(R.mipmap.ic_main_wifi_none) imageView2.setImageResource(R.mipmap.ic_main_wifi_none)
} }
Handler(Looper.getMainLooper()).postDelayed({
swipeRefreshLayout.isRefreshing = false
}, 1000)
return return
} }
...@@ -154,26 +160,49 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -154,26 +160,49 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
tv_wifi_ssid.text = connectionWifiInfo.ssid.replace("\"", "") tv_wifi_ssid.text = connectionWifiInfo.ssid.replace("\"", "")
tv_wifi_info.text = "连接成功,安全保护中" tv_wifi_info.text = "连接成功,安全保护中"
btn_signal.text = "信号增强" btn_signal.text = "信号增强"
imageView2.setImageResource(R.mipmap.ic_main_wifi)
if (connectionWifiInfo.rssi > -70) {
imageView2.setImageResource(R.mipmap.ic_main_wifi)
} else {
imageView2.setImageResource(R.mipmap.ic_main_wifi_low)
}
generateWifiListData(connectionWifiInfo, true)
} else { } else {
tv_wifi_ssid.text = "WIFI未连接" tv_wifi_ssid.text = "WIFI未连接"
tv_wifi_info.text = "请连接无线网络" tv_wifi_info.text = "请连接无线网络"
btn_signal.text = "打开设置" btn_signal.text = "打开设置"
imageView2.setImageResource(R.mipmap.ic_main_wifi_none) imageView2.setImageResource(R.mipmap.ic_main_wifi_none)
generateWifiListData(null, false)
} }
generateWifiListData(connectionWifiInfo)
} else { } else {
tv_wifi_ssid.text = "WIFI未开启" tv_wifi_ssid.text = "WIFI未开启"
tv_wifi_info.text = "请先开启无线网络" tv_wifi_info.text = "请先开启无线网络"
btn_signal.text = "开启WIFI" btn_signal.text = "开启WIFI"
imageView2.setImageResource(R.mipmap.ic_main_wifi_none) imageView2.setImageResource(R.mipmap.ic_main_wifi_none)
generateWifiListData(null, false)
} }
} }
/** 生成wifi列表数据 */ /** 生成wifi列表数据 */
private fun generateWifiListData(connectionWifiInfo: WifiInfo) { private fun generateWifiListData(connectionWifiInfo: WifiInfo?, isConnected: Boolean) {
val ssid = connectionWifiInfo.ssid.replace("\"", "") Handler(Looper.getMainLooper()).postDelayed({
swipeRefreshLayout.isRefreshing = false
}, 1000)
if (!isConnected) {
Handler(Looper.getMainLooper()).postDelayed({
swipeRefreshLayout.isRefreshing = false
}, 1000)
mMainWifiAdapter?.notifyDataSetChanged()
return
}
mWifiList.clear()
val ssid = connectionWifiInfo!!.ssid.replace("\"", "")
for (scanResult in wifiUtils.wifiList) { for (scanResult in wifiUtils.wifiList) {
if (TextUtils.isEmpty(scanResult.SSID)) continue if (TextUtils.isEmpty(scanResult.SSID)) continue
if (TextUtils.equals(scanResult.SSID, ssid)) { if (TextUtils.equals(scanResult.SSID, ssid)) {
...@@ -220,6 +249,10 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -220,6 +249,10 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
Collections.swap(mWifiList, 0, connectIndex) Collections.swap(mWifiList, 0, connectIndex)
} }
Handler(Looper.getMainLooper()).postDelayed({
swipeRefreshLayout.isRefreshing = false
}, 1000)
mMainWifiAdapter?.notifyDataSetChanged() mMainWifiAdapter?.notifyDataSetChanged()
} }
...@@ -251,7 +284,9 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -251,7 +284,9 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
} }
if (AppConfig.isCanSaveBattery) { if (AppConfig.isCanSaveBattery) {
AppConfig.fakeSaveBatteryCount = 1 + Random.nextInt(8) if (AppConfig.fakeBoostCount != 0) {
AppConfig.fakeSaveBatteryCount = 1 + Random.nextInt(8)
}
tv_save_battery.text = SpanUtils() tv_save_battery.text = SpanUtils()
.append("超强省电\n") .append("超强省电\n")
.append("${AppConfig.fakeSaveBatteryCount}个") .append("${AppConfig.fakeSaveBatteryCount}个")
...@@ -305,7 +340,12 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -305,7 +340,12 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
} }
private fun initRecy() { private fun initRecy() {
recy_wifi.addItemDecoration(RecyItemDecoration(mContext, DividerItemDecoration.VERTICAL)) recy_wifi.addItemDecoration(
RecyItemDecoration(
mContext,
DividerItemDecoration.VERTICAL
)
)
mMainWifiAdapter = MainWifiAdapter(mContext, mWifiList) mMainWifiAdapter = MainWifiAdapter(mContext, mWifiList)
recy_wifi.adapter = mMainWifiAdapter recy_wifi.adapter = mMainWifiAdapter
mMainWifiAdapter?.setOnItemClickListener(this) mMainWifiAdapter?.setOnItemClickListener(this)
...@@ -320,9 +360,17 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -320,9 +360,17 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
tv_save_battery.setOnClickListener(this) tv_save_battery.setOnClickListener(this)
btn_signal.setOnClickListener(this) btn_signal.setOnClickListener(this)
ivImg.setOnClickListener(this) ivImg.setOnClickListener(this)
swipeRefreshLayout.setOnRefreshListener(this)
} }
private fun initView() { private fun initView() {
swipeRefreshLayout.setProgressViewEndTarget(true, ToolUtil.dp2px(mContext, 100))
swipeRefreshLayout.setColorSchemeColors(
ContextCompat.getColor(
mContext,
R.color.color_main
)
)
WifiStateManager.instance.setWifiStateCallback(this) WifiStateManager.instance.setWifiStateCallback(this)
} }
...@@ -465,7 +513,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -465,7 +513,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
/** 滚动到底部 */ /** 滚动到底部 */
private fun scrollToBottom() { private fun scrollToBottom() {
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
container.scrollTo(0, container.height) container.smoothScrollTo(0, container.height)
}, 100) }, 100)
} }
...@@ -537,14 +585,31 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -537,14 +585,31 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
return return
} }
wifiUtils.connectWifiPws(wifiListBean.wifiName, wifiDialog!!.getInputStr())
ToastUtils.show("正在连接中...") ToastUtils.show("正在连接中...")
wifiUtils.connectWifiPws(
wifiListBean.wifiName,
wifiDialog!!.getInputStr(),
object : WifiUtils.CallBack {
override fun onSuccess() {
ToastUtils.show("连接成功...")
requireActivity().runOnUiThread {
loadWifiData()
}
}
override fun onFail() {
ToastUtils.show("连接失败...")
startActivity(Intent(Settings.ACTION_WIFI_SETTINGS))
}
})
wifiDialog?.dismiss() wifiDialog?.dismiss()
} }
}) })
wifiDialog?.let { wifiDialog?.let {
it.clearInput()
it.setWifiName(wifiListBean.wifiName) it.setWifiName(wifiListBean.wifiName)
it.setWifiSignal(wifiListBean.wifiSignal) it.setWifiSignal(wifiListBean.wifiSignal)
it.setWifiEncodeType(wifiListBean.cipherType) it.setWifiEncodeType(wifiListBean.cipherType)
...@@ -566,4 +631,8 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener, ...@@ -566,4 +631,8 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
// fl_wifi_banner?.removeAllViews() // fl_wifi_banner?.removeAllViews()
super.onDestroy() super.onDestroy()
} }
override fun onRefresh() {
loadWifiData()
}
} }
\ No newline at end of file
...@@ -113,6 +113,11 @@ public class CycleProgress extends View { ...@@ -113,6 +113,11 @@ public class CycleProgress extends View {
} }
public void setComplete() { public void setComplete() {
if (mAnimator != null) {
mAnimator.cancel();
mAnimator = null;
}
mProgressWidth = mViewWidth; mProgressWidth = mViewWidth;
invalidate(); invalidate();
} }
......
...@@ -51,6 +51,10 @@ class WifiConnectDialog(context: Context, private val listener: DialogListener) ...@@ -51,6 +51,10 @@ class WifiConnectDialog(context: Context, private val listener: DialogListener)
tvCancel.setOnClickListener { dismiss() } tvCancel.setOnClickListener { dismiss() }
} }
fun clearInput() {
etPsw.text.clear()
}
fun setWifiName(str: String) { fun setWifiName(str: String) {
tvName.text = str tvName.text = str
} }
......
This diff is collapsed.
package com.mints.flowbox.utils;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.IPackageStatsObserver;
import android.content.pm.PackageStats;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.UserHandle;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* @author jyx
* @date 2021/7/17
* @des
*/
public class CleanUtils {
public static void cleanCache(Context context) {
PackageManager pm = context.getPackageManager();
try {
Method getPackageSizeInfoMethod = pm.getClass().getMethod("getPackageSizeInfo", String.class, IPackageStatsObserver.class);
Method myUserId = UserHandle.class.getDeclaredMethod("myUserId");
getPackageSizeInfoMethod.invoke(pm, "com.mints.camera", new IPackageStatsObserver() {
@Override
public void onGetStatsCompleted(PackageStats pStats, boolean succeeded) throws RemoteException {
if (succeeded) {
LogUtil.d("AAA" + pStats.cacheSize);
}
}
@Override
public IBinder asBinder() {
return null;
}
});
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
e.printStackTrace();
}
}
}
...@@ -64,10 +64,15 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall ...@@ -64,10 +64,15 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
} }
public static Activity getMain_activity() { public static Activity getMain_activity() {
if (main_activity.get() == null) { try {
return app_activity.get(); if (main_activity.get() == null) {
return app_activity.get();
}
return main_activity.get();
} catch (NullPointerException e) {
e.printStackTrace();
return null;
} }
return main_activity.get();
} }
@Override @Override
......
...@@ -3,13 +3,24 @@ package com.mints.flowbox.utils; ...@@ -3,13 +3,24 @@ package com.mints.flowbox.utils;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.NetworkInfo; import android.net.NetworkInfo;
import android.net.NetworkRequest;
import android.net.wifi.ScanResult; import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo; import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager; import android.net.wifi.WifiManager;
import android.net.wifi.WifiNetworkSpecifier;
import android.os.Build;
import android.os.PatternMatcher;
import android.text.TextUtils; import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import com.mints.flowbox.MintsApplication;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
...@@ -79,7 +90,7 @@ public class WifiUtils { ...@@ -79,7 +90,7 @@ public class WifiUtils {
ConnectivityManager connectivityManager = (ConnectivityManager) context ConnectivityManager connectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE); .getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo(); NetworkInfo activeNetInfo = connectivityManager.getActiveNetworkInfo();
return activeNetInfo != null && activeNetInfo.getType() == ConnectivityManager.TYPE_WIFI; return activeNetInfo != null && activeNetInfo.isConnected();
} }
/** /**
...@@ -172,10 +183,54 @@ public class WifiUtils { ...@@ -172,10 +183,54 @@ public class WifiUtils {
* @param ssid * @param ssid
* @param pws * @param pws
*/ */
public void connectWifiPws(String ssid, String pws) { public void connectWifiPws(String ssid, String pws, CallBack callBack) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
connectWifiPswQ(ssid, pws, callBack);
return;
}
wifiManager.disableNetwork(wifiManager.getConnectionInfo().getNetworkId()); wifiManager.disableNetwork(wifiManager.getConnectionInfo().getNetworkId());
int netId = wifiManager.addNetwork(getWifiConfig(ssid, pws, true)); int netId = wifiManager.addNetwork(getWifiConfig(ssid, pws, true));
wifiManager.enableNetwork(netId, true); if (wifiManager.enableNetwork(netId, true)) {
callBack.onSuccess();
} else {
callBack.onFail();
}
}
@RequiresApi(api = Build.VERSION_CODES.Q)
private void connectWifiPswQ(String ssid, String pws, CallBack callBack) {
WifiNetworkSpecifier wifiNetworkSpecifier = new WifiNetworkSpecifier.Builder()
.setSsidPattern(new PatternMatcher(ssid, PatternMatcher.PATTERN_PREFIX))
.setWpa2Passphrase(pws)
.build();
NetworkRequest networkRequest = new NetworkRequest.Builder()
.addTransportType(NetworkCapabilities.TRANSPORT_WIFI)
.removeCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
.setNetworkSpecifier(wifiNetworkSpecifier)
.build();
ConnectivityManager connectivityManager = MintsApplication.getContext().getSystemService(ConnectivityManager.class);
connectivityManager.requestNetwork(networkRequest,
new ConnectivityManager.NetworkCallback() {
@Override
public void onAvailable(@NonNull Network network) {
super.onAvailable(network);
connectivityManager.bindProcessToNetwork(network);
callBack.onSuccess();
}
@Override
public void onUnavailable() {
super.onUnavailable();
callBack.onFail();
}
});
}
public interface CallBack {
void onSuccess();
void onFail();
} }
/** /**
......
...@@ -11,8 +11,8 @@ import androidx.core.app.NotificationCompat ...@@ -11,8 +11,8 @@ import androidx.core.app.NotificationCompat
import com.mints.flowbox.R import com.mints.flowbox.R
object NotificationUtils { object NotificationUtils {
private const val ID = "channel_1" private const val ID = "channel_flowbox"
private const val NAME = "notification" private const val NAME = "默认通知"
private var manager: NotificationManager? = null private var manager: NotificationManager? = null
...@@ -56,7 +56,7 @@ object NotificationUtils { ...@@ -56,7 +56,7 @@ object NotificationUtils {
PendingIntent.FLAG_UPDATE_CURRENT PendingIntent.FLAG_UPDATE_CURRENT
) )
val notificationBuilder = NotificationCompat.Builder(context, ID) val notificationBuilder = NotificationCompat.Builder(context, ID)
.setSmallIcon(R.drawable.ic_launcher_main) .setSmallIcon(R.mipmap.ic_wifi_notice)
.setContentTitle(title) .setContentTitle(title)
.setContentText(content) .setContentText(content)
.setSound(null) .setSound(null)
......
...@@ -4,13 +4,17 @@ import android.app.Activity; ...@@ -4,13 +4,17 @@ import android.app.Activity;
import android.app.ActivityManager; import android.app.ActivityManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Build;
import android.provider.Settings; import android.provider.Settings;
import com.mints.flowbox.MintsApplication; import com.activityutil.ActivityManagerProxy;
import com.activityutil.BringToFrontListener;
import com.activityutil.ContextLike;
import com.mints.flowbox.utils.ForegroundOrBackground;
import net.phone.PhoneBrandUtils; import net.phone.PhoneBrandUtils;
import org.jetbrains.annotations.NotNull;
import java.util.List; import java.util.List;
/** /**
...@@ -22,22 +26,38 @@ public class IntentUtils { ...@@ -22,22 +26,38 @@ public class IntentUtils {
public static final String TAG = "IntentUtils"; public static final String TAG = "IntentUtils";
public static void startActivity(Activity activity, Intent intent) { public static void startActivity2(Intent intent) {
if (PhoneBrandUtils.isXiaomi() | PhoneBrandUtils.isVivo() | PhoneBrandUtils.isOppo()) { if (PhoneBrandUtils.isHuaweiHonor()) {
// if (!isRunningForeground(activity)) { if (ForegroundOrBackground.getMain_activity() != null) {
// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) { startActivity(intent);
return;
}
}
try {
ActivityManagerProxy.INSTANCE.bringToFront(new BringToFrontListener() {
@Override
public void onCall(@NotNull ContextLike contextLike) {
contextLike.startActivity(intent);
}
@Override
public void onResult(boolean b) {
}
}, null);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void startActivity(Intent intent) {
if (ForegroundOrBackground.getMain_activity() != null) {
Activity activity = ForegroundOrBackground.getMain_activity();
moveToFront(activity); moveToFront(activity);
MintsApplication.getContext().startActivity(intent); activity.startActivity(intent);
activity.moveTaskToBack(true); activity.moveTaskToBack(true);
// } else { return;
// NotificationUtils.INSTANCE.sendNotificationFullScreen(activity, "", "", intent);
// }
// } else {
// MintsApplication.getContext().startActivity(intent);
// }
} else {
MintsApplication.getContext().startActivity(intent);
} }
startActivity2(intent);
} }
public static Boolean isRunningForeground(Activity activity) { public static Boolean isRunningForeground(Activity activity) {
...@@ -54,7 +74,7 @@ public class IntentUtils { ...@@ -54,7 +74,7 @@ public class IntentUtils {
public static void moveToFront(Context context) { public static void moveToFront(Context context) {
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningTaskInfo> taskInfoList = activityManager.getRunningTasks(1); List<ActivityManager.RunningTaskInfo> taskInfoList = activityManager.getRunningTasks(20);
for (ActivityManager.RunningTaskInfo taskInfo : taskInfoList) { for (ActivityManager.RunningTaskInfo taskInfo : taskInfoList) {
//遍历找到本应用的 task,并将它切换到前台 //遍历找到本应用的 task,并将它切换到前台
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="100dp" android:layout_height="100dp"
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:layout_marginTop="180dp" android:layout_marginTop="150dp"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:background="@mipmap/ic_app_out_background"> android:background="@mipmap/ic_app_out_background">
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:drawableStart="@mipmap/ic_ok" android:drawableStart="@mipmap/ic_right"
android:drawablePadding="6dp" android:drawablePadding="6dp"
android:text="-" android:text="-"
android:textColor="@color/white" android:textColor="@color/white"
......
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_above="@id/app_logo" android:layout_above="@id/app_logo"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginStart="20dp" android:layout_marginStart="30dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="20dp" android:layout_marginEnd="30dp"
android:layout_marginBottom="50dp" /> android:layout_marginBottom="50dp" />
</RelativeLayout> </RelativeLayout>
......
...@@ -4,16 +4,18 @@ ...@@ -4,16 +4,18 @@
android:layout_width="300dp" android:layout_width="300dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/shape_bg_write" android:background="@drawable/shape_bg_write"
android:padding="10dp"> android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingEnd="20dp"
android:paddingBottom="10dp">
<TextView <TextView
android:id="@+id/textView8" android:id="@+id/textView8"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="15dp"
android:text="WIFI名称" android:text="WIFI名称"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
...@@ -21,10 +23,9 @@ ...@@ -21,10 +23,9 @@
android:id="@+id/tv_wifi_name" android:id="@+id/tv_wifi_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="15dp"
android:text="-" android:text="-"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
...@@ -32,7 +33,7 @@ ...@@ -32,7 +33,7 @@
android:id="@+id/line1" android:id="@+id/line1"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginTop="10dp" android:layout_marginTop="15dp"
android:background="@color/color_E6E6E6" android:background="@color/color_E6E6E6"
app:layout_constraintTop_toBottomOf="@id/textView8" /> app:layout_constraintTop_toBottomOf="@id/textView8" />
...@@ -40,10 +41,9 @@ ...@@ -40,10 +41,9 @@
android:id="@+id/textView9" android:id="@+id/textView9"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="15dp"
android:text="信号强度" android:text="信号强度"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/line1" /> app:layout_constraintTop_toBottomOf="@id/line1" />
...@@ -51,10 +51,9 @@ ...@@ -51,10 +51,9 @@
android:id="@+id/tv_wifi_signal" android:id="@+id/tv_wifi_signal"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="15dp"
android:text="-" android:text="-"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="12sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/line1" /> app:layout_constraintTop_toBottomOf="@id/line1" />
...@@ -62,7 +61,7 @@ ...@@ -62,7 +61,7 @@
android:id="@+id/line2" android:id="@+id/line2"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginTop="10dp" android:layout_marginTop="15dp"
android:background="@color/color_E6E6E6" android:background="@color/color_E6E6E6"
app:layout_constraintTop_toBottomOf="@id/textView9" /> app:layout_constraintTop_toBottomOf="@id/textView9" />
...@@ -70,10 +69,9 @@ ...@@ -70,10 +69,9 @@
android:id="@+id/textView10" android:id="@+id/textView10"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="15dp"
android:text="加密方式" android:text="加密方式"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="12sp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/line2" /> app:layout_constraintTop_toBottomOf="@id/line2" />
...@@ -81,7 +79,7 @@ ...@@ -81,7 +79,7 @@
android:id="@+id/tv_wifi_encode_type" android:id="@+id/tv_wifi_encode_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="15dp"
android:text="-" android:text="-"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="12sp" android:textSize="12sp"
...@@ -92,7 +90,7 @@ ...@@ -92,7 +90,7 @@
android:id="@+id/line3" android:id="@+id/line3"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_marginTop="10dp" android:layout_marginTop="15dp"
android:background="@color/color_E6E6E6" android:background="@color/color_E6E6E6"
app:layout_constraintTop_toBottomOf="@id/textView10" /> app:layout_constraintTop_toBottomOf="@id/textView10" />
...@@ -103,7 +101,7 @@ ...@@ -103,7 +101,7 @@
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:text="输入WiFi密码" android:text="输入WiFi密码"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="16sp" android:textSize="18sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
...@@ -118,7 +116,7 @@ ...@@ -118,7 +116,7 @@
android:hint="输入密码" android:hint="输入密码"
android:inputType="textPassword" android:inputType="textPassword"
android:padding="10dp" android:padding="10dp"
android:textSize="12sp" android:textSize="14sp"
app:layout_constraintTop_toBottomOf="@id/textView11" /> app:layout_constraintTop_toBottomOf="@id/textView11" />
<Button <Button
...@@ -129,7 +127,7 @@ ...@@ -129,7 +127,7 @@
android:background="@drawable/shape_btn_clean" android:background="@drawable/shape_btn_clean"
android:text="连接" android:text="连接"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="18sp" android:textSize="16sp"
app:layout_constraintTop_toBottomOf="@id/et_psw" /> app:layout_constraintTop_toBottomOf="@id/et_psw" />
<TextView <TextView
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/scrollviewMy" android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent">
android:focusable="true"
android:focusableInTouchMode="true"
android:overScrollMode="never">
<FrameLayout <androidx.core.widget.NestedScrollView
android:id="@+id/scrollviewMy"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:overScrollMode="never">
<View <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:background="@mipmap/bg_my" /> android:focusable="true"
android:focusableInTouchMode="true">
<LinearLayout <View
android:id="@+id/llMyRoot" android:layout_width="match_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/header_layout" />
<include layout="@layout/item_fragment_main_my_title" />
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/fl_my_banner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:background="@mipmap/bg_my" />
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="4dip"
android:visibility="gone" />
<androidx.appcompat.widget.LinearLayoutCompat <LinearLayout
android:id="@+id/llMyRoot"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="10dp" android:orientation="vertical">
android:layout_marginEnd="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="2dip"
android:orientation="vertical"
android:padding="10dp">
<TextView <include layout="@layout/header_layout" />
<include layout="@layout/item_fragment_main_my_title" />
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/fl_my_banner"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="任务列表" android:layout_marginStart="10dp"
android:textColor="@color/black" android:layout_marginEnd="10dp"
android:textSize="18sp" /> android:layout_marginBottom="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="4dip"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/recy_my"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="2dip"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="任务列表"
android:textColor="@color/black"
android:textSize="18sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recy_my"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
<include layout="@layout/item_fragment_main_my_customer_service" /> <include layout="@layout/item_fragment_main_my_customer_service" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
\ No newline at end of file </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
\ No newline at end of file
This diff is collapsed.
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
android:id="@+id/iv_left_icon" android:id="@+id/iv_left_icon"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:padding="10dp" android:padding="14dp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
......
...@@ -18,6 +18,6 @@ ...@@ -18,6 +18,6 @@
android:layout_height="20dp" android:layout_height="20dp"
android:layout_alignTop="@id/tv1" android:layout_alignTop="@id/tv1"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:src="@mipmap/bg_right" /> android:src="@mipmap/ic_right_green" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:padding="10dp" android:padding="14dp"
android:src="@mipmap/ic_arrow_back" /> android:src="@mipmap/ic_arrow_back" />
<ImageView <ImageView
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
android:layout_height="50dp" android:layout_height="50dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_toEndOf="@id/tv_activity_back" android:layout_toEndOf="@id/tv_activity_back"
android:padding="12dp" android:padding="15dp"
android:src="@mipmap/ic_close" /> android:src="@mipmap/ic_close" />
<TextView <TextView
......
app/src/main/res/mipmap-xhdpi/ic_close.png

420 Bytes | W: | H:

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

655 Bytes | W: | H:

app/src/main/res/mipmap-xhdpi/ic_close.png
app/src/main/res/mipmap-xhdpi/ic_close.png
app/src/main/res/mipmap-xhdpi/ic_close.png
app/src/main/res/mipmap-xhdpi/ic_close.png
  • 2-up
  • Swipe
  • Onion skin
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