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
cc15d588
Commit
cc15d588
authored
Oct 16, 2020
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改分享逻辑返回逻辑,部分bug修改
parent
36e1e3f4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
71 deletions
+64
-71
BannerBaseAdapter.java
...ava/com/mints/goodmoney/ui/adapter/BannerBaseAdapter.java
+3
-3
BannerTaskAdapter.kt
.../java/com/mints/goodmoney/ui/adapter/BannerTaskAdapter.kt
+11
-1
FriendsFragment.kt
...n/java/com/mints/goodmoney/ui/fragment/FriendsFragment.kt
+27
-57
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+13
-6
BannerView.java
.../main/java/com/mints/goodmoney/ui/widgets/BannerView.java
+6
-0
item_bv_friends_task.xml
GoodMoney/app/src/main/res/layout/item_bv_friends_task.xml
+4
-4
ic_sign_newgift_close.png
...y/app/src/main/res/mipmap-xhdpi/ic_sign_newgift_close.png
+0
-0
ic_sign_newgift_open.png
...ey/app/src/main/res/mipmap-xhdpi/ic_sign_newgift_open.png
+0
-0
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/adapter/BannerBaseAdapter.java
View file @
cc15d588
...
...
@@ -118,9 +118,9 @@ public abstract class BannerBaseAdapter<T> extends PagerAdapter {
this
.
mDatas
=
new
ArrayList
<>(
datas
);
notifyDataSetChanged
();
if
(
mBannerView
!=
null
)
{
mBannerView
.
resetCurrentPosition
(
datas
.
size
());
}
//
if (mBannerView != null) {
//
mBannerView.resetCurrentPosition(datas.size());
//
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/adapter/BannerTaskAdapter.kt
View file @
cc15d588
package
com.mints.goodmoney.ui.adapter
import
android.content.Context
import
android.graphics.Color
import
android.view.View
import
android.widget.Button
import
android.widget.TextView
import
com.mints.goodmoney.R
import
com.mints.goodmoney.mvp.model.FriendsTaskBean
class
BannerTaskAdapter
(
context
:
Context
)
:
BannerBaseAdapter
<
FriendsTaskBean
.
ChallengeBean
.
ListBean
>(
context
)
{
private
val
mContext
:
Context
=
context
override
fun
getLayoutResID
()
=
R
.
layout
.
item_bv_friends_task
override
fun
convert
(
convertView
:
View
,
data
:
FriendsTaskBean
.
ChallengeBean
.
ListBean
)
{
convertView
.
findViewById
<
TextView
>(
R
.
id
.
item_bv_friends_task_title
).
text
=
data
.
title
convertView
.
findViewById
<
TextView
>(
R
.
id
.
item_bv_friends_task_info
).
text
=
data
.
remarks
convertView
.
findViewById
<
TextView
>(
R
.
id
.
item_bv_friends_task_btn
).
text
=
data
.
button
if
(
data
.
button
==
"去邀请"
)
{
convertView
.
findViewById
<
TextView
>(
R
.
id
.
item_bv_friends_task_btn
).
setBackgroundResource
(
R
.
drawable
.
shape_btn_orange
)
convertView
.
findViewById
<
TextView
>(
R
.
id
.
item_bv_friends_task_btn
).
setTextColor
(
mContext
.
resources
.
getColor
(
R
.
color
.
my_color_orange
))
}
else
{
convertView
.
findViewById
<
TextView
>(
R
.
id
.
item_bv_friends_task_btn
).
setBackgroundResource
(
R
.
drawable
.
shape_btn_orange_complete
)
convertView
.
findViewById
<
TextView
>(
R
.
id
.
item_bv_friends_task_btn
).
setTextColor
(
Color
.
WHITE
)
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/FriendsFragment.kt
View file @
cc15d588
...
...
@@ -2,13 +2,11 @@ package com.mints.goodmoney.ui.fragment
import
android.graphics.Typeface
import
android.os.Bundle
import
android.view.View
import
android.widget.LinearLayout
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.DividerItemDecoration
import
cn.sharesdk.framework.Platform
import
cn.sharesdk.framework.PlatformActionListener
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.wechat.friends.Wechat
import
com.mints.goodmoney.R
...
...
@@ -30,14 +28,13 @@ import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import
kotlinx.android.synthetic.main.fragment_main_friends.*
import
kotlinx.android.synthetic.main.fragment_main_friends.srl_my
import
kotlinx.android.synthetic.main.header_layout.*
import
java.util.HashMap
/**
* 描述:邀请好友
* 作者:孟崔广
* 时间:2020/9/20 17:30
*/
class
FriendsFragment
:
BaseFragment
(),
FriendsView
,
OnRefreshListener
,
PlatformActionListener
{
class
FriendsFragment
:
BaseFragment
(),
FriendsView
,
OnRefreshListener
{
private
val
friendsPresenter
by
lazy
{
FriendsPresenter
()
}
...
...
@@ -77,7 +74,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform
override
fun
onTabUnselected
(
tab
:
TabLayout
.
Tab
)
{
val
title
=
((
tab_friends
.
getChildAt
(
0
)
as
LinearLayout
).
getChildAt
(
tab
!!
.
position
)
as
LinearLayout
).
getChildAt
(
((
tab_friends
.
getChildAt
(
0
)
as
LinearLayout
).
getChildAt
(
tab
.
position
)
as
LinearLayout
).
getChildAt
(
1
)
as
TextView
title
.
apply
{
...
...
@@ -88,7 +85,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform
override
fun
onTabSelected
(
tab
:
TabLayout
.
Tab
)
{
val
title
=
((
tab_friends
.
getChildAt
(
0
)
as
LinearLayout
).
getChildAt
(
tab
!!
.
position
)
as
LinearLayout
).
getChildAt
(
((
tab_friends
.
getChildAt
(
0
)
as
LinearLayout
).
getChildAt
(
tab
.
position
)
as
LinearLayout
).
getChildAt
(
1
)
as
TextView
title
.
apply
{
...
...
@@ -110,12 +107,6 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform
recy_friends
.
addItemDecoration
(
DividerItemDecoration
(
mContext
,
DividerItemDecoration
.
VERTICAL
))
invitedAdapter
=
InvitedAdapter
(
mContext
,
invitedData
)
recy_friends
.
adapter
=
invitedAdapter
invitedAdapter
?.
setOnItemClickListener
(
object
:
InvitedAdapter
.
OnItemClickListener
{
override
fun
onItemClick
(
view
:
View
?,
position
:
Int
)
{
}
})
}
private
fun
initBanner
()
{
...
...
@@ -132,13 +123,9 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform
}
}
override
fun
onPageDown
()
{
// bv_friends_task.stopAutoScroll()
}
override
fun
onPageDown
()
{}
override
fun
onPageUp
()
{
// bv_friends_task.startAutoScroll()
}
override
fun
onPageUp
()
{}
})
bv_friends_task
.
setAdapter
(
bannerTaskAdapter
)
...
...
@@ -159,17 +146,11 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform
// if (!TextUtils.isEmpty(userManager?.userID)) {
// friendsPresenter.getFriendsMsg()
// }
}
// bv_friends_task.startAutoScroll()
}
override
fun
onPause
()
{
super
.
onPause
()
// bv_friends_task.stopAutoScroll()
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
...
...
@@ -183,18 +164,19 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform
}
private
fun
invitedFriends
()
{
val
wechatSp
=
Platform
.
ShareParams
()
wechatSp
.
shareType
=
Platform
.
SHARE_WEBPAGE
wechatSp
.
title
=
Constant
.
SHARE_TITLE
wechatSp
.
text
=
Constant
.
SHARE_CONTENT
wechatSp
.
imageData
=
ImageUtil
.
drawableToBitmap
(
ContextCompat
.
getDrawable
(
context
!!
,
R
.
mipmap
.
ic_launcher
))
wechatSp
.
url
=
Constant
.
SHARE_URL
val
wechat
=
ShareSDK
.
getPlatform
(
Wechat
.
NAME
)
if
(
wechat
.
isClientValid
)
{
friendsPresenter
.
cmtShareStatus
()
wechat
.
platformActionListener
=
this
// 设置分享事件回调
val
wechatSp
=
Platform
.
ShareParams
()
wechatSp
.
shareType
=
Platform
.
SHARE_WEBPAGE
wechatSp
.
title
=
Constant
.
SHARE_TITLE
wechatSp
.
text
=
Constant
.
SHARE_CONTENT
wechatSp
.
imageData
=
ImageUtil
.
drawableToBitmap
(
ContextCompat
.
getDrawable
(
context
!!
,
R
.
mipmap
.
ic_launcher
))
wechatSp
.
url
=
Constant
.
SHARE_URL
// 执行图文分享
wechat
.
share
(
wechatSp
)
}
else
{
showToast
(
"请先安装微信"
)
}
...
...
@@ -203,31 +185,30 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform
override
fun
getWorldRankSuc
(
data
:
FriendsTaskBean
.
FriendsBean
)
{
srl_my
.
finishRefresh
(
true
)
// if (data.list.size == 0) {
// iv_empty.visibility = View.VISIBLE
// recy_friends.visibility = View.GONE
// } else {
// iv_empty.visibility = View.GONE
// recy_friends.visibility = View.VISIBLE
invitedData
.
clear
()
invitedData
.
addAll
(
data
.
list
)
invitedAdapter
?.
notifyDataSetChanged
()
// }
}
override
fun
getFriendsRankSuc
(
data
:
FriendsTaskBean
)
{
srl_my
.
finishRefresh
(
true
)
// var currentPostion: Int
// for (i in 0..data.challenge.list.size) {
// if (data.challenge.list[i].status == 1 && data.challenge.list[i + 1].status == 0) {
// currentPostion = i
// }
// }
bvTaskData
=
data
.
challenge
.
list
bannerTaskAdapter
?.
setData
(
bvTaskData
)
// 跳转当前完成的页面
var
currentPosition
=
0
for
(
i
in
0
until
bvTaskData
.
size
)
{
if
(
i
==
bvTaskData
.
size
-
1
&&
bvTaskData
[
i
].
status
==
1
)
{
currentPosition
=
i
}
if
(
bvTaskData
[
i
].
status
==
1
&&
i
+
1
<
bvTaskData
.
size
&&
bvTaskData
[
i
+
1
].
status
==
0
)
{
currentPosition
=
i
break
}
}
bv_friends_task
.
setCurrentIndex
(
currentPosition
)
if
(
tab_friends
.
selectedTabPosition
==
0
)
{
invitedData
.
clear
()
invitedData
.
addAll
(
data
.
friends
.
list
)
...
...
@@ -235,15 +216,4 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, Platform
}
}
override
fun
onComplete
(
p0
:
Platform
?,
p1
:
Int
,
p2
:
HashMap
<
String
,
Any
>?)
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
50
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CHALLENGE_SHAREFRIEND
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
override
fun
onError
(
p0
:
Platform
?,
p1
:
Int
,
p2
:
Throwable
?)
=
showToast
(
"邀请取消"
)
override
fun
onCancel
(
p0
:
Platform
?,
p1
:
Int
)
=
showToast
(
"邀请取消"
)
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
cc15d588
...
...
@@ -80,6 +80,13 @@ class MyFragment : BaseFragment(), MyView, MainMyAdapter.OnItemChildClickListene
initView
()
initRecy
()
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
myPresenter
.
getUserHallBaseMsg
()
}
else
{
// 游客登录
myPresenter
.
userLogin
(
ps
)
}
}
private
fun
initView
()
{
...
...
@@ -121,12 +128,12 @@ 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
)
}
//
if (!TextUtils.isEmpty(userManager.userID)) {
//
myPresenter.getUserHallBaseMsg()
//
} else {
//
// 游客登录
//
myPresenter.userLogin(ps)
//
}
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/BannerView.java
View file @
cc15d588
...
...
@@ -11,12 +11,14 @@ import android.content.Context;
import
android.content.res.TypedArray
;
import
android.os.Handler
;
import
android.os.Looper
;
import
androidx.annotation.AttrRes
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.viewpager.widget.PagerAdapter
;
import
androidx.core.view.ViewCompat
;
import
androidx.viewpager.widget.ViewPager
;
import
android.util.AttributeSet
;
import
android.util.DisplayMetrics
;
import
android.util.TypedValue
;
...
...
@@ -361,4 +363,8 @@ public class BannerView extends FrameLayout {
public
void
setAnimDuration
(
long
animDuration
)
{
mAnimDuration
=
animDuration
;
}
public
void
setCurrentIndex
(
int
position
)
{
mViewPager
.
setCurrentItem
(
position
);
}
}
GoodMoney/app/src/main/res/layout/item_bv_friends_task.xml
View file @
cc15d588
...
...
@@ -20,8 +20,8 @@
android:id=
"@+id/item_bv_friends_task_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"1
0
dp"
android:layout_marginTop=
"1
0
dp"
android:layout_marginStart=
"1
6
dp"
android:layout_marginTop=
"1
2
dp"
android:text=
"任务1"
android:textColor=
"@color/black"
android:textSize=
"18sp"
...
...
@@ -33,8 +33,8 @@
android:id=
"@+id/item_bv_friends_task_info"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"1
0
dp"
android:layout_marginBottom=
"1
0
dp"
android:layout_marginStart=
"1
6
dp"
android:layout_marginBottom=
"1
2
dp"
android:text=
"邀请1名好友"
android:textColor=
"@color/main_bg_text"
app:layout_constraintBottom_toBottomOf=
"parent"
...
...
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_sign_newgift_close.png
View replaced file @
36e1e3f4
View file @
cc15d588
9.19 KB
|
W:
|
H:
7.12 KB
|
W:
|
H:
2-up
Swipe
Onion skin
GoodMoney/app/src/main/res/mipmap-xhdpi/ic_sign_newgift_open.png
View replaced file @
36e1e3f4
View file @
cc15d588
28.7 KB
|
W:
|
H:
9.19 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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