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
5eeb81ae
Commit
5eeb81ae
authored
Jan 05, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据应用名称获取包名
parent
8f367830
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
1017 additions
and
2 deletions
+1017
-2
okgo-2.2.aar
GoodMoney/app/libs/okgo-2.2.aar
+0
-0
scenead-2.2.aar
GoodMoney/app/libs/scenead-2.2.aar
+0
-0
scenemodule-2.2.aar
GoodMoney/app/libs/scenemodule-2.2.aar
+0
-0
BaseVedioAd.kt
...src/main/java/com/mints/goodmoney/ad/vedio/BaseVedioAd.kt
+0
-0
CsjVedioAdManager.java
.../java/com/mints/goodmoney/ad/vedio/CsjVedioAdManager.java
+0
-0
MhVedioAdManager.kt
...ain/java/com/mints/goodmoney/ad/vedio/MhVedioAdManager.kt
+0
-0
VedioAdingManager.java
.../java/com/mints/goodmoney/ad/vedio/VedioAdingManager.java
+0
-0
WnVedioAdManager.kt
...ain/java/com/mints/goodmoney/ad/vedio/WnVedioAdManager.kt
+0
-0
YlhVedioAdManager.java
.../java/com/mints/goodmoney/ad/vedio/YlhVedioAdManager.java
+0
-0
DeviceInfo.kt
...pp/src/main/java/com/mints/goodmoney/common/DeviceInfo.kt
+35
-2
KylTabBean.kt
...src/main/java/com/mints/goodmoney/mvp/model/KylTabBean.kt
+4
-0
KylVedioBean.kt
...c/main/java/com/mints/goodmoney/mvp/model/KylVedioBean.kt
+4
-0
KuYinYuePagePresenter.kt
...m/mints/goodmoney/mvp/presenters/KuYinYuePagePresenter.kt
+68
-0
KylVedioPresenter.kt
...a/com/mints/goodmoney/mvp/presenters/KylVedioPresenter.kt
+68
-0
KuYinYuePageView.kt
...in/java/com/mints/goodmoney/mvp/views/KuYinYuePageView.kt
+7
-0
KylVedioView.kt
...c/main/java/com/mints/goodmoney/mvp/views/KylVedioView.kt
+13
-0
KylVedioActivity.kt
...java/com/mints/goodmoney/ui/activitys/KylVedioActivity.kt
+153
-0
KylPageAdapter.kt
...ain/java/com/mints/goodmoney/ui/adapter/KylPageAdapter.kt
+58
-0
KuYinYueFragment.kt
.../java/com/mints/goodmoney/ui/fragment/KuYinYueFragment.kt
+88
-0
KuYinYuePageFragment.kt
...a/com/mints/goodmoney/ui/fragment/KuYinYuePageFragment.kt
+217
-0
JZVideoPlayerStandardLoopVideo.java
.../goodmoney/ui/widgets/JZVideoPlayerStandardLoopVideo.java
+85
-0
activity_kyl_vedio.xml
GoodMoney/app/src/main/res/layout/activity_kyl_vedio.xml
+113
-0
fragment_main_kyl.xml
GoodMoney/app/src/main/res/layout/fragment_main_kyl.xml
+29
-0
fragment_main_kyl_page.xml
GoodMoney/app/src/main/res/layout/fragment_main_kyl_page.xml
+34
-0
item_rv_kyl_page.xml
GoodMoney/app/src/main/res/layout/item_rv_kyl_page.xml
+41
-0
No files found.
GoodMoney/app/libs/okgo-2.
1
.aar
→
GoodMoney/app/libs/okgo-2.
2
.aar
100644 → 100755
View file @
5eeb81ae
File moved
GoodMoney/app/libs/scenead-2.
1
.aar
→
GoodMoney/app/libs/scenead-2.
2
.aar
100644 → 100755
View file @
5eeb81ae
File moved
GoodMoney/app/libs/scenemodule-2.
1
.aar
→
GoodMoney/app/libs/scenemodule-2.
2
.aar
100644 → 100755
View file @
5eeb81ae
No preview for this file type
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
ideo/BaseVide
oAd.kt
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
edio/BaseVedi
oAd.kt
View file @
5eeb81ae
File moved
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
ide
o/CsjVedioAdManager.java
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
edi
o/CsjVedioAdManager.java
View file @
5eeb81ae
File moved
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
ide
o/MhVedioAdManager.kt
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
edi
o/MhVedioAdManager.kt
View file @
5eeb81ae
File moved
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
ide
o/VedioAdingManager.java
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
edi
o/VedioAdingManager.java
View file @
5eeb81ae
File moved
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
ide
o/WnVedioAdManager.kt
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
edi
o/WnVedioAdManager.kt
View file @
5eeb81ae
File moved
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
ide
o/YlhVedioAdManager.java
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
edi
o/YlhVedioAdManager.java
View file @
5eeb81ae
File moved
GoodMoney/app/src/main/java/com/mints/goodmoney/common/DeviceInfo.kt
View file @
5eeb81ae
...
...
@@ -582,7 +582,7 @@ class DeviceInfo private constructor() {
}
/**
* 获取APP列表信息
* 获取APP
名称
列表信息
*/
fun
getAppNameInfoList
():
MutableList
<
String
>?
{
try
{
...
...
@@ -616,7 +616,7 @@ class DeviceInfo private constructor() {
}
/**
* 获取APP列表信息
* 获取APP
包名
列表信息
*/
fun
getAppPkgInfoList
():
MutableList
<
String
>?
{
try
{
...
...
@@ -651,6 +651,39 @@ class DeviceInfo private constructor() {
}
/**
* 根据应用名称获取包名
*
* return:包名
*/
fun
getAppPkg
(
name
:
String
):
String
{
var
pkg
=
""
try
{
val
mainintent
=
Intent
(
Intent
.
ACTION_MAIN
,
null
)
mainintent
.
addCategory
(
Intent
.
CATEGORY_LAUNCHER
)
val
packageinfo
=
mContext
!!
.
packageManager
.
getInstalledPackages
(
0
)
var
pinfo
:
PackageInfo
?
=
null
val
count
=
packageinfo
.
size
for
(
i
in
0
until
count
)
{
pinfo
=
packageinfo
[
i
]
val
appInfo
=
pinfo
.
applicationInfo
if
(
appInfo
.
flags
and
ApplicationInfo
.
FLAG_SYSTEM
>
0
)
{
//系统程序 忽略
}
else
{
//非系统程序
if
(
TextUtils
.
equals
(
name
,
appInfo
.
loadLabel
(
mContext
!!
.
packageManager
)
as
String
))
{
pkg
=
pinfo
.
packageName
break
}
}
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
return
pkg
}
/**
* Android ID
*
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/KylTabBean.kt
0 → 100644
View file @
5eeb81ae
package
com.mints.goodmoney.mvp.model
class
KylTabBean
{
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/KylVedioBean.kt
0 → 100644
View file @
5eeb81ae
package
com.mints.goodmoney.mvp.model
class
KylVedioBean
{
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/KuYinYuePagePresenter.kt
0 → 100644
View file @
5eeb81ae
package
com.mints.goodmoney.mvp.presenters
import
com.google.gson.JsonObject
import
com.mints.goodmoney.manager.AppHttpManager
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.views.BookView
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
import
java.util.*
class
BookPresenter
:
BasePresenter
<
BookView
>()
{
fun
addReadSeconds
(
seconds
:
Int
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"seconds"
]
=
seconds
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
addReadSeconds
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onCompleted
()
{
}
override
fun
onError
(
e
:
Throwable
)
{
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
JsonObject
>)
{
if
(
isLinkView
)
return
val
code
=
baseResponse
.
getStatus
()
val
data
=
baseResponse
.
data
when
(
code
)
{
200
->
{
if
(
data
!=
null
)
{
val
coin
=
data
[
"coin"
].
asInt
view
.
readSecondsSuc
(
coin
)
}
}
else
->
view
.
showToast
(
baseResponse
.
getMessage
())
}
}
})
}
fun
getReadInfo
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getReadInfo
(),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onCompleted
()
{
}
override
fun
onError
(
e
:
Throwable
)
{
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
JsonObject
>)
{
if
(
isLinkView
)
return
val
code
=
baseResponse
.
getStatus
()
val
data
=
baseResponse
.
data
when
(
code
)
{
200
->
{
if
(
data
!=
null
)
{
val
msg
=
data
.
getAsJsonObject
(
"msg"
)
view
.
readInfo
(
msg
[
"needSecods"
].
asInt
,
msg
[
"coin"
].
asInt
,
msg
[
"completeSeconds"
].
asInt
)
}
}
else
->
view
.
showToast
(
baseResponse
.
getMessage
())
}
}
})
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/KylVedioPresenter.kt
0 → 100644
View file @
5eeb81ae
package
com.mints.goodmoney.mvp.presenters
import
com.google.gson.JsonObject
import
com.mints.goodmoney.manager.AppHttpManager
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.views.BookView
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
import
java.util.*
class
BookPresenter
:
BasePresenter
<
BookView
>()
{
fun
addReadSeconds
(
seconds
:
Int
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"seconds"
]
=
seconds
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
addReadSeconds
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onCompleted
()
{
}
override
fun
onError
(
e
:
Throwable
)
{
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
JsonObject
>)
{
if
(
isLinkView
)
return
val
code
=
baseResponse
.
getStatus
()
val
data
=
baseResponse
.
data
when
(
code
)
{
200
->
{
if
(
data
!=
null
)
{
val
coin
=
data
[
"coin"
].
asInt
view
.
readSecondsSuc
(
coin
)
}
}
else
->
view
.
showToast
(
baseResponse
.
getMessage
())
}
}
})
}
fun
getReadInfo
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getReadInfo
(),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onCompleted
()
{
}
override
fun
onError
(
e
:
Throwable
)
{
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
JsonObject
>)
{
if
(
isLinkView
)
return
val
code
=
baseResponse
.
getStatus
()
val
data
=
baseResponse
.
data
when
(
code
)
{
200
->
{
if
(
data
!=
null
)
{
val
msg
=
data
.
getAsJsonObject
(
"msg"
)
view
.
readInfo
(
msg
[
"needSecods"
].
asInt
,
msg
[
"coin"
].
asInt
,
msg
[
"completeSeconds"
].
asInt
)
}
}
else
->
view
.
showToast
(
baseResponse
.
getMessage
())
}
}
})
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/KuYinYuePageView.kt
0 → 100644
View file @
5eeb81ae
package
com.mints.goodmoney.mvp.views
interface
BookView
:
BaseView
{
fun
readSecondsSuc
(
coin
:
Int
)
fun
readInfo
(
sumTime
:
Int
,
sumCoin
:
Int
,
readTime
:
Int
)
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/KylVedioView.kt
0 → 100644
View file @
5eeb81ae
package
com.mints.goodmoney.mvp.views
import
com.mints.goodmoney.mvp.model.AccountMsgBean
interface
AccountMergeView
:
BaseView
{
fun
getKeepAccountMsgSuc
(
data
:
AccountMsgBean
)
fun
getKeepAccountMsgFail
()
fun
toKeepAccountSuc
()
fun
toKeepAccountFail
()
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/KylVedioActivity.kt
0 → 100644
View file @
5eeb81ae
package
com.mints.goodmoney.ui.activitys
import
android.os.Bundle
import
android.view.View
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.RsNewsManager
import
com.mints.goodmoney.manager.SceneManager
import
com.mints.goodmoney.mvp.model.AccountMsgBean
import
com.mints.goodmoney.mvp.presenters.AccountMergePresenter
import
com.mints.goodmoney.mvp.views.AccountMergeView
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.widgets.CustomDialogAsApple
import
com.mints.goodmoney.ui.widgets.DialogListener
import
com.mints.goodmoney.utils.SpanUtils
import
com.mints.library.utils.GlideUtils
import
kotlinx.android.synthetic.main.activity_account_merge.*
import
kotlinx.android.synthetic.main.header_layout.*
/**
* 描述:账号合并
* 作者:孟崔广
* 时间:2020/9/23 18:39
*/
class
AccountMergeActivity
:
BaseActivity
(),
View
.
OnClickListener
,
AccountMergeView
{
private
lateinit
var
mobile
:
String
private
lateinit
var
wxOpenId
:
String
private
lateinit
var
keepOneAccountKey
:
String
private
var
cdaa
:
CustomDialogAsApple
?
=
null
private
var
toDoKey
:
String
?
=
null
private
val
accountMergePresenter
by
lazy
{
AccountMergePresenter
()
}
companion
object
{
const
val
TYPE_SAVE_MOBILE
=
1
const
val
TYPE_SAVE_WECHAT
=
2
}
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_account_merge
override
fun
isApplyKitKatTranslucency
()
=
false
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{
super
.
getBundleExtras
(
extras
)
extras
?.
let
{
mobile
=
it
.
getString
(
Constant
.
MERGE_MOBILE
,
""
)
wxOpenId
=
it
.
getString
(
Constant
.
MERGE_WXOPENID
,
""
)
keepOneAccountKey
=
it
.
getString
(
Constant
.
MERGE_KEY
,
""
)
}
}
override
fun
initViewsAndEvents
()
{
tv_title
.
text
=
"账号合并"
iv_left_icon
.
visibility
=
View
.
VISIBLE
iv_left_icon
.
setImageResource
(
R
.
mipmap
.
ic_arrow_back
)
accountMergePresenter
.
attachView
(
this
)
initListener
()
if
(
::
keepOneAccountKey
.
isInitialized
)
{
accountMergePresenter
.
getKeepAccountMsg
(
keepOneAccountKey
)
}
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
accountMergePresenter
.
detachView
()
}
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
iv_left_icon
->
finish
()
R
.
id
.
btn_invite_left
->
{
toDoKey
?.
let
{
hintDialog
(
it
,
"微信"
,
TYPE_SAVE_WECHAT
)
}
}
R
.
id
.
btn_invite_right
->
{
toDoKey
?.
let
{
hintDialog
(
it
,
"手机"
,
TYPE_SAVE_MOBILE
)
}
}
}
}
private
fun
initListener
()
{
iv_left_icon
.
setOnClickListener
(
this
)
btn_invite_left
.
setOnClickListener
(
this
)
btn_invite_right
.
setOnClickListener
(
this
)
}
private
fun
hintDialog
(
toDoKey
:
String
,
str
:
String
,
type
:
Int
)
{
val
content
=
SpanUtils
()
.
append
(
"保留后微信会跟手机号绑定\r\n仅保留"
)
.
append
(
str
+
"账号"
).
setForegroundColor
(
resources
.
getColor
(
R
.
color
.
color_FF2326
))
.
append
(
"下的数据\r\n"
)
.
append
(
"另一个账号的数据将会被删除"
)
.
create
()
cdaa
=
CustomDialogAsApple
(
context
,
object
:
DialogListener
()
{
override
fun
onClick
(
v
:
View
)
{
if
(
cdaa
!=
null
&&
cdaa
!!
.
isShowing
)
{
cdaa
!!
.
dismiss
()
}
when
(
v
.
id
)
{
R
.
id
.
dialog_btn_left
->
{
}
R
.
id
.
dialog_btn_right
->
{
accountMergePresenter
.
toKeepAccount
(
toDoKey
,
type
)
}
}
}
})
cdaa
!!
.
setTitle
(
"温馨提示"
)
cdaa
!!
.
setContent
(
content
)
cdaa
!!
.
setLeft
(
"考虑一下"
)
cdaa
!!
.
setRightDelay
(
"确认绑定"
,
5
)
cdaa
!!
.
show
()
}
override
fun
getKeepAccountMsgSuc
(
data
:
AccountMsgBean
)
{
data
.
let
{
toDoKey
=
it
.
toDoKey
GlideUtils
.
loadImageViewLoding
(
context
,
it
.
wxUser
.
head
,
civ_avatar_left
,
R
.
mipmap
.
ic_my
,
R
.
mipmap
.
ic_my
)
GlideUtils
.
loadImageViewLoding
(
context
,
it
.
mobileUser
.
head
,
civ_avatar_right
,
R
.
mipmap
.
ic_my
,
R
.
mipmap
.
ic_my
)
tv_name_left
.
text
=
""
+
it
.
wxUser
.
account
tv_coin_left
.
text
=
"金币 "
+
it
.
wxUser
.
coin
tv_bonus_left
.
text
=
"贡献 "
+
it
.
wxUser
.
contribution
tv_invited_left
.
text
=
"亲友 "
+
it
.
wxUser
.
sons
tv_name_right
.
text
=
""
+
it
.
mobileUser
.
account
tv_coin_right
.
text
=
"金币 "
+
it
.
mobileUser
.
coin
tv_bonus_right
.
text
=
"贡献 "
+
it
.
mobileUser
.
contribution
tv_invited_right
.
text
=
"亲友 "
+
it
.
mobileUser
.
sons
}
}
override
fun
getKeepAccountMsgFail
()
{}
override
fun
toKeepAccountSuc
()
{
showToast
(
"账号合并成功!"
)
SceneManager
.
signIn
(
this
)
RsNewsManager
.
init
(
baseApplication
)
readyGoThenKill
(
MainActivity
::
class
.
java
)
}
override
fun
toKeepAccountFail
()
{}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/adapter/KylPageAdapter.kt
0 → 100644
View file @
5eeb81ae
package
com.mints.goodmoney.ui.adapter
import
android.content.Context
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.TextView
import
androidx.recyclerview.widget.RecyclerView
import
com.mints.goodmoney.R
import
com.mints.goodmoney.utils.ToolUtil
import
com.mints.library.utils.GlideUtils
import
com.ximalaya.ting.android.opensdk.model.album.Album
class
XmlyPageAdapter
(
val
xmlyPageList
:
MutableList
<
Album
>)
:
RecyclerView
.
Adapter
<
XmlyPageAdapter
.
ViewHolder
>()
{
lateinit
var
context
:
Context
lateinit
var
mOnItemClickListener
:
OnItemClickListener
inner
class
ViewHolder
(
view
:
View
)
:
RecyclerView
.
ViewHolder
(
view
)
{
val
ivXmlyPage
:
ImageView
=
view
.
findViewById
(
R
.
id
.
ivXmlyPage
)
val
tvXmlyPageContent
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvXmlyPageContent
)
val
tvXmlyPagecount
:
TextView
=
view
.
findViewById
(
R
.
id
.
tvXmlyPagecount
)
}
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
ViewHolder
{
context
=
parent
.
context
val
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
item_rv_xmly_page
,
parent
,
false
)
val
viewHolder
=
ViewHolder
(
view
)
return
viewHolder
}
override
fun
onBindViewHolder
(
holder
:
ViewHolder
,
position
:
Int
)
{
val
album
=
xmlyPageList
[
position
]
holder
.
tvXmlyPageContent
.
text
=
album
.
recommendReason
holder
.
tvXmlyPagecount
.
text
=
ToolUtil
.
formatNum
(
album
.
playCount
.
toString
(),
false
)
GlideUtils
.
loadImageView
(
holder
.
itemView
.
context
,
album
.
coverUrlLarge
,
holder
.
ivXmlyPage
)
holder
.
itemView
.
setOnClickListener
{
if
(
::
mOnItemClickListener
.
isInitialized
)
{
mOnItemClickListener
.
onItemClick
(
position
)
}
}
}
override
fun
getItemCount
()
=
xmlyPageList
.
size
interface
OnItemClickListener
{
fun
onItemClick
(
position
:
Int
)
}
fun
setOnItemClickListener
(
listener
:
OnItemClickListener
)
{
mOnItemClickListener
=
listener
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/KuYinYueFragment.kt
0 → 100644
View file @
5eeb81ae
package
com.mints.goodmoney.ui.fragment
import
android.view.View
import
androidx.fragment.app.Fragment
import
androidx.viewpager.widget.ViewPager
import
com.fly.scenemodule.util.GsonUtils
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.ui.adapter.MessageFragAdapter
import
com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import
com.mints.goodmoney.utils.LogUtil
import
com.ximalaya.ting.android.opensdk.datatrasfer.CommonRequest
import
com.ximalaya.ting.android.opensdk.datatrasfer.IDataCallBack
import
com.ximalaya.ting.android.opensdk.model.category.CategoryList
import
kotlinx.android.synthetic.main.fragment_main_xmly.*
import
java.util.*
import
kotlin.collections.ArrayList
import
kotlin.concurrent.schedule
/**
* 描述:喜马拉雅
* 作者:孟崔广
*/
class
XmlyFragment
:
LazyLoadBaseFragment
()
{
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_xmly
override
fun
initViewsAndEvents
()
{
}
override
fun
onFragmentFirstVisible
()
{
super
.
onFragmentFirstVisible
()
loadData
()
}
private
fun
loadData
()
{
showLoading
(
"加载中..."
)
// 获取分类数据
val
vo
=
hashMapOf
<
String
,
String
>()
CommonRequest
.
getCategories
(
vo
,
object
:
IDataCallBack
<
CategoryList
>
{
override
fun
onSuccess
(
p0
:
CategoryList
?)
{
initViewAndData
(
p0
)
}
override
fun
onError
(
p0
:
Int
,
p1
:
String
?)
{
LogUtil
.
e
(
p1
)
hideLoading
()
}
})
}
private
fun
initViewAndData
(
categoryList
:
CategoryList
?)
{
// hideLoading()
categoryList
?.
let
{
val
tabs
:
MutableList
<
String
>
=
ArrayList
()
val
fragments
:
MutableList
<
Fragment
>
=
ArrayList
()
var
tempPageSize
=
18
if
(
it
.
categories
.
size
<
18
)
{
tempPageSize
=
it
.
categories
.
size
}
for
(
i
in
0
until
tempPageSize
)
{
tabs
.
add
(
it
.
categories
[
i
].
categoryName
)
fragments
.
add
(
XmlyPageFragment
(
it
.
categories
[
i
].
id
))
}
Timer
().
schedule
(
1000
)
{
activity
?.
runOnUiThread
{
hideLoading
()
xtFragmentXmly
.
visibility
=
View
.
VISIBLE
}
}
xtFragmentXmly
.
overScrollMode
=
ViewPager
.
OVER_SCROLL_NEVER
vpFragmentXmly
.
offscreenPageLimit
=
tabs
.
size
+
3
val
adapter
=
MessageFragAdapter
(
childFragmentManager
,
fragments
,
tabs
)
vpFragmentXmly
.
adapter
=
adapter
xtFragmentXmly
.
setxTabDisplayNum
(
tabs
.
size
)
xtFragmentXmly
.
setupWithViewPager
(
vpFragmentXmly
)
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/KuYinYuePageFragment.kt
0 → 100644
View file @
5eeb81ae
package
com.mints.fairyland.ui.fragment
import
android.os.Bundle
import
android.text.TextUtils
import
android.view.View
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.mints.fairyland.R
import
com.mints.fairyland.ad.video.VedioAdingManager
import
com.mints.fairyland.common.Constant
import
com.mints.fairyland.manager.UserManager
import
com.mints.fairyland.mvp.model.GameBean
import
com.mints.fairyland.mvp.model.VedioAdingBean
import
com.mints.fairyland.mvp.presenters.HomePresenter
import
com.mints.fairyland.mvp.views.HomeView
import
com.mints.fairyland.ui.activitys.AwardActivity
import
com.mints.fairyland.ui.activitys.WebActivity
import
com.mints.fairyland.ui.adapter.InvitedAdapter
import
com.mints.fairyland.ui.adapter.listener.OnItemClickListener
import
com.mints.fairyland.ui.fragment.base.LazyLoadBaseFragment
import
com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
import
kotlinx.android.synthetic.main.fragment_main_page.*
/**
* 描述:首页列表详情
* 作者:孟崔广
*/
class
MainPageFragment
(
private
val
categoryId
:
Int
)
:
LazyLoadBaseFragment
(),
HomeView
,
OnRefreshListener
,
OnLoadMoreListener
,
OnItemClickListener
{
private
val
homePresenter
by
lazy
{
HomePresenter
()
}
private
val
userManager
by
lazy
{
UserManager
.
getInstance
()
}
//首页列表
private
var
gameDataList
:
MutableList
<
GameBean
.
ListBean
>
=
mutableListOf
()
private
lateinit
var
gameAdapter
:
InvitedAdapter
private
var
gamePage
=
1
// 分页
private
var
curDataId
=
0
// 当前item id
private
var
curCoin
=
0
// 当前福利金币
// 激励视频相关
private
var
vedioAdingManager
:
VedioAdingManager
?
=
null
private
var
loadVedioFailCount
=
0
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_page
override
fun
initViewsAndEvents
()
{
}
override
fun
onFragmentFirstVisible
()
{
super
.
onFragmentFirstVisible
()
homePresenter
.
attachView
(
this
)
vedioAdingManager
=
VedioAdingManager
.
getInstance
(
activity
)
initRvView
()
initListener
()
if
(!
TextUtils
.
isEmpty
(
userManager
?.
userID
))
{
homePresenter
.
getAconfigList
(
categoryId
,
gamePage
)
}
else
{
homePresenter
.
userLogin
(
categoryId
)
}
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
homePresenter
.
detachView
()
}
override
fun
onItemClick
(
view
:
View
?,
position
:
Int
)
{
if
(
gameDataList
.
size
>
0
)
{
curDataId
=
gameDataList
[
position
].
id
homePresenter
.
getAconfigStatus
(
curDataId
)
}
}
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
gamePage
=
1
gameDataList
.
clear
()
srlMainPage
.
resetNoMoreData
()
if
(!
TextUtils
.
isEmpty
(
userManager
?.
userID
))
{
homePresenter
.
getAconfigList
(
categoryId
,
gamePage
)
}
else
{
homePresenter
.
userLogin
(
categoryId
)
}
}
override
fun
onLoadMore
(
refreshLayout
:
RefreshLayout
)
{
gamePage
=
++
gamePage
homePresenter
.
getAconfigList
(
categoryId
,
gamePage
)
}
override
fun
getAconfigListSuc
(
data
:
GameBean
)
{
if
(
::
gameAdapter
.
isInitialized
)
{
gameDataList
.
addAll
(
data
.
list
)
if
(
gamePage
==
1
)
{
srlMainPage
.
finishRefresh
(
true
)
gameAdapter
.
notifyDataSetChanged
()
}
else
{
if
(
data
.
list
.
size
<
Constant
.
PAGE_SIZE
)
{
srlMainPage
.
finishLoadMoreWithNoMoreData
()
}
else
{
srlMainPage
.
finishLoadMore
()
}
gameAdapter
.
notifyItemChanged
(
data
.
list
.
size
)
}
}
}
override
fun
getAconfigListFail
()
{
srlMainPage
.
finishRefresh
(
false
)
srlMainPage
.
finishLoadMore
(
false
)
gamePage
=
if
(
gamePage
==
1
)
1
else
gamePage
-
1
}
override
fun
getAconfigStatusSuc
(
status
:
Int
,
coin
:
Int
,
url
:
String
)
{
when
(
status
)
{
0
->
{
// 看视频
curCoin
=
coin
awardVedio
(
coin
,
Constant
.
CARRIER_EXCHANGEMAIL_GETCOIN
)
}
1
->
{
// 兑换
val
bundle
=
Bundle
()
bundle
.
putString
(
WebActivity
.
WEB_TITLE
,
"福利领取"
)
bundle
.
putString
(
WebActivity
.
WEB_URL
,
url
)
readyGo
(
WebActivity
::
class
.
java
,
bundle
)
}
2
->
{
// 今日已看完
// val bundle = Bundle()
// bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_MAIN_VEDIO_FINISH)
// readyGo(AwardActivity::class.java, bundle)
showToast
(
"今日视频已达上限,请明日再来"
)
}
}
}
private
fun
initRvView
()
{
val
linearLayoutManager
=
LinearLayoutManager
(
context
)
rvMainPage
.
layoutManager
=
linearLayoutManager
gameAdapter
=
InvitedAdapter
(
context
!!
,
gameDataList
)
rvMainPage
.
adapter
=
gameAdapter
gameAdapter
.
setOnItemClickListener
(
this
)
}
private
fun
initListener
()
{
srlMainPage
.
setOnRefreshListener
(
this
)
srlMainPage
.
setOnLoadMoreListener
(
this
)
}
/**
* 获取激励视频
*/
private
fun
awardVedio
(
coin
:
Int
,
carrierType
:
String
)
{
if
(
vedioAdingManager
?.
vedioFinishFlag
!!
)
{
showToast
(
"今日视频已看完,请明天再来吧"
)
return
}
loadVedioFailCount
=
0
showLoading
(
"加载中..."
)
val
bean
=
VedioAdingBean
()
bean
.
carrierType
=
carrierType
bean
.
curCoin
=
coin
loadVedio
(
vedioAdingManager
!!
,
bean
,
true
)
}
/**
* 加载激励视频
*/
private
fun
loadVedio
(
vedioAdingManager
:
VedioAdingManager
,
bean
:
VedioAdingBean
,
isFirstLoad
:
Boolean
)
{
vedioAdingManager
.
setVedioAdingListener
(
object
:
VedioAdingManager
.
VedioAdingListener
{
override
fun
vedioAdingListenerError
(
adType
:
String
)
{
showToast
(
"加载超时,请休息一下"
)
hideLoading
()
}
override
fun
vedioAdingListenerFail
(
adType
:
String
)
{
loadVedioFailCount
++
if
(
loadVedioFailCount
>=
2
)
{
hideLoading
()
showToast
(
"加载失败,请稍后重试!"
)
}
else
{
loadVedio
(
vedioAdingManager
,
bean
,
false
)
}
}
override
fun
vedioAdingListenerSuccess
(
adType
:
String
)
{
hideLoading
()
vedioAdingSuccess
(
adType
)
}
})
if
(
isFirstLoad
)
{
// 首页按权重加载
vedioAdingManager
.
loadAding
(
activity
,
bean
)
}
else
{
// 失败按优先级加载
vedioAdingManager
.
loadFailAding
(
activity
,
bean
)
}
}
private
fun
vedioAdingSuccess
(
adType
:
String
)
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
curCoin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_EXCHANGEMAIL_GETCOIN
)
bundle
.
putString
(
Constant
.
MAIN_EXTRA_ID
,
curDataId
.
toString
())
// readyGo(AwardAgainActivity::class.java, bundle)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/JZVideoPlayerStandardLoopVideo.java
0 → 100644
View file @
5eeb81ae
package
com
.
mints
.
highgold
.
ui
.
widgets
;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
cn.jzvd.JZDataSource
;
import
cn.jzvd.JzvdStd
;
public
class
JZVideoPlayerStandardLoopVideo
extends
JzvdStd
{
private
JZVedioStatusListener
jzVedioStatusListener
;
private
boolean
isVedioRestart
=
true
;
//true-重复播放视频
public
void
setJzVedioStatusListener
(
JZVedioStatusListener
jzVedioStatusListener
)
{
this
.
jzVedioStatusListener
=
jzVedioStatusListener
;
}
public
JZVideoPlayerStandardLoopVideo
(
Context
context
)
{
super
(
context
);
}
public
JZVideoPlayerStandardLoopVideo
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
@Override
public
void
onStatePlaying
()
{
super
.
onStatePlaying
();
if
(
jzVedioStatusListener
!=
null
)
{
jzVedioStatusListener
.
jzVedioPlaying
();
}
}
@Override
public
void
onAutoCompletion
()
{
super
.
onAutoCompletion
();
try
{
if
(
isVedioRestart
)
{
startVideo
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
interface
JZVedioStatusListener
{
void
jzVedioPlaying
();
}
@Override
public
void
setUp
(
JZDataSource
jzDataSource
,
int
screen
)
{
super
.
setUp
(
jzDataSource
,
screen
);
try
{
if
(
screen
!=
SCREEN_NORMAL
)
{
fullscreenButton
.
setVisibility
(
View
.
VISIBLE
);
progressBar
.
setVisibility
(
View
.
VISIBLE
);
currentTimeTextView
.
setVisibility
(
View
.
VISIBLE
);
totalTimeTextView
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
fullscreenButton
.
setVisibility
(
View
.
INVISIBLE
);
progressBar
.
setVisibility
(
View
.
INVISIBLE
);
currentTimeTextView
.
setVisibility
(
View
.
INVISIBLE
);
totalTimeTextView
.
setVisibility
(
View
.
INVISIBLE
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
/**
* 设置视频是否重复播放 true-重复播放
*/
public
void
setVedioRestart
(
boolean
isVedioRestart
)
{
this
.
isVedioRestart
=
isVedioRestart
;
}
// public int getJZVedioState(){
// return state;
// }
}
GoodMoney/app/src/main/res/layout/activity_kyl_vedio.xml
0 → 100644
View file @
5eeb81ae
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/black"
tools:context=
".ui.activitys.HytechVedioActivity"
>
<ImageView
android:id=
"@+id/iv_hytechvideo_root"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<com.mints.highgold.ui.widgets.JZVideoPlayerStandardLoopVideo
android:id=
"@+id/jz_hytechvideo"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<FrameLayout
android:id=
"@+id/fl_hytechvedio_touch"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/full_transparent"
>
<LinearLayout
android:id=
"@+id/ll_hytechvedio_item"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom"
android:layout_marginLeft=
"30pt"
android:layout_marginRight=
"30pt"
android:layout_marginBottom=
"100pt"
android:background=
"@drawable/shape_vedio_white"
android:orientation=
"horizontal"
android:paddingLeft=
"30pt"
android:paddingTop=
"30pt"
android:paddingRight=
"40pt"
android:paddingBottom=
"30pt"
android:visibility=
"invisible"
>
<com.shehuan.niv.NiceImageView
android:id=
"@+id/ic_hytechvideo"
android:layout_width=
"110pt"
android:layout_height=
"110pt"
android:src=
"@mipmap/ic_launcher"
app:corner_radius=
"10dp"
/>
<RelativeLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_marginLeft=
"10pt"
android:layout_marginRight=
"10pt"
android:layout_weight=
"1"
android:paddingLeft=
"10pt"
>
<TextView
android:id=
"@+id/tv_hytechvideo_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"6pt"
android:textColor=
"@color/black"
android:textSize=
"12sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_hytechvideo_subtitle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/tv_hytechvideo_title"
android:textColor=
"@color/loan_tv_choose_paycash_text"
android:textSize=
"10sp"
/>
</RelativeLayout>
<TextView
android:id=
"@+id/tv_hytechvideo_next"
android:layout_width=
"78dp"
android:layout_height=
"32dp"
android:layout_gravity=
"center_vertical"
android:background=
"@drawable/shape_tv_gold"
android:gravity=
"center"
android:text=
"查看"
android:textColor=
"@color/white"
android:textSize=
"10sp"
/>
</LinearLayout>
</FrameLayout>
<RelativeLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_marginTop=
"70pt"
android:layout_marginRight=
"40pt"
>
<TextView
android:id=
"@+id/tv_hytechvedio_time"
android:layout_width=
"50pt"
android:layout_height=
"50pt"
android:background=
"@drawable/shape_back"
android:gravity=
"center"
android:textColor=
"@color/white"
android:textSize=
"12sp"
/>
<ImageView
android:id=
"@+id/iv_hytechvedio_back"
android:layout_width=
"50pt"
android:layout_height=
"50pt"
android:src=
"@mipmap/ic_cancel"
android:visibility=
"gone"
/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
GoodMoney/app/src/main/res/layout/fragment_main_kyl.xml
0 → 100644
View file @
5eeb81ae
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<com.androidkun.xtablayout.XTabLayout
android:id=
"@+id/xtFragmentXmly"
android:visibility=
"invisible"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:xTabIndicatorColor=
"#F28335"
app:xTabIndicatorHeight=
"4dp"
app:xTabIndicatorRoundX=
"30dp"
app:xTabIndicatorRoundY=
"30dp"
app:xTabIndicatorWidth=
"20dp"
app:xTabMode=
"scrollable"
app:xTabSelectedTextColor=
"@color/color_FF9837"
app:xTabSelectedTextSize=
"18sp"
app:xTabTextColor=
"#000"
app:xTabTextSize=
"14sp"
/>
<com.mints.goodmoney.ui.widgets.MyViewPager
android:id=
"@+id/vpFragmentXmly"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
GoodMoney/app/src/main/res/layout/fragment_main_kyl_page.xml
0 → 100755
View file @
5eeb81ae
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/color_50E8E8E8"
android:orientation=
"vertical"
>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id=
"@+id/srl_xmly"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:srlAccentColor=
"@color/gray"
app:srlPrimaryColor=
"@color/color_50E8E8E8"
>
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/xmlyPageVip"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"6dp"
android:layout_marginBottom=
"6dp"
android:background=
"@null"
android:overScrollMode=
"never"
/>
<com.scwang.smartrefresh.layout.footer.ClassicsFooter
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
GoodMoney/app/src/main/res/layout/item_rv_kyl_page.xml
0 → 100644
View file @
5eeb81ae
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"6dp"
android:background=
"@color/white"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/ivXmlyPage"
android:layout_width=
"match_parent"
android:layout_height=
"180dp"
android:scaleType=
"fitXY"
android:src=
"@mipmap/bg_eat"
/>
<TextView
android:id=
"@+id/tvXmlyPageContent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"6dp"
android:ellipsize=
"end"
android:lines=
"1"
android:singleLine=
"true"
android:text=
"123213112321311232131123213112321311232131123213112321311232131123213112321311232131"
android:textColor=
"@color/black"
android:textSize=
"14sp"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tvXmlyPagecount"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"6dp"
android:layout_marginBottom=
"6dp"
android:drawableLeft=
"@mipmap/ic_headset"
android:drawablePadding=
"6dp"
android:gravity=
"center_vertical"
android:text=
"7.2亿"
android:textColor=
"@color/color_AAA"
android:textSize=
"12sp"
/>
</LinearLayout>
\ 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