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
6752303b
Commit
6752303b
authored
Apr 08, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_mcg_reader' into dev_ad
parents
e6ac82fb
552b120c
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1018 additions
and
21 deletions
+1018
-21
build.gradle
GoodMoney/app/build.gradle
+66
-4
Reader17kSDK-release1.1.3.aar
GoodMoney/app/libs/Reader17kSDK-release1.1.3.aar
+0
-0
filter-lib-release1.1.aar
GoodMoney/app/libs/filter-lib-release1.1.aar
+0
-0
readerlib-release1.1.aar
GoodMoney/app/libs/readerlib-release1.1.aar
+0
-0
proguard-rules.pro
GoodMoney/app/proguard-rules.pro
+111
-1
MintsApplication.java
...p/src/main/java/com/mints/goodmoney/MintsApplication.java
+6
-0
ReaderManager.java
.../main/java/com/mints/goodmoney/manager/ReaderManager.java
+111
-0
ToutiaoAD.java
.../src/main/java/com/mints/goodmoney/manager/ToutiaoAD.java
+552
-0
TtCsjAdManager.java
...main/java/com/mints/goodmoney/manager/TtCsjAdManager.java
+1
-0
BookPresenter.kt
.../java/com/mints/goodmoney/mvp/presenters/BookPresenter.kt
+4
-4
MainActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
+2
-0
WrapperActivity.kt
.../java/com/mints/goodmoney/ui/activitys/WrapperActivity.kt
+13
-2
BannerAdapter.java
...in/java/com/mints/goodmoney/ui/adapter/BannerAdapter.java
+1
-1
MoneyFragment.kt
...ain/java/com/mints/goodmoney/ui/fragment/MoneyFragment.kt
+22
-9
ReaderFragment.kt
...in/java/com/mints/goodmoney/ui/fragment/ReaderFragment.kt
+85
-0
item_mints_banner.xml
GoodMoney/app/src/main/res/layout/item_mints_banner.xml
+0
-0
build.gradle
GoodMoney/build.gradle
+44
-0
No files found.
GoodMoney/app/build.gradle
View file @
6752303b
...
...
@@ -2,6 +2,12 @@ apply plugin: 'com.android.application'
apply
plugin:
'kotlin-android'
apply
plugin:
'kotlin-android-extensions'
apply
plugin:
'kotlin-kapt'
apply
plugin:
'dagger.hilt.android.plugin'
apply
plugin:
'androidx.navigation.safeargs.kotlin'
apply
plugin:
'android-aspectjx'
apply
plugin:
'com.sensorsdata.analytics.android'
android
{
compileSdkVersion
rootProject
.
ext
.
androidCompileSdkVersion
buildToolsVersion
rootProject
.
ext
.
androidBuildToolsVersion
...
...
@@ -58,6 +64,19 @@ android {
}
}
kapt
{
arguments
{
arg
(
"AROUTER_MODULE_NAME"
,
project
.
getName
())
}
}
aspectjx
{
exclude
'versions.9'
}
buildFeatures
{
dataBinding
true
}
buildTypes
{
debug
{
...
...
@@ -135,7 +154,7 @@ dependencies {
implementation
'androidx.appcompat:appcompat:1.2.0'
implementation
'androidx.constraintlayout:constraintlayout:1.1.3'
implementation
'androidx.recyclerview:recyclerview:1.0.0'
implementation
'com.google.android.material:material:1.
0
.0'
implementation
'com.google.android.material:material:1.
2
.0'
// 网络请求
implementation
'com.squareup.retrofit2:retrofit:2.7.1'
...
...
@@ -190,7 +209,7 @@ dependencies {
// 三方接入
// leakcanary
debugImplementation
'com.squareup.leakcanary:leakcanary-android:2.4'
//
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.4'
// 极光推送
implementation
'cn.jiguang.sdk:jpush:3.6.6'
implementation
'cn.jiguang.sdk:jcore:2.3.8'
...
...
@@ -280,10 +299,53 @@ dependencies {
implementation
'com.squareup.retrofit2:converter-scalars:2.6.2'
implementation
'com.squareup.retrofit2:converter-gson:2.6.2'
implementation
'com.alibaba:fastjson:1.2.11'
// 激励视频RTA
implementation
(
name:
'taskwake1.0'
,
ext:
'aar'
)
// 听读
implementation
files
(
'libs/Reader17kSDK-release1.1.3.aar'
)
implementation
files
(
'libs/readerlib-release1.1.aar'
)
implementation
files
(
'libs/filter-lib-release1.1.aar'
)
compileOnly
"com.squareup.inject:assisted-inject-annotations-dagger2:$rootProject.assistedInjectVersion"
kapt
"androidx.room:room-compiler:$rootProject.roomVersion"
kapt
"com.google.dagger:hilt-android-compiler:$rootProject.hiltVersion"
kapt
"androidx.hilt:hilt-compiler:$rootProject.hiltViewModelVersion"
kapt
"com.squareup.inject:assisted-inject-processor-dagger2:$rootProject.assistedInjectVersion"
implementation
"androidx.core:core-ktx:$rootProject.ktxVersion"
implementation
"androidx.fragment:fragment-ktx:$rootProject.fragmentVersion"
implementation
"androidx.lifecycle:lifecycle-extensions:$rootProject.lifecycleVersion"
implementation
"androidx.lifecycle:lifecycle-livedata-ktx:$rootProject.lifecycleVersion"
implementation
"androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.lifecycleVersion"
implementation
"androidx.navigation:navigation-fragment-ktx:$rootProject.navigationVersion"
implementation
"androidx.navigation:navigation-ui-ktx:$rootProject.navigationVersion"
implementation
"androidx.paging:paging-runtime:$rootProject.pagingVersion"
implementation
"androidx.room:room-runtime:$rootProject.roomVersion"
implementation
"androidx.room:room-ktx:$rootProject.roomVersion"
implementation
"androidx.viewpager2:viewpager2:$rootProject.viewPagerVersion"
implementation
"androidx.work:work-runtime-ktx:$rootProject.workVersion"
implementation
"com.google.code.gson:gson:$rootProject.gsonVersion"
implementation
"org.jetbrains.kotlinx:kotlinx-coroutines-android:$rootProject.coroutinesVersion"
implementation
"org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.coroutinesVersion"
implementation
"com.google.dagger:hilt-android:$rootProject.hiltVersion"
implementation
"androidx.hilt:hilt-lifecycle-viewmodel:$rootProject.hiltViewModelVersion"
implementation
"com.scwang.smart:refresh-header-material:$rootProject.refresh_version"
implementation
'com.github.pdog18:dimension-extensions:1.0'
implementation
'com.github.zhpanvip:BannerViewPager:3.2.0'
api
"androidx.navigation:navigation-fragment-ktx:$navigationVersion"
api
"androidx.navigation:navigation-ui-ktx:$navigationVersion"
api
"androidx.navigation:navigation-dynamic-features-fragment:$navigationVersion"
implementation
'com.github.warkiz.widget:indicatorseekbar:1.2.9'
implementation
'org.greenrobot:eventbus:3.2.0'
implementation
'skin.support:skin-support:4.0.5'
implementation
'skin.support:skin-support-appcompat:4.0.5'
implementation
'skin.support:skin-support-design:4.0.5'
implementation
'skin.support:skin-support-cardview:4.0.5'
implementation
'skin.support:skin-support-constraint-layout:4.0.5'
implementation
"androidx.datastore:datastore-preferences:1.0.0-alpha02"
implementation
'com.github.F1ReKing:StatusLayout:1.2.1'
kapt
"com.alibaba:arouter-compiler:$arouter_compiler_version"
implementation
"com.alibaba:arouter-api:$arouter_api_version"
implementation
'com.sensorsdata.analytics.android:SensorsAnalyticsSDK:4.4.3'
api
'org.aspectj:aspectjrt:1.9.5'
// testImplementation 'junit:junit:4.13'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
...
...
GoodMoney/app/libs/Reader17kSDK-release1.1.3.aar
0 → 100755
View file @
6752303b
File added
GoodMoney/app/libs/filter-lib-release1.1.aar
0 → 100755
View file @
6752303b
File added
GoodMoney/app/libs/readerlib-release1.1.aar
0 → 100755
View file @
6752303b
File added
GoodMoney/app/proguard-rules.pro
View file @
6752303b
...
...
@@ -667,4 +667,114 @@
*
*[] $VALUES;
public *;
}
# ======================= 蘑菇星球 END ================
\ No newline at end of file
# ======================= 蘑菇星球 END ================
# ===================== 听读 START ================
-keep class com.chineseall.reader17ksdk.
*
*{*;}
-keep class com.chineseall.reader.utils.
*
*{*;}
-keep class com.chineseall.reader.lib.reader.
*
*{*;}
#arouter
-keep public class com.alibaba.android.arouter.routes.
*
*{*;}
-keep public class com.alibaba.android.arouter.facade.
*
*{*;}
-keep class * implements
com.alibaba.android.arouter.facade.template.ISyringe{*;}
# If you use the byType method to obtain Service, add the
-keep interface * implements
com.alibaba.android.arouter.facade.template.IProvider
#百度语音
-keep class com.baidu.tts.
*
*{*;}
-keep class com.baidu.speechsynthesizer.
*
*{*;}
#eventBus
-keepattributes *Annotation*
-keepclassmembers class
*
* {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
-keep class org.greenrobot.eventbug.
*
*{*;}
-keepclassmembers class * extends
org.greenrobot.eventbus.util.ThrowableFailureEvent {
<init>(java.lang.Throwable);
}
#rxjava
-dontwarn rx.
*
*
-keep class rx.
*
* { *; }
#okhttp3
-dontwarn com.squareup.okhttp3.
*
*
-keep class com.squareup.okhttp3.
*
* { *;}
-keep class okhttp3.
*
* { *;}
-keep class okio.
*
* { *;}
-dontwarn sun.security.
*
*
-keep class sun.security.
*
* { *;}
-dontwarn okio.
*
*
-dontwarn okhttp3.
*
*
#retrofit2
-dontwarn retrofit2.
*
*
-keep class retrofit2.
*
* { *; }
-keepattributes Signature
-keepattributes Exceptions
-dontwarn org.robovm.
*
*
-keep class org.robovm.
*
* { *; }
#glide
-keep public class * implements
com.bumptech.glide.module.GlideModule
-keep public enum
com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$
*
* {
*
*[] $VALUES;
public *; }
-keep class com.bumptech.glide.
*
* { *; }
#gson
-keep class com.google.gson.
*
* {*;}
#-keep class com.google.
*
*{*;}
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.stream.
*
* { *; }
-keep class com.google.gson.examples.android.model.
*
* { *; }
-keep class com.google.
*
* {
<fields>;
<methods>; }
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[]
serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
-dontwarn com.google.gson.
*
*
#umeng
-dontwarn com.umeng.
*
*
-keep class com.umeng.
*
*{*;}
-keep class u.aly.
*
*{*;}
-keep class com.google.
*
*{*;}
#filter
-keep class com.baiiu.filter.
*
*{*;}
#dragger
-keep class dagger.
*
* { *; }
#statuslayout
-keep class com.f1reking.
*
*{*;}
#dp
-keep class com.pdog.dimension.
*
*{*;}
#seekbar
-keep class com.warkiz.widget.
*
*{*;}
#banner
-keep class com.zhpan.bannerview.
*
*{*;}
-keep class com.zhpan.indicator.
*
*{*;}
#refresh
-keep class com.scwang.smart.refresh.
*
*{*;}
#skin
-keep class skin.support.
*
*{*;}
#神策
-dontwarn com.sensorsdata.analytics.android.sdk.
*
* -keep class com.sensorsdata.analytics.android.sdk.
*
* { *;
}
-dontwarn com.sensorsdata.analytics.android.
*
*
-keep class com.sensorsdata.analytics.android.
*
* {
*;
}
# 使用可视化埋点需添加
-keep class
*
*.R$* {
<fields>; }
# ======================= 听读 END ================
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/MintsApplication.java
View file @
6752303b
...
...
@@ -16,6 +16,7 @@ import com.mints.goodmoney.manager.KsManager;
import
com.mints.goodmoney.manager.LiebaoManager
;
import
com.mints.goodmoney.manager.MhManager
;
import
com.mints.goodmoney.manager.MiitHelper
;
import
com.mints.goodmoney.manager.ReaderManager
;
import
com.mints.goodmoney.manager.RsNewsManager
;
import
com.mints.goodmoney.manager.TtCsjAdManager
;
import
com.mints.goodmoney.manager.TzManager
;
...
...
@@ -41,6 +42,7 @@ import com.ximalaya.ting.android.opensdk.util.BaseUtil;
import
java.util.concurrent.Executors
;
import
dagger.hilt.android.HiltAndroidApp
;
import
rx.Scheduler
;
import
rx.schedulers.Schedulers
;
...
...
@@ -49,6 +51,7 @@ import rx.schedulers.Schedulers;
* 作者:孟崔广
* 时间:2020/10/09 11:40
*/
@HiltAndroidApp
public
class
MintsApplication
extends
MultiDexApplication
{
private
static
MintsApplication
mContext
;
...
...
@@ -146,6 +149,9 @@ public class MintsApplication extends MultiDexApplication {
// 自定义logger
bindLogger
();
// 中文在线 听读
ReaderManager
.
init
(
this
);
// 子线程初始化三方SDK
String
processName
=
SystemUtils
.
INSTANCE
.
getProcessName
(
this
,
android
.
os
.
Process
.
myPid
());
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/ReaderManager.java
0 → 100644
View file @
6752303b
package
com
.
mints
.
goodmoney
.
manager
;
import
android.app.Application
;
import
android.app.Dialog
;
import
android.content.DialogInterface
;
import
android.view.View
;
import
androidx.appcompat.app.AlertDialog
;
import
com.chineseall.reader.lib.reader.callbacks.OnAdViewReceiver
;
import
com.chineseall.reader17ksdk.ChineseAllReaderApplication
;
import
com.chineseall.reader17ksdk.callbacks.AdProvider
;
import
com.chineseall.reader17ksdk.callbacks.OnReadCallBack
;
import
com.chineseall.reader17ksdk.utils.ActivityStackManager
;
import
com.chineseall.reader17ksdk.utils.DensityUtil
;
import
com.chineseall.reader17ksdk.utils.NetworkUtil
;
import
com.chineseall.reader17ksdk.utils.ToastUtil
;
import
com.chineseall.reader17ksdk.utils.book.ScreenUtils
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
java.util.Map
;
import
kotlin.Unit
;
import
kotlin.jvm.functions.Function0
;
/**
* 中文在线 听读
* 作者:孟崔广
* 时间:2021/04/08 14:44
* 邮箱:mengcga@163.com
*/
public
class
ReaderManager
{
public
static
void
init
(
Application
applicationContext
)
{
ToutiaoAD
csjAd
=
new
ToutiaoAD
();
ChineseAllReaderApplication
.
Companion
.
install
(
applicationContext
,
"1242"
,
"hzq@1242"
,
"32"
,
"0"
,
new
AdProvider
()
{
/**
* 阅读⻚弹窗广告确认按钮的点击回调-激励视频
* @param dialog
* @param block 对话框关闭回调,必须调用,否则计时每次切换章节都会出现弹窗
*/
@Override
public
void
onAdDialogPositiveClick
(
@Nullable
Dialog
dialog
,
@NotNull
Function0
<
Unit
>
function0
)
{
if
(
NetworkUtil
.
isNetworkAvailable
(
applicationContext
)
&&
!
NetworkUtil
.
INSTANCE
.
isWifiConnected
(
applicationContext
))
{
new
AlertDialog
.
Builder
(
ActivityStackManager
.
getInstance
().
getTopActivity
())
.
setTitle
(
"温馨提示"
)
.
setMessage
(
"当前处于移动网络,播放视频会消耗流量,确定播放?"
)
.
setPositiveButton
(
"观看视频"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
csjAd
.
showVideo
(
ActivityStackManager
.
getInstance
().
getTopActivity
(),
new
ToutiaoAD
.
OnVideoCloseCallBack
()
{
@Override
public
void
onClose
()
{
function0
.
invoke
();
}
});
}
}).
setNegativeButton
(
"取消"
,
new
DialogInterface
.
OnClickListener
()
{
@Override
public
void
onClick
(
DialogInterface
dialog
,
int
which
)
{
dialog
.
dismiss
();
}
}).
create
().
show
();
return
;
}
else
{
csjAd
.
showVideo
(
ActivityStackManager
.
getInstance
().
getTopActivity
(),
new
ToutiaoAD
.
OnVideoCloseCallBack
()
{
@Override
public
void
onClose
()
{
function0
.
invoke
();
}
});
}
}
/**
* 阅读⻚首次打开 弹框广告(信息流) 广告宽度 320 高度 260 * @param adViewContainer 广告view的容器
*/
@Override
public
void
getReaderScreenAd
(
@NotNull
View
view
,
@NotNull
OnAdViewReceiver
receiver
,
@Nullable
Dialog
dialog
)
{
csjAd
.
loadAD
(
applicationContext
,
receiver
,
320
,
260
,
new
ToutiaoAD
.
OnClickListener
()
{
@Override
public
void
onClick
()
{
dialog
.
dismiss
();
}
});
}
/**
* 阅读⻚翻⻚广告(信息流) 广告宽度 320 高度 260 */
@Override
public
void
getReaderPageAd
(
@NotNull
OnAdViewReceiver
receiver
)
{
csjAd
.
loadAD
(
applicationContext
,
receiver
,
DensityUtil
.
px2dip
(
applicationContext
,
ScreenUtils
.
getScreenWidth
(
applicationContext
)
-
DensityUtil
.
dip2px
(
applicationContext
,
30
f
)),
DensityUtil
.
px2dip
(
applicationContext
,
854
f
),
null
);
}
/**
* 阅读⻚定时弹窗广告 (激励视频)
*/
@Override
public
void
getReaderDialogAd
(
@NotNull
View
view
,
@NotNull
OnAdViewReceiver
receiver
,
@Nullable
Dialog
dialog
)
{
csjAd
.
loadVideoAd
(
ActivityStackManager
.
getInstance
().
getTopActivity
(),
receiver
);
}
});
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/ToutiaoAD.java
0 → 100755
View file @
6752303b
This diff is collapsed.
Click to expand it.
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/TtCsjAdManager.java
View file @
6752303b
...
...
@@ -43,6 +43,7 @@ public class TtCsjAdManager {
public
static
String
TT_AD_VEDIO_HOMEVEDIO
=
"945744137"
;
// 首页视频翻倍
public
static
String
TT_AD_VEDIO_SMALLHOMEVEDIO
=
"945744186"
;
// 短视频翻倍
public
static
String
TT_AD_VEDIO_KYLVEDIO
=
"945791766"
;
// 来电秀视频
public
static
String
TT_AD_VEDIO_READ
=
"945997554"
;
// 听读
/*全屏视频*/
public
static
String
TT_AD_FULLVEDIO_ALL
=
"945752969"
;
// 通用
/*信息流*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/BookPresenter.kt
View file @
6752303b
...
...
@@ -28,10 +28,10 @@ class BookPresenter : BasePresenter<BookView>() {
val
data
=
baseResponse
.
data
when
(
code
)
{
200
->
{
if
(
data
!=
null
)
{
val
coin
=
data
[
"coin"
].
asInt
view
.
readSecondsSuc
(
coin
)
}
//
if (data != null) {
//
val coin = data["coin"].asInt
//
view.readSecondsSuc(coin)
//
}
}
else
->
view
.
showToast
(
baseResponse
.
getMessage
())
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
View file @
6752303b
...
...
@@ -20,6 +20,7 @@ import com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.views.MainView
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.fragment.*
import
dagger.hilt.android.AndroidEntryPoint
import
kotlinx.android.synthetic.main.activity_main.*
/**
...
...
@@ -28,6 +29,7 @@ import kotlinx.android.synthetic.main.activity_main.*
* 时间:2020/10/9 10:39
* 邮箱:mengcga@163.com
*/
@AndroidEntryPoint
class
MainActivity
:
BaseActivity
(),
MainView
,
View
.
OnClickListener
{
private
val
audioManager
by
lazy
{
getSystemService
(
Context
.
AUDIO_SERVICE
)
as
AudioManager
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/WrapperActivity.kt
View file @
6752303b
...
...
@@ -3,12 +3,14 @@ package com.mints.goodmoney.ui.activitys
import
android.os.Bundle
import
android.view.View
import
androidx.fragment.app.Fragment
import
com.fly.scenemodule.fragment.IdiomFragment
import
androidx.fragment.app.FragmentTransaction
import
com.chineseall.reader17ksdk.feature.main.bookshop.wellchosen.WellChosenFragment
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.*
import
com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils
import
dagger.hilt.android.AndroidEntryPoint
import
kotlinx.android.synthetic.main.activity_wrapper.*
import
kotlinx.android.synthetic.main.header_layout.*
...
...
@@ -55,6 +57,15 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
layoutParams
.
height
=
BubbleUtils
.
dp2px
(
30
)
tv_title
.
text
=
"新闻"
currentFragment
=
RsNewsFragment
()
// val wellChosenFragment = WellChosenFragment("home")
// val transaction = supportFragmentManager.beginTransaction()
// transaction.add(R.id.flWrapper, wellChosenFragment, WellChosenFragment::class.java.toString())
// transaction.show(wellChosenFragment)
// transaction.commitAllowingStateLoss()
}
Constant
.
WRAPPER_TYPE_BOOK
->
{
tv_title
.
text
=
"书城"
currentFragment
=
ReaderFragment
()
}
Constant
.
WRAPPER_TYPE_FRIENDS
->
{
tv_title
.
text
=
"瓜分百万现金福利"
...
...
@@ -77,7 +88,7 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
if
(!
currentFragment
.
isAdded
)
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
flWrapper
,
currentFragment
).
commitAllowingStateLoss
()
.
add
(
R
.
id
.
flWrapper
,
currentFragment
,
currentFragment
.
tag
).
commitAllowingStateLoss
()
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/adapter/BannerAdapter.java
View file @
6752303b
...
...
@@ -26,7 +26,7 @@ public class BannerAdapter extends BannerBaseAdapter<BannerBean.ListBean> {
@Override
protected
int
getLayoutResID
()
{
return
R
.
layout
.
item_banner
;
return
R
.
layout
.
item_
mints_
banner
;
}
@Override
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MoneyFragment.kt
View file @
6752303b
...
...
@@ -4,9 +4,11 @@ import androidx.fragment.app.Fragment
import
androidx.fragment.app.FragmentManager
import
androidx.fragment.app.FragmentTransaction
import
com.androidkun.xtablayout.XTabLayout
import
com.chineseall.reader17ksdk.feature.main.bookshop.wellchosen.WellChosenFragment
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
dagger.hilt.android.AndroidEntryPoint
import
kotlinx.android.synthetic.main.fragment_main_money.*
/**
...
...
@@ -27,7 +29,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
private
var
currentFragment
:
Fragment
?
=
null
private
var
mainFragment
:
Fragment
?
=
null
//
private var bookStoreFragment: Fragment? = null
private
var
bookStoreFragment
:
Fragment
?
=
null
// private var newsFragment: Fragment? = null
private
var
xmlyGameFragment
:
Fragment
?
=
null
...
...
@@ -46,7 +48,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
if
(
AppConfig
.
showAdFlag
)
{
if
(
curPosition
==
0
)
{
mainFragment
?.
onHiddenChanged
(
hidden
)
}
else
if
(
curPosition
==
3
)
{
}
else
if
(
curPosition
==
4
)
{
liebaoGameFragment
?.
onHiddenChanged
(
hidden
)
}
}
...
...
@@ -73,11 +75,11 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
currentFragment
=
mainFragment
}
xtFragmentMoney
.
setxTabDisplayNum
(
4
)
xtFragmentMoney
.
setxTabDisplayNum
(
5
)
val
newTab1
=
xtFragmentMoney
.
newTab
()
newTab1
.
text
=
"视频"
//
val newTab3 = xtFragmentMoney.newTab()
// newTab3.text = "新闻
"
val
newTab3
=
xtFragmentMoney
.
newTab
()
newTab3
.
text
=
"书城
"
val
newTab4
=
xtFragmentMoney
.
newTab
()
newTab4
.
text
=
"听书"
val
newTab5
=
xtFragmentMoney
.
newTab
()
...
...
@@ -85,7 +87,7 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
val
newTab6
=
xtFragmentMoney
.
newTab
()
newTab6
.
text
=
"来电秀"
xtFragmentMoney
.
addTab
(
newTab1
)
//
xtFragmentMoney.addTab(newTab3)
xtFragmentMoney
.
addTab
(
newTab3
)
xtFragmentMoney
.
addTab
(
newTab4
)
xtFragmentMoney
.
addTab
(
newTab5
)
xtFragmentMoney
.
addTab
(
newTab6
)
...
...
@@ -141,10 +143,15 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
}
fun
selectBook
()
{
xtFragmentMoney
.
getTabAt
(
1
)
?.
select
()
if
(
bookStoreFragment
==
null
)
{
bookStoreFragment
=
ReaderFragment
()
}
addOrShowFragment
(
childFragmentManager
,
bookStoreFragment
!!
,
FRAGMENT_TAG_BOOKSTORE
)
}
fun
selectXmly
()
{
xtFragmentMoney
.
getTabAt
(
1
)
?.
select
()
xtFragmentMoney
.
getTabAt
(
2
)
?.
select
()
if
(
xmlyGameFragment
==
null
)
{
xmlyGameFragment
=
XmlyFragment
()
}
...
...
@@ -174,18 +181,24 @@ class MoneyFragment : BaseFragment(), XTabLayout.OnTabSelectedListener {
}
1
->
{
if
(
bookStoreFragment
==
null
)
{
bookStoreFragment
=
ReaderFragment
()
}
addOrShowFragment
(
childFragmentManager
,
bookStoreFragment
!!
,
FRAGMENT_TAG_BOOKSTORE
)
}
2
->
{
if
(
xmlyGameFragment
==
null
)
{
xmlyGameFragment
=
XmlyFragment
()
}
addOrShowFragment
(
childFragmentManager
,
xmlyGameFragment
!!
,
FRAGMENT_TAG_XMLY
)
}
2
->
{
3
->
{
if
(
liebaoGameFragment
==
null
)
{
liebaoGameFragment
=
LiebaoGameFragment
()
}
addOrShowFragment
(
childFragmentManager
,
liebaoGameFragment
!!
,
FRAGMENT_TAG_GAME
)
}
3
->
{
4
->
{
if
(
kuYinyueFragment
==
null
)
{
kuYinyueFragment
=
KuYinYueFragment
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/ReaderFragment.kt
0 → 100644
View file @
6752303b
package
com.mints.goodmoney.ui.fragment
import
android.view.View
import
androidx.fragment.app.FragmentTransaction
import
com.chineseall.reader17ksdk.ChineseAllReaderApplication
import
com.chineseall.reader17ksdk.callbacks.OnReadCallBack
import
com.chineseall.reader17ksdk.feature.main.bookshop.wellchosen.WellChosenFragment
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.fragment.base.LazyLoadBaseFragment
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.SpanUtils
import
kotlinx.android.synthetic.main.fragment_main_zy.*
/**
* 描述:听读
* 作者:孟崔广
* 时间:2021/04/08 10:55
*/
class
ReaderFragment
:
LazyLoadBaseFragment
(),
BookView
,
OnReadCallBack
{
private
val
wellChosenFragment
by
lazy
{
WellChosenFragment
(
"home"
)
}
private
val
bookPresenter
by
lazy
{
BookPresenter
()
}
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_zy
override
fun
initViewsAndEvents
()
{}
override
fun
onFragmentFirstVisible
()
{
bookPresenter
.
attachView
(
this
)
val
transaction
:
FragmentTransaction
=
supportFragmentManager
.
beginTransaction
()
transaction
.
add
(
R
.
id
.
fragment
,
wellChosenFragment
,
ReaderFragment
::
class
.
java
.
simpleName
)
transaction
.
show
(
wellChosenFragment
)
transaction
.
commitAllowingStateLoss
()
//间隔30秒 回调一次 间隔任意设置
ChineseAllReaderApplication
.
setOnReadCallBack
(
this
,
30
*
1000
)
}
override
fun
onFragmentResume
()
{
super
.
onFragmentResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_ONE
)
{
bookPresenter
.
getReadInfo
()
}
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
ChineseAllReaderApplication
.
destory
()
bookPresenter
.
detachView
()
}
override
fun
readSecondsSuc
(
coin
:
Int
)
{
}
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
()
}
}
override
fun
onReceive
(
map
:
Map
<
String
,
Any
>)
{
val
time
=
map
.
get
(
"time"
).
toString
().
toInt
()
val
seconds
=
(
time
/
1000
)
// 阅读5秒以上 保存时长
if
(
seconds
>
5
)
{
bookPresenter
.
addReadSeconds
(
seconds
)
}
LogUtil
.
d
(
"ReaderFragment"
,
"time:-->${time}"
)
}
}
\ No newline at end of file
GoodMoney/app/src/main/res/layout/item_banner.xml
→
GoodMoney/app/src/main/res/layout/item_
mints_
banner.xml
View file @
6752303b
File moved
GoodMoney/build.gradle
View file @
6752303b
buildscript
{
ext
.
kotlin_version
=
'1.3.72'
ext
{
// 听读 App dependencies
appCompatVersion
=
'1.1.0'
assistedInjectVersion
=
'0.5.2'
constraintLayoutVersion
=
'2.0.0-beta3'
coreTestingVersion
=
'2.0.0'
coroutinesVersion
=
"1.3.0-M2"
espressoVersion
=
'3.1.1'
fragmentVersion
=
'1.1.0-alpha09'
glideVersion
=
'4.10.0'
gradleVersion
=
'4.0.1'
gsonVersion
=
'2.8.2'
hiltVersion
=
'2.28.3-alpha'
hiltViewModelVersion
=
'1.0.0-alpha02'
junitVersion
=
'4.12'
kotlinVersion
=
'1.4.10'
ktlintVersion
=
'0.38.1'
ktxVersion
=
'1.0.2'
lifecycleVersion
=
'2.2.0'
materialVersion
=
'1.2.0'
navigationVersion
=
'2.3.1'
okhttpLoggingVersion
=
'4.7.2'
pagingVersion
=
'3.0.0-alpha09'
recyclerViewVersion
=
'1.2.0-alpha04'
retrofitVersion
=
'2.9.0'
roomVersion
=
'2.3.0-alpha01'
runnerVersion
=
'1.0.1'
truthVersion
=
'0.42'
testExtJunit
=
'1.1.0'
uiAutomatorVersion
=
'2.2.0'
viewPagerVersion
=
'1.0.0'
workVersion
=
'2.1.0'
kotlin_version
=
'1.4.10'
arouter_compiler_version
=
'1.5.1'
arouter_api_version
=
'1.5.1'
refresh_version
=
"2.0.1"
}
repositories
{
google
()
jcenter
()
...
...
@@ -18,6 +56,12 @@ buildscript {
dependencies
{
classpath
'com.android.tools.build:gradle:4.0.1'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// 听读
classpath
"androidx.navigation:navigation-safe-args-gradle-plugin:2.3.1"
classpath
"com.google.dagger:hilt-android-gradle-plugin:2.28.3-alpha"
classpath
'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.10'
classpath
'com.sensorsdata.analytics.android:android-gradle-plugin2:3.3.1'
}
}
...
...
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