Commit 087cd240 by Baoxy

fix: 修改设置密码界面的小眼睛图标/两次激活延时

parent 248b41e2
......@@ -106,6 +106,11 @@
android:excludeFromRecents="true"
android:theme="@style/SettingTheme"></activity>
<activity
android:name=".function.setting.AppUseActivity"
android:excludeFromRecents="true"
android:theme="@style/SettingTheme"></activity>
<activity
android:name=".ManagerAuthActivity"
android:excludeFromRecents="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true"
android:drawable="@drawable/small_eyes" /><!--选中时效果-->
android:drawable="@drawable/ic_visibility_off_gray_24dp" /><!--选中时效果-->
<item android:state_checked="false"
android:drawable="@drawable/show_pwd" /><!--未选中时效果-->
android:drawable="@drawable/ic_visibility_gray_24dp" /><!--未选中时效果-->
</selector>
\ No newline at end of file
<vector android:height="24dp" android:tint="#ABABAB"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M10,6L8.59,7.41 13.17,12l-4.58,4.59L10,18l6,-6z"/>
</vector>
<vector android:height="24dp" android:tint="#ABABAB"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z"/>
</vector>
<vector android:height="24dp" android:tint="#ABABAB"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,7c2.76,0 5,2.24 5,5 0,0.65 -0.13,1.26 -0.36,1.83l2.92,2.92c1.51,-1.26 2.7,-2.89 3.43,-4.75 -1.73,-4.39 -6,-7.5 -11,-7.5 -1.4,0 -2.74,0.25 -3.98,0.7l2.16,2.16C10.74,7.13 11.35,7 12,7zM2,4.27l2.28,2.28 0.46,0.46C3.08,8.3 1.78,10.02 1,12c1.73,4.39 6,7.5 11,7.5 1.55,0 3.03,-0.3 4.38,-0.84l0.42,0.42L19.73,22 21,20.73 3.27,3 2,4.27zM7.53,9.8l1.55,1.55c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.66 1.34,3 3,3 0.22,0 0.44,-0.03 0.65,-0.08l1.55,1.55c-0.67,0.33 -1.41,0.53 -2.2,0.53 -2.76,0 -5,-2.24 -5,-5 0,-0.79 0.2,-1.53 0.53,-2.2zM11.84,9.02l3.15,3.15 0.02,-0.16c0,-1.66 -1.34,-3 -3,-3l-0.17,0.01z"/>
</vector>
......@@ -55,10 +55,10 @@
<CheckBox
android:id="@+id/cb_show_pwd"
android:layout_width="40dp"
android:layout_height="25dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_marginRight="10dp"
android:button="@drawable/cb_selector"
android:checked="true" />
</LinearLayout>
......@@ -91,10 +91,10 @@
<CheckBox
android:id="@+id/cb_show_pwd_again"
android:layout_width="40dp"
android:layout_height="25dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_marginRight="10dp"
android:button="@drawable/cb_selector"
android:checked="true" />
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical"
tools:context="com.android.launcher3.function.setting.AppUseActivity">
<TextView
android:id="@+id/tv_setting_title"
android:layout_width="match_parent"
android:layout_height="48dp"
android:drawableStart="@mipmap/ic_back"
android:drawablePadding="10dp"
android:gravity="center_vertical"
android:onClick="close"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/edu_item_about"
android:textColor="#363636"
android:textSize="16sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#DDDFE1" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="center_vertical"
android:background="@color/bg_white"
android:onClick="more"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_app_use_time"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:gravity="center_vertical"
android:onClick="close"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:text="@string/edu_item_app_use_last_day"
android:textColor="#363636"
android:textSize="16sp" />
<com.qmuiteam.qmui.widget.QMUIEmptyView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="48dp"
android:drawableEnd="@drawable/ic_chevron_right_gray_24dp"
android:gravity="center_vertical"
android:text="@string/edu_item_app_use_more"
android:textColor="#ABABAB"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout>
......@@ -375,9 +375,12 @@
<string name="edu_item_input_encryted_error">未获取到密保答案</string>
<string name="edu_item_input_answer1_error">问题一答案错误</string>
<string name="edu_item_input_answer2_error">问题二答案错误</string>
<string name="edu_item_input_encryted_title">请输入密保答案用于修改密码</string>
<string name="edu_item_app_use_title">应用使用情况</string>
<string name="edu_item_app_use_last_day">最近一天使用时长: %1$s分钟</string>
<string name="edu_item_app_use_more">更多</string>
</resources>
package com.android.launcher3.function.setting
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.widget.GridLayout
import android.widget.LinearLayout
import com.android.launcher3.BaseActivity
import com.android.launcher3.R
import com.qmuiteam.qmui.widget.grouplist.QMUICommonListItemView
import com.qmuiteam.qmui.widget.grouplist.QMUIGroupListView
import com.secspace.lib.common.utils.*
import kotlinx.android.synthetic.main.activity_setting.*
import kotlinx.android.synthetic.main.activity_setting.tv_setting_title
import kotlinx.android.synthetic.main.activity_use_app.*
class AppUseActivity : BaseActivity() {
private var mContext: Context? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setAndroidNativeLightStatusBar(true)
setContentView(R.layout.activity_use_app)
mContext = this
initView()
}
private fun initView() {
tv_setting_title.setText(R.string.edu_item_app_use_title)
tv_app_use_time.text = String.format(getString(R.string.edu_item_app_use_last_day), "50")
}
fun close(view: View?) {
finish()
}
fun more(view: View) {
}
}
\ No newline at end of file
......@@ -56,7 +56,7 @@ class SettingActivity : BaseActivity() {
dp2px(48f))
QMUIGroupListView.newSection(mContext)
.addItemView(wlan) { IntentUtil.startWifiSetting(mContext) }
.addItemView(appUse) { ToastUtil.showShort(mContext, R.string.edu_toast_wait) }
.addItemView(appUse) { startActivity(Intent(mContext, AppUseActivity::class.java)) }
.addItemView(buy) { startActivity(Intent(mContext, SettingBuyActivity::class.java)) }
.addItemView(about) { startActivity(Intent(mContext, SettingAboutActivity::class.java)) }
.addTo(grouplistview)
......
......@@ -101,6 +101,7 @@ object ActivationHelper {
return withContext(Dispatchers.IO) {
val file = File(FILE_PATH + context.packageName, PROBATION_FILE_NAME)
if (!file.exists()) {
Log.e("TAG1", "isProbationFromLocal 1")
return@withContext false
}
val map: HashMap<String?, *>?
......@@ -129,33 +130,37 @@ object ActivationHelper {
}
}
private suspend fun probation(context: Context): Boolean {
val map: MutableMap<String?, String?> = HashMap()
val currentTime = getCurrentTimeByNet()
if (currentTime == -1L) {
return false
}
val endTime = currentTime + PROBATION_TIME
map[SP_IS_ACTIVE] = DesUtil.encrypt(PROBATION)
map[SP_TRIAL_ACTIVE_END_TIME] = DesUtil.encrypt(endTime.toString())
map[SP_ACTIVE_CODE] = DesUtil.encrypt("无")
map[SP_TRIAL_ACTIVE_START_TIME] = DesUtil.encrypt(currentTime.toString())
try {
val fileDir = File(FILE_PATH + context.packageName)
if (!fileDir.exists()) {
fileDir.mkdirs()
private suspend fun probation(context: Context): Boolean{
return withContext(Dispatchers.IO){
val map: MutableMap<String?, String?> = HashMap()
Log.e("TAG1", "probation 1")
val currentTime = getCurrentTimeByNet()
Log.e("TAG1", "probation 2")
if (currentTime == -1L) {
return@withContext false
}
val file = File(fileDir, PROBATION_FILE_NAME)
if (!file.exists()) {
file.createNewFile()
val endTime = currentTime + PROBATION_TIME
map[SP_IS_ACTIVE] = DesUtil.encrypt(PROBATION)
map[SP_TRIAL_ACTIVE_END_TIME] = DesUtil.encrypt(endTime.toString())
map[SP_ACTIVE_CODE] = DesUtil.encrypt("无")
map[SP_TRIAL_ACTIVE_START_TIME] = DesUtil.encrypt(currentTime.toString())
try {
val fileDir = File(FILE_PATH + context.packageName)
if (!fileDir.exists()) {
fileDir.mkdirs()
}
val file = File(fileDir, PROBATION_FILE_NAME)
if (!file.exists()) {
file.createNewFile()
}
XmlUtils.writeMapXml(map, FileOutputStream(file))
} catch (e: XmlPullParserException) {
return@withContext false
} catch (e: IOException) {
return@withContext false
}
XmlUtils.writeMapXml(map, FileOutputStream(file))
} catch (e: XmlPullParserException) {
return false
} catch (e: IOException) {
return false
return@withContext true
}
return true
}
private fun getValueByXmlKey(context: Context, key: String, fileName: String): String {
......
......@@ -20,6 +20,7 @@ import com.secspace.mdmengine.api.manager.MdmFactoryManager
import com.skr.activation.network.linstener.CheckActiveStatusListener
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import java.io.File
......@@ -62,6 +63,7 @@ object WorkManager {
SwitchInMdm.onInit(launcher)
activate(launcher)
// checkLocalUpdateFile() //检查本地更新文件
delay(5000)
ActivationHelper.checkActivate(launcher, EduCheckActiveStatusListener(launcher))
}
isChecksCompleted = true
......
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