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
5b700b08
Commit
5b700b08
authored
Oct 16, 2020
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
邀好友返回结果处理
parent
3dd5e131
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
23 deletions
+31
-23
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+1
-1
FriendsFragment.kt
...n/java/com/mints/goodmoney/ui/fragment/FriendsFragment.kt
+3
-1
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+27
-21
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
5b700b08
...
...
@@ -98,7 +98,7 @@ object Constant {
const
val
CARRIER_NEW_USER
=
"CARRIER_NEW_USER"
//新用户红包
const
val
CARRIER_FRIENDS
=
"CARRIER_FRIENDS"
//邀请好友
// 邀请好友
//
新
邀请好友
const
val
CHALLENGE_SHAREFRIEND
=
"CHALLENGE_SHAREFRIEND"
//邀请好友
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/FriendsFragment.kt
View file @
5b700b08
...
...
@@ -57,6 +57,8 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform
initView
()
initRecy
()
initBanner
()
friendsPresenter
.
getFriendsMsg
()
}
private
fun
initView
()
{
...
...
@@ -155,7 +157,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform
// friendsPresenter.getFriendsMsg()
// }
friendsPresenter
.
getFriendsMsg
()
}
// bv_friends_task.startAutoScroll()
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
5b700b08
...
...
@@ -6,6 +6,8 @@ import android.content.ClipData
import
android.content.ClipboardManager
import
android.content.Context
import
android.os.Bundle
import
android.os.Handler
import
android.os.Looper
import
android.text.TextUtils
import
android.view.View
import
android.widget.AdapterView
...
...
@@ -13,7 +15,6 @@ import androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.DividerItemDecoration
import
cn.sharesdk.framework.Platform
import
cn.sharesdk.framework.Platform.ShareParams
import
cn.sharesdk.framework.PlatformActionListener
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.wechat.friends.Wechat
import
com.mints.goodmoney.BuildConfig
...
...
@@ -52,7 +53,7 @@ import java.util.*
* 时间:2020/6/4 17:30
*/
@SuppressLint
(
"SetTextI18n"
)
class
MyFragment
:
BaseFragment
(),
MyView
,
MainMyAdapter
.
OnItemChildClickListener
,
OnRefreshListener
,
View
.
OnClickListener
,
AdapterView
.
OnItemClickListener
,
PlatformActionListener
{
class
MyFragment
:
BaseFragment
(),
MyView
,
MainMyAdapter
.
OnItemChildClickListener
,
OnRefreshListener
,
View
.
OnClickListener
,
AdapterView
.
OnItemClickListener
{
private
val
ps
by
lazy
{
AppPreferences
(
context
)
}
private
val
myPresenter
by
lazy
{
MyPresenter
()
}
...
...
@@ -79,6 +80,15 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
initView
()
initRecy
()
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
myPresenter
.
getUserHallBaseMsg
()
}
else
{
// 游客登录
myPresenter
.
userLogin
(
ps
)
}
}
private
fun
initView
()
{
...
...
@@ -120,12 +130,7 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
override
fun
onResume
()
{
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_MY
)
{
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
myPresenter
.
getUserHallBaseMsg
()
}
else
{
// 游客登录
myPresenter
.
userLogin
(
ps
)
}
}
}
...
...
@@ -418,6 +423,11 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
50
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CHALLENGE_SHAREFRIEND
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
userConfig
?.
taskShareFriend
!!
.
complete
+=
1
dataList
[
1
].
progressStr
=
"("
+
userConfig
!!
.
taskShareFriend
.
complete
+
"/"
+
userConfig
!!
.
taskShareFriend
.
max
+
")"
dataList
[
1
].
btnStr
=
"去邀请"
mainMyAdapter
?.
notifyItemChanged
(
1
)
}
}
else
{
val
wechatSp
=
ShareParams
()
...
...
@@ -429,9 +439,17 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
val
wechat
=
ShareSDK
.
getPlatform
(
Wechat
.
NAME
)
if
(
wechat
.
isClientValid
)
{
myPresenter
.
cmtShareStatus
()
wechat
.
platformActionListener
=
this
// 设置分享事件回调
// 执行图文分享
wechat
.
share
(
wechatSp
)
Handler
(
Looper
.
getMainLooper
())
.
postDelayed
({
userConfig
?.
taskShareFriend
!!
.
complete
dataList
[
1
].
progressStr
=
"("
+
userConfig
!!
.
taskShareFriend
.
complete
+
"/"
+
userConfig
!!
.
taskShareFriend
.
max
+
")"
dataList
[
1
].
btnStr
=
"立即领取"
mainMyAdapter
?.
notifyItemChanged
(
1
)
},
1000
)
}
else
{
showToast
(
"请先安装微信"
)
}
...
...
@@ -536,16 +554,4 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
}
}
override
fun
onComplete
(
p0
:
Platform
?,
p1
:
Int
,
p2
:
HashMap
<
String
,
Any
>?)
{
userConfig
?.
taskShareFriend
!!
.
complete
+=
1
dataList
[
1
].
progressStr
=
"("
+
userConfig
!!
.
taskShareFriend
.
complete
+
"/"
+
userConfig
!!
.
taskShareFriend
.
max
+
")"
dataList
[
1
].
btnStr
=
"立即领取"
mainMyAdapter
?.
notifyItemChanged
(
1
)
}
override
fun
onError
(
p0
:
Platform
?,
p1
:
Int
,
p2
:
Throwable
?)
=
showToast
(
"邀请取消"
)
override
fun
onCancel
(
p0
:
Platform
?,
p1
:
Int
)
=
showToast
(
"邀请取消"
)
}
\ 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