Commit b9070f1d authored by jyx's avatar jyx

更新UI

parent 4b959344
......@@ -265,4 +265,7 @@ dependencies {
implementation(name: 'net_native-v3.1.3.22-release', ext: 'aar')
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'androidx.core:core-ktx:1.1.0'
// switchbutton
implementation 'com.github.iielse:switchbutton:1.0.4'
}
......@@ -158,6 +158,19 @@
android:excludeFromRecents="true"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.appswitch.AppSwitchActivity"
android:excludeFromRecents="true"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.appswitch.BoostWhiteActivity"
android:excludeFromRecents="true"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.ScoreTestActivity"
android:excludeFromRecents="true"
android:screenOrientation="portrait" />
<activity
android:name="com.mints.fiveworld.ui.activitys.anim.ResultActivity"
android:excludeFromRecents="true"
......
......@@ -3,9 +3,11 @@ package com.mints.fiveworld.clean;
import android.app.usage.StorageStats;
import android.app.usage.StorageStatsManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.storage.StorageManager;
......@@ -18,7 +20,9 @@ import com.mints.fiveworld.utils.LogUtil;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
public class CleanUtils {
......@@ -164,4 +168,51 @@ public class CleanUtils {
return "" + size + "B";
}
/**
* 获取全部可以打开的APP packageName
*/
public static List<CacheListItem> getAllApp(Context context) {
PackageManager pm = context.getPackageManager();
// 查询所有已经安装的应用程序
List<ApplicationInfo> appInfos = pm.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);// GET_UNINSTALLED_PACKAGES代表已删除,但还有安装目录的
List<CacheListItem> allList = new ArrayList<>();
// 创建一个类别为CATEGORY_LAUNCHER的该包名的Intent
Intent resolveIntent = new Intent(Intent.ACTION_MAIN, null);
resolveIntent.addCategory(Intent.CATEGORY_LAUNCHER);
// 通过getPackageManager()的queryIntentActivities方法遍历,得到所有能打开的app的packageName
List<ResolveInfo> resolveinfoList = context.getPackageManager()
.queryIntentActivities(resolveIntent, 0);
Set<String> allowPackages = new HashSet();
for (ResolveInfo resolveInfo : resolveinfoList) {
allowPackages.add(resolveInfo.activityInfo.packageName);
}
for (ApplicationInfo app : appInfos) {
//通过flag排除系统应用,会将电话、短信也排除掉
// if ((app.flags & ApplicationInfo.FLAG_SYSTEM) <= 0) {
// applicationInfos.add(app);
// }
// if(app.uid > 10000){//通过uid排除系统应用,在一些手机上效果不好
// applicationInfos.add(app);
// }
if (allowPackages.contains(app.packageName)) {
if (app.packageName.equals(context.getPackageName()))
continue;
// 应用名称
String label = app.loadLabel(pm).toString();
// 应用图标
Drawable icon = app.loadIcon(pm);
CacheListItem cacheListItem = new CacheListItem(app.packageName, label, icon, 0);
allList.add(cacheListItem);
}
}
return allList;
}
}
......@@ -50,4 +50,10 @@ public class AppConfig {
public static boolean isRiskFlag=false;//是否命中风控
/* 上次网络测速数值 */
public static String lastSpeedType = "";
public static String lastSpeedData = "";
/* 降温数据 */
public static String lastCoolData = "";
}
......@@ -41,8 +41,8 @@ object Constant {
// 协议地址
var REGISTER_URL = BuildConfig.MainIp + "ds/register.html"//服务协议
var PRIVACY_URL = BuildConfig.MainIp + "ds/privacy.html"//隐私协议
var REGISTER_URL = BuildConfig.MainIp + "fiveworld/register.html"//服务协议
var PRIVACY_URL = BuildConfig.MainIp + "fiveworld/privacy.html"//隐私协议
// 载体
/*******************************************************/
......
......@@ -86,6 +86,26 @@ object WifiDataManager {
// 总开关
const val APP_OUT_SWITCH = "APP_OUT_SWITCH"
// 上次加速操作时间
const val FAKE_BOOST_TIME = "FAKE_BOOST_TIME"
// 上次清理操作时间
const val FAKE_CLEAN_TIME = "FAKE_CLEAN_TIME"
// 上次省电操作时间
const val FAKE_SAVE_BATTERY_TIME = "FAKE_SAVE_BATTERY_TIME"
// 上次安全检测操作时间
const val FAKE_SAFE_CHECK_TIME = "FAKE_SAFE_CHECK_TIME"
// 上次网络测速操作时间
const val FAKE_SPEED_TEST_TIME = "FAKE_SPEED_TEST_TIME"
// 上次Wifi提速操作时间
const val FAKE_SPEED_FAST_TIME = "FAKE_SPEED_FAST_TIME"
// 上次W测分分值
const val LAST_SCORE = "LAST_SCORE"
// 锁屏 单位:次数
var LOCK_TIMES = 120
......@@ -2086,5 +2106,46 @@ object WifiDataManager {
// fun getTimingShowWhenScreenOnPercentage() =
// sp.getInt(LOCAL_TIMING_SHOW_WHEN_SCREEN_ON_PERCENTAGE, 0)
fun getFakeBoostTime() = sp.getLong(FAKE_BOOST_TIME, 0L)
fun setFakeBoostTime(value: Long) {
sp.put(FAKE_BOOST_TIME, value)
}
fun getFakeCleanTime() = sp.getLong(FAKE_CLEAN_TIME, 0L)
fun setFakeCleanTime(value: Long) {
sp.put(FAKE_CLEAN_TIME, value)
}
fun getFakeSaveBatteryTime() = sp.getLong(FAKE_SAVE_BATTERY_TIME, 0L)
fun setFakeSaveBatteryTime(value: Long) {
sp.put(FAKE_SAVE_BATTERY_TIME, value)
}
fun getFakeSaveCheckTime() = sp.getLong(FAKE_SAFE_CHECK_TIME, 0L)
fun setFakeSaveCheckTime(value: Long) {
sp.put(FAKE_SAFE_CHECK_TIME, value)
}
fun getFakeSpeedTestTime() = sp.getLong(FAKE_SPEED_TEST_TIME, 0L)
fun setFakeSpeedTestTime(value: Long) {
sp.put(FAKE_SPEED_TEST_TIME, value)
}
fun getFakeSpeedFastTime() = sp.getLong(FAKE_SPEED_FAST_TIME, 0L)
fun setFakeSpeedFastTime(value: Long) {
sp.put(FAKE_SPEED_FAST_TIME, value)
}
fun getFakeLastScore() = sp.getString(LAST_SCORE, "")
fun setFakeLastScore(value: String) {
sp.put(LAST_SCORE, value)
}
}
\ No newline at end of file
......@@ -82,7 +82,7 @@ class MainPresenter : BasePresenter<MainView>() {
Handler(Looper.getMainLooper()).postDelayed({
val intent = Intent(forwardActivity, HintActivity::class.java)
intent.putExtra(HintActivity.HINT_TEXT, baseResponse.data.msg)
forwardActivity.startActivity(intent)
// forwardActivity.startActivity(intent)
}, 200)
}
}
......
......@@ -25,6 +25,7 @@ import com.mints.fiveworld.ad.wifi.WifiAdManager
import com.mints.fiveworld.ad.wifi.WifiAdStatusListener
import com.mints.fiveworld.common.AppConfig
import com.mints.fiveworld.common.Constant
import com.mints.fiveworld.manager.wifi.WifiDataManager
import com.mints.fiveworld.ui.activitys.base.BaseActivity
import com.mints.fiveworld.ui.adapter.CleanListAdapter
import com.mints.fiveworld.ui.adapter.listener.OnItemClickListener
......@@ -339,10 +340,11 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
if (AppConfig.fakeSaveBatteryMinter == 0) {
AppConfig.fakeSaveBatteryMinter = 20 + Random.nextInt(40)
}
headTitleStr = "超强省电"
AppConfig.lastCoolData = "" + (2 + Random.nextInt(5))
headTitleStr = "电池降温"
titleStr = SpanUtils()
.append("延长待机时间")
.append("${AppConfig.fakeSaveBatteryMinter}分钟")
.append("电池成功降温")
.append("${AppConfig.lastCoolData}℃")
.setForegroundColor(ContextCompat.getColor(this, R.color.color_FFDD0C))
.create()
infoStr = "电池已达到最佳状态"
......@@ -635,13 +637,22 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
private fun resetTime() {
when (mIncreaseType) {
INCREASE_BOOST -> {
AppConfig.fakeBoostTime = System.currentTimeMillis()
// AppConfig.fakeBoostTime = System.currentTimeMillis()
if (TimeRender.isOverspedMin2(WifiDataManager.getFakeBoostTime(), 3)) {
WifiDataManager.setFakeBoostTime(System.currentTimeMillis())
}
}
INCREASE_CLEAN -> {
AppConfig.fakeCleanTime = System.currentTimeMillis()
// AppConfig.fakeCleanTime = System.currentTimeMillis()
if (TimeRender.isOverspedMin2(WifiDataManager.getFakeCleanTime(), 3)) {
WifiDataManager.setFakeCleanTime(System.currentTimeMillis())
}
}
INCREASE_SAVE_ELECTRICITY -> {
AppConfig.fakeSaveBatteryTime = System.currentTimeMillis()
// AppConfig.fakeSaveBatteryTime = System.currentTimeMillis()
if (TimeRender.isOverspedMin2(WifiDataManager.getFakeSaveBatteryTime(), 3)) {
WifiDataManager.setFakeSaveBatteryTime(System.currentTimeMillis())
}
}
}
}
......
......@@ -21,7 +21,7 @@ import com.mints.fiveworld.mvp.model.UserTaskMsgBean
import com.mints.fiveworld.mvp.presenters.MainPresenter
import com.mints.fiveworld.mvp.views.MainView
import com.mints.fiveworld.ui.activitys.base.BaseActivity
import com.mints.fiveworld.ui.fragment.WifiFragment
import com.mints.fiveworld.ui.fragment.MainFragment
import com.mints.fiveworld.utils.WifiUtils
import com.permissionx.guolindev.PermissionX
......@@ -45,7 +45,7 @@ class MainActivity : BaseActivity(), MainView {
mainPresenter.attachView(this)
if (threeFragment == null) {
threeFragment = WifiFragment()
threeFragment = MainFragment()
}
if (!threeFragment!!.isAdded) {
......@@ -110,7 +110,7 @@ class MainActivity : BaseActivity(), MainView {
if (AppPreferencesManager.get().getBoolean(Constant.IS_ONE_PERMISSIONS, true)) {
AppPreferencesManager.get().put(Constant.IS_ONE_PERMISSIONS, false)
checkPermission()
(threeFragment as WifiFragment).setIsFirstEnter(true)
(threeFragment as MainFragment).setIsFirstEnter(true)
}
}
......
......@@ -16,14 +16,18 @@ import com.mints.fiveworld.ad.express.OutSceneExpress
import com.mints.fiveworld.ad.express.ExpressManager
import com.mints.fiveworld.ad.wifi.WifiAdManager
import com.mints.fiveworld.ad.wifi.WifiAdStatusListener
import com.mints.fiveworld.common.AppConfig
import com.mints.fiveworld.common.Constant
import com.mints.fiveworld.manager.DownloadApkManager
import com.mints.fiveworld.manager.wifi.NetSpeed
import com.mints.fiveworld.manager.wifi.WifiDataManager
import com.mints.fiveworld.ui.activitys.base.BaseActivity
import com.mints.fiveworld.ui.widgets.dialog.DialogListener
import com.mints.fiveworld.ui.widgets.dialog.DialogUtils
import com.mints.fiveworld.utils.PingNet
import com.mints.fiveworld.utils.TimeRender
import com.mints.fiveworld.utils.Utils
import com.mints.fiveworld.utils.WifiUtils
import kotlinx.android.synthetic.main.activity_net_testing.*
import kotlinx.android.synthetic.main.header_layout.*
import java.util.*
......@@ -281,6 +285,12 @@ class NetTestingActivity : BaseActivity(), View.OnClickListener {
// tvRxSpeed.text = NetSpeed.getShowStr(averageRx)
// tvTxSpeed.text = NetSpeed.getShowStr(averageTx)
if (TimeRender.isOverspedMin2(WifiDataManager.getFakeSpeedTestTime(), 3)) {
WifiDataManager.setFakeSpeedTestTime(System.currentTimeMillis())
}
val speedStr = NetSpeed.getShowStr(averageRx)
val bundle = Bundle()
bundle.putString(
IncreasespeedActivity.INCREASE_TYPE,
......@@ -288,8 +298,16 @@ class NetTestingActivity : BaseActivity(), View.OnClickListener {
)
bundle.putString(
IncreasespeedActivity.INCREASE_WIFI_SPEED,
NetSpeed.getShowStr(averageRx)
speedStr
)
if (WifiUtils.getInstance(this).isWifiEnable) {
AppConfig.lastSpeedType = "WIFI"
} else {
AppConfig.lastSpeedType = "数据"
}
AppConfig.lastSpeedData = speedStr
if (mIsFromAppOut) {
bundle.putBoolean(IncreasespeedActivity.ROUTER_FROM_OUT, true)
}
......
......@@ -23,6 +23,7 @@ import com.mints.fiveworld.ad.wifi.WifiAdManager
import com.mints.fiveworld.ad.wifi.WifiAdStatusListener
import com.mints.fiveworld.common.AppConfig
import com.mints.fiveworld.common.Constant
import com.mints.fiveworld.manager.wifi.WifiDataManager
import com.mints.fiveworld.ui.activitys.base.BaseActivity
import com.mints.fiveworld.ui.adapter.CleanListAdapter
import com.mints.fiveworld.ui.adapter.IncreaseAdapter
......@@ -196,6 +197,10 @@ class SafeTestingActivity : BaseActivity(), View.OnClickListener {
}
}
if (TimeRender.isOverspedMin2(WifiDataManager.getFakeSaveCheckTime(), 3)) {
WifiDataManager.setFakeSaveCheckTime(System.currentTimeMillis())
}
startAnim()
}
......
package com.mints.fiveworld.ui.activitys
import android.annotation.SuppressLint
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.view.View
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import android.view.animation.LayoutAnimationController
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import com.mints.fiveworld.R
import com.mints.fiveworld.manager.wifi.WifiDataManager
import com.mints.fiveworld.ui.activitys.base.BaseActivity
import com.mints.fiveworld.ui.adapter.ScoreAdapter
import com.mints.fiveworld.ui.widgets.NumAnimUtil
import com.mints.fiveworld.ui.widgets.RecyItemDecoration
import kotlinx.android.synthetic.main.activity_safe_testing.recycleView
import kotlinx.android.synthetic.main.activity_score_test.*
import kotlinx.android.synthetic.main.header_layout.*
import kotlin.random.Random
/**
* 描述:关于我们
* 作者:孟崔广
* 时间:2020/9/23 18:39
*/
@SuppressLint("SetTextI18n")
class ScoreTestActivity : BaseActivity(), View.OnClickListener {
private var mScoreAdapter: ScoreAdapter? = null
override fun getContentViewLayoutID() = R.layout.activity_score_test
override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() {
tv_title.text = "一键测分"
tv_title.setTextColor(Color.WHITE)
headerContainer.setBackgroundColor(ContextCompat.getColor(this, R.color.color_00072D))
line.setBackgroundColor(ContextCompat.getColor(this, R.color.color_00F6FF))
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back_white)
val mPlaceStr = mutableListOf(
"" + (1500 + Random.nextInt(1500)),
"" + (800 + Random.nextInt(700)),
"" + (300 + Random.nextInt(200)),
"" + (800 + Random.nextInt(700)),
"" + (300 + Random.nextInt(500)),
"" + (800 + Random.nextInt(400)),
"" + (500 + Random.nextInt(1000))
)
var allScore = 0
for (s in mPlaceStr) {
allScore += s.toInt()
}
mScoreAdapter = ScoreAdapter(this, mPlaceStr)
val loadAnimation = AnimationUtils.loadAnimation(this, R.anim.layout_right_in)
val lac = LayoutAnimationController(loadAnimation)
lac.delay = 1f
lac.order = LayoutAnimationController.ORDER_NORMAL
var flag = true
loadAnimation.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation?) {
}
override fun onAnimationEnd(animation: Animation?) {
// tvAllScore.text = "" + allScore
if (flag) {
NumAnimUtil.startAnim2(tvAllScore, allScore.toFloat(), 3000)
WifiDataManager.setFakeLastScore("" + allScore)
flag = false
}
}
override fun onAnimationRepeat(animation: Animation?) {
}
})
val dividerItemDecoration = DividerItemDecoration(this, 1)
dividerItemDecoration.setDrawable(ColorDrawable(Color.WHITE))
recycleView.addItemDecoration(dividerItemDecoration)
recycleView.layoutManager = LinearLayoutManager(this)
recycleView.layoutAnimation = lac
recycleView.addItemDecoration(RecyItemDecoration(this, DividerItemDecoration.VERTICAL))
recycleView.adapter = mScoreAdapter
initListener()
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_left_icon -> finish()
}
}
private fun initListener() {
iv_left_icon.setOnClickListener(this)
}
}
......@@ -61,7 +61,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener {
item_invitedCode.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE
item_invitedCode.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE
item_invitedCode.findViewById<TextView>(R.id.tv_right).text =
"CL-${UserManager.getInstance().codeID}"
"5G-${UserManager.getInstance().codeID}"
item_cleanCache.findViewById<TextView>(R.id.tv_title).text = "清理缓存"
val cleanCache = ContextCompat.getDrawable(this, R.mipmap.icon_settings_clean)
......
......@@ -15,7 +15,9 @@ import com.mints.fiveworld.ad.express.ExpressManager
import com.mints.fiveworld.ad.express.InSceneExpress
import com.mints.fiveworld.ad.wifi.WifiAdManager
import com.mints.fiveworld.common.Constant
import com.mints.fiveworld.manager.wifi.WifiDataManager
import com.mints.fiveworld.ui.activitys.base.BaseActivity
import com.mints.fiveworld.utils.TimeRender
import com.mints.fiveworld.utils.Utils
import com.mints.library.utils.GlideUtils
import kotlinx.android.synthetic.main.activity_signal_strength.*
......@@ -119,6 +121,11 @@ class SignalStrengthActivity : BaseActivity(), View.OnClickListener {
}
showAd()
if (TimeRender.isOverspedMin2(WifiDataManager.getFakeSpeedFastTime(), 3)) {
WifiDataManager.setFakeSpeedFastTime(System.currentTimeMillis())
}
mTimer?.cancel()
return@runOnUiThread
} else if (mStep == 2) {
......
package com.mints.fiveworld.ui.activitys.appswitch
import com.mints.fiveworld.R
import com.mints.fiveworld.ui.activitys.base.BaseActivity
import com.mints.fiveworld.ui.widgets.applock.GestureViewGroup
import kotlinx.android.synthetic.main.activity_app_lock.*
import kotlin.properties.Delegates
/**
*
* @author jyx
* @date 2021/9/1
* @des 加速白名单页面
*/
class AppSwitchActivity : BaseActivity() {
private var settingStep = 0
private var isAppLockActive by Delegates.notNull<Boolean>()
override fun initViewsAndEvents() {
ivBack.setOnClickListener { finish() }
isAppLockActive = AppSwitchUtil.getAppLockActive(applicationContext)
val appLockPassword = AppSwitchUtil.getAppLockPassword(applicationContext)
if (isAppLockActive && appLockPassword != null) {
tvLockHint.text = "请输入手势密码解锁"
unlock(appLockPassword)
} else {
tvLockHint.text = "请先设置手势密码"
settingLock()
}
}
private fun settingLock() {
gestureLockViewGroup.apply {
setGestureLockSet(true)
setOnGestureLockViewListener(object :
GestureViewGroup.OnGestureViewListener {
override fun onBlockSelected(cId: Int) {}
override fun onGestureEvent(matched: Boolean) {
val password = answer
if (settingStep == 0) {
if (password.size < 4) {
tvLockHint.text = "请至少连接4个点"
showToast("请至少连接4个点")
} else {
tvLockHint.text = "请再次绘制手势密码"
answer = password
settingStep = 1
}
clear()
} else if (settingStep == 1) {
if (matched) {
settingStep = 1
AppSwitchUtil.setAppLockPassword(applicationContext, password)
AppSwitchUtil.setAppLockActive(applicationContext, true)
showToast("密码设置成功")
readyGoThenKill(BoostWhiteActivity::class.java)
} else {
tvLockHint.text = "两次密码不一致,请重新设置"
settingStep = 0
answer = null
clear()
}
}
}
override fun onUnmatchedExceedBoundary() {}
})
}
}
private fun unlock(appLockPassword: IntArray) {
gestureLockViewGroup.apply {
answer = appLockPassword
setOnGestureLockViewListener(object :
GestureViewGroup.OnGestureViewListener {
override fun onBlockSelected(cId: Int) {}
override fun onGestureEvent(matched: Boolean) {
if (matched) {
readyGoThenKill(BoostWhiteActivity::class.java)
} else {
showToast("密码错误")
clear()
}
}
override fun onUnmatchedExceedBoundary() {}
})
}
}
override fun isApplyKitKatTranslucency() = false
override fun getContentViewLayoutID() = R.layout.activity_app_lock
}
\ No newline at end of file
package com.mints.fiveworld.ui.activitys.appswitch
import android.content.Context
import android.content.SharedPreferences
/**
*
* @author jyx
* @date 2021/9/1
* @des app lock
*/
object AppSwitchUtil {
private const val SP_Name_AppLock = "SP_Name_AppLock"
private const val SP_Field_LockPassword = "SP_Field_LockPassword"
private const val SP_Field_LockActive = "SP_Field_LockActive"
private const val SP_Field_WhiteApp = "SP_Field_WhiteApp"
fun setAppLockActive(context: Context, isActive: Boolean): Boolean {
val sp = context.getSharedPreferences(SP_Name_AppLock, Context.MODE_PRIVATE)
val editor = sp.edit()
editor.putBoolean(SP_Field_LockActive, isActive)
editor.apply()
return true
}
fun getAppLockActive(context: Context): Boolean {
val sp = context.getSharedPreferences(SP_Name_AppLock, Context.MODE_PRIVATE)
return sp.getBoolean(SP_Field_LockActive, false) //default not active lock
}
fun getAppLockPassword(ctx: Context): IntArray? {
val sp: SharedPreferences = ctx.getSharedPreferences(SP_Name_AppLock, Context.MODE_PRIVATE)
var password: String? = ""
password = sp.getString(SP_Field_LockPassword, password)
val values = password!!.split(",").toTypedArray()
var appLockPassword: IntArray? = IntArray(values.size)
try {
for (i in values.indices) {
appLockPassword!![i] = values[i].toInt()
}
} catch (e: Exception) {
e.printStackTrace()
appLockPassword = null
}
return appLockPassword
}
fun setAppLockPassword(ctx: Context, password: IntArray?): Boolean {
if (password == null) return false
val sp: SharedPreferences =
ctx.getSharedPreferences(SP_Name_AppLock, Context.MODE_PRIVATE)
var sb = ""
for (value in password) {
sb += "$value," //can't add other char except ',';
}
if (sb.endsWith(",")) {
sb =
sb.substring(0, sb.length - 1) // remove the last char ',' in the end.
}
val editor = sp.edit()
editor.putString(SP_Field_LockPassword, sb)
editor.apply()
return true
}
fun setAppWhite(ctx: Context, whiteApp: MutableList<String>?): Boolean {
if (whiteApp == null) return false
val sp: SharedPreferences = ctx.getSharedPreferences(SP_Name_AppLock, Context.MODE_PRIVATE)
var sb = ""
for (value in whiteApp) {
sb += "$value," //can't add other char except ',';
}
if (sb.endsWith(",")) {
sb = sb.substring(0, sb.length - 1) // remove the last char ',' in the end.
}
val editor = sp.edit()
editor.putString(SP_Field_WhiteApp, sb)
editor.apply()
return true
}
fun getAppWhite(ctx: Context): MutableList<String> {
val sp: SharedPreferences = ctx.getSharedPreferences(SP_Name_AppLock, Context.MODE_PRIVATE)
var sb: String? = ""
sb = sp.getString(SP_Field_WhiteApp, sb)
val values = sb!!.split(",").toTypedArray()
var appWhite: MutableList<String> = mutableListOf()
try {
for (i in values.indices) {
appWhite.add(values[i])
}
} catch (e: Exception) {
e.printStackTrace()
appWhite = mutableListOf()
}
return appWhite
}
}
\ No newline at end of file
package com.mints.fiveworld.ui.activitys.appswitch
import android.view.View
import androidx.core.widget.NestedScrollView
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import com.mints.fiveworld.R
import com.mints.fiveworld.clean.CleanUtils
import com.mints.fiveworld.ui.activitys.base.BaseActivity
import com.mints.fiveworld.ui.adapter.clean.ExpandInfo
import com.mints.fiveworld.ui.widgets.RecyItemDecoration
import kotlinx.android.synthetic.main.activity_boost_white.*
import kotlinx.android.synthetic.main.header_layout.*
/**
*
* @author jyx
* @date 2021/9/1
* @des 加速白名单页面
*/
class BoostWhiteActivity : BaseActivity(), BoostWhiteAdapter.OnStateChangedListener {
private var mWhiteAdapter: BoostWhiteAdapter? = null
private var mBlackAdapter: BoostWhiteAdapter? = null
private var mBlackData: MutableList<ExpandInfo.ChildInfo> = mutableListOf()
private var mWhiteData: MutableList<ExpandInfo.ChildInfo> = mutableListOf()
private lateinit var appWhite: MutableList<String>
override fun initViewsAndEvents() {
tv_title.text = "应用保险柜"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
iv_left_icon.setOnClickListener { finish() }
appWhite = AppSwitchUtil.getAppWhite(applicationContext)
val allApp = CleanUtils.getAllApp(applicationContext)
for (i in 0 until allApp.size) {
val cacheListItem = allApp[i]
val childInfo = ExpandInfo.ChildInfo()
childInfo.headId = cacheListItem.applicationIcon
childInfo.name = cacheListItem.applicationName
childInfo.pkgName = cacheListItem.packageName
if (appWhite.size > 0 && appWhite.contains(cacheListItem.packageName)) {
childInfo.tint = "已加入白名单"
childInfo.isLock = true
mWhiteData.add(childInfo)
} else {
childInfo.tint = "上锁后清理时不在清理当前应用"
childInfo.isLock = false
mBlackData.add(childInfo)
}
}
tvBlackCount.text = "${mBlackData.size}个应用"
tvWhiteCount.text = "${mWhiteData.size}个应用"
mBlackAdapter = BoostWhiteAdapter(this, mBlackData, false)
mWhiteAdapter = BoostWhiteAdapter(this, mWhiteData, true)
val linearLayoutManager = LinearLayoutManager(this)
val linearLayoutManager2 = LinearLayoutManager(this)
recyclerBlack.addItemDecoration(RecyItemDecoration(this, DividerItemDecoration.VERTICAL))
recyclerWhite.addItemDecoration(RecyItemDecoration(this, DividerItemDecoration.VERTICAL))
recyclerBlack.layoutManager = linearLayoutManager
recyclerWhite.layoutManager = linearLayoutManager2
recyclerBlack.adapter = mBlackAdapter
recyclerWhite.adapter = mWhiteAdapter
mBlackAdapter?.setOnStateChangedListener(this)
mWhiteAdapter?.setOnStateChangedListener(this)
nestedScrollView.setOnScrollChangeListener(NestedScrollView.OnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY ->
if (scrollY > whiteContainer.height) {
fakeContainer.visibility = View.VISIBLE
fakeTitle.text = "已上锁"
fakeCount.text = "${mWhiteData.size}个应用"
} else {
fakeContainer.visibility = View.GONE
}
if (scrollY > whiteContainer.height + recyclerWhite.measuredHeight + blackContainer.height) {
fakeContainer.visibility = View.VISIBLE
fakeTitle.text = "未上锁"
fakeCount.text = "${mBlackData.size}个应用"
}
})
}
override fun toggleToOn(position: Int, isWhite: Boolean) {
if (!isWhite) {
val blackData = mBlackData[position]
if (!appWhite.contains(blackData.pkgName)) {
appWhite.add(blackData.pkgName)
}
blackData.isLock = true
blackData.tint = "已加入白名单"
mBlackData.remove(blackData)
mWhiteData.add(0, blackData)
tvBlackCount.text = "${mBlackData.size}个应用"
tvWhiteCount.text = "${mWhiteData.size}个应用"
if (fakeContainer.visibility == View.VISIBLE) {
if (fakeTitle.text.equals("已上锁")) {
fakeCount.text = "${mWhiteData.size}个应用"
} else {
fakeCount.text = "${mBlackData.size}个应用"
}
}
mBlackAdapter?.notifyDataSetChanged()
mWhiteAdapter?.notifyDataSetChanged()
AppSwitchUtil.setAppWhite(applicationContext, appWhite)
}
}
override fun toggleToOff(position: Int, isWhite: Boolean) {
if (isWhite) {
val whiteData = mWhiteData[position]
if (appWhite.contains(whiteData.pkgName)) {
appWhite.remove(whiteData.pkgName)
}
whiteData.isLock = false
whiteData.tint = "上锁后清理时不在清理当前应用"
mWhiteData.remove(whiteData)
mBlackData.add(0, whiteData)
tvBlackCount.text = "${mBlackData.size}个应用"
tvWhiteCount.text = "${mWhiteData.size}个应用"
if (fakeContainer.visibility == View.VISIBLE) {
if (fakeTitle.text.equals("已上锁")) {
fakeCount.text = "${mWhiteData.size}个应用"
} else {
fakeCount.text = "${mBlackData.size}个应用"
}
}
mBlackAdapter?.notifyDataSetChanged()
mWhiteAdapter?.notifyDataSetChanged()
AppSwitchUtil.setAppWhite(applicationContext, appWhite)
}
}
override fun isApplyKitKatTranslucency() = false
override fun getContentViewLayoutID() = R.layout.activity_boost_white
}
\ No newline at end of file
package com.mints.fiveworld.ui.activitys.appswitch
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.CheckBox
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.github.iielse.switchbutton.SwitchView
import com.mints.fiveworld.R
import com.mints.fiveworld.ui.adapter.clean.ExpandInfo
import com.mints.library.utils.GlideUtils
/**
*
* @author jyx
* @date 2021/9/1
* @des 加速应用白名单
*/
class BoostWhiteAdapter(
val context: Context,
val lockData: MutableList<ExpandInfo.ChildInfo>,
val isWhite: Boolean
) :
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private var mOnStateChangedListener: OnStateChangedListener? = null
fun setOnStateChangedListener(onStateChangedListener: OnStateChangedListener) {
mOnStateChangedListener = onStateChangedListener
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
val view =
LayoutInflater.from(context).inflate(R.layout.item_clean_child, parent, false)
return SwitchHolder(view)
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if (holder is SwitchHolder) {
val childInfo = lockData[position]
holder.cb.visibility = View.GONE
// holder.tint.visibility = View.GONE
holder.size.visibility = View.GONE
holder.swv.visibility = View.VISIBLE
GlideUtils.loadImageView(context, childInfo.headId, holder.img)
holder.name.text = childInfo.name
holder.tint.text = childInfo.tint
holder.swv.isOpened = childInfo.isLock
holder.swv.setOnStateChangedListener(object : SwitchView.OnStateChangedListener {
override fun toggleToOn(view: SwitchView?) {
mOnStateChangedListener?.toggleToOn(position, isWhite)
}
override fun toggleToOff(view: SwitchView?) {
mOnStateChangedListener?.toggleToOff(position, isWhite)
}
})
}
}
override fun getItemCount() = lockData.size
private class SwitchHolder(view: View) : RecyclerView.ViewHolder(view) {
val img: ImageView = view.findViewById(R.id.ivChildImg)
val name: TextView = view.findViewById(R.id.tvChildName)
val tint: TextView = view.findViewById(R.id.tvChildInfo)
val size: TextView = view.findViewById(R.id.tvChildSize)
val cb: CheckBox = view.findViewById(R.id.cbChild)
val swv: SwitchView = view.findViewById(R.id.swv)
}
interface OnStateChangedListener {
fun toggleToOn(position: Int, isWhite: Boolean)
fun toggleToOff(position: Int, isWhite: Boolean)
}
}
\ No newline at end of file
package com.mints.fiveworld.ui.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.mints.fiveworld.R
import com.mints.fiveworld.ui.adapter.listener.OnItemClickListener
class ScoreAdapter(val context: Context, val taskData: MutableList<String>) :
RecyclerView.Adapter<RecyclerView.ViewHolder>() {
companion object {
const val HOLDER_TYPE_SIMPLE = 0
}
private var mOnItemClickListener: OnItemClickListener? = null
fun setOnItemClickListener(onItemClickListener: OnItemClickListener?) {
mOnItemClickListener = onItemClickListener
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
val inflater: LayoutInflater = LayoutInflater.from(context)
return ScoreHolder(inflater.inflate(R.layout.item_recyclerview_score, parent, false))
}
override fun getItemCount() = taskData.size
override fun getItemViewType(position: Int): Int {
return HOLDER_TYPE_SIMPLE
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
val increaseHolder = holder as ScoreHolder
when (position) {
0 -> {
increaseHolder.tv1.setCompoundDrawablesWithIntrinsicBounds(
ContextCompat.getDrawable(context, R.mipmap.ic_score_basic),
null,
null,
null
)
increaseHolder.tv1.text = "基础得分"
increaseHolder.tv2.text = taskData[position]
}
1 -> {
increaseHolder.tv1.setCompoundDrawablesWithIntrinsicBounds(
ContextCompat.getDrawable(context, R.mipmap.ic_score_cpu),
null,
null,
null
)
increaseHolder.tv1.text = "处理器"
increaseHolder.tv2.text = taskData[position]
}
2 -> {
increaseHolder.tv1.setCompoundDrawablesWithIntrinsicBounds(
ContextCompat.getDrawable(context, R.mipmap.ic_score_memory),
null,
null,
null
)
increaseHolder.tv1.text = "内存"
increaseHolder.tv2.text = taskData[position]
}
3 -> {
increaseHolder.tv1.setCompoundDrawablesWithIntrinsicBounds(
ContextCompat.getDrawable(context, R.mipmap.ic_score_battery),
null,
null,
null
)
increaseHolder.tv1.text = "电池"
increaseHolder.tv2.text = taskData[position]
}
4 -> {
increaseHolder.tv1.setCompoundDrawablesWithIntrinsicBounds(
ContextCompat.getDrawable(context, R.mipmap.ic_score_storage),
null,
null,
null
)
increaseHolder.tv1.text = "存储"
increaseHolder.tv2.text = taskData[position]
}
5 -> {
increaseHolder.tv1.setCompoundDrawablesWithIntrinsicBounds(
ContextCompat.getDrawable(context, R.mipmap.ic_score_screen),
null,
null,
null
)
increaseHolder.tv1.text = "显示"
increaseHolder.tv2.text = taskData[position]
}
6 -> {
increaseHolder.tv1.setCompoundDrawablesWithIntrinsicBounds(
ContextCompat.getDrawable(context, R.mipmap.ic_score_system),
null,
null,
null
)
increaseHolder.tv1.text = "系统"
increaseHolder.tv2.text = taskData[position]
// increaseHolder.line.visibility = View.INVISIBLE
return
}
else -> {
}
}
// increaseHolder.line.visibility = View.VISIBLE
}
private inner class ScoreHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val tv1: TextView = itemView.findViewById(R.id.tv1)
val tv2: TextView = itemView.findViewById(R.id.tv2)
// val line: View = itemView.findViewById(R.id.line)
}
}
\ No newline at end of file
......@@ -48,6 +48,15 @@ public class ExpandInfo {
public String filePath; // 路径
public boolean isChecked; // 是否选中
public String pkgName; // 包名
public boolean isLock; // 是否锁定
public boolean isLock() {
return isLock;
}
public void setLock(boolean lock) {
isLock = lock;
}
public String isPkgName() {
return pkgName;
......
......@@ -105,4 +105,50 @@ public class NumAnimUtil {
String strfloat = NumberFormat(f, m);
return Float.parseFloat(strfloat);
}
/**
* 进度随意 时间随意
*
* @param textV
*/
public static void startAnim2(TextView textV, float num, long time) {
if (num == 0) {
textV.setText(NumAnimUtil.NumberFormat(num, 2));
return;
}
Float[] nums = splitnum(num, (int) ((time / 1000f) * COUNTPERS));
Counter2 counter = new Counter2(textV, nums, time);
textV.removeCallbacks(counter);
textV.post(counter);
}
static class Counter2 implements Runnable {
private final TextView view;
private Float[] nums;
private long pertime;
private int i = 0;
Counter2(TextView view, Float[] nums, long time) {
this.view = view;
this.nums = nums;
this.pertime = time / nums.length;
}
@Override
public void run() {
if (i > nums.length - 1) {
view.removeCallbacks(Counter2.this);
return;
}
view.setText(NumAnimUtil.NumberFormat(nums[i++], 2));
view.removeCallbacks(Counter2.this);
view.postDelayed(Counter2.this, pertime);
}
}
}
package com.mints.fiveworld.ui.widgets.applock;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.Path;
import android.view.View;
import com.mints.fiveworld.utils.BubbleUtils;
@SuppressLint("ViewConstructor")
public class GestureView extends View {
private static final String TAG = GestureView.class.getName();
/**
* GestureLockView的三种状态
*/
enum Mode {
STATUS_NO_FINGER, STATUS_FINGER_ON, STATUS_FINGER_UP;
}
/**
* GestureLockView的当前状态
*/
private Mode mCurrentStatus = Mode.STATUS_NO_FINGER;
/**
* 宽度
*/
private int mWidth;
/**
* 高度
*/
private int mHeight;
/**
* 外圆半径
*/
private int mRadius;
/**
* 画笔的宽度
*/
private int mStrokeWidth = 2;
/**
* 圆心坐标
*/
private int mCenterX;
private int mCenterY;
private Paint mPaint;
/**
* 箭头(小三角最长边的一半长度 = mArrawRate * mWidth / 2 )
*/
private float mArrowRate = 0.333f;
private int mArrowDegree = -1;
private Path mArrowPath;
/**
* 内圆的半径 = mInnerCircleRadiusRate * mRadus
*/
private float mInnerCircleRadiusRate = 0.25f;
/**
* 四个颜色,可由用户自定义,初始化时由GestureLockViewGroup传入
*/
private int mColorNoFingerInner;
private int mColorNoFingerOutter;
private int mColorFingerOn;
private int mColorFingerUpMatched;
private int mColorFingerUpNotMatched;
private boolean matched;
public GestureView(Context context, int colorNoFingerInner, int colorNoFingerOutter, int colorFingerOn, int colorFingerUpMatched, int colorFingerUpNotMatched) {
super(context);
this.mColorNoFingerInner = colorNoFingerInner;
this.mColorNoFingerOutter = colorNoFingerOutter;
this.mColorFingerOn = colorFingerOn;
this.mColorFingerUpMatched = colorFingerUpMatched;
this.mColorFingerUpNotMatched = colorFingerUpNotMatched;
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mArrowPath = new Path();
mStrokeWidth = BubbleUtils.dp2px(1);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
mWidth = MeasureSpec.getSize(widthMeasureSpec);
mHeight = MeasureSpec.getSize(heightMeasureSpec);
// 取长和宽中的小值
mWidth = Math.min(mWidth, mHeight);
mCenterX = mCenterY = mWidth / 2;
mRadius = mWidth / 3;
mRadius -= mStrokeWidth / 2;
// 绘制三角形,初始时是个默认箭头朝上的一个等腰三角形,用户绘制结束后,根据由两个GestureLockView决定需要旋转多少度
float mArrowLength = mWidth / 2 * mArrowRate;
mArrowPath.moveTo(mWidth / 2, mStrokeWidth + 2);
mArrowPath.lineTo(mWidth / 2 - mArrowLength, mStrokeWidth + 2
+ mArrowLength);
mArrowPath.lineTo(mWidth / 2 + mArrowLength, mStrokeWidth + 2
+ mArrowLength);
mArrowPath.close();
mArrowPath.setFillType(Path.FillType.WINDING);
}
@Override
protected void onDraw(Canvas canvas) {
switch (mCurrentStatus) {
case STATUS_FINGER_ON:
// 绘制外圆
mPaint.setStyle(Style.FILL); //
mPaint.setColor(0x33ffffff);
mPaint.setStrokeWidth(mStrokeWidth);
canvas.drawCircle(mCenterX, mCenterY, mRadius, mPaint);
// 绘制外圆环
mPaint.setStyle(Style.STROKE);
mPaint.setColor(0x99fdfdfd);
mPaint.setStrokeWidth(mStrokeWidth);
canvas.drawCircle(mCenterX, mCenterY, mRadius, mPaint);
// 绘制内圆
mPaint.setStyle(Style.FILL);
mPaint.setColor(mColorFingerOn);
canvas.drawCircle(mCenterX, mCenterY, mRadius
* mInnerCircleRadiusRate, mPaint);
break;
case STATUS_FINGER_UP:
if (matched) {
// 绘制外圆环
mPaint.setColor(mColorFingerUpMatched);
mPaint.setStyle(Style.STROKE);
mPaint.setStrokeWidth(mStrokeWidth);
canvas.drawCircle(mCenterX, mCenterY, mRadius, mPaint);
} else {
// 外圆
mPaint.setStyle(Style.FILL);
mPaint.setColor(0x33ff5c5c);
mPaint.setStrokeWidth(mStrokeWidth);
canvas.drawCircle(mCenterX, mCenterY, mRadius, mPaint);
// 外圆环
mPaint.setColor(0x99e3362d);
mPaint.setStyle(Style.STROKE);
mPaint.setStrokeWidth(mStrokeWidth);
canvas.drawCircle(mCenterX, mCenterY, mRadius, mPaint);
mPaint.setColor(mColorFingerUpNotMatched);
}
// 绘制内圆
mPaint.setStyle(Style.FILL);
canvas.drawCircle(mCenterX, mCenterY, mRadius
* mInnerCircleRadiusRate, mPaint);
// drawArrow(canvas);
break;
case STATUS_NO_FINGER:
// 绘制外圆
mPaint.setStyle(Style.STROKE);
mPaint.setStrokeWidth(mStrokeWidth);
mPaint.setColor(mColorNoFingerOutter);
canvas.drawCircle(mCenterX, mCenterY, mRadius, mPaint);
// 绘制内圆
mPaint.setStyle(Style.FILL);
mPaint.setColor(mColorNoFingerInner);
canvas.drawCircle(mCenterX, mCenterY, mRadius
* mInnerCircleRadiusRate, mPaint);
break;
}
}
/**
* 绘制箭头
*
* @param canvas
*/
private void drawArrow(Canvas canvas) {
if (mArrowDegree != -1) {
mPaint.setStyle(Style.FILL);
canvas.save();
canvas.rotate(mArrowDegree, mCenterX, mCenterY);
canvas.drawPath(mArrowPath, mPaint);
canvas.restore();
}
}
public void setMatched(boolean matched) {
this.matched = matched;
}
/**
* 设置当前模式并重绘界面
*
* @param mode
*/
public void setMode(Mode mode) {
this.mCurrentStatus = mode;
invalidate();
}
public void setArrowDegree(int degree) {
this.mArrowDegree = degree;
}
public int getArrowDegree() {
return this.mArrowDegree;
}
}
......@@ -473,4 +473,19 @@ public final class Utils {
public static void killMainProcess() {
android.os.Process.killProcess(android.os.Process.myPid());
}
public static String getBatteryCapacity() {
Object mPowerProfile;
double batteryCapacity = 0;
//电池的容量mAhfinal
String POWER_PROFILE_CLASS = "com.android.internal.os.PowerProfile";
try {
mPowerProfile = Class.forName(POWER_PROFILE_CLASS).getConstructor(Context.class).newInstance(MintsApplication.getContext());
batteryCapacity = (double) Class.forName(POWER_PROFILE_CLASS).getMethod("getBatteryCapacity").invoke(mPowerProfile);
} catch (Exception e) {
return "unknown";
}
return ((int) batteryCapacity) + "mA";
}
}
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="600">
<translate
android:fromXDelta="100%p"
android:interpolator="@android:anim/decelerate_interpolator"
android:toXDelta="0" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_0097F7"
android:orientation="vertical">
<!-- <include layout="@layout/header_layout" />-->
<ImageView
android:id="@+id/ivBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:padding="16dp"
android:src="@mipmap/ic_arrow_back_white" />
<TextView
android:id="@+id/tvLockHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="200dp"
android:textColor="@color/white"
android:textSize="20sp" />
<com.mints.fiveworld.ui.widgets.applock.GestureViewGroup
android:id="@+id/gestureLockViewGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:layout_marginBottom="90dp"
android:gravity="center" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include
android:id="@+id/header"
layout="@layout/header_layout" />
<androidx.core.widget.NestedScrollView
android:id="@+id/nestedScrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/header"
android:overScrollMode="never">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/whiteContainer"
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingStart="20dp"
android:paddingEnd="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="已上锁"
android:textColor="@color/black"
android:textSize="16sp" />
<TextView
android:id="@+id/tvWhiteCount"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:gravity="center"
android:text="1个应用"
android:textColor="@color/black" />
</RelativeLayout>
<View style="@style/view_line_E6E6E6" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerWhite"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<View style="@style/view_line_E6E6E6" />
<RelativeLayout
android:id="@+id/blackContainer"
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingStart="20dp"
android:paddingEnd="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="未上锁"
android:textColor="@color/black"
android:textSize="16sp" />
<TextView
android:id="@+id/tvBlackCount"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:gravity="center"
android:text="1个应用"
android:textColor="@color/black" />
</RelativeLayout>
<View style="@style/view_line_E6E6E6" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerBlack"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>
<RelativeLayout
android:id="@+id/fakeContainer"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="@id/header"
android:background="@color/white"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:visibility="gone">
<TextView
android:id="@+id/fakeTitle"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="已上锁"
android:textColor="@color/black"
android:textSize="16sp" />
<TextView
android:id="@+id/fakeCount"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentEnd="true"
android:gravity="center"
android:text="1个应用"
android:textColor="@color/black" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_00072D"
android:orientation="vertical">
<include layout="@layout/header_layout" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_1E283C"
android:padding="20dp">
<TextView
android:id="@+id/tvScore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="设备得分:"
android:textColor="@color/color_E2E2E2"
android:textSize="16sp" />
<TextView
android:id="@+id/tvAllScore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tvScore"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:layout_marginBottom="10dp"
android:background="@mipmap/ic_score_btn"
android:gravity="center"
android:text="0"
android:textColor="@color/color_00F6FF"
android:textSize="40sp" />
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycleView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@color/color_1E283C"
android:paddingBottom="30dp" />
<TextView
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="40dp"
android:background="@color/color_1E283C"
android:gravity="center"
android:text="恭喜您,测分完成!"
android:textColor="@color/white"
android:textSize="22sp" />
</LinearLayout>
\ No newline at end of file
This diff is collapsed.
......@@ -41,9 +41,9 @@
android:id="@+id/tvChildSize"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="10dp"
android:layout_toStartOf="@id/cbChild"
android:layout_marginEnd="70dp"
android:text="4 MB" />
<CheckBox
......@@ -56,4 +56,15 @@
android:buttonTint="@color/color_main"
android:focusable="false" />
<com.github.iielse.switchbutton.SwitchView
android:id="@+id/swv"
android:layout_width="60dp"
android:layout_height="30dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="20dp"
android:buttonTint="@color/color_main"
android:focusable="false"
android:visibility="gone" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="60dp">
<TextView
android:id="@+id/tv1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="20dp"
android:drawablePadding="6dp"
android:text=""
android:textColor="@color/color_E2E2E2"
android:textSize="16sp" />
<TextView
android:id="@+id/tv2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="20dp"
android:text=""
android:textColor="@color/color_F9F9F9"
android:textSize="18sp" />
<!-- <View-->
<!-- android:id="@+id/line"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="1dp"-->
<!-- android:layout_alignParentBottom="true"-->
<!-- android:background="@color/white" />-->
</RelativeLayout>
\ No newline at end of file
......@@ -247,4 +247,16 @@
<declare-styleable name="CircleAnimationView">
<attr name="image" format="reference" />
</declare-styleable>
<declare-styleable name="GestureLockViewGroup">
<attr name="color_no_finger_inner_circle" format="color" />
<attr name="color_no_finger_outer_circle" format="color" />
<attr name="color_error_circle" format="color" />
<attr name="outer_circle_width" format="dimension" />
<attr name="margin_between_vircle" format="dimension" />
<attr name="color_finger_on" format="color" />
<attr name="color_finger_up" format="color" />
<attr name="count" format="integer" />
<attr name="tryTimes" format="integer" />
</declare-styleable>
</resources>
\ No newline at end of file
......@@ -38,4 +38,11 @@
<color name="dd_win_bg">#8000</color>
<color name="color_00F6FF">#00F6FF</color>
<color name="color_FE3B77">#FE3B77</color>
<color name="color_00072D">#00072D</color>
<color name="color_1E283C">#1E283C</color>
<color name="color_F9F9F9">#F9F9F9</color>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment