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
bed72fd5
Commit
bed72fd5
authored
Oct 30, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页视频 书城合并
parent
60ed9bb3
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
264 additions
and
24 deletions
+264
-24
build.gradle
GoodMoney/app/build.gradle
+3
-0
iReader-release-1.0.1.aar
GoodMoney/app/libs/iReader-release-1.0.1.aar
+0
-0
MintsApplication.java
...p/src/main/java/com/mints/goodmoney/MintsApplication.java
+2
-2
ZhangyueManager.kt
.../main/java/com/mints/goodmoney/manager/ZhangyueManager.kt
+2
-2
BookPresenter.kt
.../java/com/mints/goodmoney/mvp/presenters/BookPresenter.kt
+48
-0
BookView.kt
...p/src/main/java/com/mints/goodmoney/mvp/views/BookView.kt
+9
-0
LoanService.java
...pp/src/main/java/com/mints/goodmoney/net/LoanService.java
+8
-0
MainActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
+9
-9
MessageFragAdapter.java
...va/com/mints/goodmoney/ui/adapter/MessageFragAdapter.java
+44
-0
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+5
-1
MoneyFragment.kt
...ain/java/com/mints/goodmoney/ui/fragment/MoneyFragment.kt
+55
-0
ZhangyueFragment.kt
.../java/com/mints/goodmoney/ui/fragment/ZhangyueFragment.kt
+49
-5
fragment_main_money.xml
GoodMoney/app/src/main/res/layout/fragment_main_money.xml
+29
-0
fragment_main_zy.xml
GoodMoney/app/src/main/res/layout/fragment_main_zy.xml
+1
-5
No files found.
GoodMoney/app/build.gradle
View file @
bed72fd5
...
...
@@ -166,6 +166,8 @@ dependencies {
implementation
'com.daimajia.easing:library:2.0@aar'
implementation
'com.daimajia.androidanimations:library:2.3@aar'
implementation
'com.romandanylyk:pageindicatorview:1.0.3'
// xtablayout
implementation
'com.androidkun:XTabLayout:1.1.4'
// 工具类
...
...
@@ -227,6 +229,7 @@ dependencies {
implementation
'androidx.fragment:fragment:1.0.0'
testImplementation
'junit:junit:4.12'
androidTestImplementation
'androidx.test.ext:junit:1.1.1'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.1.0'
...
...
GoodMoney/app/libs/iReader-release-1.0.1.aar
View file @
bed72fd5
No preview for this file type
GoodMoney/app/src/main/java/com/mints/goodmoney/MintsApplication.java
View file @
bed72fd5
...
...
@@ -83,7 +83,7 @@ public class MintsApplication extends MultiDexApplication {
e
.
printStackTrace
();
}
//
ZhangyueManager.INSTANCE.attachBaseContextIreader(this);
ZhangyueManager
.
INSTANCE
.
attachBaseContextIreader
(
this
);
}
/**
...
...
@@ -119,7 +119,7 @@ public class MintsApplication extends MultiDexApplication {
// LiebaoManager.getInstance().initCmGameSdk();
// 掌阅书城
//
ZhangyueManager.INSTANCE.onCreateIreader(this);
ZhangyueManager
.
INSTANCE
.
onCreateIreader
(
this
);
}
/**
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/ZhangyueManager.kt
View file @
bed72fd5
...
...
@@ -12,10 +12,10 @@ object ZhangyueManager {
fun
onCreateIreader
(
application
:
Application
){
IreaderApi
.
onCreate
(
application
,
APPID
)
IreaderApi
.
attachBaseContext
(
application
)
}
fun
attachBaseContextIreader
(
application
:
Application
){
IreaderApi
.
attachBaseContext
(
application
)
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/BookPresenter.kt
0 → 100644
View file @
bed72fd5
package
com.mints.goodmoney.mvp.presenters
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.common.DeviceInfo
import
com.mints.goodmoney.manager.AppHttpManager
import
com.mints.goodmoney.manager.ShumeiManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.model.MainVedioMsgBean
import
com.mints.goodmoney.mvp.model.UserBean
import
com.mints.goodmoney.mvp.model.UserTaskMsgBean
import
com.mints.goodmoney.mvp.views.BookView
import
com.mints.goodmoney.mvp.views.HomeView
import
com.mints.goodmoney.utils.DeviceUuidFactory
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
import
net.grandcentrix.tray.AppPreferences
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
<
UserBean
>>()
{
override
fun
onCompleted
()
{
}
override
fun
onError
(
e
:
Throwable
)
{
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
UserBean
>)
{
val
code
=
baseResponse
.
getStatus
()
val
message
=
baseResponse
.
getMessage
()
val
data
:
UserBean
?
=
baseResponse
.
getData
()
when
(
code
)
{
200
->
{
view
.
readSecondsSuc
(
12
)
}
else
->
view
.
showToast
(
message
)
}
}
})
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/BookView.kt
0 → 100644
View file @
bed72fd5
package
com.mints.goodmoney.mvp.views
import
com.mints.goodmoney.mvp.model.MainVedioMsgBean
import
com.mints.goodmoney.mvp.model.UserTaskMsgBean
interface
BookView
:
BaseView
{
fun
readSecondsSuc
(
coin
:
Int
)
}
GoodMoney/app/src/main/java/com/mints/goodmoney/net/LoanService.java
View file @
bed72fd5
...
...
@@ -320,6 +320,14 @@ public interface LoanService {
@POST
(
"api/requestAddHomeVedioReward"
)
Observable
<
BaseResponse
<
Object
>>
requestAddHomeVedioReward
();
/**
* 阅读时长
*
* @return
*/
@POST
(
"api/addReadSeconds"
)
Observable
<
BaseResponse
<
Object
>>
addReadSeconds
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 默认http工厂
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
View file @
bed72fd5
...
...
@@ -27,7 +27,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
private
val
audioManager
by
lazy
{
getSystemService
(
Context
.
AUDIO_SERVICE
)
as
AudioManager
}
// 底部标签切换的Fragment
private
var
m
ain
Fragment
:
Fragment
?
=
null
private
var
m
oney
Fragment
:
Fragment
?
=
null
private
var
panFragment
:
Fragment
?
=
null
private
var
friendsFragment
:
Fragment
?
=
null
private
var
myFragment
:
Fragment
?
=
null
...
...
@@ -36,16 +36,16 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_main
override
fun
initViewsAndEvents
()
{
if
(
m
ain
Fragment
==
null
)
{
m
ainFragment
=
Main
Fragment
()
if
(
m
oney
Fragment
==
null
)
{
m
oneyFragment
=
Money
Fragment
()
}
if
(!
m
ain
Fragment
!!
.
isAdded
)
{
if
(!
m
oney
Fragment
!!
.
isAdded
)
{
// 提交事务
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
content_layout
,
m
ain
Fragment
!!
).
commitAllowingStateLoss
()
.
add
(
R
.
id
.
content_layout
,
m
oney
Fragment
!!
).
commitAllowingStateLoss
()
// 记录当前Fragment
currentFragment
=
m
ain
Fragment
currentFragment
=
m
oney
Fragment
}
tab_iv_main
.
setSelected
(
true
)
tab_tv_main
.
setSelected
(
true
)
...
...
@@ -125,10 +125,10 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
*/
fun
clickTab1Layout
()
{
AppConfig
.
fragmentClickFlag
=
Constant
.
FRAGMENT_CLICK_MAIN
if
(
m
ain
Fragment
==
null
)
{
m
ainFragment
=
Main
Fragment
()
if
(
m
oney
Fragment
==
null
)
{
m
oneyFragment
=
Money
Fragment
()
}
addOrShowFragment
(
supportFragmentManager
.
beginTransaction
(),
m
ain
Fragment
!!
)
addOrShowFragment
(
supportFragmentManager
.
beginTransaction
(),
m
oney
Fragment
!!
)
tab_iv_main
.
setSelected
(
true
)
tab_tv_main
.
setSelected
(
true
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/adapter/MessageFragAdapter.java
0 → 100755
View file @
bed72fd5
package
com
.
mints
.
goodmoney
.
ui
.
adapter
;
import
androidx.fragment.app.Fragment
;
import
androidx.fragment.app.FragmentManager
;
import
androidx.fragment.app.FragmentPagerAdapter
;
import
androidx.fragment.app.FragmentStatePagerAdapter
;
import
java.util.List
;
public
class
MessageFragAdapter
extends
FragmentStatePagerAdapter
{
private
List
<
Fragment
>
fragments
;
private
List
<
String
>
tabs
;
public
MessageFragAdapter
(
FragmentManager
fm
)
{
super
(
fm
);
}
public
MessageFragAdapter
(
FragmentManager
fm
,
List
<
Fragment
>
fragments
)
{
super
(
fm
);
this
.
fragments
=
fragments
;
}
public
MessageFragAdapter
(
FragmentManager
fm
,
List
<
Fragment
>
fragments
,
List
<
String
>
tabs
)
{
super
(
fm
);
this
.
fragments
=
fragments
;
this
.
tabs
=
tabs
;
}
@Override
public
Fragment
getItem
(
int
position
)
{
return
fragments
.
get
(
position
);
}
@Override
public
int
getCount
()
{
return
fragments
.
size
();
}
@Override
public
CharSequence
getPageTitle
(
int
position
)
{
return
tabs
.
get
(
position
);
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
bed72fd5
...
...
@@ -89,6 +89,9 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
override
fun
onResume
()
{
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
===
Constant
.
FRAGMENT_CLICK_MAIN
)
{
LogUtil
.
d
(
"MainFragment onResume"
)
// 打开激活
uploadDeviceInfo
()
...
...
@@ -113,6 +116,8 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
override
fun
onPause
()
{
super
.
onPause
()
LogUtil
.
d
(
"MainFragment onPause"
)
littleVideoFragment
?.
onPause
()
pauseDownloadTime
()
}
...
...
@@ -398,5 +403,4 @@ class MainFragment : BaseFragment(), HomeView, AdVideoCallback, View.OnClickList
})
powerDialog
!!
.
show
()
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MoneyFragment.kt
0 → 100644
View file @
bed72fd5
package
com.mints.goodmoney.ui.fragment
import
androidx.fragment.app.Fragment
import
androidx.viewpager.widget.ViewPager
import
com.mints.goodmoney.R
import
com.mints.goodmoney.mvp.presenters.MyPresenter
import
com.mints.goodmoney.ui.adapter.MessageFragAdapter
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import
kotlinx.android.synthetic.main.fragment_main_money.*
import
java.util.*
/**
* 描述:赚钱大厅
* 作者:孟崔广
* 时间:2020/10/29 13:48
*/
class
MoneyFragment
:
BaseFragment
()
{
private
var
mainFragment
:
MainFragment
?
=
null
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_money
override
fun
initViewsAndEvents
()
{
initView
()
}
override
fun
onHiddenChanged
(
hidden
:
Boolean
)
{
mainFragment
?.
onHiddenChanged
(
hidden
)
super
.
onHiddenChanged
(
hidden
)
}
override
fun
setUserVisibleHint
(
isVisibleToUser
:
Boolean
)
{
super
.
setUserVisibleHint
(
isVisibleToUser
)
mainFragment
?.
userVisibleHint
=
isVisibleToUser
}
private
fun
initView
()
{
//去除两侧应阴影
vpFragmentMoney
.
setOverScrollMode
(
ViewPager
.
OVER_SCROLL_NEVER
)
val
fragments
:
MutableList
<
Fragment
>
=
ArrayList
()
mainFragment
=
MainFragment
()
fragments
.
add
(
mainFragment
!!
)
fragments
.
add
(
ZhangyueFragment
())
val
tabs
:
MutableList
<
String
>
=
ArrayList
()
tabs
.
add
(
"视频"
)
tabs
.
add
(
"书城"
)
val
adapter
=
MessageFragAdapter
(
childFragmentManager
,
fragments
,
tabs
)
vpFragmentMoney
.
setAdapter
(
adapter
)
xtFragmentMoney
.
setupWithViewPager
(
vpFragmentMoney
)
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/ZhangyueFragment.kt
View file @
bed72fd5
package
com.mints.goodmoney.ui.fragment
import
android.os.Bundle
import
androidx.fragment.app.Fragment
import
androidx.fragment.app.FragmentTransaction
import
com.ireader.ireadersdk.IreaderApi
import
com.mints.goodmoney.R
import
com.mints.goodmoney.manager.ZhangyueManager
import
com.mints.goodmoney.ui.fragment.base.BaseFragment
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.mvp.presenters.BookPresenter
import
com.mints.goodmoney.mvp.presenters.HomePresenter
import
com.mints.goodmoney.mvp.views.BookView
import
com.mints.goodmoney.mvp.views.HomeView
import
com.mints.goodmoney.ui.activitys.AwardActivity
import
com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import
com.mints.goodmoney.utils.LogUtil
/**
* 描述:掌阅书城
* 作者:孟崔广
*/
class
ZhangyueFragment
:
BaseFragment
()
{
class
ZhangyueFragment
:
LazyLoadBaseFragment
(),
BookView
,
IreaderApi
.
OnReadChangeListener
{
private
val
TAG
=
ZhangyueFragment
::
class
.
java
.
simpleName
private
val
bookPresenter
by
lazy
{
BookPresenter
()
}
private
var
bookFragment
:
Fragment
?
=
null
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_main_zy
override
fun
initViewsAndEvents
()
{
ZhangyueManager
.
onCreateIreader
(
baseApplication
)
}
override
fun
onFragmentFirstVisible
()
{
bookPresenter
.
attachView
(
this
)
val
transaction
:
FragmentTransaction
=
supportFragmentManager
.
beginTransaction
()
if
(
bookFragment
==
null
)
{
bookFragment
=
IreaderApi
.
getNovelBookStoreFragment
()
transaction
.
add
(
R
.
id
.
fragment
,
bookFragment
!!
,
bookFragment
!!::
class
.
java
.
simpleName
)
IreaderApi
.
setReadChangeListener
(
this
)
}
else
{
transaction
.
show
(
bookFragment
!!
)
}
transaction
.
commitAllowingStateLoss
()
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
IreaderApi
.
setReadChangeListener
(
null
)
bookPresenter
.
detachView
()
}
// supportFragmentManager.beginTransaction().replace(R.id.fragment, IreaderApi.getNovelBookStoreFragment()).commitAllowingStateLoss()
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
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
coin
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/res/layout/fragment_main_money.xml
0 → 100755
View file @
bed72fd5
<?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:background=
"@color/white"
android:orientation=
"vertical"
>
<com.androidkun.xtablayout.XTabLayout
android:id=
"@+id/xtFragmentMoney"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:xTabDisplayNum=
"2"
android:layout_marginTop=
"20dp"
app:xTabIndicatorColor=
"#F28335"
app:xTabIndicatorHeight=
"4dp"
app:xTabMode=
"scrollable"
app:xTabSelectedTextColor=
"@color/main_mints"
app:xTabSelectedTextSize=
"20sp"
app:xTabTextColor=
"#000"
app:xTabIndicatorWidth=
"10dp"
app:xTabTextSize=
"15sp"
/>
<androidx.viewpager.widget.ViewPager
android:id=
"@+id/vpFragmentMoney"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
GoodMoney/app/src/main/res/layout/fragment_main_zy.xml
View file @
bed72fd5
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/fragment"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
android:orientation=
"vertical"
>
<FrameLayout
android:id=
"@+id/fragment"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"30dp"
/>
</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