Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
MobileManager
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Wang Xu
MobileManager
Commits
12e91010
Commit
12e91010
authored
Mar 24, 2020
by
Baoxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改Toast
parent
3f8d9c8a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
21 deletions
+28
-21
activity_app_manager.xml
Launcher3/res/layout/activity_app_manager.xml
+2
-0
PwdPinSetPwdActivity.java
.../android/launcher3/function/pwd/PwdPinSetPwdActivity.java
+7
-10
AppChooseActivity.kt
...m/android/launcher3/function/setting/AppChooseActivity.kt
+3
-0
ChangePwdActivity.kt
...m/android/launcher3/function/setting/ChangePwdActivity.kt
+13
-9
PrivacyPolicyDialog.java
...com/secspace/lib/common/function/PrivacyPolicyDialog.java
+3
-2
No files found.
Launcher3/res/layout/activity_app_manager.xml
View file @
12e91010
...
@@ -92,6 +92,7 @@
...
@@ -92,6 +92,7 @@
android:layout_margin=
"10dp"
android:layout_margin=
"10dp"
android:elevation=
"3dp"
android:elevation=
"3dp"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:enabled=
"false"
android:background=
"#fafafa"
android:background=
"#fafafa"
android:onClick=
"btnClick"
android:onClick=
"btnClick"
android:text=
"确定"
/>
android:text=
"确定"
/>
...
@@ -101,6 +102,7 @@
...
@@ -101,6 +102,7 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
android:layout_height=
"48dp"
style=
"@style/Widget.AppCompat.Button.Borderless"
style=
"@style/Widget.AppCompat.Button.Borderless"
android:enabled=
"false"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:background=
"#fafafa"
android:background=
"#fafafa"
android:layout_margin=
"10dp"
android:layout_margin=
"10dp"
...
...
Launcher3/src/com/android/launcher3/function/pwd/PwdPinSetPwdActivity.java
View file @
12e91010
package
com
.
android
.
launcher3
.
function
.
pwd
;
package
com
.
android
.
launcher3
.
function
.
pwd
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.support.v7.app.AppCompatActivity
;
import
android.support.v7.widget.Toolbar
;
import
android.text.InputType
;
import
android.text.InputType
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.View
;
import
android.view.Window
;
import
android.view.inputmethod.InputMethodManager
;
import
android.view.WindowManager
;
import
android.widget.Button
;
import
android.widget.Button
;
import
android.widget.CheckBox
;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
android.widget.CompoundButton
;
...
@@ -22,9 +18,8 @@ import android.widget.TextView;
...
@@ -22,9 +18,8 @@ import android.widget.TextView;
import
com.android.launcher3.BaseActivity
;
import
com.android.launcher3.BaseActivity
;
import
com.android.launcher3.R
;
import
com.android.launcher3.R
;
import
com.android.launcher3.settings.BlankActivity
;
import
com.android.launcher3.settings.BlankActivity
;
import
com.secspace.lib.common.dialog.other.DialogUIUtils
;
import
com.secspace.lib.common.utils.Prefs
;
import
com.secspace.lib.common.utils.Prefs
;
import
com.secspace.lib.common.utils.ToastUtil
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
...
@@ -87,13 +82,15 @@ public class PwdPinSetPwdActivity extends BaseActivity implements View.OnClickLi
...
@@ -87,13 +82,15 @@ public class PwdPinSetPwdActivity extends BaseActivity implements View.OnClickLi
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
switch
(
v
.
getId
())
{
switch
(
v
.
getId
())
{
case
R
.
id
.
btn_sure
:
case
R
.
id
.
btn_sure
:
InputMethodManager
imm
=
(
InputMethodManager
)
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
imm
.
hideSoftInputFromWindow
(
getWindow
().
getDecorView
().
getWindowToken
(),
0
);
String
pwd
=
String
.
valueOf
(
mEditPwd
.
getText
());
String
pwd
=
String
.
valueOf
(
mEditPwd
.
getText
());
if
(
TextUtils
.
isEmpty
(
pwd
))
{
if
(
TextUtils
.
isEmpty
(
pwd
))
{
ToastUtil
.
showShort
(
this
,
"密码不能为空"
);
DialogUIUtils
.
showToastCenter
(
"密码不能为空"
);
return
;
return
;
}
}
if
(
pwd
.
length
()
<
PWD_TINY_LENGTH
)
{
if
(
pwd
.
length
()
<
PWD_TINY_LENGTH
)
{
ToastUtil
.
showShort
(
this
,
"密码至少为6位"
);
DialogUIUtils
.
showToastCenter
(
"密码至少为6位"
);
return
;
return
;
}
}
// if (pwd.length() > PWD_MAX_LENGTH) {
// if (pwd.length() > PWD_MAX_LENGTH) {
...
...
Launcher3/src/com/android/launcher3/function/setting/AppChooseActivity.kt
View file @
12e91010
...
@@ -77,6 +77,7 @@ class AppChooseActivity : BaseActivity() {
...
@@ -77,6 +77,7 @@ class AppChooseActivity : BaseActivity() {
private
suspend
fun
loadFinished
(
appModels
:
List
<
AppModel
>)
{
private
suspend
fun
loadFinished
(
appModels
:
List
<
AppModel
>)
{
mSystemApps
.
clear
()
mSystemApps
.
clear
()
mUserApps
.
clear
()
mUserApps
.
clear
()
appModels
.
forEach
{
appModels
.
forEach
{
if
(
it
.
appInfo
.
flags
and
ApplicationInfo
.
FLAG_SYSTEM
!=
0
)
{
if
(
it
.
appInfo
.
flags
and
ApplicationInfo
.
FLAG_SYSTEM
!=
0
)
{
mSystemApps
.
add
(
it
)
mSystemApps
.
add
(
it
)
...
@@ -87,6 +88,8 @@ class AppChooseActivity : BaseActivity() {
...
@@ -87,6 +88,8 @@ class AppChooseActivity : BaseActivity() {
}
}
}
}
withContext
(
Dispatchers
.
Main
)
{
withContext
(
Dispatchers
.
Main
)
{
btn_sure
.
isEnabled
=
true
btn_cancel
.
isEnabled
=
true
LoadingDialog
.
getInstance
(
mContext
).
dismiss
()
LoadingDialog
.
getInstance
(
mContext
).
dismiss
()
mAppInfoAdapterUserApp
?.
readResult
(
mAppContext
)
mAppInfoAdapterUserApp
?.
readResult
(
mAppContext
)
mAppInfoAdapterSystemApp
?.
readResult
(
mAppContext
)
mAppInfoAdapterSystemApp
?.
readResult
(
mAppContext
)
...
...
Launcher3/src/com/android/launcher3/function/setting/ChangePwdActivity.kt
View file @
12e91010
...
@@ -8,16 +8,18 @@ import android.text.SpannedString
...
@@ -8,16 +8,18 @@ import android.text.SpannedString
import
android.text.TextUtils
import
android.text.TextUtils
import
android.text.style.AbsoluteSizeSpan
import
android.text.style.AbsoluteSizeSpan
import
android.view.View
import
android.view.View
import
android.view.inputmethod.InputMethodManager
import
android.widget.EditText
import
android.widget.EditText
import
com.android.launcher3.BaseActivity
import
com.android.launcher3.BaseActivity
import
com.android.launcher3.R
import
com.android.launcher3.R
import
com.android.launcher3.function.pwd.PwdPinSetPwdActivity
import
com.android.launcher3.function.pwd.PwdPinSetPwdActivity
import
com.android.launcher3.settings.ErrorTimeHelper
import
com.android.launcher3.settings.ErrorTimeHelper
import
com.secspace.lib.common.dialog.other.DialogUIUtils
import
com.secspace.lib.common.utils.Prefs
import
com.secspace.lib.common.utils.Prefs
import
com.secspace.lib.common.utils.ToastUtil
import
kotlinx.android.synthetic.main.activity_change_pwd.*
import
kotlinx.android.synthetic.main.activity_change_pwd.*
import
kotlinx.android.synthetic.main.activity_setting.tv_setting_title
import
kotlinx.android.synthetic.main.activity_setting.tv_setting_title
class
ChangePwdActivity
:
BaseActivity
()
{
class
ChangePwdActivity
:
BaseActivity
()
{
private
var
mContext
:
Context
?
=
null
private
var
mContext
:
Context
?
=
null
...
@@ -36,7 +38,7 @@ class ChangePwdActivity : BaseActivity() {
...
@@ -36,7 +38,7 @@ class ChangePwdActivity : BaseActivity() {
setHintSize
(
et_new_pwd_again
,
getString
(
R
.
string
.
edu_item_input_newpwd_again
))
setHintSize
(
et_new_pwd_again
,
getString
(
R
.
string
.
edu_item_input_newpwd_again
))
tv_confir_pwd_protection
.
setOnClickListener
{
tv_confir_pwd_protection
.
setOnClickListener
{
ToastUtil
.
showShort
(
this
@ChangePwdActivity
,
R
.
string
.
edu_toast_wait
)
DialogUIUtils
.
showToastCenter
(
R
.
string
.
edu_toast_wait
)
}
}
}
}
...
@@ -48,35 +50,37 @@ class ChangePwdActivity : BaseActivity() {
...
@@ -48,35 +50,37 @@ class ChangePwdActivity : BaseActivity() {
}
}
fun
btnClick
(
v
:
View
)
{
fun
btnClick
(
v
:
View
)
{
val
imm
:
InputMethodManager
=
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
imm
.
hideSoftInputFromWindow
(
window
.
decorView
.
windowToken
,
0
)
val
originalPwd
=
et_old_pwd
.
text
.
toString
()
val
originalPwd
=
et_old_pwd
.
text
.
toString
()
val
newPwd
=
et_new_pwd
.
text
.
toString
()
val
newPwd
=
et_new_pwd
.
text
.
toString
()
val
confirmNewPwd
=
et_new_pwd_again
.
text
.
toString
()
val
confirmNewPwd
=
et_new_pwd_again
.
text
.
toString
()
if
(!
ErrorTimeHelper
.
getInstance
(
this
).
canShowDialog
())
{
if
(!
ErrorTimeHelper
.
getInstance
(
this
).
canShowDialog
())
{
ToastUtil
.
showShort
(
this
,
String
.
format
(
getString
(
R
.
string
.
edu_item_input_lock
),
ErrorTimeHelper
.
getInstance
(
this
).
countDownTime
))
DialogUIUtils
.
showToastCenter
(
String
.
format
(
getString
(
R
.
string
.
edu_item_input_lock
),
ErrorTimeHelper
.
getInstance
(
this
).
countDownTime
))
return
return
}
}
if
(
newPwd
.
isEmpty
()||
newPwd
.
length
<
PwdPinSetPwdActivity
.
PWD_TINY_LENGTH
)
{
if
(
newPwd
.
isEmpty
()||
newPwd
.
length
<
PwdPinSetPwdActivity
.
PWD_TINY_LENGTH
)
{
ToastUtil
.
showShort
(
this
,
R
.
string
.
edu_item_input_newpwd_null
)
DialogUIUtils
.
showToastCenter
(
R
.
string
.
edu_item_input_newpwd_null
)
return
return
}
}
if
(
confirmNewPwd
.
isEmpty
()
||
confirmNewPwd
.
length
<
PwdPinSetPwdActivity
.
PWD_TINY_LENGTH
)
{
if
(
confirmNewPwd
.
isEmpty
()
||
confirmNewPwd
.
length
<
PwdPinSetPwdActivity
.
PWD_TINY_LENGTH
)
{
ToastUtil
.
showShort
(
this
,
R
.
string
.
edu_item_input_newpwd_again_null
)
DialogUIUtils
.
showToastCenter
(
R
.
string
.
edu_item_input_newpwd_again_null
)
return
return
}
}
if
(
originalPwd
.
isEmpty
())
{
if
(
originalPwd
.
isEmpty
())
{
ToastUtil
.
showShort
(
this
,
R
.
string
.
edu_item_input_oldpwd_null
)
DialogUIUtils
.
showToastCenter
(
R
.
string
.
edu_item_input_oldpwd_null
)
return
return
}
}
if
(!
TextUtils
.
equals
(
originalPwd
,
Prefs
.
getLoginPwd
(
this
)))
{
if
(!
TextUtils
.
equals
(
originalPwd
,
Prefs
.
getLoginPwd
(
this
)))
{
ToastUtil
.
showShort
(
this
,
R
.
string
.
edu_item_input_pwd_error
)
DialogUIUtils
.
showToastCenter
(
R
.
string
.
edu_item_input_pwd_error
)
ErrorTimeHelper
.
getInstance
(
this
).
addErrorCount
()
ErrorTimeHelper
.
getInstance
(
this
).
addErrorCount
()
return
return
}
}
if
(!
TextUtils
.
equals
(
newPwd
,
confirmNewPwd
))
{
if
(!
TextUtils
.
equals
(
newPwd
,
confirmNewPwd
))
{
ToastUtil
.
showShort
(
this
,
R
.
string
.
edu_item_input_pwd_different
)
DialogUIUtils
.
showToastCenter
(
R
.
string
.
edu_item_input_pwd_different
)
return
return
}
}
ToastUtil
.
showShort
(
this
,
R
.
string
.
edu_item_input_pwd_change_success
)
DialogUIUtils
.
showToastCenter
(
R
.
string
.
edu_item_input_pwd_change_success
)
Prefs
.
setLoginPwd
(
this
,
newPwd
)
Prefs
.
setLoginPwd
(
this
,
newPwd
)
//如果存在输错密码多次的情况下重置密码
//如果存在输错密码多次的情况下重置密码
ErrorTimeHelper
.
getInstance
(
this
).
resetLockTimeAndCount
()
ErrorTimeHelper
.
getInstance
(
this
).
resetLockTimeAndCount
()
...
...
lib_common/src/main/java/com/secspace/lib/common/function/PrivacyPolicyDialog.java
View file @
12e91010
...
@@ -177,12 +177,13 @@ public class PrivacyPolicyDialog implements DialogInterface.OnDismissListener, V
...
@@ -177,12 +177,13 @@ public class PrivacyPolicyDialog implements DialogInterface.OnDismissListener, V
}
else
if
(
v
.
getId
()
==
R
.
id
.
btn_accept
)
{
}
else
if
(
v
.
getId
()
==
R
.
id
.
btn_accept
)
{
Prefs
.
setPrivacyPolicyState
(
mActivity
,
true
);
Prefs
.
setPrivacyPolicyState
(
mActivity
,
true
);
try
{
try
{
mActivity
.
startActivity
(
new
Intent
(
mActivity
,
Class
.
forName
(
"com.android.launcher3.settings.BlankActivity"
)));
Intent
intent
=
new
Intent
(
mActivity
,
Class
.
forName
(
"com.android.launcher3.settings.BlankActivity"
));
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
mActivity
.
startActivity
(
intent
);
}
catch
(
ClassNotFoundException
e
)
{
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
dismiss
();
dismiss
();
mActivity
.
finish
();
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment