Commit 0b3c1526 authored by jyx's avatar jyx

更新应用外信息流展示,添加应用外弹窗权限

parent 030e7d21
......@@ -168,21 +168,28 @@
android:launchMode="singleInstance" />
<activity
android:name=".ui.activitys.ScreenActivity"
android:name=".ui.activitys.keepalive.ScreenActivity"
android:excludeFromRecents="true"
android:exported="false"
android:finishOnTaskLaunch="false"
android:launchMode="singleInstance"
android:theme="@style/CustomerTransparentTheme" />
<activity
android:name=".ui.activitys.BoostActivity"
android:name=".ui.activitys.keepalive.BoostActivity"
android:excludeFromRecents="true"
android:exported="false"
android:finishOnTaskLaunch="false"
android:launchMode="singleInstance"
android:theme="@style/CustomerTransparentTheme" />
<activity
android:name=".ui.activitys.ApkActivity"
android:name=".ui.activitys.keepalive.ApkActivity"
android:excludeFromRecents="true"
android:exported="false"
android:finishOnTaskLaunch="false"
android:launchMode="singleInstance"
android:theme="@style/CustomerTransparentTheme" />
<activity
android:name=".ui.activitys.keepalive.TimingActivity"
android:excludeFromRecents="true"
android:exported="false"
android:finishOnTaskLaunch="false"
......
......@@ -24,7 +24,7 @@ import com.mints.flowbox.utils.VideoOptionUtil
import java.util.ArrayList
import java.util.HashMap
private val TAG = GroMoreCarrierExpressManager::class.java.simpleName
private val TAG = AppOutGroMoreCarrierExpressManager::class.java.simpleName
class AppOutGroMoreCarrierExpressManager : TTSettingConfigCallback {
......@@ -69,7 +69,10 @@ class AppOutGroMoreCarrierExpressManager : TTSettingConfigCallback {
private fun loadAd() {
mTTAdNative =
TTUnifiedNativeAd(MintsApplication.getContext(), CsjGroMoreManager.APP_OUT_AD_UNIT_EXPRESS_ID)
TTUnifiedNativeAd(
MintsApplication.getContext(),
CsjGroMoreManager.APP_OUT_AD_UNIT_LOCK_EXPRESS_ID
)
//视频声音控制设置
var videoOption: TTVideoOption = VideoOptionUtil.getTTVideoOption()
......@@ -86,7 +89,6 @@ class AppOutGroMoreCarrierExpressManager : TTSettingConfigCallback {
.setRequestMultipleImages(true).isReturnUrlsForImageAssets =
true //设置为true,SDK会仅提供Uri字段的值,允许自行决定是否下载实际图片,同时不会提供Drawable字段的值
// 针对Gdt Native自渲染广告,可以自定义gdt logo的布局参数。该参数可选,非必须。
val gdtNativeAdLogUtiloParams = FrameLayout.LayoutParams(
BubbleUtils.dp2px(40),
......@@ -150,7 +152,7 @@ class AppOutGroMoreCarrierExpressManager : TTSettingConfigCallback {
vo["ecpm"] = ttNativeAd.preEcpm
vo["adSource"] = ttNativeAd.adNetworkPlatformId
vo["adType"] = Constant.GRO_MORE_ADTYPE1
vo["adid"] = CsjGroMoreManager.APP_OUT_AD_UNIT_EXPRESS_ID
vo["adid"] = CsjGroMoreManager.APP_OUT_AD_UNIT_LOCK_EXPRESS_ID
TrackManager.getInstance().cmtGroMoreInfo(vo)
}
}
......
......@@ -8,6 +8,9 @@ import com.mints.flowbox.common.AppConfig
*/
object ExpressManager {
/**
* @param isMain 是否是网赚信息流
*/
fun loadExpress(isMain: Boolean) {
if (AppConfig.groMoreVideoAdCount > 0) {
GroMoreCarrierExpressManager.instance.loadADFrameLayout(isMain)
......@@ -18,6 +21,7 @@ object ExpressManager {
}
}
/** 加载应用外信息流 */
fun loadAppOutExpress() {
if (AppConfig.groMoreVideoAdCount > 0) {
AppOutGroMoreCarrierExpressManager.instance.loadADFrameLayout()
......@@ -28,6 +32,7 @@ object ExpressManager {
// }
}
/** 获取应用内信息流 */
fun getExpressFrameLayout(): FrameLayout? {
if (AppConfig.groMoreVideoAdCount > 0) {
return GroMoreCarrierExpressManager.instance.getADFrameLayout()
......@@ -37,6 +42,7 @@ object ExpressManager {
}
}
/** 获取应用外信息流 */
fun getAppOutExpressFrameLayout(): FrameLayout? {
if (AppConfig.groMoreVideoAdCount > 0) {
return AppOutGroMoreCarrierExpressManager.instance.getADFrameLayout()
......
......@@ -9,9 +9,11 @@ import com.mints.flowbox.MintsApplication;
import com.mints.flowbox.ad.express.ExpressManager;
import com.mints.flowbox.common.AppConfig;
import com.mints.flowbox.manager.TrackManager;
import com.mints.flowbox.ui.activitys.BoostActivity;
import com.mints.flowbox.ui.activitys.keepalive.BoostActivity;
import com.mints.flowbox.ui.activitys.keepalive.TimingActivity;
import com.mints.flowbox.utils.ForegroundOrBackground;
import com.mints.flowbox.utils.IntentUtils;
import com.mints.flowbox.utils.LogUtil;
import com.mints.flowbox.utils.keepalive.IntentUtils;
/**
* 描述:应用外广告定时器
......@@ -24,7 +26,7 @@ public class AlarmManager implements WeakHandler.IHandler {
public static final int WIFI_MINTER = 3;//单位-分钟,wifi页重置
public static final int USER_ACTIVE_MINTER = 10;//单位-分钟,用户激活接口
public static final int APP_OUT_CLEAR_MINTER = 10;//单位-分钟,应用外清理
public static final int APP_OUT_CLEAR_MINTER = 1;//单位-分钟,应用外清理
public static final long ONE_MINTER_Interval = 60 * 1000;//60秒
public static final long TEN_SECOND_Interval = 10 * 1000;//10秒
......@@ -33,6 +35,9 @@ public class AlarmManager implements WeakHandler.IHandler {
private volatile int curTime = 1;//每分钟变一次
public volatile int userTime = 1;//应用外用户操作时间
// 定时展示页面的类型
public volatile int currentType = 0;
private WeakHandler mHandler;
public static AlarmManager getInstance() {
......@@ -69,6 +74,8 @@ public class AlarmManager implements WeakHandler.IHandler {
// 防止userTime超出Integer范围
if (userTime < 20) userTime++;
LogUtil.d("AAAAAAAAAA");
// 固定时间增长
exeActionForTime(curTime);
// 用户操作按时间增长
......@@ -90,19 +97,20 @@ public class AlarmManager implements WeakHandler.IHandler {
// 应用在前台时,不弹出应用外广告
if (ForegroundOrBackground.isForeground2()) {
this.resetUserActionTime();
return;
}
// 预加载信息流
ExpressManager.INSTANCE.loadAppOutExpress();
//用户关闭界面后10分钟调用
Intent intent = new Intent(MintsApplication.getContext(), BoostActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Bundle bundle = new Bundle();
bundle.putBoolean(BoostActivity.IS_FROM_ALARM, true);
intent.putExtras(bundle);
IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent);
this.resetUserActionTime();
showTimingActivity();
// // 预加载信息流
// ExpressManager.INSTANCE.loadAppOutExpress();
// //用户关闭界面后10分钟调用
// Intent intent = new Intent(MintsApplication.getContext(), BoostActivity.class);
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
// Bundle bundle = new Bundle();
// bundle.putBoolean(BoostActivity.IS_FROM_ALARM, true);
// intent.putExtras(bundle);
// IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent);
}
}
......@@ -114,9 +122,9 @@ public class AlarmManager implements WeakHandler.IHandler {
private void exeActionForTime(int curTime) {
if (curTime % WIFI_MINTER == 0) {
//每3分钟 wifi界面功能重置
AppConfig.isCanBoost = true;
AppConfig.isCanClean = true;
AppConfig.isCanSaveBattery = true;
// AppConfig.isCanBoost = true;
// AppConfig.isCanClean = true;
// AppConfig.isCanSaveBattery = true;
AppConfig.fakeBoostCount = 0;
AppConfig.fakeCleanCount = 0;
......@@ -127,6 +135,24 @@ public class AlarmManager implements WeakHandler.IHandler {
}
}
/**
* 展示定时页面
*/
private void showTimingActivity() {
// 预加载信息流
ExpressManager.INSTANCE.loadAppOutExpress();
currentType++;
if (currentType > 2) {
currentType = 0;
}
Intent intent = new Intent(MintsApplication.getContext(), TimingActivity.class);
intent.putExtra(TimingActivity.TIMING_TYPE, currentType);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
IntentUtils.startActivity(ForegroundOrBackground.getMain_activity(), intent);
}
/**
* 重置用户操作时长
*/
......
......@@ -40,6 +40,8 @@ public class ScreenWatch {
mScreenStateListener.onScreenOn();
} else if (Intent.ACTION_SCREEN_OFF.equals(intent.getAction())) { // 息屏
mScreenStateListener.onScreenOff();
} else if (Intent.ACTION_USER_PRESENT.equals(intent.getAction())) { // 解锁屏幕
mScreenStateListener.onScreenOff();
}
}
}
......@@ -75,8 +77,8 @@ public class ScreenWatch {
void onScreenOn();
void onScreenOff();
//
// public void onUserPresent();
void onUserPresent();
}
}
package com.mints.flowbox.manager
import android.text.TextUtils
import com.mints.flowbox.MintsApplication
import com.mints.flowbox.manager.ad.TTGroMoreAdManagerHolder
import com.mints.flowbox.mvp.model.GroAdcodeBean
/**
* 穿山甲GroMore
*/
......@@ -25,12 +23,12 @@ object CsjGroMoreManager {
* 应用外:
* 普通:
* 新插屏 -> 946333773
* 信息流 -> 94633992
* 信息流 -> 946333992
* 锁屏:
* 信息流 -> 946334023
*/
var APP_OUT_AD_UNIT_EXPRESS_ID = "94633992" // 应用外普通信息流
var APP_OUT_AD_UNIT_EXPRESS_ID = "946333992" // 应用外普通信息流
var APP_OUT_AD_UNIT_LOCK_EXPRESS_ID = "946334023" // 应用外锁屏信息流
var APP_OUT_AD_UNIT_INTERSTITIAL_ID = "946333773" // 应用外插屏
......
......@@ -26,7 +26,8 @@ object UserWeight {
groMoreCount = data.vedioRules.gromorE_VEDIO.surplus
}
videoAdingManager.initAdWeight(data.vedioRules.csJ_VEDIO.rate,
videoAdingManager.initAdWeight(
data.vedioRules.csJ_VEDIO.rate,
data.vedioRules.ylH_VEDIO.rate,
data.vedioRules.sdhZ_VEDIO.rate,
0,
......@@ -37,7 +38,8 @@ object UserWeight {
data.vedioRules.oW_VEDIO.rate
)
LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} " +
LogUtil.d(
TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} " +
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} " +
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} " +
"csjFullWeight:${data.vedioRules.csjfulL_VEDIO.rate} " +
......@@ -57,7 +59,8 @@ object UserWeight {
AppConfig.owVideoAdCount = data.vedioRules.oW_VEDIO.surplus
AppConfig.csjFullVedioAdCount = data.vedioRules.csjfulL_VEDIO.surplus
AppConfig.groMoreVideoAdCount = groMoreCount
LogUtil.d(TAG, "首页视频数:csjCount:${AppConfig.csjVideoAdCount} " +
LogUtil.d(
TAG, "首页视频数:csjCount:${AppConfig.csjVideoAdCount} " +
"ylhCount:${AppConfig.ylhAdCount} " +
"sdhzCount:${AppConfig.wnVideoAdCount} " +
"csjFullCount:${AppConfig.csjFullVedioAdCount} " +
......
......@@ -254,7 +254,6 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
}
if (taskType == 0) {
AppConfig.isCanClean = false
// cleaningOperation(mContext)
}
......@@ -279,16 +278,23 @@ class CleanActivity : BaseActivity(), View.OnClickListener {
}
private fun toResult() {
AppConfig.isCanClean = false
// 预加载信息流
ExpressManager.loadExpress(false)
val bundle = Bundle()
if (scanMax == 1) {
// AppConfig.isCanBoost = false
bundle.putString(
IncreasespeedActivity.INCREASE_TYPE,
IncreasespeedActivity.INCREASE_BOOST
)
} else {
// AppConfig.isCanClean = false
bundle.putString(
IncreasespeedActivity.INCREASE_TYPE,
IncreasespeedActivity.INCREASE_CLEAN
)
}
readyGoThenKill(IncreasespeedActivity::class.java, bundle)
}
......
......@@ -49,7 +49,7 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
private val mStringArr1 = mutableListOf(
"检测结果WiFi加密安全性",
"检查ARP网络攻击异常",
"提升DNS劫持安STEP_Interval全性",
"提升DNS劫持安全性",
"部署网页防篡改",
"加固链路,避免SSL中间人攻击",
"检测是否钓鱼WiFi"
......@@ -105,8 +105,8 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
} else {
containerAnim.setBackgroundColor(Color.parseColor("#8278DC"))
GlideUtils.loadImageViewGif(this, R.drawable.safe_check, iv_gif)
mTimerMax = 10
NumAnimUtil.startAnim(tv_progress, 100f, ((mTimerMax - 4) * STEP_Interval))
mTimerMax = 9
NumAnimUtil.startAnim(tv_progress, 100f, ((mTimerMax - 6) * STEP_Interval))
}
mTimer = Timer()
......
......@@ -95,31 +95,30 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
}
})
if (mIncreaseType == INCREASE_BOOST && AppConfig.isCanBoost) {
// if (mIncreaseType == INCREASE_BOOST) {
// if (mIncreaseType == INCREASE_BOOST && AppConfig.isCanBoost) {
if (mIncreaseType == INCREASE_BOOST) {
startTimer()
} else if (mIncreaseType == INCREASE_SAVE_ELECTRICITY && AppConfig.isCanSaveBattery) {
// } else if (mIncreaseType == INCREASE_SAVE_ELECTRICITY) {
// } else if (mIncreaseType == INCREASE_SAVE_ELECTRICITY && AppConfig.isCanSaveBattery) {
} else if (mIncreaseType == INCREASE_SAVE_ELECTRICITY) {
startTimer()
mTimerMax = 11
} else if (mIncreaseType == INCREASE_CLEAN && AppConfig.isCanClean) {
// } else if (mIncreaseType == INCREASE_CLEAN) {
// } else if (mIncreaseType == INCREASE_CLEAN && AppConfig.isCanClean) {
} else if (mIncreaseType == INCREASE_CLEAN) {
startTimer()
mTimerMax = 14
} else {
initView()
Handler(Looper.getMainLooper()).postDelayed({
// 动画结束后 展示插屏广告
mWifiAdManager?.showInterstitial()
showFirstGive()
}, 3000)
}
initView()
}
private fun showFirstGive() {
// 新人福利
if (AppConfig.isShowFirstGive) {
// 游客首次提示1500新人奖励 且 不是分享包
val channel = CommonUtils.getAppMetaData(
MintsApplication.getContext(),
......@@ -146,7 +145,6 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
readyGo(AwardActivity::class.java, bundle)
}
}
}
private fun startTimer() {
container.visibility = View.GONE
......@@ -178,6 +176,8 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
runOnUiThread {
step++
if (step == mTimerMax - 2) {
initView()
YoYo.with(Techniques.FadeOut).duration(600).playOn(containerAnim)
if (mIncreaseType == INCREASE_CLEAN) {
// 一键清理
......@@ -224,10 +224,10 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
infoStr = "网速像飞一样快~"
}
INCREASE_BOOST -> {
AppConfig.isCanBoost = false
if (AppConfig.fakeBoostCount == 0) {
AppConfig.fakeBoostCount = 10 + Random.nextInt(15)
}
// AppConfig.isCanBoost = false
headTitleStr = "一键加速"
titleStr = SpanUtils()
.append("运行速度已提升")
......@@ -237,6 +237,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
infoStr = "成功清理完成"
}
INCREASE_CLEAN -> {
// AppConfig.isCanClean = false
headTitleStr = "一键清理"
titleStr = SpanUtils()
.append("已经清理后台软件")
......@@ -247,9 +248,9 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
}
INCREASE_SAVE_ELECTRICITY -> {
AppConfig.isCanSaveBattery = false
if (AppConfig.fakeBoostCount == 0) {
// if (AppConfig.fakeSaveBatteryCount == 0) {
AppConfig.fakeSaveBatteryCount = 20 + Random.nextInt(40)
}
// }
headTitleStr = "超强省电"
titleStr = SpanUtils()
.append("延长待机时间")
......
......@@ -11,6 +11,7 @@ import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentTransaction
import com.mints.flowbox.MintsApplication
import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ad.express.PreLoadExpressManager
import com.mints.flowbox.ad.express.TTPreLoadCarrierExpressManager
import com.mints.flowbox.ad.video.VideoAdingManager
......@@ -27,8 +28,9 @@ import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.ui.fragment.*
import com.mints.flowbox.ui.widgets.dialog.DialogListener
import com.mints.flowbox.ui.widgets.dialog.PowerDialog
import com.mints.flowbox.utils.LogUtil
import com.mints.flowbox.utils.WifiUtils
import com.mints.library.utils.CommonUtils
import com.mints.flowbox.utils.keepalive.ScreenLockerUtils
import com.mints.library.utils.GlideUtils
import kotlinx.android.synthetic.main.activity_main.*
......@@ -55,8 +57,16 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override fun getContentViewLayoutID() = R.layout.activity_main
override fun initViewsAndEvents() {
// 奖励页预加载 信息流广告
ExpressManager.loadExpress(true)
PreLoadExpressManager.loadADFrameLayout()
mainPresenter.attachView(this)
LogUtil.d("是否有系统锁屏 -> " + ScreenLockerUtils.hasSystemLockScreen(this))
LogUtil.d("是否是OV -> " + ScreenLockerUtils.isOV())
LogUtil.d("canShowScreenLocker -> " + ScreenLockerUtils.canShowScreenLocker(this))
if (threeFragment == null) {
threeFragment = WifiFragment()
}
......@@ -144,17 +154,17 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
}
}
fun selectVideo() {
twoFragment?.let {
(it as MoneyFragment).selectVideo()
}
}
// fun selectVideo() {
// twoFragment?.let {
// (it as MoneyFragment).selectVideo()
// }
// }
fun selectXmly() {
twoFragment?.let {
(it as MoneyFragment).selectXmly()
}
}
// fun selectXmly() {
// twoFragment?.let {
// (it as MoneyFragment).selectXmly()
// }
// }
fun turnDayTask() {
clickTab4Layout()
......@@ -190,7 +200,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
fun clickTab2Layout() {
AppConfig.fragmentClickFlag = Constant.FRAGMENT_CLICK_TWO
if (twoFragment == null) {
twoFragment = MoneyFragment()
twoFragment = VideoFragment()
}
addOrShowFragment(supportFragmentManager, twoFragment!!, Constant.FRAGMENT_TAG_TWO)
tab_iv_one.isSelected = false
......@@ -398,7 +408,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
// token失效之后刷新数据
when (mRefreshType) {
Constant.FRAGMENT_CLICK_ONE -> (oneFragment as HomeFragment).refreshData()
Constant.FRAGMENT_CLICK_TWO -> (twoFragment as MoneyFragment).refreshData()
Constant.FRAGMENT_CLICK_TWO -> {
}
Constant.FRAGMENT_CLICK_THREE -> {
}
Constant.FRAGMENT_CLICK_FOUR -> {
......@@ -442,10 +453,10 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
// 是否上报点击广告
AppConfig.needReportClickAdEvent = data.isNeedReportClickAdEvent
if (data.userMsg.firstGiveCoin > 0) {
AppConfig.isShowFirstGive = true
AppConfig.firstGiveCoin = data.userMsg.firstGiveCoin
}
// if (data.userMsg.firstGiveCoin > 0) {
// AppConfig.isShowFirstGive = true
// AppConfig.firstGiveCoin = data.userMsg.firstGiveCoin
// }
// 离线收益
if (data.offlineBean.offlineIncome > 0) {
......
package com.mints.flowbox.ui.activitys
import android.annotation.SuppressLint
import android.app.Dialog
import android.graphics.ImageFormat
import android.text.TextUtils
import android.util.Size
......@@ -13,10 +14,13 @@ import com.google.common.util.concurrent.ListenableFuture
import com.google.zxing.BinaryBitmap
import com.google.zxing.PlanarYUVLuminanceSource
import com.google.zxing.common.HybridBinarizer
import com.hjq.toast.ToastUtils
import com.mints.flowbox.R
import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.ui.widgets.dialog.DialogListener
import com.mints.flowbox.ui.widgets.dialog.DialogUtils
import com.mints.flowbox.utils.DecodeCodeTools
import com.mints.flowbox.utils.WifiUtils
import kotlinx.android.synthetic.main.activity_scan.*
import java.nio.ByteBuffer
import java.util.concurrent.Executor
......@@ -158,7 +162,9 @@ class ScanActivity : BaseActivity(), View.OnClickListener {
))
) {
mQrText = result.text
DialogUtils.showDialog(this, mQrText)
autoConnectWifi(mQrText)
// DialogUtils.showDialog(this, mQrText)
// TODO 只扫描一张
// mIsNextAnalysis = false;
}
......@@ -173,6 +179,48 @@ class ScanActivity : BaseActivity(), View.OnClickListener {
}
/**
* SAMPLE -> WIFI:T:WPA;S:mints_wifi;P:mints@190419;;
*
*/
private fun autoConnectWifi(wifiStr: String?) {
if (TextUtils.isEmpty(wifiStr)) {
ToastUtils.show("无效的WIFI二维码!")
return
}
var ssid = ""
var psw = ""
wifiStr?.let {
if (!it.contains("WIFI") or !it.contains("wifi")) {
ToastUtils.show("无效的WIFI二维码!")
return
}
ssid = it.substring(it.indexOf("S:") + 2, it.indexOf(";", it.indexOf("S:")))
psw = it.substring(it.indexOf("P:") + 2, it.indexOf(";", it.indexOf("P:")))
}
if (TextUtils.isEmpty(ssid) or TextUtils.isEmpty(ssid)) {
ToastUtils.show("无效的WIFI二维码!")
return
}
DialogUtils.showDialog(
this,
"WIFI名称: $ssid\nWIFI密码: $psw",
"提示",
"连接",
object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
ToastUtils.show("正在连接中...")
WifiUtils.getInstance(this@ScanActivity).connectWifiPws(ssid, psw)
dialog?.dismiss()
}
})
}
override fun onClick(v: View?) {
}
......
......@@ -134,10 +134,16 @@ class SpeedTestActivity : BaseActivity(), View.OnClickListener {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
DownloadApkManager.instance.destroy()
mTimer?.cancel()
mTimer = null
finish()
}
})
} else {
DownloadApkManager.instance.destroy()
mTimer?.cancel()
mTimer = null
finish()
}
}
......
package com.mints.flowbox.ui.activitys.base
import android.app.KeyguardManager
import android.content.Context
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.util.AttributeSet
import android.view.View
import android.view.WindowManager
import com.mints.flowbox.R
import com.mints.flowbox.utils.keepalive.ScreenLockerUtils
import com.mints.library.base.BaseSwipeBackCompatActivity
import com.mints.library.net.netstatus.NetUtils
/**
* 应用外Activity
*/
abstract class OutAppActivity : BaseSwipeBackCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
// 设置可以显示在锁屏页面之上
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
setShowWhenLocked(true)
// 强制亮屏
// setTurnScreenOn(true)
val keyguardManager = getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
keyguardManager.requestDismissKeyguard(this, null)
}
ScreenLockerUtils.updateWindowFlags(this.window.decorView)
this.window.addFlags(
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD or
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
)
// 设置锁屏页全屏
ScreenLockerUtils.makeLockWindowFullScreen(this, this.window.attributes, true)
super.onCreate(savedInstanceState)
}
override fun onNetworkConnected(type: NetUtils.NetType?) {}
override fun onNetworkDisConnected() {}
override fun isApplyStatusBarTranslucency() = false
override fun toggleOverridePendingTransition() = false
override fun getOverridePendingTransitionMode() = TransitionMode.FADE
override fun toggleIsBack2Left() = false
override fun getBundleExtras(extras: Bundle?) {}
override fun getLoadingTargetView() = null
}
\ No newline at end of file
package com.mints.flowbox.ui.activitys
package com.mints.flowbox.ui.activitys.keepalive
import android.os.Bundle
import android.text.TextUtils
......@@ -7,14 +7,20 @@ import androidx.core.content.ContextCompat
import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo
import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.common.Constant
import com.mints.flowbox.keepalive.AlarmManager
import com.mints.flowbox.ui.activitys.CleanActivity
import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.utils.AppUtil
import com.mints.flowbox.utils.SpanUtils
import com.mints.library.utils.GlideUtils
import kotlinx.android.synthetic.main.activity_apk.*
import kotlinx.android.synthetic.main.activity_apk.btnClean
import kotlinx.android.synthetic.main.activity_apk.fl_ad
import kotlinx.android.synthetic.main.activity_apk.tvInfo
import kotlinx.android.synthetic.main.activity_boost.iv_close
import kotlinx.android.synthetic.main.activity_timing.*
import kotlin.random.Random
/**
......@@ -62,7 +68,6 @@ class ApkActivity : BaseActivity() {
GlideUtils.loadImageView(this, apkInfo2.applicationIcon, ivIcon)
tvInfo2.visibility = View.VISIBLE
ivIcon.visibility = View.VISIBLE
} else if (mApkState == 2) {
// 应用卸载
tvTitle.text = "卸载残留提示"
......@@ -105,11 +110,26 @@ class ApkActivity : BaseActivity() {
override fun onResume() {
super.onResume()
initExpress()
btnClean.postDelayed({
rope = YoYo.with(Techniques.Tada).duration(1000).repeat(2).playOn(btnClean)
rope = YoYo.with(Techniques.Pulse).duration(1000).repeat(6).playOn(btnClean)
}, 200)
}
/**
* 初始化信息iyc
*/
private fun initExpress() {
try {
if (fl_ad != null) {
fl_ad.removeAllViews()
fl_ad.addView(ExpressManager.getAppOutExpressFrameLayout())
}
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun onDestroy() {
rope?.stop()
......
package com.mints.flowbox.ui.activitys
package com.mints.flowbox.ui.activitys.keepalive
import android.app.ActivityManager
import android.content.Context
......@@ -71,7 +71,7 @@ class BoostActivity : BaseActivity() {
try {
if (fl_ad != null) {
fl_ad.removeAllViews()
fl_ad.addView(ExpressManager.getExpressFrameLayout())
fl_ad.addView(ExpressManager.getAppOutExpressFrameLayout())
}
} catch (e: Exception) {
e.printStackTrace()
......@@ -79,8 +79,6 @@ class BoostActivity : BaseActivity() {
}
private fun cleanMemory() {
ExpressManager.loadAppOutExpress()
ccav_speed.startAnimation()
Handler(Looper.getMainLooper()).postDelayed(
{
......
package com.mints.flowbox.ui.activitys
package com.mints.flowbox.ui.activitys.keepalive
import android.app.KeyguardManager
import android.content.Context
import android.app.WallpaperManager
import android.graphics.Color
import android.graphics.drawable.Drawable
import android.os.*
import android.view.View
import android.view.WindowManager
import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.common.Constant
import com.mints.flowbox.ui.activitys.CleanActivity
import com.mints.flowbox.ui.activitys.IncreasespeedActivity
import com.mints.flowbox.ui.activitys.base.OutAppActivity
import com.mints.flowbox.utils.TimeThread
import com.mints.flowbox.utils.ToolUtil
import com.mints.library.base.BaseSwipeBackCompatActivity
import com.mints.library.net.netstatus.NetUtils
import com.mints.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.activity_screen.*
class ScreenActivity : BaseSwipeBackCompatActivity(), View.OnClickListener {
var mKeyguard: KeyguardManager? = null
var mKeylock: KeyguardManager.KeyguardLock? = null
override fun onCreate(savedInstanceState: Bundle?) {
// 设置可以显示在锁屏页面之上
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
setShowWhenLocked(true)
// 强制亮屏
// setTurnScreenOn(true)
val keyguardManager = getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
keyguardManager.requestDismissKeyguard(this, null)
}
this.window.addFlags(
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD or
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED or
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
)
super.onCreate(savedInstanceState)
}
class ScreenActivity : OutAppActivity(), View.OnClickListener {
override fun initViewsAndEvents() {
ExpressManager.loadAppOutExpress()
try {
val wallpaperManager = WallpaperManager.getInstance(this)
val wallpaperDrawable: Drawable = wallpaperManager.drawable
container.background = wallpaperDrawable
} catch (e: java.lang.Exception) {
e.printStackTrace()
container.setBackgroundColor(Color.BLACK)
}
Handler(Looper.getMainLooper()).postDelayed({
mHelper.swipeBackLayout.setEdgeSize(ToolUtil.getScreenWidth(this))
......@@ -68,9 +54,6 @@ class ScreenActivity : BaseSwipeBackCompatActivity(), View.OnClickListener {
override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return
// 预加载信息流
ExpressManager.loadExpress(false)
when (v?.id) {
R.id.tvBoost -> {
val bundle = Bundle()
......@@ -106,28 +89,13 @@ class ScreenActivity : BaseSwipeBackCompatActivity(), View.OnClickListener {
try {
if (fl_ad != null) {
fl_ad.removeAllViews()
fl_ad.addView(ExpressManager.getExpressFrameLayout())
fl_ad.addView(ExpressManager.getAppOutExpressFrameLayout())
}
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun onNetworkConnected(type: NetUtils.NetType?) {}
override fun onNetworkDisConnected() {}
override fun isApplyStatusBarTranslucency() = false
override fun toggleOverridePendingTransition() = false
override fun getOverridePendingTransitionMode() = TransitionMode.FADE
override fun toggleIsBack2Left() = false
override fun getBundleExtras(extras: Bundle?) {}
override fun getContentViewLayoutID() = R.layout.activity_screen
override fun getLoadingTargetView() = null
}
\ No newline at end of file
package com.mints.flowbox.ui.activitys.keepalive
import android.os.Bundle
import androidx.core.content.ContextCompat
import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo
import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.keepalive.AlarmManager
import com.mints.flowbox.ui.activitys.IncreasespeedActivity
import com.mints.flowbox.ui.activitys.SpeedFastActivity
import com.mints.flowbox.ui.activitys.SpeedTestActivity
import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.utils.SpanUtils
import com.mints.flowbox.utils.SystemUtils
import kotlinx.android.synthetic.main.activity_timing.*
import kotlinx.android.synthetic.main.activity_timing.fl_ad
import kotlinx.android.synthetic.main.activity_timing.iv_close
import kotlin.random.Random
/**
*
* 描述:定时或具体操作弹出的activity
*/
class TimingActivity : BaseActivity() {
companion object {
const val TIMING_TYPE = "TIMING_TYPE"
const val TIMING_TYPE_BOOST = 0 // 加速
const val TIMING_TYPE_CLEAN = 1 // 清理
const val TIMING_TYPE_SAVE_ELE = 2 // 省电
const val TIMING_TYPE_WIFI_BOOST = 3 // 信号增强
const val TIMING_TYPE_SPEED_TEST = 4 // 网络测速
}
/**
* 0-加速 1-清理 2-省电
* 3-wifi加速 4-网络测速
*
*/
private var mType = 0
private var rope: YoYo.YoYoString? = null
override fun getContentViewLayoutID() = R.layout.activity_timing
override fun initViewsAndEvents() {
iv_close.setOnClickListener {
finish()
overridePendingTransition(0, 0)
}
initView()
}
private fun initView() {
when (mType) {
TIMING_TYPE_BOOST -> { // 加速
val usedPercentValue = SystemUtils.getUsedPercentValue(mContext)
tvInfo.text = SpanUtils()
.append("内存占用")
.setForegroundColor(ContextCompat.getColor(mContext, R.color.gray))
.append("${usedPercentValue}%")
.setForegroundColor(ContextCompat.getColor(mContext, R.color.red))
.create()
btnClean.text = "立即加速"
}
TIMING_TYPE_CLEAN -> { // 清理
tvInfo.text = SpanUtils()
.append("大量文件")
.setForegroundColor(ContextCompat.getColor(mContext, R.color.red))
.append("待清理")
.setForegroundColor(ContextCompat.getColor(mContext, R.color.gray))
.create()
btnClean.text = "立即清理"
}
TIMING_TYPE_SAVE_ELE -> { // 省电
if (AppConfig.fakeSaveBatteryCount == 0) {
AppConfig.fakeSaveBatteryCount = 1 + Random.nextInt(8)
}
tvInfo.text = SpanUtils()
.append("检测到")
.append("${AppConfig.fakeSaveBatteryCount}个")
.setForegroundColor(ContextCompat.getColor(mContext, R.color.red))
.append("应用耗电")
.setForegroundColor(ContextCompat.getColor(mContext, R.color.gray))
.create()
btnClean.text = "立即省电"
}
TIMING_TYPE_WIFI_BOOST -> { // 信号增强
tvInfo.text = SpanUtils()
.append("信号增强")
.create()
btnClean.text = "信号增强"
}
TIMING_TYPE_SPEED_TEST -> { // 网络测速
tvInfo.text = SpanUtils()
.append("网络测速")
.create()
btnClean.text = "网络测速"
}
}
btnClean.setOnClickListener {
val bundle = Bundle()
when (mType) {
TIMING_TYPE_BOOST -> { // 加速
bundle.putString(
IncreasespeedActivity.INCREASE_TYPE,
IncreasespeedActivity.INCREASE_BOOST
)
}
TIMING_TYPE_CLEAN -> { // 清理
bundle.putString(
IncreasespeedActivity.INCREASE_TYPE,
IncreasespeedActivity.INCREASE_CLEAN
)
}
TIMING_TYPE_SAVE_ELE -> { // 省电
bundle.putString(
IncreasespeedActivity.INCREASE_TYPE,
IncreasespeedActivity.INCREASE_SAVE_ELECTRICITY
)
}
TIMING_TYPE_WIFI_BOOST -> { // 信号增强
readyGo(SpeedFastActivity::class.java)
return@setOnClickListener
}
TIMING_TYPE_SPEED_TEST -> { // 省电
readyGo(SpeedTestActivity::class.java)
return@setOnClickListener
}
}
readyGoThenKill(IncreasespeedActivity::class.java, bundle)
}
}
override fun getBundleExtras(extras: Bundle?) {
super.getBundleExtras(extras)
extras?.let {
mType = it.getInt(TIMING_TYPE, 0)
}
}
/**
* 初始化信息iyc
*/
private fun initExpress() {
try {
if (fl_ad != null) {
fl_ad.removeAllViews()
fl_ad.addView(ExpressManager.getAppOutExpressFrameLayout())
}
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun isApplyKitKatTranslucency() = true
override fun finish() {
super.finish()
AlarmManager.getInstance().resetUserActionTime()
}
override fun onResume() {
super.onResume()
initExpress()
btnClean.postDelayed({
rope = YoYo.with(Techniques.Pulse).duration(1000).repeat(6).playOn(btnClean)
}, 200)
}
override fun onDestroy() {
rope?.stop()
rope = null
super.onDestroy()
}
override fun onBackPressed() {
// 屏蔽返回键
// super.onBackPressed()
}
}
\ No newline at end of file
......@@ -58,7 +58,7 @@ class BonusTaskAdapter(
holder.itemTaskPb.progress = taskBean.complete
holder.itemTaskPb.max = taskBean.need
if (taskBean.otherConfig != null){
if (taskBean.otherConfig != null) {
}
......
......@@ -74,6 +74,9 @@ public class GvSignAdapter extends BaseAdapter {
if (TextUtils.equals(itemData.getStatus(), "lock")) {
viewHolder.ic_my_icon.setImageResource(R.mipmap.ic_bouns_redbox_lock);
viewHolder.tv_day.setTextColor(ContextCompat.getColor(mContext, R.color.color_FF2326));
} else if (TextUtils.equals(itemData.getStatus(), "open")) {
viewHolder.ic_my_icon.setImageResource(R.mipmap.ic_bouns_redbox);
viewHolder.tv_day.setTextColor(ContextCompat.getColor(mContext, R.color.color_FF2326));
} else {
viewHolder.ic_my_icon.setImageResource(R.mipmap.ic_bouns_redbox_normal);
viewHolder.tv_day.setTextColor(ContextCompat.getColor(mContext, R.color.gray));
......
......@@ -29,6 +29,8 @@ class MainWifiAdapter(val context: Context, val taskData: MutableList<WifiListBe
mOnItemClickListener = onItemClickListener
}
// fun set
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if (viewType == FriendsInvitedAdapter.HOLDER_TYPE_EMPTY) {
val emptyView =
......
......@@ -127,10 +127,14 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
return
}
if (dataList[position].complete >= dataList[position].need)
return
when (view?.id) {
R.id.item_task_click -> {
when (dataList[position].carrierType) {
BonusTaskAdapter.CHALLENGE_VEDIO -> {
// 看视频
if (dataList[position].otherConfig != null) {
awardVedio(
......@@ -150,7 +154,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
readyGo(WrapperActivity::class.java, bundle)
}
BonusTaskAdapter.CHALLENGE_SHAREFRIEND -> {
// 邀请好友
if (dataList[position].otherConfig != null) {
when (dataList[position].otherConfig.status) {
0, 2 -> {
......@@ -162,20 +166,6 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
shareImgDialog()
}
1 -> {
val bundle = Bundle()
bundle.putInt(
Constant.MAIN_CUR_COIN,
dataList[position].otherConfig.coin
)
bundle.putString(
Constant.MAIN_CARRIER_TYPE,
Constant.CHALLENGE_SHAREFRIEND
)
bundle.putString(
Constant.MAIN_EXTRA_ID,
dataList[position].otherConfig.doubleCoin.toString()
)
readyGo(AwardActivity::class.java, bundle)
}
}
}
......
......@@ -78,7 +78,8 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener {
// 看视频
(requireActivity() as MainActivity).clickTab2Layout()
Handler(Looper.getMainLooper()).postDelayed({
(requireActivity() as MainActivity).selectVideo()
// (requireActivity() as MainActivity).selectVideo()
(requireActivity() as MainActivity).clickTab2Layout()
}, 200)
}
R.id.btn_invite -> {
......
package com.mints.flowbox.ui.fragment
import android.Manifest
import android.app.Dialog
import android.os.Bundle
import android.text.TextUtils
import android.view.LayoutInflater
......@@ -10,7 +9,6 @@ import android.widget.AdapterView
import android.widget.GridView
import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ad.express.PreLoadExpressManager
import com.mints.flowbox.ad.video.VideoAdingManager
import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant
......@@ -24,9 +22,8 @@ import com.mints.flowbox.ui.adapter.GvMyAdapter
import com.mints.flowbox.ui.adapter.ViewPagerAdapter
import com.mints.flowbox.ui.fragment.base.BaseFragment
import com.mints.flowbox.ui.widgets.WifiView
import com.mints.flowbox.ui.widgets.dialog.DialogListener
import com.mints.flowbox.ui.widgets.dialog.DialogUtils
import com.mints.flowbox.utils.WifiUtils
import com.mints.library.net.netstatus.NetUtils
import com.mints.library.utils.nodoubleclick.AntiShake
import com.rd.animation.type.AnimationType
import com.tbruyelle.rxpermissions.RxPermissions
......@@ -71,9 +68,6 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
/** 初始化 */
private fun init() {
// 奖励页预加载 信息流广告
PreLoadExpressManager.loadADFrameLayout()
// 打开激活
uploadDeviceInfo()
}
......@@ -118,23 +112,15 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_ONE) {
refreshData()
if (bubbleCount == 0) {
wifi_view.wifiOnAndNoBonus()
} else {
wifi_view.wifiOn()
}
tvContent.text = "每天签到最高可得${AppConfig.HOME_BANNER_SIGN_GIVECASH}元红包"
tvContent.text = "连续签到可得${AppConfig.HOME_BANNER_SIGN_GIVECASH}元红包"
}
}
override fun onPause() {
super.onPause()
if (bubbleCount == 0) {
wifi_view.wifiOnAndNoBonus()
} else {
wifi_view.wifiOff()
}
}
/** 刷新数据 **/
fun refreshData() {
......@@ -159,20 +145,12 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
override fun getContentViewLayoutID() = R.layout.fragment_home
override fun onWifiOpen() {
if (bubbleCount == 0) {
wifi_view.wifiOnAndNoBonus()
} else {
wifi_view.wifiOn()
}
bg_view.setBackgroundResource(R.mipmap.bg_home_enable)
}
override fun onWifiClose() {
if (bubbleCount == 0) {
wifi_view.wifiOnAndNoBonus()
} else {
wifi_view.wifiOff()
}
bg_view.setBackgroundResource(R.mipmap.bg_home_unenable)
}
......@@ -182,21 +160,11 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
when (v?.id) {
// 网络测速
R.id.btn_speed_test -> {
if (wifiManager.isWifiEnable) {
readyGo(SpeedTestActivity::class.java)
} else {
DialogUtils.showDialog(
requireActivity(),
"当前不是Wifi网络,是否还需要进行网络测速?",
"提示",
"确定",
object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
}
})
if (!NetUtils.isNetworkConnected(context)) {
showToast("网络异常,请检测网络")
return
}
readyGo(SpeedTestActivity::class.java)
}
// 内存清理
R.id.btn_clean -> {
......@@ -206,12 +174,17 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
if (granted) {
readyGo(CleanActivity::class.java)
} else {
showMissingPermissionDialog("定位")
showMissingPermissionDialog("存储")
}
}
}
// 扫一扫
R.id.btn_scan -> {
if (!NetUtils.isNetworkConnected(context)) {
showToast("网络异常,请检测网络")
return
}
RxPermissions(requireActivity())
.request(Manifest.permission.CAMERA)
.subscribe { granted: Boolean ->
......@@ -224,9 +197,13 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
}
// wifi提速
R.id.btn_speed_fast -> {
if (!NetUtils.isNetworkConnected(context)) {
showToast("网络异常,请检测网络")
return
}
// 预加载信息流
ExpressManager.loadExpress(false)
readyGo(SpeedFastActivity::class.java)
}
// 跳转福利页面
......@@ -261,7 +238,7 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
override fun getBubbleSuc(count: Int, coin: Int) {
bubbleCount = count
bubbleCoin = coin
wifi_view.setCount(count)
wifi_view.setCount(bubbleCount)
if (wifiManager.isWifiEnable) {
bg_view.setBackgroundResource(R.mipmap.bg_home_enable)
......
......@@ -377,7 +377,6 @@ class MyFragment : BaseFragment(),
val activity: MainActivity? = activity as MainActivity?
activity?.let {
it.clickTab2Layout()
it.selectVideo()
}
}
1 -> {
......@@ -459,29 +458,29 @@ class MyFragment : BaseFragment(),
awardVedio(taskBean.otherConfig.coin, Constant.CARRIER_VERSUS_VIDEO)
}
}
MainMyAdapter.TO_XMLY -> {
if (taskBean.otherConfig != null) {
when (taskBean.otherConfig.status) {
0, 2 -> {
val activity: MainActivity? = activity as MainActivity?
activity?.let {
it.clickTab1Layout()
it.selectXmly()
}
}
1 -> {
val bundle = Bundle()
bundle.putInt(Constant.MAIN_CUR_COIN, taskBean.otherConfig.coin)
bundle.putString(
Constant.MAIN_CARRIER_TYPE,
Constant.CARRIER_XMLY_CHALLENGE
)
readyGo(AwardActivity::class.java, bundle)
}
}
}
}
// MainMyAdapter.TO_XMLY -> {
// if (taskBean.otherConfig != null) {
// when (taskBean.otherConfig.status) {
// 0, 2 -> {
// val activity: MainActivity? = activity as MainActivity?
// activity?.let {
// it.clickTab1Layout()
// it.selectXmly()
// }
// }
// 1 -> {
// val bundle = Bundle()
// bundle.putInt(Constant.MAIN_CUR_COIN, taskBean.otherConfig.coin)
// bundle.putString(
// Constant.MAIN_CARRIER_TYPE,
// Constant.CARRIER_XMLY_CHALLENGE
// )
// readyGo(AwardActivity::class.java, bundle)
// }
// }
// }
//
// }
MainMyAdapter.TO_DOWNLOADS -> {
if (taskBean.otherConfig != null) {
when (taskBean.otherConfig.status) {
......@@ -698,6 +697,7 @@ class MyFragment : BaseFragment(),
}
private fun initManager() {
BannerManager.instance.init()
videoAdingManager = VideoAdingManager.getInstance(activity)
}
......
......@@ -33,7 +33,6 @@ import com.yilan.sdk.ui.little.YLLittleVideoFragment
import com.yilan.sdk.ylad.YLAdListener
import kotlinx.android.synthetic.main.layout_red_bag.*
import kotlinx.android.synthetic.main.layout_red_box.*
import net.grandcentrix.tray.AppPreferences
private val TAG = VideoFragment::class.java.simpleName
......@@ -301,14 +300,14 @@ class VideoFragment : BaseFragment(), VideoView, View.OnClickListener {
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
params.setMargins(0, 0, 0, BubbleUtils.dp2px(410))
params.setMargins(0, 0, 0, BubbleUtils.dp2px(280))
cdvvYilanTime.layoutParams = params
val paramsRedBox = FrameLayout.LayoutParams(
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT
)
paramsRedBox.setMargins(0, BubbleUtils.dp2px(40), BubbleUtils.dp2px(10), 0)
paramsRedBox.setMargins(0, BubbleUtils.dp2px(120), BubbleUtils.dp2px(10), 0)
paramsRedBox.gravity = Gravity.END
rl_fragment_main_redbox.layoutParams = paramsRedBox
cdvvYilanTime.setOnClickListener(this)
......
......@@ -20,11 +20,9 @@ import com.daimajia.androidanimations.library.Techniques
import com.daimajia.androidanimations.library.YoYo
import com.hjq.toast.ToastUtils
import com.mints.flowbox.R
import com.mints.flowbox.ad.banner.BannerManager
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant
import com.mints.flowbox.manager.TtCsjAdManager
import com.mints.flowbox.manager.UserManager
import com.mints.flowbox.manager.wifi.WifiStateManager
import com.mints.flowbox.mvp.model.WifiListBean
......@@ -37,6 +35,7 @@ import com.mints.flowbox.ui.widgets.dialog.DialogUtils
import com.mints.flowbox.ui.widgets.dialog.WifiConnectDialog
import com.mints.flowbox.ui.widgets.seekbar.BubbleUtils
import com.mints.flowbox.utils.*
import com.mints.flowbox.utils.keepalive.IntentUtils
import com.mints.library.net.netstatus.NetUtils
import com.mints.library.utils.nodoubleclick.AntiShake
import com.tbruyelle.rxpermissions.RxPermissions
......@@ -79,6 +78,8 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
override fun onResume() {
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_THREE) {
// 校验是否开启定位信息开关
if (PermissionUtils.isOpenGps(requireContext())) {
loadWifiData()
} else {
......@@ -86,8 +87,8 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
}
// 防止banner刷新太快
if (AntiShake.check(fl_wifi_banner?.id)) return
BannerManager.instance.getTtBanner(TtCsjAdManager.TT_AD_BANNER_MY, fl_wifi_banner)
// if (AntiShake.check(fl_wifi_banner?.id)) return
// BannerManager.instance.getTtBanner(TtCsjAdManager.TT_AD_BANNER_MY, fl_wifi_banner)
if (!TextUtils.isEmpty(UserManager.getInstance().userID)) {
(requireActivity() as MainActivity).refreshHall()
......@@ -98,7 +99,8 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
}
override fun initViewsAndEvents() {
BannerManager.instance.init()
// Banner信息流初始化
// BannerManager.instance.init()
initRecy()
initView()
......@@ -109,7 +111,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
@SuppressLint("SetTextI18n")
private fun loadWifiData() {
btn_signal.postDelayed({
rope = YoYo.with(Techniques.Tada).duration(1000).repeat(-1).playOn(btn_signal)
rope = YoYo.with(Techniques.Pulse).duration(1000).repeat(-1).playOn(btn_signal)
}, 200)
if (wifiUtils.isWifiEnable) {
......@@ -240,7 +242,9 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
}
if (AppConfig.isCanSaveBattery) {
if (AppConfig.fakeSaveBatteryCount == 0) {
AppConfig.fakeSaveBatteryCount = 1 + Random.nextInt(8)
}
tv_save_battery.text = SpanUtils()
.append("超强省电\n")
.append("${AppConfig.fakeSaveBatteryCount}个")
......@@ -253,7 +257,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
} else {
tv_save_battery.text = SpanUtils()
.append("超强省电\n")
.append("延长时间")
.append("延长待机")
.setForegroundColor(ContextCompat.getColor(mContext, R.color.gray))
.setFontSize(BubbleUtils.sp2px(10))
.append("${AppConfig.fakeSaveBatteryCount}分钟")
......@@ -375,6 +379,10 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
readyGo(IncreasespeedActivity::class.java)
}
R.id.tv_clean -> { // 一键清理
RxPermissions(requireActivity())
.request(Manifest.permission.WRITE_EXTERNAL_STORAGE)
.subscribe { granted: Boolean ->
if (granted) {
// 预加载信息流
ExpressManager.loadExpress(false)
......@@ -384,6 +392,10 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
IncreasespeedActivity.INCREASE_CLEAN
)
readyGo(IncreasespeedActivity::class.java, bundle)
} else {
showMissingPermissionDialog("存储")
}
}
}
R.id.tv_save_battery -> { // 超强省电
// 预加载信息流
......@@ -397,10 +409,10 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
readyGo(IncreasespeedActivity::class.java, bundle)
}
R.id.btn_signal -> { // 信号增强
if (PermissionUtils.checkPermission(
mContext,
Manifest.permission.ACCESS_COARSE_LOCATION
)
if (ActivityCompat.checkSelfPermission(
requireActivity(),
Manifest.permission.ACCESS_FINE_LOCATION
) != PackageManager.PERMISSION_GRANTED
) {
checkPermission()
return
......@@ -444,11 +456,15 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
RxPermissions(activity!!)
.request(
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_BACKGROUND_LOCATION
Manifest.permission.ACCESS_BACKGROUND_LOCATION,
Manifest.permission.WRITE_EXTERNAL_STORAGE
)
} else {
RxPermissions(activity!!)
.request(Manifest.permission.ACCESS_FINE_LOCATION)
.request(
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.WRITE_EXTERNAL_STORAGE
)
}
request.subscribe { granted: Boolean ->
if (granted) {
......@@ -467,7 +483,7 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
}, 1000)
} else {
showMissingPermissionDialog("位置")
showMissingPermissionDialog("位置,存储")
}
}
}
......@@ -532,12 +548,13 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
loadWifiData()
}
/** wifi关闭 */
override fun onWifiClose() {
loadWifiData()
}
override fun onDestroy() {
fl_wifi_banner?.removeAllViews()
// fl_wifi_banner?.removeAllViews()
super.onDestroy()
}
}
\ No newline at end of file
......@@ -129,6 +129,11 @@ public class WifiView extends FrameLayout implements View.OnClickListener {
}
public void wifiOn() {
if (mCount == 0) {
wifiOnAndNoBonus();
return;
}
progressBar.resumeAnim();
setTitle("WIFI已连接");
......@@ -153,7 +158,7 @@ public class WifiView extends FrameLayout implements View.OnClickListener {
setTitle("WIFI已连接");
tvInfo.setText("今日流量补贴金额已达到上限");
progressBar.setComplete();
progressBar.post(() -> progressBar.setComplete());
}
public void wifiOff() {
......
......@@ -100,6 +100,9 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
if (activity == null)
return;
app_activity = new WeakReference<>(activity);
if (TextUtils.equals(activity.getClass().getSimpleName(), "MainActivity")) {
main_activity = new WeakReference<>(activity);
}
......
package com.mints.flowbox.utils;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.widget.TextView;
......@@ -30,7 +31,7 @@ public class TimeThread extends Thread {
}
}
private Handler mHandler = new Handler() {
private Handler mHandler = new Handler(Looper.getMainLooper()) {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
......
......@@ -2,7 +2,6 @@ package com.mints.flowbox.utils;
import android.app.Activity;
import android.content.Context;
import android.location.LocationManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.ScanResult;
......
package com.mints.flowbox.utils.keepalive;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.provider.Settings;
import com.mints.flowbox.MintsApplication;
import com.mints.flowbox.utils.NotificationUtils;
import net.phone.PhoneBrandUtils;
import java.util.List;
/**
* @author jyx
* @date 2021/7/10
* @des
*/
public class IntentUtils {
public static final String TAG = "IntentUtils";
public static void startActivity(Activity activity, Intent intent) {
if (PhoneBrandUtils.isXiaomi() | PhoneBrandUtils.isVivo() | PhoneBrandUtils.isOppo()) {
if (!isRunningForeground(activity)) {
// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
moveToFront(activity);
MintsApplication.getContext().startActivity(intent);
activity.moveTaskToBack(true);
// } else {
// NotificationUtils.INSTANCE.sendNotificationFullScreen(activity, "", "", intent);
// }
} else {
MintsApplication.getContext().startActivity(intent);
}
} else {
MintsApplication.getContext().startActivity(intent);
}
}
public static Boolean isRunningForeground(Activity activity) {
ActivityManager activityManager = (ActivityManager) activity.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningTaskInfo> taskInfoList = activityManager.getRunningTasks(1);
for (ActivityManager.RunningTaskInfo taskInfo : taskInfoList) {
if (taskInfo.baseActivity.getPackageName().equals(activity.getPackageName())) {
return true;
}
}
return false;
}
public static void moveToFront(Context context) {
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningTaskInfo> taskInfoList = activityManager.getRunningTasks(1);
for (ActivityManager.RunningTaskInfo taskInfo : taskInfoList) {
//遍历找到本应用的 task,并将它切换到前台
if (taskInfo.baseActivity.getPackageName().equals(context.getPackageName())) {
activityManager.moveTaskToFront(taskInfo.id, 0);
return;
}
}
}
/**
* 跳转GPS设置
*/
public static void openGPSSettings(Context context) {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
context.startActivity(intent);
}
}
package com.mints.flowbox.utils;
package com.mints.flowbox.utils.keepalive;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.AppOpsManager;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.provider.Settings;
import android.util.Log;
import com.mints.flowbox.MintsApplication;
import java.lang.reflect.Method;
import java.util.List;
/**
* @author jyx
* @date 2021/7/10
* @date 2021/7/13
* @des
*/
public class IntentUtils {
public class LockPermissionUtils {
public static final String TAG = "IntentUtils";
public static final String TAG = "LockPermissionUtils";
/**
* 小米后台弹出界面权限检测
......@@ -35,7 +29,7 @@ public class IntentUtils {
AppOpsManager ops = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
try {
int op = 10021;
Method method = ops.getClass().getMethod("checkOpNoThrow", new Class[]{int.class, int.class, String.class});
Method method = ops.getClass().getMethod("checkOpNoThrow", int.class, int.class, String.class);
Integer result = (Integer) method.invoke(ops, op, android.os.Process.myUid(), context.getPackageName());
return result == AppOpsManager.MODE_ALLOWED;
......@@ -53,13 +47,14 @@ public class IntentUtils {
*/
public static boolean canShowLockView(Context context) {
AppOpsManager ops = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
ops = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
}
try {
int op = 10020; // >= 23
// ops.checkOpNoThrow(op, uid, packageName)
Method method = ops.getClass().getMethod("checkOpNoThrow", new Class[]
{int.class, int.class, String.class}
);
Method method = ops.getClass().getMethod("checkOpNoThrow",
int.class, int.class, String.class);
Integer result = (Integer) method.invoke(ops, op, android.os.Process.myUid(), context.getPackageName());
return result == AppOpsManager.MODE_ALLOWED;
......@@ -71,7 +66,7 @@ public class IntentUtils {
}
/**
* 判断vivo后台弹出界面 false未开启 true开启
* 判断vivo后台弹出界面 1未开启 0开启
*
* @param context
* @return
......@@ -102,12 +97,12 @@ public class IntentUtils {
}
/**
* 判断vivo锁屏显示 1未开启 0开启
* 判断vivo锁屏显示
*
* @param context
* @return
*/
public static int getVivoLockStatus(Context context) {
public static boolean getVivoLockStatus(Context context) {
String packageName = context.getPackageName();
Uri uri2 = Uri.parse("content://com.vivo.permissionmanager.provider.permission/control_locked_screen_action");
String selection = "pkgname = ?";
......@@ -120,67 +115,23 @@ public class IntentUtils {
if (cursor.moveToFirst()) {
int currentmode = cursor.getInt(cursor.getColumnIndex("currentstate"));
cursor.close();
return currentmode;
return currentmode == 0;
} else {
cursor.close();
return 1;
return false;
}
}
} catch (Throwable throwable) {
throwable.printStackTrace();
}
return 1;
}
public static void startActivity(Activity activity, Intent intent) {
if (isAllowedBackPopPermission(activity) | getvivoBgStartActivityPermissionStatus(activity)) {
if (!isRunningForeground(activity)) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.Q) {
moveToFront(activity);
MintsApplication.getContext().startActivity(intent);
activity.moveTaskToBack(true);
} else {
NotificationUtils.INSTANCE.sendNotificationFullScreen(activity, "", "", intent);
}
} else {
MintsApplication.getContext().startActivity(intent);
}
} else {
MintsApplication.getContext().startActivity(intent);
}
}
public static Boolean isRunningForeground(Activity activity) {
ActivityManager activityManager = (ActivityManager) activity.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningTaskInfo> taskInfoList = activityManager.getRunningTasks(1);
for (ActivityManager.RunningTaskInfo taskInfo : taskInfoList) {
if (taskInfo.baseActivity.getPackageName().equals(activity.getPackageName())) {
return true;
}
}
return false;
}
public static void moveToFront(Context context) {
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<ActivityManager.RunningTaskInfo> taskInfoList = activityManager.getRunningTasks(20);
for (ActivityManager.RunningTaskInfo taskInfo : taskInfoList) {
//遍历找到本应用的 task,并将它切换到前台
if (taskInfo.baseActivity.getPackageName().equals(context.getPackageName())) {
activityManager.moveTaskToFront(taskInfo.id, 0);
return;
}
}
public static boolean getOppoLockStatus(Context context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
return Settings.canDrawOverlays(context);
}
/**
* 跳转GPS设置
*/
public static void openGPSSettings(Context context) {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
context.startActivity(intent);
return true;
}
}
......@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="270"
android:angle="90"
android:endColor="#C9C3FF"
android:startColor="#AFA6FF" />
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
......@@ -68,7 +67,7 @@
android:layout_marginRight="2dp"
android:padding="5dp"
android:text="@string/register_name"
android:textColor="@color/color_FF9837"
android:textColor="@color/color_main"
android:textSize="14sp" />
<View
......@@ -76,7 +75,7 @@
android:layout_height="match_parent"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:background="@color/color_FF9837" />
android:background="@color/color_main" />
<TextView
android:id="@+id/tvAboutasPolicy"
......@@ -85,7 +84,7 @@
android:layout_marginLeft="2dp"
android:padding="5dp"
android:text="隐私政策"
android:textColor="@color/color_FF9837"
android:textColor="@color/color_main"
android:textSize="14sp" />
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_20000000">
android:background="@color/color_10000000"
android:orientation="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="300dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="15dp"
android:layout_marginTop="120dp"
android:layout_marginEnd="15dp"
android:background="@drawable/shape_bg_write"
android:orientation="vertical"
android:visibility="visible">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:drawableStart="@drawable/ic_launcher_main_mini"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:padding="5dp"
android:text="@string/appName"
android:textColor="@color/black" />
<ImageView
android:id="@+id/iv_close"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_alignParentEnd="true"
android:layout_gravity="end"
android:layout_margin="10dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="10dp"
android:src="@mipmap/ic_close"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.appcompat.widget.LinearLayoutCompat>
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-20dp"
android:text="安装包卸载"
android:textColor="@color/black"
android:textSize="18sp"
......@@ -89,7 +113,10 @@
android:id="@+id/btnClean"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_margin="15dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_green_light"
android:text="立即清理"
android:textColor="@color/white"
......@@ -101,4 +128,14 @@
</androidx.appcompat.widget.LinearLayoutCompat>
</FrameLayout>
\ No newline at end of file
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/fl_ad"
android:layout_width="360dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:background="@drawable/shape_gold_card"
android:elevation="2dip"
android:gravity="center" />
</LinearLayout>
\ No newline at end of file
......@@ -64,6 +64,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="4dp"
android:background="@drawable/shape_btn_gold_left"
android:drawablePadding="4dp"
android:gravity="center"
......
......@@ -2,7 +2,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent">
android:background="@color/color_10000000">
<com.mints.flowbox.ui.widgets.CircleCleanAnimationView
android:id="@+id/ccav_speed"
......@@ -15,18 +15,18 @@
android:layout_width="360dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/colorPrimaryDark"
android:background="@color/color_main"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:id="@+id/iv_close"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="right"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:src="@mipmap/ic_activity_quit" />
android:src="@mipmap/ic_close" />
<TextView
android:layout_width="wrap_content"
......@@ -55,6 +55,19 @@
android:elevation="2dip"
android:gravity="center" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="10dp"
android:background="@color/color_20000000"
android:drawableStart="@drawable/ic_launcher_main_mini"
android:drawablePadding="5dp"
android:padding="5dp"
android:text="@string/appName"
android:textColor="@color/white"
android:textSize="10sp" />
</LinearLayout>
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="30dp"
android:layout_marginTop="50dp"
android:text="-"
android:textColor="@color/white"
android:textSize="60sp" />
......@@ -75,20 +80,37 @@
android:layout_height="wrap_content"
android:layout_below="@id/tvBoost"
android:layout_centerHorizontal="true"
android:layout_marginStart="15dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="15dp"
android:background="@drawable/shape_gold_card"
android:elevation="2dip"
android:gravity="center" />
</RelativeLayout>
<TextView
android:id="@+id/tv"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_alignParentBottom="true"
android:layout_gravity="bottom"
android:background="@color/color_20000000"
android:gravity="center"
android:text="右滑关闭"
android:text="> > 右滑关闭"
android:textColor="@color/white"
android:textSize="20sp" />
</RelativeLayout>
\ No newline at end of file
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:layout_marginTop="10dp"
android:layout_marginBottom="80dp"
android:background="@color/color_20000000"
android:drawableStart="@drawable/ic_launcher_main_mini"
android:drawablePadding="5dp"
android:padding="5dp"
android:text="@string/appName"
android:textColor="@color/white"
android:textSize="10sp" />
</FrameLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_10000000"
android:orientation="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="15dp"
android:layout_marginTop="120dp"
android:layout_marginEnd="15dp"
android:background="@drawable/shape_bg_write"
android:orientation="vertical">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:drawableStart="@drawable/ic_launcher_main_mini"
android:drawablePadding="6dp"
android:gravity="center_vertical"
android:padding="5dp"
android:text="@string/appName"
android:textColor="@color/black" />
<ImageView
android:id="@+id/iv_close"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_alignParentEnd="true"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="10dp"
android:src="@mipmap/ic_close"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.appcompat.widget.LinearLayoutCompat>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="10dp"
android:src="@mipmap/ic_launcher" />
<TextView
android:id="@+id/tvInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:gravity="center"
android:text="-"
android:textColor="@color/black"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/ivIcon"
app:layout_constraintTop_toBottomOf="@+id/tvTitle" />
<Button
android:id="@+id/btnClean"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_green_light"
android:text="立即清理"
android:textColor="@color/white"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvInfo2" />
</androidx.appcompat.widget.LinearLayoutCompat>
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="15dp"
android:background="@drawable/shape_gold_card"
android:elevation="2dip"
android:gravity="center" />
</LinearLayout>
\ No newline at end of file
......@@ -136,7 +136,7 @@
android:paddingRight="2dp"
android:paddingBottom="6dp"
android:text="@string/register_name"
android:textColor="@color/color_FF9837"
android:textColor="@color/color_main"
android:textSize="12sp" />
<TextView
......@@ -157,7 +157,7 @@
android:paddingRight="2dp"
android:paddingBottom="6dp"
android:text="隐私政策"
android:textColor="@color/color_FF9837"
android:textColor="@color/color_main"
android:textSize="12sp" />
</LinearLayout>
......@@ -175,37 +175,34 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:orientation="vertical">
<TextView
android:id="@+id/btn_dialogper_back"
android:layout_width="0dp"
android:id="@+id/btn_dialogper_next"
android:layout_width="match_parent"
android:layout_height="36dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:background="@color/color_ccc"
android:background="@color/color_main"
android:gravity="center"
android:text="同意"
android:text="同意"
android:textColor="@color/white" />
<TextView
android:id="@+id/btn_dialogper_next"
android:layout_width="0dp"
android:id="@+id/btn_dialogper_back"
android:layout_width="match_parent"
android:layout_height="36dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:background="@color/color_FF9837"
android:background="@color/color_ccc"
android:gravity="center"
android:text="同意"
android:text="同意"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
......@@ -86,7 +86,7 @@
android:layout_marginTop="10dp"
android:text="WIFI未开启"
android:textColor="@color/black"
android:textSize="22sp"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@+id/imageView2"
app:layout_constraintTop_toTopOf="parent" />
......
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