Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
Project
Project
Details
Activity
Releases
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
android
android_vedio
Commits
e974d479
Commit
e974d479
authored
Oct 13, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
f52f437f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
DrawCashFragment.kt
...om/duben/miniplaylet/ui/fragment/draw/DrawCashFragment.kt
+2
-2
MateUtils.kt
...pp/src/main/java/com/duben/miniplaylet/utils/MateUtils.kt
+11
-0
No files found.
video/app/src/main/java/com/duben/miniplaylet/ui/fragment/draw/DrawCashFragment.kt
View file @
e974d479
...
...
@@ -33,6 +33,7 @@ import com.duben.miniplaylet.login.LoginApi
import
com.duben.miniplaylet.login.OnLoginListener
import
com.duben.miniplaylet.manager.UserManager
import
com.duben.miniplaylet.mvp.model.WXInfo
import
com.duben.miniplaylet.utils.MateUtils
import
kotlinx.android.synthetic.main.fragment_draw.*
/**
...
...
@@ -212,8 +213,7 @@ class DrawCashFragment : LazyLoadBaseFragment(), OnLoginListener, DrawCashView,
if
(
TextUtils
.
equals
(
payChannel
,
WEIXIN_PAY
))
{
// 微信授权
if
(!
weixinStatus
)
{
val
wechat
=
ShareSDK
.
getPlatform
(
Wechat
.
NAME
)
if
(!
wechat
.
isClientValid
)
{
if
(!
MateUtils
.
checkPackageName
(
requireContext
(),
"com.tencent.mm"
))
{
showToast
(
"请先安装微信"
)
return
}
...
...
video/app/src/main/java/com/duben/miniplaylet/utils/MateUtils.kt
View file @
e974d479
package
com.duben.miniplaylet.utils
import
android.content.Context
import
android.content.pm.PackageInfo
import
android.content.pm.PackageManager
import
android.text.TextUtils
...
...
@@ -31,4 +32,14 @@ object MateUtils {
}
return
resultData
}
fun
checkPackageName
(
ctx
:
Context
,
pkg
:
String
):
Boolean
{
var
packageInfo
:
PackageInfo
?
=
null
try
{
packageInfo
=
ctx
.
packageManager
.
getPackageInfo
(
pkg
,
0
)
}
catch
(
e
:
PackageManager
.
NameNotFoundException
)
{
e
.
printStackTrace
()
}
return
packageInfo
!=
null
}
}
\ No newline at end of file
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