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
0c737d5a
Commit
0c737d5a
authored
Jan 26, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页新增微转分享
parent
3c9214ac
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
477 additions
and
176 deletions
+477
-176
proguard-rules.pro
GoodMoney/app/proguard-rules.pro
+2
-0
AppConfig.java
...p/src/main/java/com/mints/goodmoney/common/AppConfig.java
+10
-0
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+12
-11
TrackManager.java
...c/main/java/com/mints/goodmoney/manager/TrackManager.java
+6
-1
TzTaskBean.java
...c/main/java/com/mints/goodmoney/mvp/model/TzTaskBean.java
+15
-0
UserTaskMsgBean.java
...n/java/com/mints/goodmoney/mvp/model/UserTaskMsgBean.java
+21
-0
MyPresenter.kt
...in/java/com/mints/goodmoney/mvp/presenters/MyPresenter.kt
+4
-1
TaskPresenter.kt
.../java/com/mints/goodmoney/mvp/presenters/TaskPresenter.kt
+9
-7
TrackPresenter.java
...va/com/mints/goodmoney/mvp/presenters/TrackPresenter.java
+37
-0
LoanService.java
...pp/src/main/java/com/mints/goodmoney/net/LoanService.java
+6
-7
KylVideoActivity.kt
...java/com/mints/goodmoney/ui/activitys/KylVideoActivity.kt
+0
-1
MainActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
+105
-82
SplashYlhActivity.kt
...ava/com/mints/goodmoney/ui/activitys/SplashYlhActivity.kt
+1
-0
TaskActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/TaskActivity.kt
+65
-30
FriendsFragment.kt
...n/java/com/mints/goodmoney/ui/fragment/FriendsFragment.kt
+1
-1
HorizonChannelFragment.kt
...com/mints/goodmoney/ui/fragment/HorizonChannelFragment.kt
+2
-2
LiebaoGameFragment.kt
...ava/com/mints/goodmoney/ui/fragment/LiebaoGameFragment.kt
+1
-1
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+6
-2
MoneyFragment.kt
...ain/java/com/mints/goodmoney/ui/fragment/MoneyFragment.kt
+11
-12
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+5
-1
MyZhangyueFragment.kt
...ava/com/mints/goodmoney/ui/fragment/MyZhangyueFragment.kt
+1
-1
PanFragment.kt
.../main/java/com/mints/goodmoney/ui/fragment/PanFragment.kt
+1
-1
WzFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/WzFragment.kt
+129
-0
ZhangyueFragment.kt
.../java/com/mints/goodmoney/ui/fragment/ZhangyueFragment.kt
+1
-1
AppUtil.kt
...ey/app/src/main/java/com/mints/goodmoney/utils/AppUtil.kt
+1
-1
activity_main.xml
GoodMoney/app/src/main/res/layout/activity_main.xml
+13
-13
fragment_main_wz.xml
GoodMoney/app/src/main/res/layout/fragment_main_wz.xml
+12
-0
No files found.
GoodMoney/app/proguard-rules.pro
View file @
0c737d5a
...
...
@@ -627,6 +627,8 @@
# webView处理,项目中没有使用到webView忽略即可,webview与JS交互内部类不能混淆
-keepclassmembers class com.show.you.WebVerfiedActivity$MyHandler {*;}
-keepattributes *JavascriptInterface*
-keep public class com.mints.goodmoney.ui.fragment.WzFragment.JsObject.
*
*
# ======================= 微转分享 END ================
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/common/AppConfig.java
View file @
0c737d5a
...
...
@@ -100,4 +100,14 @@ public class AppConfig {
*/
public
static
boolean
needReportClickAdEvent
=
false
;
/**
* 首页是显示微转
*/
public
static
boolean
isMainShowWz
=
true
;
/**
* 微转金币
*/
public
static
int
wzReadCoin
=
300
;
}
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
0c737d5a
...
...
@@ -63,17 +63,18 @@ object Constant {
/**
* app应用首页 0-主页 1-横屏视频 2-pan 3-friends 4-我
*/
const
val
FRAGMENT_CLICK_MAIN
=
0
const
val
FRAGMENT_CLICK_CHANNEL
=
1
const
val
FRAGMENT_CLICK_PAN
=
2
const
val
FRAGMENT_CLICK_FRIENDS
=
3
const
val
FRAGMENT_CLICK_MY
=
4
const
val
FRAGMENT_TAG_MAIN
=
"FRAGMENT_TAG_MAIN"
const
val
FRAGMENT_TAG_CHANNEL
=
"FRAGMENT_TAG_CHANNEL"
const
val
FRAGMENT_TAG_PAN
=
"FRAGMENT_TAG_PAN"
const
val
FRAGMENT_TAG_FRIENDS
=
"FRAGMENT_TAG_FRIENDS"
const
val
FRAGMENT_TAG_MY
=
"FRAGMENT_TAG_MY"
const
val
FRAGMENT_CLICK_ONE
=
0
const
val
FRAGMENT_CLICK_TWO
=
1
const
val
FRAGMENT_CLICK_THREE
=
2
const
val
FRAGMENT_CLICK_FOUR
=
3
const
val
FRAGMENT_CLICK_FIVE
=
4
const
val
FRAGMENT_TAG_ONE
=
"FRAGMENT_TAG_ONE"
const
val
FRAGMENT_TAG_TWO
=
"FRAGMENT_TAG_TWO"
const
val
FRAGMENT_TAG_THREE
=
"FRAGMENT_TAG_THREE"
const
val
FRAGMENT_TAG_FOUR
=
"FRAGMENT_TAG_FOUR"
const
val
FRAGMENT_TAG_FIVE
=
"FRAGMENT_TAG_FIVE"
const
val
FRAGMENT_TAG_RSNEWS
=
"FRAGMENT_TAG_RSNEWS"
// 协议地址
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/TrackManager.java
View file @
0c737d5a
...
...
@@ -4,7 +4,6 @@ package com.mints.goodmoney.manager;
import
android.text.TextUtils
;
import
com.mints.goodmoney.MintsApplication
;
import
com.mints.goodmoney.common.AppConfig
;
import
com.mints.goodmoney.mvp.presenters.TrackPresenter
;
/**
...
...
@@ -98,4 +97,10 @@ public class TrackManager {
trackPresenter
.
getCommonHallBaseMsg
();
}
}
public
void
firstApiWithUid
()
{
if
(
trackPresenter
!=
null
)
{
trackPresenter
.
firstApiWithUid
();
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/TzTaskBean.java
View file @
0c737d5a
...
...
@@ -106,4 +106,19 @@ public class TzTaskBean {
this
.
currentPkgName
=
currentPkgName
;
}
@Override
public
String
toString
()
{
return
"TzTaskBean{"
+
"icon='"
+
icon
+
'\''
+
", title='"
+
title
+
'\''
+
", description='"
+
description
+
'\''
+
", app_url='"
+
app_url
+
'\''
+
", isShCpd="
+
isShCpd
+
", coralAd="
+
coralAd
+
", trackerBean="
+
trackerBean
+
", coin="
+
coin
+
", state="
+
state
+
", currentPkgName='"
+
currentPkgName
+
'\''
+
'}'
;
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/UserTaskMsgBean.java
View file @
0c737d5a
...
...
@@ -7,6 +7,7 @@ public class UserTaskMsgBean implements Serializable {
private
OfflineBean
offline
;
private
UserMsgBean
userMsg
;
private
ShareNewsBean
shareNews
;
private
VedioRulesBean
vedioRules
;
private
BlessingBigMsgBean
blessingBigMsg
;
private
UserRiskAppsBean
userRiskApps
;
...
...
@@ -29,10 +30,30 @@ public class UserTaskMsgBean implements Serializable {
return
blessingBigMsg
;
}
public
ShareNewsBean
getShareNews
()
{
return
shareNews
;
}
public
void
setShareNews
(
ShareNewsBean
shareNews
)
{
this
.
shareNews
=
shareNews
;
}
public
void
setBlessingBigMsgBean
(
BlessingBigMsgBean
blessingBigMsg
)
{
this
.
blessingBigMsg
=
blessingBigMsg
;
}
public
class
ShareNewsBean
implements
Serializable
{
private
int
readCoin
;
public
int
getReadCoin
()
{
return
readCoin
;
}
public
void
setReadCoin
(
int
readCoin
)
{
this
.
readCoin
=
readCoin
;
}
}
public
class
BlessingBigMsgBean
implements
Serializable
{
private
int
doubleCoin
;
private
int
surplusCount
;
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/MyPresenter.kt
View file @
0c737d5a
...
...
@@ -73,8 +73,11 @@ open class MyPresenter : BasePresenter<MyView>() {
}
fun
getAutoUserHallBaseMsg
()
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"isAndroid10"
]
=
TextUtils
.
isEmpty
(
DeviceInfo
.
instance
.
iMEI
)
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
autoUserHallBaseMsg
,
object
:
BaseSubscriber
<
BaseResponse
<
MyInfo
>>()
{
.
call
(
loanService
.
getAutoUserHallBaseMsg
(
vo
)
,
object
:
BaseSubscriber
<
BaseResponse
<
MyInfo
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/TaskPresenter.kt
View file @
0c737d5a
package
com.mints.goodmoney.mvp.presenters
import
android.text.TextUtils
import
com.google.gson.Gson
import
com.google.gson.JsonObject
import
com.mints.goodmoney.common.DeviceInfo
import
com.mints.goodmoney.manager.AppHttpManager
import
com.mints.goodmoney.manager.CpdManager
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.model.CpdModelBean
import
com.mints.goodmoney.mvp.views.TaskView
import
com.mints.goodmoney.net.CpdService
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
class
TaskPresenter
:
BasePresenter
<
TaskView
>()
{
fun
getShCpdTime
()
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"isAndroid10"
]
=
TextUtils
.
isEmpty
(
DeviceInfo
.
instance
.
iMEI
)
view
.
showLoading
(
"加载中..."
)
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
shCpdTime
,
.
call
(
loanService
.
getShCpdTime
(
vo
)
,
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onCompleted
()
{
}
override
fun
onError
(
e
:
Throwable
)
{
}
override
fun
onError
(
e
:
Throwable
)
{}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
JsonObject
>)
{
if
(
isLinkView
)
return
...
...
@@ -36,7 +39,6 @@ class TaskPresenter : BasePresenter<TaskView>() {
view
.
getShCpdTimeSuc
(
data
.
get
(
"needSeconds"
).
asInt
,
data
.
get
(
"CPD"
).
asInt
,
data
.
get
(
"CPD_SYD"
).
asInt
)
}
}
else
->
view
.
showToast
(
message
)
}
}
})
...
...
@@ -66,7 +68,6 @@ class TaskPresenter : BasePresenter<TaskView>() {
}
override
fun
onError
(
e
:
Throwable
)
{
LogUtil
.
d
(
""
+
e
.
code
+
" -> "
+
e
.
message
)
view
.
getCpdModelFail
()
}
...
...
@@ -78,10 +79,11 @@ class TaskPresenter : BasePresenter<TaskView>() {
val
data
=
response
.
data
if
(
data
!=
null
)
{
view
.
getCpdModelSuc
(
data
)
}
else
{
view
.
getCpdModelFail
()
}
}
else
{
view
.
getCpdModelFail
()
view
.
showToast
(
response
.
message
)
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/TrackPresenter.java
View file @
0c737d5a
package
com
.
mints
.
goodmoney
.
mvp
.
presenters
;
import
com.google.gson.JsonObject
;
import
com.mints.goodmoney.common.AppConfig
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.manager.AppHttpManager
;
...
...
@@ -183,4 +184,40 @@ public class TrackPresenter extends BaseTrackPresenter {
}
});
}
/**
* 首页是否显示微转
*/
public
void
firstApiWithUid
()
{
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"param"
,
"param"
);
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
firstApiWithUid
(
vo
),
new
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
@Override
public
void
onCompleted
()
{
}
@Override
public
void
onError
(
Throwable
e
)
{
}
@Override
public
void
onNext
(
BaseResponse
<
JsonObject
>
baseResponse
)
{
try
{
if
(
baseResponse
.
getStatus
()
==
200
)
{
JsonObject
data
=
baseResponse
.
getData
();
if
(
data
!=
null
)
{
AppConfig
.
isMainShowWz
=
data
.
get
(
"showCallShow"
).
getAsBoolean
();
}
else
{
AppConfig
.
isMainShowWz
=
false
;
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
});
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/net/LoanService.java
View file @
0c737d5a
...
...
@@ -397,8 +397,8 @@ public interface LoanService {
*
* @return
*/
@POST
(
"api/getAutoUserHallBaseMsg"
)
Observable
<
BaseResponse
<
MyInfo
>>
getAutoUserHallBaseMsg
();
@POST
(
"api/
114/
getAutoUserHallBaseMsg"
)
Observable
<
BaseResponse
<
MyInfo
>>
getAutoUserHallBaseMsg
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 饭补
...
...
@@ -533,8 +533,8 @@ public interface LoanService {
*
* @return
*/
@POST
(
"api/getCPDBaseMsg"
)
Observable
<
BaseResponse
<
JsonObject
>>
getShCpdTime
();
@POST
(
"api/
114/
getCPDBaseMsg"
)
Observable
<
BaseResponse
<
JsonObject
>>
getShCpdTime
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 获取用户配置信息
...
...
@@ -549,9 +549,8 @@ public interface LoanService {
*
* @return
*/
// @Headers({"domain_name: domain_musesmobi"})
@POST
(
"api/cpd/1/detail/default"
)
Observable
<
BaseResponse
<
JsonObject
>>
getCpdDetail
(
@HeaderMap
Map
<
String
,
String
>
headers
,
@Body
Map
<
String
,
Object
>
vo
);
@POST
(
"api//firstApiWithUid"
)
Observable
<
BaseResponse
<
JsonObject
>>
firstApiWithUid
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 默认http工厂
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/KylVideoActivity.kt
View file @
0c737d5a
...
...
@@ -5,7 +5,6 @@ import android.media.MediaPlayer
import
android.os.Bundle
import
android.text.TextUtils
import
android.view.View
import
android.widget.VideoView
import
com.downloader.Error
import
com.downloader.OnDownloadListener
import
com.downloader.PRDownloader
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
View file @
0c737d5a
...
...
@@ -18,7 +18,6 @@ import com.mints.goodmoney.manager.ZhangyueManager
import
com.mints.goodmoney.mvp.views.MainView
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.fragment.*
import
com.mints.goodmoney.utils.IPUtil
import
kotlinx.android.synthetic.main.activity_main.*
/**
...
...
@@ -34,9 +33,13 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
// 底部标签切换的Fragment
private
var
moneyFragment
:
Fragment
?
=
null
private
var
panFragment
:
Fragment
?
=
null
private
var
friendsFragment
:
Fragment
?
=
null
// private var friendsFragment: Fragment? = null
private
var
myFragment
:
Fragment
?
=
null
private
var
channelFragment
:
Fragment
?
=
null
private
var
kuYinyueFragment
:
Fragment
?
=
null
private
var
wzFragment
:
Fragment
?
=
null
private
var
currentFragment
:
Fragment
?
=
null
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_main
...
...
@@ -49,6 +52,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
if
(
moneyFragment
==
null
)
{
moneyFragment
=
MoneyFragment
()
}
if
(!
moneyFragment
!!
.
isAdded
)
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
...
...
@@ -57,14 +61,21 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
// 记录当前Fragment
currentFragment
=
moneyFragment
}
tab_iv_main
.
isSelected
=
true
tab_tv_main
.
isSelected
=
true
tab_rl_main
.
setOnClickListener
(
this
)
tab_rl_pan
.
setOnClickListener
(
this
)
tab_rl_channel
.
setOnClickListener
(
this
)
tab_rl_friends
.
setOnClickListener
(
this
)
tab_rl_my
.
setOnClickListener
(
this
)
if
(
AppConfig
.
isMainShowWz
)
{
tab_tv_four
.
text
=
"新闻分享"
}
else
{
tab_tv_four
.
text
=
"来电秀"
}
tab_iv_one
.
isSelected
=
true
tab_tv_one
.
isSelected
=
true
tab_rl_one
.
setOnClickListener
(
this
)
tab_rl_three
.
setOnClickListener
(
this
)
tab_rl_two
.
setOnClickListener
(
this
)
tab_rl_four
.
setOnClickListener
(
this
)
tab_rl_five
.
setOnClickListener
(
this
)
}
override
fun
isApplyKitKatTranslucency
()
=
false
...
...
@@ -111,11 +122,11 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override
fun
onClick
(
view
:
View
)
{
when
(
view
.
id
)
{
R
.
id
.
tab_rl_
main
->
clickTab1Layout
()
R
.
id
.
tab_rl_
channel
->
clickTab2Layout
()
R
.
id
.
tab_rl_f
riends
->
clickTab4Layout
()
R
.
id
.
tab_rl_
pan
->
clickTab3Layout
()
R
.
id
.
tab_rl_
my
->
clickTab5Layout
()
R
.
id
.
tab_rl_
one
->
clickTab1Layout
()
R
.
id
.
tab_rl_
two
->
clickTab2Layout
()
R
.
id
.
tab_rl_f
our
->
clickTab4Layout
()
R
.
id
.
tab_rl_
three
->
clickTab3Layout
()
R
.
id
.
tab_rl_
five
->
clickTab5Layout
()
}
}
...
...
@@ -123,22 +134,22 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
* 点击第一个tab
*/
fun
clickTab1Layout
()
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_
MAIN
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_
ONE
if
(
moneyFragment
==
null
)
{
moneyFragment
=
MoneyFragment
()
}
addOrShowFragment
(
supportFragmentManager
,
moneyFragment
!!
,
Constant
.
FRAGMENT_TAG_
MAIN
)
addOrShowFragment
(
supportFragmentManager
,
moneyFragment
!!
,
Constant
.
FRAGMENT_TAG_
ONE
)
tab_iv_
main
.
isSelected
=
true
tab_tv_
main
.
isSelected
=
true
tab_iv_
channel
.
isSelected
=
false
tab_tv_
channel
.
isSelected
=
false
// tab_iv_
pan
.isSelected = false
// tab_tv_
pan
.isSelected = false
tab_iv_f
riends
.
isSelected
=
false
tab_tv_f
riends
.
isSelected
=
false
tab_iv_
my
.
isSelected
=
false
tab_tv_
my
.
isSelected
=
false
tab_iv_
one
.
isSelected
=
true
tab_tv_
one
.
isSelected
=
true
tab_iv_
two
.
isSelected
=
false
tab_tv_
two
.
isSelected
=
false
// tab_iv_
three
.isSelected = false
// tab_tv_
three
.isSelected = false
tab_iv_f
our
.
isSelected
=
false
tab_tv_f
our
.
isSelected
=
false
tab_iv_
five
.
isSelected
=
false
tab_tv_
five
.
isSelected
=
false
}
fun
selectVedio
()
{
...
...
@@ -169,22 +180,22 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
/**
* 点击第二个tab
*/
public
fun
clickTab2Layout
()
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_
CHANNEL
fun
clickTab2Layout
()
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_
TWO
if
(
channelFragment
==
null
)
{
channelFragment
=
HorizonChannelFragment
()
}
addOrShowFragment
(
supportFragmentManager
,
channelFragment
!!
,
Constant
.
FRAGMENT_TAG_
CHANNEL
)
tab_iv_
main
.
isSelected
=
false
tab_tv_
main
.
isSelected
=
false
tab_iv_
channel
.
isSelected
=
true
tab_tv_
channel
.
isSelected
=
true
// tab_iv_
pan
.isSelected = false
// tab_tv_
pan
.isSelected = false
tab_iv_f
riends
.
isSelected
=
false
tab_tv_f
riends
.
isSelected
=
false
tab_iv_
my
.
isSelected
=
false
tab_tv_
my
.
isSelected
=
false
addOrShowFragment
(
supportFragmentManager
,
channelFragment
!!
,
Constant
.
FRAGMENT_TAG_
TWO
)
tab_iv_
one
.
isSelected
=
false
tab_tv_
one
.
isSelected
=
false
tab_iv_
two
.
isSelected
=
true
tab_tv_
two
.
isSelected
=
true
// tab_iv_
three
.isSelected = false
// tab_tv_
three
.isSelected = false
tab_iv_f
our
.
isSelected
=
false
tab_tv_f
our
.
isSelected
=
false
tab_iv_
five
.
isSelected
=
false
tab_tv_
five
.
isSelected
=
false
}
...
...
@@ -192,63 +203,75 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
* 点击第四个tab
*/
fun
clickTab4Layout
()
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_FRIENDS
if
(
friendsFragment
==
null
)
{
friendsFragment
=
FriendsFragment
()
}
addOrShowFragment
(
supportFragmentManager
,
friendsFragment
!!
,
Constant
.
FRAGMENT_TAG_FRIENDS
)
tab_iv_main
.
isSelected
=
false
tab_tv_main
.
isSelected
=
false
tab_iv_channel
.
isSelected
=
false
tab_tv_channel
.
isSelected
=
false
// tab_iv_pan.isSelected = false
// tab_tv_pan.isSelected = false
tab_iv_friends
.
isSelected
=
true
tab_tv_friends
.
isSelected
=
true
tab_iv_my
.
isSelected
=
false
tab_tv_my
.
isSelected
=
false
// 是否显示微转
if
(
AppConfig
.
isMainShowWz
)
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_FOUR
if
(
wzFragment
==
null
)
{
wzFragment
=
WzFragment
()
}
addOrShowFragment
(
supportFragmentManager
,
wzFragment
!!
,
Constant
.
FRAGMENT_TAG_FOUR
)
}
else
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_FOUR
if
(
kuYinyueFragment
==
null
)
{
kuYinyueFragment
=
KuYinYueFragment
()
}
addOrShowFragment
(
supportFragmentManager
,
kuYinyueFragment
!!
,
Constant
.
FRAGMENT_TAG_FOUR
)
}
tab_iv_one
.
isSelected
=
false
tab_tv_one
.
isSelected
=
false
tab_iv_two
.
isSelected
=
false
tab_tv_two
.
isSelected
=
false
// tab_iv_three.isSelected = false
// tab_tv_three.isSelected = false
tab_iv_four
.
isSelected
=
true
tab_tv_four
.
isSelected
=
true
tab_iv_five
.
isSelected
=
false
tab_tv_five
.
isSelected
=
false
}
/**
* 点击第三个tab
*/
private
fun
clickTab3Layout
()
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_
PAN
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_
THREE
if
(
panFragment
==
null
)
{
panFragment
=
PanFragment
()
}
addOrShowFragment
(
supportFragmentManager
,
panFragment
!!
,
Constant
.
FRAGMENT_TAG_
PAN
)
tab_iv_
main
.
isSelected
=
false
tab_tv_
main
.
isSelected
=
false
tab_iv_
channel
.
isSelected
=
false
tab_tv_
channel
.
isSelected
=
false
// tab_iv_
pan
.isSelected = true
// tab_tv_
pan
.isSelected = true
tab_iv_f
riends
.
isSelected
=
false
tab_tv_f
riends
.
isSelected
=
false
tab_iv_
my
.
isSelected
=
false
tab_tv_
my
.
isSelected
=
false
addOrShowFragment
(
supportFragmentManager
,
panFragment
!!
,
Constant
.
FRAGMENT_TAG_
THREE
)
tab_iv_
one
.
isSelected
=
false
tab_tv_
one
.
isSelected
=
false
tab_iv_
two
.
isSelected
=
false
tab_tv_
two
.
isSelected
=
false
// tab_iv_
three
.isSelected = true
// tab_tv_
three
.isSelected = true
tab_iv_f
our
.
isSelected
=
false
tab_tv_f
our
.
isSelected
=
false
tab_iv_
five
.
isSelected
=
false
tab_tv_
five
.
isSelected
=
false
}
/**
* 点击第五个tab
*/
private
fun
clickTab5Layout
()
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_
MY
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_
FIVE
if
(
myFragment
==
null
)
{
myFragment
=
MyFragment
()
}
addOrShowFragment
(
supportFragmentManager
,
myFragment
!!
,
Constant
.
FRAGMENT_TAG_
MY
)
tab_iv_
main
.
isSelected
=
false
tab_tv_
main
.
isSelected
=
false
tab_iv_
channel
.
isSelected
=
false
tab_tv_
channel
.
isSelected
=
false
// tab_iv_
pan
.isSelected = false
// tab_tv_
pan
.isSelected = false
tab_iv_f
riends
.
isSelected
=
false
tab_tv_f
riends
.
isSelected
=
false
tab_iv_
my
.
isSelected
=
true
tab_tv_
my
.
isSelected
=
true
addOrShowFragment
(
supportFragmentManager
,
myFragment
!!
,
Constant
.
FRAGMENT_TAG_
FIVE
)
tab_iv_
one
.
isSelected
=
false
tab_tv_
one
.
isSelected
=
false
tab_iv_
two
.
isSelected
=
false
tab_tv_
two
.
isSelected
=
false
// tab_iv_
three
.isSelected = false
// tab_tv_
three
.isSelected = false
tab_iv_f
our
.
isSelected
=
false
tab_tv_f
our
.
isSelected
=
false
tab_iv_
five
.
isSelected
=
true
tab_tv_
five
.
isSelected
=
true
}
/**
...
...
@@ -270,11 +293,11 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
currentFragment
=
fragment
}
fun
showShortVedioLayout
(){
fun
showShortVedioLayout
()
{
if
(
AppConfig
.
showAdFlag
)
{
tab_rl_
channel
.
visibility
=
View
.
VISIBLE
tab_rl_
two
.
visibility
=
View
.
VISIBLE
}
else
{
tab_rl_
channel
.
visibility
=
View
.
GONE
tab_rl_
two
.
visibility
=
View
.
GONE
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/SplashYlhActivity.kt
View file @
0c737d5a
...
...
@@ -65,6 +65,7 @@ class SplashYlhActivity : BaseActivity(), SplashADListener {
return
}
TrackManager
.
getInstance
().
getCommonHallBaseMsg
()
TrackManager
.
getInstance
().
firstApiWithUid
()
// 校验APP签名
checkAppSign
()
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/TaskActivity.kt
View file @
0c737d5a
...
...
@@ -35,7 +35,6 @@ import com.tz.sdk.coral.callback.h5.DownloadProcess
import
kotlinx.android.synthetic.main.activity_task.*
import
kotlinx.android.synthetic.main.header_layout.*
/**
*
* 描述:试玩任务
...
...
@@ -150,8 +149,6 @@ class TaskActivity : BaseActivity(), TaskView,
shMax
=
CPD
cpdMax
=
CPD_SYD
isTwiceGetCpd
=
false
if
((
shMax
+
cpdMax
)
<=
0
)
{
hideLoading
()
showToast
(
"今日任务已完成,请明日再试"
)
...
...
@@ -159,13 +156,23 @@ class TaskActivity : BaseActivity(), TaskView,
return
}
isTwiceGetCpd
=
false
shLoadCountTime
=
0
cpdLoadCountTime
=
0
mFakeTaskList
.
clear
()
if
(
shMax
>
0
&&
(
cpdMax
>
0
||
cpdMax
==
0
))
{
for
(
i
in
0
until
shMax
)
{
mCoralDownload
?.
pull
()
}
}
else
if
(
cpdMax
>
0
)
{
for
(
i
in
0
until
cpdMax
)
{
loadCPDData
()
}
}
}
override
fun
getCpdModelSuc
(
dataBean
:
CpdModelBean
.
DataBean
)
{
...
...
@@ -177,9 +184,10 @@ class TaskActivity : BaseActivity(), TaskView,
}
LogUtil
.
d
(
TAG_LOG
,
"CPD -> getCpdModelSuc CPD-PKG -> "
+
dataBean
.
materials
[
0
].
app_apk_name
)
LogUtil
.
d
(
TAG_LOG
,
"CPD -> getCpdModelSuc cpdLoadCountTime -> "
+
cpdLoadCountTime
)
// 多拉取的CPD广告
if
(
cpdLoadCountTime
++
=
=
cpdMax
-
1
)
{
if
(
cpdLoadCountTime
++
>
=
cpdMax
-
1
)
{
getCpdRepeatPkg
()
}
}
...
...
@@ -189,12 +197,14 @@ class TaskActivity : BaseActivity(), TaskView,
*/
private
fun
getCpdRepeatPkg
()
{
if
(
isTwiceGetCpd
)
{
LogUtil
.
d
(
"isTwiceGetCpd"
)
if
(
cpdLoadCountTime
>=
cpdMax
)
{
LogUtil
.
d
(
"BBBBBB"
)
notifyDataAndShowAd
()
}
return
}
var
thatC
pdLoadCountTime
=
cpdMax
c
pdLoadCountTime
=
cpdMax
RxjavaUtil
.
executeRxTask
<
MutableList
<
TzTaskBean
>>(
object
:
CommonRxTask
<
MutableList
<
TzTaskBean
>>()
{
override
fun
doInIOThread
()
{
...
...
@@ -205,19 +215,26 @@ class TaskActivity : BaseActivity(), TaskView,
if
(
mFakeTaskList
[
i
].
isShCpd
)
{
newPkgData
.
add
(
mFakeTaskList
[
i
])
}
else
{
var
flag
=
true
for
(
j
in
0
until
mFakeTaskList
.
size
)
{
if
(!
mFakeTaskList
[
j
].
isShCpd
&&
!
mFakeTaskList
[
i
].
isShCpd
)
{
if
(
mFakeTaskList
[
j
].
currentPkgName
==
mFakeTaskList
[
i
].
currentPkgName
)
{
// 是否已经安装此app
if
(!
DeviceInfo
.
instance
.
isLoadingPkg
(
mFakeTaskList
[
j
].
currentPkgName
))
{
newPkgData
.
add
(
mFakeTaskList
[
j
])
}
else
{
thatCpdLoadCountTime
--
if
(!
mFakeTaskList
[
i
].
isShCpd
&&
!
mFakeTaskList
[
j
].
isShCpd
)
{
// 数据重复
if
(
i
!=
j
&&
mFakeTaskList
[
i
].
currentPkgName
==
mFakeTaskList
[
j
].
currentPkgName
)
{
flag
=
false
break
}
}
else
{
thatCpdLoadCountTime
--
}
}
if
(
flag
)
{
// 是否已经安装此app
if
(!
DeviceInfo
.
instance
.
isLoadingPkg
(
mFakeTaskList
[
i
].
currentPkgName
))
{
cpdLoadCountTime
--
newPkgData
.
add
(
mFakeTaskList
[
i
])
}
}
}
}
...
...
@@ -231,17 +248,19 @@ class TaskActivity : BaseActivity(), TaskView,
mFakeTaskList
.
clear
()
mFakeTaskList
.
addAll
(
t
)
LogUtil
.
d
(
"列表数据"
+
"-->"
+
mFakeTaskLis
t
.
size
)
LogUtil
.
d
(
"列表数据"
+
"-->"
+
t
.
size
)
LogUtil
.
d
(
"thatCpdLoadCountTime
"
+
"-->"
+
thatCpdLoadCountTime
)
LogUtil
.
d
(
"thatCpdLoadCountTime
-->$cpdLoadCountTime"
)
// 重新获取数据
if
(
thatCpdLoadCountTime
<
cpdMax
-
1
)
{
if
(
cpdLoadCountTime
in
1
..
cpdMax
)
{
isTwiceGetCpd
=
true
for
(
i
in
thatCpdLoadCountTime
until
cpdMax
)
{
for
(
i
in
0
until
cpdLoadCountTime
)
{
loadCPDData
()
}
cpdLoadCountTime
=
cpdMax
-
cpdLoadCountTime
return
}
else
{
notifyDataAndShowAd
()
...
...
@@ -252,15 +271,19 @@ class TaskActivity : BaseActivity(), TaskView,
})
}
fun
notifyDataAndShowAd
()
{
private
fun
notifyDataAndShowAd
()
{
hideLoading
()
srl_task
.
finishRefresh
()
mTaskAdapter
?.
notifyDataSetChanged
()
for
(
tzTaskBean
in
mFakeTaskList
)
{
if
(!
tzTaskBean
.
isShCpd
)
{
val
trackerBean
=
tzTaskBean
.
trackerBean
if
(
trackerBean
!=
null
)
{
LogUtil
.
d
(
"AAAAA"
)
LogUtil
.
d
(
TAG_LOG
,
"CPD -> show"
)
// 上报CPD显示
...
...
@@ -271,8 +294,10 @@ class TaskActivity : BaseActivity(), TaskView,
}
override
fun
getCpdModelFail
()
{
if
(
cpdLoadCountTime
++
>=
cpdMax
-
1
)
{
notifyDataAndShowAd
()
}
}
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
loadData
()
...
...
@@ -288,7 +313,12 @@ class TaskActivity : BaseActivity(), TaskView,
}
// 多拉取的广告
if
(
shLoadCountTime
++
==
shMax
-
1
)
{
if
(
shLoadCountTime
++
>=
shMax
-
1
)
{
if
(
cpdMax
==
0
)
{
notifyDataAndShowAd
()
return
}
for
(
i
in
0
until
cpdMax
)
{
loadCPDData
()
}
...
...
@@ -298,10 +328,15 @@ class TaskActivity : BaseActivity(), TaskView,
override
fun
onLoadFail
()
{
// 次数刷新完 且未拿到数据 提示
if
(
mFakeTaskList
.
size
==
0
)
{
hideLoading
()
// showToast("加载失败,请下拉刷新重试")
srl_task
.
finishRefresh
(
false
)
if
(
shLoadCountTime
++
>=
shMax
-
1
)
{
if
(
cpdMax
==
0
)
{
notifyDataAndShowAd
()
return
}
for
(
i
in
0
until
cpdMax
)
{
loadCPDData
()
}
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/FriendsFragment.kt
View file @
0c737d5a
...
...
@@ -161,7 +161,7 @@ class FriendsFragment : BaseFragment(), FriendsView, OnRefreshListener, View.OnC
override
fun
onResume
()
{
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_F
RIENDS
)
{
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_F
OUR
)
{
if
(!
TextUtils
.
isEmpty
(
UserManager
.
getInstance
().
userID
))
{
// 刷新分红数据
friendsPresenter
.
getFriendHallMsg
()
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/HorizonChannelFragment.kt
View file @
0c737d5a
...
...
@@ -85,7 +85,7 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
override
fun
onResume
()
{
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
CHANNEL
)
{
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
TWO
)
{
// 调用金币视频信息接口
horizChannelPresenter
.
getSmallHomeVedioBaseMsg
()
...
...
@@ -105,7 +105,7 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
override
fun
onPause
()
{
super
.
onPause
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
CHANNEL
)
{
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
TWO
)
{
YLPlayerConfig
.
config
().
unRegisterPlayerCallback
()
}
// 福袋动画停止
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/LiebaoGameFragment.kt
View file @
0c737d5a
...
...
@@ -52,7 +52,7 @@ class LiebaoGameFragment : LazyLoadBaseFragment(), GameView,
override
fun
onFragmentResume
()
{
super
.
onFragmentResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
MAIN
)
{
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
ONE
)
{
gvGameLiebao
.
inflate
(
activity
)
LogUtil
.
d
(
"LiebaoGameFragment"
,
"onFragmentResume"
)
gamePresenter
.
getGameInfo
()
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
0c737d5a
...
...
@@ -131,7 +131,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override
fun
onResume
()
{
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
MAIN
)
{
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
ONE
)
{
if
(!
TextUtils
.
isEmpty
(
userManager
?.
userID
))
{
homePresenter
.
getHallBaseMsg
()
}
else
{
...
...
@@ -162,7 +162,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override
fun
onPause
()
{
super
.
onPause
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
MAIN
)
{
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
ONE
)
{
YLPlayerConfig
.
config
().
unRegisterPlayerCallback
()
}
// 福袋动画停止
...
...
@@ -214,6 +214,10 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
userMsgBean
=
data
if
(
userMsgBean
?.
shareNews
!=
null
)
{
AppConfig
.
wzReadCoin
=
userMsgBean
!!
.
shareNews
.
readCoin
}
// 保存Ip,用于穿山甲回调校验
ps
.
put
(
Constant
.
CSJ_VEDIO_APPIP
,
data
.
ip
)
AppConfig
.
app_black_name
=
data
.
userRiskApps
.
userRiskAppName
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MoneyFragment.kt
View file @
0c737d5a
...
...
@@ -28,10 +28,10 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
private
var
currentFragment
:
Fragment
?
=
null
private
var
mainFragment
:
Fragment
?
=
null
private
var
bookStoreFragment
:
Fragment
?
=
null
private
var
newsFragment
:
Fragment
?
=
null
//
private var newsFragment: Fragment? = null
private
var
xmlyGameFragment
:
Fragment
?
=
null
private
var
liebaoGameFragment
:
Fragment
?
=
null
private
var
kuYinyueFragment
:
Fragment
?
=
null
//
private var kuYinyueFragment: Fragment? = null
private
var
curPosition
=
0
//当前标签选中的下标
...
...
@@ -186,7 +186,6 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
addOrShowFragment
(
childFragmentManager
,
xmlyGameFragment
!!
,
FRAGMENT_TAG_XMLY
)
}
}
1
->
{
if
(
AppConfig
.
showAdFlag
)
{
...
...
@@ -213,18 +212,18 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
}
addOrShowFragment
(
childFragmentManager
,
xmlyGameFragment
!!
,
FRAGMENT_TAG_XMLY
)
}
// 3 -> {
// if (liebaoGameFragment == null) {
// liebaoGameFragment = LiebaoGameFragment()
// }
// addOrShowFragment(childFragmentManager, liebaoGameFragment!!, FRAGMENT_TAG_GAME)
// }
3
->
{
if
(
kuYinyu
eFragment
==
null
)
{
kuYinyueFragment
=
KuYinYu
eFragment
()
if
(
liebaoGam
eFragment
==
null
)
{
liebaoGameFragment
=
LiebaoGam
eFragment
()
}
addOrShowFragment
(
childFragmentManager
,
kuYinyueFragment
!!
,
FRAGMENT_TAG_KYL
)
addOrShowFragment
(
childFragmentManager
,
liebaoGameFragment
!!
,
FRAGMENT_TAG_GAME
)
}
// 3 -> {
// if (kuYinyueFragment == null) {
// kuYinyueFragment = KuYinYueFragment()
// }
// addOrShowFragment(childFragmentManager, kuYinyueFragment!!, FRAGMENT_TAG_KYL)
// }
}
curPosition
=
tab
.
position
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
0c737d5a
...
...
@@ -128,7 +128,7 @@ class MyFragment : BaseFragment(),
override
fun
onResume
()
{
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
MY
)
{
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
FIVE
)
{
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
myPresenter
.
getAutoUserHallBaseMsg
()
refreshHighTask
()
...
...
@@ -249,6 +249,10 @@ class MyFragment : BaseFragment(),
return
}
if
(
data
?.
shareNews
!=
null
)
{
AppConfig
.
wzReadCoin
=
data
!!
.
shareNews
.
readCoin
}
// 更新权重
initAdWeight
(
data
)
AppConfig
.
app_black_name
=
data
.
userRiskApps
.
userRiskAppName
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyZhangyueFragment.kt
View file @
0c737d5a
...
...
@@ -47,7 +47,7 @@ class MyZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadCh
override
fun
onFragmentResume
()
{
super
.
onFragmentResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
MAIN
)
{
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
ONE
)
{
bookPresenter
.
getReadInfo
()
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/PanFragment.kt
View file @
0c737d5a
...
...
@@ -62,7 +62,7 @@ class PanFragment : BaseFragment(), PanView {
override
fun
onResume
()
{
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
PAN
)
{
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
THREE
)
{
if
(
TextUtils
.
isEmpty
(
userManager
?.
userID
))
{
// 游客登录
panPresenter
.
userLogin
()
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/WzFragment.kt
0 → 100644
View file @
0c737d5a
package
com.mints.goodmoney.ui.fragment
import
android.annotation.SuppressLint
import
android.text.TextUtils
import
android.webkit.*
import
cn.sharesdk.framework.Platform
import
cn.sharesdk.framework.PlatformActionListener
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.wechat.friends.Wechat
import
cn.sharesdk.wechat.moments.WechatMoments
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.views.BaseView
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.goodmoney.utils.ToastUtil
import
kotlinx.android.synthetic.main.fragment_main_wz.*
import
java.lang.StringBuilder
import
java.util.HashMap
/**
* 描述:微转分享
* 作者:孟崔广
* 时间:2020/9/20 17:30
*/
@SuppressLint
(
"SetJavaScriptEnabled"
)
class
WzFragment
:
BaseFragment
(),
BaseView
{
private
val
userManager
by
lazy
{
UserManager
.
getInstance
()
}
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_wz
override
fun
initViewsAndEvents
()
{
}
override
fun
onHiddenChanged
(
hidden
:
Boolean
)
{
if
(
hidden
)
{
// 不在最前端界面显示
onPause
()
}
else
{
// 重新显示到最前端中
onResume
()
}
super
.
onHiddenChanged
(
hidden
)
}
override
fun
onResume
()
{
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_FOUR
)
{
if
(
TextUtils
.
isEmpty
(
userManager
?.
userID
))
{
// 游客登录
}
else
{
loadWzUrl
()
}
}
}
/**
* 加载微转url
*/
private
fun
loadWzUrl
()
{
getWzUrl
()
blTurntableWebview
.
webChromeClient
=
WebChromeClient
()
blTurntableWebview
.
webViewClient
=
object
:
WebViewClient
()
{}
blTurntableWebview
.
addJavascriptInterface
(
object
:
JsObject
()
{},
"mobile"
)
val
settings
=
blTurntableWebview
.
settings
settings
.
javaScriptEnabled
=
true
}
/**
* 获取微转url
*/
private
fun
getWzUrl
()
{
val
sb
=
StringBuilder
()
sb
.
append
(
"http://api.wenlv-kd.com/h5/init.html?appkey=haozhuanqian&appid=169"
)
.
append
(
"&userid="
+
userManager
.
userID
)
.
append
(
"&reward="
+
AppConfig
.
wzReadCoin
)
.
append
(
"&unit="
+
"金币"
)
blTurntableWebview
.
loadUrl
(
sb
.
toString
())
}
open
class
JsObject
{
/**
* 分享文章
*/
@JavascriptInterface
fun
shareArticle
(
shareImageUrl
:
String
,
shareTarget
:
String
,
shareTitle
:
String
,
shareUrl
:
String
,
shareContent
:
String
)
{
val
wechatSp
=
Platform
.
ShareParams
()
wechatSp
.
shareType
=
Platform
.
SHARE_WEBPAGE
wechatSp
.
imageUrl
=
shareImageUrl
wechatSp
.
title
=
shareTitle
wechatSp
.
url
=
shareUrl
wechatSp
.
text
=
shareContent
val
wechatTarget
:
Platform
=
when
(
shareTarget
)
{
"timegroup"
->
{
ShareSDK
.
getPlatform
(
Wechat
.
NAME
)
}
"timeline"
->
{
ShareSDK
.
getPlatform
(
WechatMoments
.
NAME
)
}
else
->
{
ShareSDK
.
getPlatform
(
Wechat
.
NAME
)
}
}
if
(
wechatTarget
.
isClientValid
)
{
wechatTarget
.
platformActionListener
=
object
:
PlatformActionListener
{
override
fun
onComplete
(
p0
:
Platform
?,
p1
:
Int
,
p2
:
HashMap
<
String
,
Any
>?)
{
}
override
fun
onError
(
p0
:
Platform
?,
p1
:
Int
,
p2
:
Throwable
?)
{
}
override
fun
onCancel
(
p0
:
Platform
?,
p1
:
Int
)
{
}
}
wechatTarget
.
share
(
wechatSp
)
}
else
{
ToastUtil
.
show
(
MintsApplication
.
getContext
(),
"请先安装微信"
)
}
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/ZhangyueFragment.kt
View file @
0c737d5a
...
...
@@ -46,7 +46,7 @@ class ZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChan
override
fun
onFragmentResume
()
{
super
.
onFragmentResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
MAIN
)
{
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_
ONE
)
{
bookPresenter
.
getReadInfo
()
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/utils/AppUtil.kt
View file @
0c737d5a
...
...
@@ -118,7 +118,7 @@ object AppUtil {
if
(
StringUtilMy
.
stringAvalable
(
paramString
)
&&
checkPackInfo
(
paramContext
,
paramString
)
&&
Build
.
VERSION
.
SDK_INT
>=
21
)
{
val
usageStatsManager
=
paramContext
.
getSystemService
(
"usagestats"
)
as
UsageStatsManager
var
l
=
System
.
currentTimeMillis
()
val
list
=
usageStatsManager
.
queryUsageStats
(
4
,
l
-
5
*
6
*
1000L
,
l
)
val
list
=
usageStatsManager
.
queryUsageStats
(
4
,
l
-
2
*
6
*
1000L
,
l
)
if
(
list
!=
null
&&
list
.
size
>
0
)
for
(
i
in
list
.
indices
)
{
val
str
=
(
list
[
i
]
as
UsageStats
).
packageName
(
list
[
i
]
as
UsageStats
).
lastTimeUsed
...
...
GoodMoney/app/src/main/res/layout/activity_main.xml
View file @
0c737d5a
...
...
@@ -27,7 +27,7 @@
android:orientation=
"horizontal"
>
<LinearLayout
android:id=
"@+id/tab_rl_
main
"
android:id=
"@+id/tab_rl_
one
"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.0"
...
...
@@ -35,13 +35,13 @@
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/tab_iv_
main
"
android:id=
"@+id/tab_iv_
one
"
android:layout_width=
"25dp"
android:layout_height=
"25dp"
android:src=
"@drawable/tab_loan_btn"
/>
<TextView
android:id=
"@+id/tab_tv_
main
"
android:id=
"@+id/tab_tv_
one
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/bottom_tab_main"
...
...
@@ -50,7 +50,7 @@
</LinearLayout>
<LinearLayout
android:id=
"@+id/tab_rl_
channel
"
android:id=
"@+id/tab_rl_
two
"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.0"
...
...
@@ -58,13 +58,13 @@
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/tab_iv_
channel
"
android:id=
"@+id/tab_iv_
two
"
android:layout_width=
"25dp"
android:layout_height=
"25dp"
android:src=
"@drawable/tab_video_btn"
/>
<TextView
android:id=
"@+id/tab_tv_
channel
"
android:id=
"@+id/tab_tv_
two
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/bottom_tab_channel"
...
...
@@ -73,7 +73,7 @@
</LinearLayout>
<LinearLayout
android:id=
"@+id/tab_rl_
pan
"
android:id=
"@+id/tab_rl_
three
"
android:layout_width=
"0dp"
android:layout_height=
"75dp"
android:layout_gravity=
"bottom"
...
...
@@ -100,7 +100,7 @@
</LinearLayout>
<LinearLayout
android:id=
"@+id/tab_rl_f
riends
"
android:id=
"@+id/tab_rl_f
our
"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.0"
...
...
@@ -108,13 +108,13 @@
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/tab_iv_f
riends
"
android:id=
"@+id/tab_iv_f
our
"
android:layout_width=
"25dp"
android:layout_height=
"25dp"
android:src=
"@drawable/tab_friends_btn"
/>
<TextView
android:id=
"@+id/tab_tv_f
riends
"
android:id=
"@+id/tab_tv_f
our
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/bottom_tab_friends"
...
...
@@ -123,7 +123,7 @@
</LinearLayout>
<LinearLayout
android:id=
"@+id/tab_rl_
my
"
android:id=
"@+id/tab_rl_
five
"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1.0"
...
...
@@ -131,13 +131,13 @@
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/tab_iv_
my
"
android:id=
"@+id/tab_iv_
five
"
android:layout_width=
"25dp"
android:layout_height=
"25dp"
android:src=
"@drawable/tab_my_btn"
/>
<TextView
android:id=
"@+id/tab_tv_
my
"
android:id=
"@+id/tab_tv_
five
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"@string/bottom_tab_my"
...
...
GoodMoney/app/src/main/res/layout/fragment_main_wz.xml
0 → 100755
View file @
0c737d5a
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<WebView
android:id=
"@+id/blTurntableWebview"
android:layout_width=
"match_parent"
android:background=
"@color/black"
android:layout_height=
"match_parent"
/>
</FrameLayout>
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