Commit 3b1813b5 authored by mengcuiguang's avatar mengcuiguang

添加书城

parent cb20f0ca
......@@ -154,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'
......@@ -307,7 +307,6 @@ dependencies {
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.github.bumptech.glide:compiler:$rootProject.glideVersion"
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"
......@@ -328,7 +327,7 @@ dependencies {
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.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"
......@@ -336,14 +335,14 @@ dependencies {
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' // skin-support
implementation 'skin.support:skin-support-appcompat:4.0.5' // skin-support 基础控件支持
implementation 'skin.support:skin-support-design:4.0.5' // skin-support-design material design 控件支持[可选]
implementation 'skin.support:skin-support-cardview:4.0.5' // skin-support-cardview CardView 控件支持[可选]
implementation 'skin.support:skin-support-constraint-layout:4.0.5' // skin-support-constraint-layout ConstraintLayout 控件支持[可选]
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" //注意版本号
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'
......
......@@ -149,6 +149,7 @@ public class MintsApplication extends MultiDexApplication {
// 自定义logger
bindLogger();
// 中文在线 听读
ReaderManager.init(this);
......
......@@ -25,6 +25,12 @@ 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) {
......@@ -32,10 +38,7 @@ public class ReaderManager {
ChineseAllReaderApplication.Companion.install(applicationContext, "1242", "hzq@1242", "32", "0", new AdProvider() {
@Override
public void onAdDialogPositiveClick(@Nullable Dialog dialog, @NotNull Function0<Unit> function0) {
if (NetworkUtil.isNetworkAvailable(applicationContext) && !NetworkUtil.INSTANCE.isWifiConnected(
applicationContext
)
) {
if (NetworkUtil.isNetworkAvailable(applicationContext) && !NetworkUtil.INSTANCE.isWifiConnected(applicationContext)) {
new AlertDialog.Builder(ActivityStackManager.getInstance().getTopActivity())
.setTitle("温馨提示")
.setMessage("当前处于移动网络,播放视频会消耗流量,确定播放?")
......@@ -56,7 +59,6 @@ public class ReaderManager {
}
}).create().show();
return;
}
}
......@@ -74,6 +76,7 @@ public class ReaderManager {
@Override
public void getReaderPageAd(@NotNull OnAdViewReceiver receiver) {
//加载阅读内容⻚广告 建议每次调用,更换不同的广告id
ad.loadAD(applicationContext, receiver, DensityUtil.px2dip(applicationContext, ScreenUtils.getScreenWidth(applicationContext) - DensityUtil.dip2px(applicationContext, 30f)), DensityUtil.px2dip(applicationContext, 854f), null);
}
......@@ -84,20 +87,5 @@ public class ReaderManager {
}
});
// ChineseAllReaderApplication.Companion.setOnReadCallBack(new OnReadCallBack() {
// /**
// * "time" : 阅读总时长
// * "bookName" : 书名
// * "chapterName" : 当前章节名
// * "pageInChapter" : 当前章节内阅读页码
// * "chapterTotalPages" : 当前章节总页数
// */
// @Override
// public void onReceive(@NotNull Map<String, ?> map) {
// Object time = map.get("time");
//// ToastUtil.toast(time + "");
//
// }
// }, 30 * 1000);//间隔30秒 回调一次 间隔任意设置
}
}
......@@ -254,7 +254,7 @@ public class ToutiaoAD {
// SharedPreferencesUtil.getInstance().putBoolean(StringConstants.VIDEO_TASK_FINISH, false);
AdSlot adSlot = new AdSlot.Builder()
.setCodeId(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK)
.setCodeId(TtCsjAdManager.TT_AD_VEDIO_MOREDIALOG)
.setSupportDeepLink(true)
.setAdCount(1)
.setImageAcceptedSize(ScreenUtils.getScreenWidth(ChineseAllReaderApplication.globalContext) / 4, ScreenUtils.getScreenHeight(ChineseAllReaderApplication.globalContext) / 4)
......
......@@ -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 }
......
......@@ -10,7 +10,9 @@ import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.fragment.FriendsFragment
import com.mints.goodmoney.ui.fragment.KuYinYueFragment
import com.mints.goodmoney.ui.fragment.RsNewsFragment
import com.mints.goodmoney.ui.fragment.WzFragment
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.*
......@@ -20,7 +22,6 @@ import kotlinx.android.synthetic.main.header_layout.*
* 作者:孟崔广
* 时间:2020/12/10 12:39
*/
@AndroidEntryPoint
class WrapperActivity : BaseActivity(), View.OnClickListener {
private var wrapperType = Constant.WRAPPER_TYPE_NEWS
......@@ -54,28 +55,16 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
var currentFragment: Fragment?
when (wrapperType) {
Constant.WRAPPER_TYPE_NEWS -> {
// layoutWrapper.visibility = View.INVISIBLE
// val layoutParams = layoutWrapper.layoutParams
// layoutParams.height = BubbleUtils.dp2px(30)
// tv_title.text = "新闻"
// currentFragment = RsNewsFragment()
layoutWrapper.visibility = View.INVISIBLE
val layoutParams = layoutWrapper.layoutParams
layoutParams.height = BubbleUtils.dp2px(30)
tv_title.text = "新闻"
currentFragment = RsNewsFragment()
// val wellChosenFragment = WellChosenFragment("home")
// val transaction: FragmentTransaction = supportFragmentManager.beginTransaction()
// transaction.add(R.id.flWrapper, wellChosenFragment, WellChosenFragment::class.java.simpleName)
// val transaction = supportFragmentManager.beginTransaction()
// transaction.add(R.id.flWrapper, wellChosenFragment, WellChosenFragment::class.java.toString())
// transaction.show(wellChosenFragment)
// transaction.commitAllowingStateLoss()
// ViewPager viewPager = findViewById(R.id.view_pager);
// TabLayout tabLayout = findViewById(R.id.tabs);
//
// viewPager.setAdapter(new MyViewPageAdapter(getSupportFragmentManager()));
// tabLayout.setupWithViewPager(viewPager);
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_FRIENDS -> {
tv_title.text = "瓜分百万现金福利"
......@@ -95,11 +84,11 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
}
}
// if (!currentFragment.isAdded) {
// // 提交事务
// supportFragmentManager.beginTransaction()
// .add(R.id.flWrapper, currentFragment,currentFragment.tag).commitAllowingStateLoss()
// }
if (!currentFragment.isAdded) {
// 提交事务
supportFragmentManager.beginTransaction()
.add(R.id.flWrapper, currentFragment,currentFragment.tag).commitAllowingStateLoss()
}
}
private fun initListener() {
......
......@@ -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
......
......@@ -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()
}
......
......@@ -16,6 +16,9 @@ import android.widget.GridView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.viewpager.widget.ViewPager
import com.alibaba.android.arouter.launcher.ARouter
import com.chineseall.reader17ksdk.feature.main.bookshop.wellchosen.WellChosenActionType
import com.chineseall.reader17ksdk.utils.RouterPath
import com.component.dly.xzzq_ywsdk.YwSDK_WebActivity.Companion.open
import com.fly.scenemodule.SceneUtil
import com.mints.goodmoney.BuildConfig
......
package com.mints.goodmoney.ui.fragment
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.mvp.presenters.RsNewsPresenter
import com.mints.goodmoney.mvp.views.RsNewsView
import com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import com.mints.goodmoney.utils.LogUtil
/**
* 描述:听读
* 作者:孟崔广
* 时间:2020/12/9 10:55
* 时间:2021/04/08 10:55
*/
class ReaderFragment : LazyLoadBaseFragment(), RsNewsView {
class ReaderFragment : LazyLoadBaseFragment(), RsNewsView, OnReadCallBack {
private val wellChosenFragment by lazy { WellChosenFragment("home") }
private val rsNewsPresenter by lazy { RsNewsPresenter() }
......@@ -28,15 +31,26 @@ class ReaderFragment : LazyLoadBaseFragment(), RsNewsView {
transaction.add(R.id.fragment, wellChosenFragment, ReaderFragment::class.java.simpleName)
transaction.show(wellChosenFragment)
transaction.commitAllowingStateLoss()
//间隔30秒 回调一次 间隔任意设置
ChineseAllReaderApplication.setOnReadCallBack(this, 30 * 1000)
}
override fun onDestroy() {
super.onDestroy()
ChineseAllReaderApplication.destory()
rsNewsPresenter.detachView()
}
override fun readSecondsSuc(coin: Int, video: Int, supr: Int) {
}
override fun onReceive(map: Map<String, Any>) {
val time = map.get("time").toString()
rsNewsPresenter.addNewsSeconds(time.toInt())
LogUtil.d("ReaderFragment", "time:-->${time}")
}
}
\ No newline at end of file
......@@ -2,12 +2,7 @@ buildscript {
ext.kotlin_version = '1.3.72'
ext {
// Sdk and tools
compileSdkVersion = 29
minSdkVersion = 21
targetSdkVersion = 29
// App dependencies
// 听读 App dependencies
appCompatVersion = '1.1.0'
assistedInjectVersion = '0.5.2'
constraintLayoutVersion = '2.0.0-beta3'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment