Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
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_goodmoney
Commits
8777fc49
Commit
8777fc49
authored
Nov 28, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
e1d8d3c1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
41 deletions
+34
-41
LoginActivity.kt
...in/java/com/mints/goodmoney/ui/activitys/LoginActivity.kt
+8
-4
SettingsActivity.kt
...java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
+26
-26
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+0
-11
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/LoginActivity.kt
View file @
8777fc49
...
...
@@ -40,6 +40,7 @@ class LoginActivity : BaseActivity()
private
val
loginApi
by
lazy
{
LoginApi
()
}
private
var
mobile
:
String
?
=
null
private
var
channel
:
String
=
""
private
var
wxInfo
:
WXInfo
?
=
null
private
var
loginFlag
:
Boolean
=
false
// false-登录 true-绑定手机号
...
...
@@ -52,7 +53,7 @@ class LoginActivity : BaseActivity()
override
fun
initViewsAndEvents
()
{
loginPresenter
.
attachView
(
this
)
channel
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
initView
()
initListener
()
}
...
...
@@ -84,7 +85,6 @@ class LoginActivity : BaseActivity()
return
true
}
val
channel
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
if
(!
TextUtils
.
equals
(
channel
,
Constant
.
CHANNEL_SHARE
))
{
finish
()
}
...
...
@@ -102,7 +102,6 @@ class LoginActivity : BaseActivity()
return
}
val
channel
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
if
(!
TextUtils
.
equals
(
channel
,
Constant
.
CHANNEL_SHARE
))
{
finish
()
}
...
...
@@ -202,7 +201,6 @@ class LoginActivity : BaseActivity()
progressDialog
.
dismiss
()
}
val
channel
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
if
(
TextUtils
.
equals
(
channel
,
Constant
.
CHANNEL_SHARE
))
{
readyGo
(
MainActivity
::
class
.
java
)
}
...
...
@@ -234,6 +232,12 @@ class LoginActivity : BaseActivity()
}
private
fun
initView
()
{
if
(
TextUtils
.
equals
(
channel
,
Constant
.
CHANNEL_SHARE
))
{
tvLoginWx
.
visibility
=
View
.
GONE
}
else
{
tvLoginWx
.
visibility
=
View
.
VISIBLE
}
// false-登录 true-绑定手机号
if
(
loginFlag
)
{
tvLoginWx
.
visibility
=
View
.
GONE
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
View file @
8777fc49
...
...
@@ -70,7 +70,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
iv_left_icon
.
setOnClickListener
(
this
)
item_phone
.
setOnClickListener
(
this
)
item_wechat
.
setOnClickListener
(
this
)
//
item_wechat.setOnClickListener(this)
item_invitedCode
.
setOnClickListener
(
this
)
item_cleanCache
.
setOnClickListener
(
this
)
item_userAgree
.
setOnClickListener
(
this
)
...
...
@@ -91,17 +91,17 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
item_phone
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
text
=
"未绑定"
}
item_wechat
.
findViewById
<
TextView
>(
R
.
id
.
tv_title
).
text
=
"微信昵称"
val
wechat
=
resources
.
getDrawable
(
R
.
mipmap
.
icon_settings_wechat
)
wechat
.
setBounds
(
0
,
0
,
56
,
56
)
item_wechat
.
findViewById
<
TextView
>(
R
.
id
.
tv_title
).
setCompoundDrawables
(
wechat
,
null
,
null
,
null
)
item_wechat
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
visibility
=
View
.
VISIBLE
item_wechat
.
findViewById
<
ImageView
>(
R
.
id
.
iv_right
).
visibility
=
View
.
GONE
if
(
userManager
.
wxOpenid
.
isNotEmpty
())
{
item_wechat
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
text
=
userManager
.
wxName
}
else
{
item_wechat
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
text
=
"未授权"
}
//
item_wechat.findViewById<TextView>(R.id.tv_title).text = "微信昵称"
//
val wechat = resources.getDrawable(R.mipmap.icon_settings_wechat)
//
wechat.setBounds(0, 0, 56, 56)
//
item_wechat.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(wechat, null, null, null)
//
item_wechat.findViewById<TextView>(R.id.tv_right).visibility = View.VISIBLE
//
item_wechat.findViewById<ImageView>(R.id.iv_right).visibility = View.GONE
//
if (userManager.wxOpenid.isNotEmpty()) {
//
item_wechat.findViewById<TextView>(R.id.tv_right).text = userManager.wxName
//
} else {
//
item_wechat.findViewById<TextView>(R.id.tv_right).text = "未授权"
//
}
// item_invitedCode.findViewById<TextView>(R.id.tv_title).text = "邀请码"
// val invitedCode = resources.getDrawable(R.mipmap.icon_settings_invite)
...
...
@@ -161,20 +161,20 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
readyGo
(
LoginActivity
::
class
.
java
,
bundle
)
}
}
R
.
id
.
item_wechat
->
{
if
(
userManager
.
wxOpenid
.
isEmpty
())
{
val
wechat
=
ShareSDK
.
getPlatform
(
Wechat
.
NAME
)
if
(!
wechat
.
isClientValid
)
{
showToast
(
"请先安装微信"
)
return
}
loginApi
.
setOnLoginListener
(
this
)
loginApi
.
setPlatform
(
Wechat
.
NAME
)
loginApi
.
login
(
this
)
}
}
//
R.id.item_wechat -> {
//
if (userManager.wxOpenid.isEmpty()) {
//
//
val wechat = ShareSDK.getPlatform(Wechat.NAME)
//
if (!wechat.isClientValid) {
//
showToast("请先安装微信")
//
return
//
}
//
//
loginApi.setOnLoginListener(this)
//
loginApi.setPlatform(Wechat.NAME)
//
loginApi.login(this)
//
}
//
}
R
.
id
.
item_invitedCode
->
{
submitInvitedCode
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
8777fc49
...
...
@@ -92,15 +92,10 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
initRecy
()
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
myPresenter
.
getAutoUserHallBaseMsg
()
// 登录成功的用户初始化鱼丸盒子
if
(
userManager
.
userIsLogin
())
{
YwhzManager
.
init
(
baseApplication
)
}
}
else
{
// 游客登录
myPresenter
.
userLogin
()
}
}
...
...
@@ -219,12 +214,6 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
}
override
fun
signInHomePageSuc
()
{
if
(
signCardBean
==
null
)
{
showToast
(
"网络异常,请检测网络!"
)
myPresenter
.
getSignInHomePageMsg
()
return
}
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
curSignCoin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_SIGNIN_HOMEPAGE_AWARD
)
...
...
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