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
ec5c3105
Commit
ec5c3105
authored
Dec 11, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
c29e4b85
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
142 additions
and
7 deletions
+142
-7
VedioAdingManager.java
.../java/com/mints/goodmoney/ad/video/VedioAdingManager.java
+1
-0
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+5
-1
YlhAdManager.kt
...src/main/java/com/mints/goodmoney/manager/YlhAdManager.kt
+1
-0
WrapperActivity.kt
.../java/com/mints/goodmoney/ui/activitys/WrapperActivity.kt
+14
-3
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+20
-3
MyZhangyueFragment.kt
...ava/com/mints/goodmoney/ui/fragment/MyZhangyueFragment.kt
+101
-0
No files found.
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/VedioAdingManager.java
View file @
ec5c3105
...
...
@@ -151,6 +151,7 @@ public class VedioAdingManager {
weight
=
weight
+
csjVedioWeight
;
LogUtil
.
d
(
TAG
,
"权重值:csjVedioWeight:"
+
csjVedioWeight
);
}
if
(
AppConfig
.
flVedioAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
flVedioWeight
,
Constant
.
FL_VEDIO_AD
));
weight
=
weight
+
flVedioWeight
;
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
ec5c3105
...
...
@@ -167,6 +167,8 @@ object Constant {
const
val
HOT_ACTIVITY_SCRAPPAGE
=
"scrapPage"
const
val
HOT_ACTIVITY_DATI
=
"dati"
const
val
HOT_ACTIVITY_CAICY
=
"ccy"
const
val
HOT_ACTIVITY_BOOK
=
"readBook"
const
val
HOT_ACTIVITY_NEWS
=
"TO_RUISHI"
// 打开激活
const
val
FIRST_DEVICE_FLAG
=
"first_device_flag"
...
...
@@ -193,7 +195,9 @@ object Constant {
const
val
MERGE_KEY
=
"merge_key"
// wrapper type
// wrapper type
0-新闻 1-小说
const
val
WRAPPER_TYPE
=
"wrapper_type"
const
val
WRAPPER_TYPE_NEWS
=
0
const
val
WRAPPER_TYPE_BOOK
=
1
}
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/YlhAdManager.kt
View file @
ec5c3105
...
...
@@ -35,6 +35,7 @@ object YlhAdManager {
const
val
YLH_AD_INTERSTITIALAD_LIEBAO
=
"1021648750986824"
//猎豹
const
val
YLH_AD_INTERSTITIALAD_JULEYUN
=
"4051047730890430"
//聚乐云
/**
* 广告初始化
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/WrapperActivity.kt
View file @
ec5c3105
...
...
@@ -5,7 +5,9 @@ import android.view.View
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.fragment.MyZhangyueFragment
import
com.mints.goodmoney.ui.fragment.RsNewsFragment
import
com.mints.goodmoney.ui.fragment.ZhangyueFragment
import
kotlinx.android.synthetic.main.header_layout.*
/**
...
...
@@ -15,7 +17,7 @@ import kotlinx.android.synthetic.main.header_layout.*
*/
class
WrapperActivity
:
BaseActivity
(),
View
.
OnClickListener
{
private
var
wrapperType
=
0
private
var
wrapperType
=
Constant
.
WRAPPER_TYPE_NEWS
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_wrapper
...
...
@@ -32,7 +34,7 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{
super
.
getBundleExtras
(
extras
)
extras
?.
let
{
wrapperType
=
it
.
getInt
(
Constant
.
WRAPPER_TYPE
,
0
)
wrapperType
=
it
.
getInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_NEWS
)
}
}
...
...
@@ -44,7 +46,7 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
private
fun
initPage
()
{
when
(
wrapperType
)
{
0
->
{
Constant
.
WRAPPER_TYPE_NEWS
->
{
tv_title
.
text
=
"新闻"
val
rsNewsFragment
=
RsNewsFragment
()
if
(!
rsNewsFragment
.
isAdded
())
{
...
...
@@ -53,6 +55,15 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
.
add
(
R
.
id
.
flWrapper
,
rsNewsFragment
).
commitAllowingStateLoss
()
}
}
Constant
.
WRAPPER_TYPE_BOOK
->
{
tv_title
.
text
=
"书城"
val
zhangyueFragment
=
MyZhangyueFragment
()
if
(!
zhangyueFragment
.
isAdded
())
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
flWrapper
,
zhangyueFragment
).
commit
()
}
}
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
ec5c3105
...
...
@@ -12,6 +12,7 @@ import androidx.recyclerview.widget.DividerItemDecoration
import
com.component.dly.xzzq_ywsdk.YwSDK_WebActivity.Companion.open
import
com.fly.scenemodule.SceneUtil
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.banner.BannerManager
import
com.mints.goodmoney.ad.video.VedioAdingManager
...
...
@@ -484,7 +485,9 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
if
(
taskBean
.
otherConfig
!=
null
)
{
when
(
taskBean
.
otherConfig
.
status
)
{
0
->
{
readyGo
(
WrapperActivity
::
class
.
java
)
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_NEWS
)
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
1
->
{
val
bundle
=
Bundle
()
...
...
@@ -493,7 +496,9 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
2
->
{
readyGo
(
WrapperActivity
::
class
.
java
)
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_NEWS
)
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
}
}
...
...
@@ -631,6 +636,18 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
// 刮刮乐
SceneUtil
.
scrapPage
(
requireActivity
())
}
Constant
.
HOT_ACTIVITY_BOOK
->
{
// 小说
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_BOOK
)
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
Constant
.
HOT_ACTIVITY_NEWS
->
{
// 新闻
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
WRAPPER_TYPE
,
Constant
.
WRAPPER_TYPE_NEWS
)
readyGo
(
WrapperActivity
::
class
.
java
,
bundle
)
}
Constant
.
HOT_ACTIVITY_EAT
->
{
TTPreLoadCarrierExpressManager
.
getInstance
().
loadTtFrameLayout
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_EAT
)
readyGo
(
FoodSubsidyActivity
::
class
.
java
)
...
...
@@ -825,7 +842,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
// 聚乐云
SceneManager
.
initScene
()
// 同步账户
//
SceneUtil.signIn(requireActivity(), SceneManager.SCENE_CHANNEL_Id, userManager.userID, MintsApplication.OAID)
SceneUtil
.
signIn
(
requireActivity
(),
SceneManager
.
SCENE_CHANNEL_Id
,
userManager
.
userID
,
MintsApplication
.
OAID
)
}
private
fun
initView
()
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyZhangyueFragment.kt
0 → 100644
View file @
ec5c3105
package
com.mints.goodmoney.ui.fragment
import
android.os.Bundle
import
android.view.View
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.FragmentTransaction
import
com.ireader.ireadersdk.IreaderApi
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.mvp.presenters.BookPresenter
import
com.mints.goodmoney.mvp.views.BookView
import
com.mints.goodmoney.ui.activitys.AwardActivity
import
com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import
com.mints.goodmoney.utils.SpanUtils
import
kotlinx.android.synthetic.main.fragment_main_zy.*
/**
* 描述:掌阅书城
* 作者:孟崔广
*/
class
MyZhangyueFragment
:
LazyLoadBaseFragment
(),
BookView
,
IreaderApi
.
OnReadChangeListener
{
private
val
bookPresenter
by
lazy
{
BookPresenter
()
}
private
var
bookFragment
:
Fragment
?
=
null
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_zy
override
fun
initViewsAndEvents
()
{
bookPresenter
.
attachView
(
this
)
val
transaction
:
FragmentTransaction
=
supportFragmentManager
.
beginTransaction
()
if
(
bookFragment
==
null
)
{
// bookFragment = IreaderApi.getNovelBookStoreFragment()
bookFragment
=
IreaderApi
.
getNovelChannelFragment
()
transaction
.
add
(
R
.
id
.
fragment
,
bookFragment
!!
,
bookFragment
!!::
class
.
java
.
simpleName
)
IreaderApi
.
setReadChangeListener
(
this
)
}
else
{
transaction
.
show
(
bookFragment
!!
)
}
transaction
.
commitAllowingStateLoss
()
}
override
fun
onFragmentFirstVisible
()
{
}
override
fun
onFragmentResume
()
{
super
.
onFragmentResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_MAIN
)
{
bookPresenter
.
getReadInfo
()
}
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
IreaderApi
.
setReadChangeListener
(
null
)
bookPresenter
.
detachView
()
}
override
fun
onReadStart
()
{
}
override
fun
onReadEnd
(
time
:
Long
)
{
// LogUtil.d(TAG, "onReadEnd time:" + time)
// LogUtil.d(TAG, "onReadEnd time(Int):" + (time/1000).toInt())
val
seconds
=
(
time
/
1000
).
toInt
()
// 阅读5秒以上 保存时长
if
(
seconds
>
5
)
{
bookPresenter
.
addReadSeconds
(
seconds
)
}
}
override
fun
onReadPage
(
time
:
Long
)
{
}
override
fun
readSecondsSuc
(
coin
:
Int
)
{
if
(
coin
>
0
)
{
val
bundle
=
Bundle
()
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_ZHANGYUE
)
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
coin
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
override
fun
readInfo
(
sumTime
:
Int
,
sumCoin
:
Int
,
readTime
:
Int
)
{
//阅读{10}分钟,奖励{xx}金币,已读{x}分钟
tvZhangContent
.
visibility
=
View
.
VISIBLE
if
(
readTime
>=
sumTime
)
{
tvZhangContent
.
text
=
"今日阅读任务已完成"
}
else
{
tvZhangContent
.
text
=
SpanUtils
()
.
append
(
"阅读"
).
append
(
"${sumTime / 60}"
).
setForegroundColor
(
mContext
.
resources
.
getColor
(
R
.
color
.
color_FF9837
)).
append
(
"分钟, "
)
.
append
(
"奖励"
).
append
(
"$sumCoin"
).
setForegroundColor
(
mContext
.
resources
.
getColor
(
R
.
color
.
color_cb4a39
)).
append
(
"金币, "
)
.
append
(
"已读"
).
append
(
"${readTime / 60}"
).
setForegroundColor
(
mContext
.
resources
.
getColor
(
R
.
color
.
color_FF9837
)).
append
(
"分钟"
)
.
create
()
}
}
}
\ 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