Commit de7f256a authored by mengcuiguang's avatar mengcuiguang

书城改为旧版方式

parent 77f091c5
...@@ -233,7 +233,8 @@ dependencies { ...@@ -233,7 +233,8 @@ dependencies {
implementation 'com.liulishuo.filedownloader:library:1.7.7' implementation 'com.liulishuo.filedownloader:library:1.7.7'
implementation "org.greenrobot:eventbus:3.1.0-RC" implementation "org.greenrobot:eventbus:3.1.0-RC"
// 掌阅书城 // 掌阅书城
implementation(name: 'iReader-release-androidx-1.0.3.1-haozhuanqian', ext: 'aar') // implementation(name: 'iReader-release-androidx-1.0.3.1_haozhuanqian', ext: 'aar')
implementation(name: 'iReader-release-1.0.1', ext: 'aar')
implementation 'com.alibaba:fastjson:1.2.11' implementation 'com.alibaba:fastjson:1.2.11'
implementation 'androidx.annotation:annotation:1.0.0' implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.core:core:1.0.0' implementation 'androidx.core:core:1.0.0'
......
package com.mints.goodmoney.manager package com.mints.goodmoney.manager
import android.app.Application import android.app.Application
import com.ireader.ireadersdk.Config
import com.ireader.ireadersdk.IreaderApi import com.ireader.ireadersdk.IreaderApi
import com.mints.goodmoney.MintsApplication import com.mints.goodmoney.MintsApplication
import java.lang.Exception import java.lang.Exception
...@@ -15,24 +14,24 @@ object ZhangyueManager { ...@@ -15,24 +14,24 @@ object ZhangyueManager {
private const val APPID = "10054" private const val APPID = "10054"
fun onCreateIreader(application: Application) { fun onCreateIreader(application: Application) {
try {
IreaderApi.onCreate(application)
val config = Config.Builder()
.setZYAppId(APPID)
.setOaId(MintsApplication.OAID)
.setSupportCSJ(true)
.setSupportGDT(true)
.build()
IreaderApi.attachBaseContext(application, config)
} catch (e: Exception) {
e.printStackTrace()
}
// try { // try {
// IreaderApi.attachBaseContext(application) // IreaderApi.onCreate(application)
// IreaderApi.onCreate(application, APPID) // val config = Config.Builder()
// .setZYAppId(APPID)
// .setOaId(MintsApplication.OAID)
// .setSupportCSJ(true)
// .setSupportGDT(true)
// .build()
// IreaderApi.attachBaseContext(application, config)
// } catch (e: Exception) { // } catch (e: Exception) {
// e.printStackTrace() // e.printStackTrace()
// } // }
try {
IreaderApi.attachBaseContext(application)
IreaderApi.onCreate(application, APPID)
} catch (e: Exception) {
e.printStackTrace()
}
} }
......
...@@ -61,6 +61,23 @@ class MyZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadCh ...@@ -61,6 +61,23 @@ class MyZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadCh
bookPresenter.detachView() 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) { override fun readSecondsSuc(coin: Int) {
if (coin > 0) { if (coin > 0) {
val bundle = Bundle() val bundle = Bundle()
...@@ -84,31 +101,31 @@ class MyZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadCh ...@@ -84,31 +101,31 @@ class MyZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadCh
} }
} }
override fun addBookShelf(p0: Bundle?) { // override fun addBookShelf(p0: Bundle?) {
TODO("Not yet implemented") // TODO("Not yet implemented")
} // }
//
override fun onReadStart(p0: Bundle?) { // override fun onReadStart(p0: Bundle?) {
TODO("Not yet implemented") // TODO("Not yet implemented")
} // }
//
override fun onReadEnd(p0: Bundle?) { // override fun onReadEnd(p0: Bundle?) {
val seconds = (p0!!.getLong(IreaderApi.BOOK_TIME) / 1000).toInt() // val seconds = (p0!!.getLong(IreaderApi.BOOK_TIME) / 1000).toInt()
// 阅读5秒以上 保存时长 // // 阅读5秒以上 保存时长
if (seconds > 5) { // if (seconds > 5) {
bookPresenter.addReadSeconds(seconds) // bookPresenter.addReadSeconds(seconds)
} // }
} // }
//
override fun onDeleteBook(p0: String?) { // override fun onDeleteBook(p0: String?) {
TODO("Not yet implemented") // TODO("Not yet implemented")
} // }
//
override fun onReadPage(p0: Bundle?) { // override fun onReadPage(p0: Bundle?) {
TODO("Not yet implemented") // TODO("Not yet implemented")
} // }
//
override fun onChangeNight(p0: Boolean) { // override fun onChangeNight(p0: Boolean) {
TODO("Not yet implemented") // TODO("Not yet implemented")
} // }
} }
\ No newline at end of file
...@@ -60,23 +60,22 @@ class ZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChan ...@@ -60,23 +60,22 @@ class ZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChan
bookPresenter.detachView() bookPresenter.detachView()
} }
// override fun onReadStart() { override fun onReadStart() {
// } }
//
// override fun onReadEnd(time: Long) { override fun onReadEnd(time: Long) {
//// LogUtil.d(TAG, "onReadEnd time:" + time) // LogUtil.d(TAG, "onReadEnd time:" + time)
//// LogUtil.d(TAG, "onReadEnd time(Int):" + (time/1000).toInt()) // 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) {
// }
val seconds = (time / 1000).toInt()
// 阅读5秒以上 保存时长
if (seconds > 5) {
bookPresenter.addReadSeconds(seconds)
}
}
override fun onReadPage(time: Long) {
}
override fun readSecondsSuc(coin: Int) { override fun readSecondsSuc(coin: Int) {
if (coin > 0) { if (coin > 0) {
...@@ -101,29 +100,29 @@ class ZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChan ...@@ -101,29 +100,29 @@ class ZhangyueFragment : LazyLoadBaseFragment(), BookView, IreaderApi.OnReadChan
} }
} }
override fun addBookShelf(p0: Bundle?) { // override fun addBookShelf(p0: Bundle?) {
} // }
//
override fun onReadStart(p0: Bundle?) { // override fun onReadStart(p0: Bundle?) {
} // }
//
override fun onReadEnd(p0: Bundle?) { // override fun onReadEnd(p0: Bundle?) {
// LogUtil.d(TAG, "onReadEnd time:" + time) // // LogUtil.d(TAG, "onReadEnd time:" + time)
// LogUtil.d(TAG, "onReadEnd time(Int):" + (time/1000).toInt()) //// LogUtil.d(TAG, "onReadEnd time(Int):" + (time/1000).toInt())
//
val seconds = (p0!!.getLong(IreaderApi.BOOK_TIME).toLong() / 1000).toInt() // val seconds = (p0!!.getLong(IreaderApi.BOOK_TIME).toLong() / 1000).toInt()
// 阅读5秒以上 保存时长 // // 阅读5秒以上 保存时长
if (seconds > 5) { // if (seconds > 5) {
bookPresenter.addReadSeconds(seconds) // bookPresenter.addReadSeconds(seconds)
} // }
} // }
//
override fun onDeleteBook(p0: String?) { // override fun onDeleteBook(p0: String?) {
} // }
//
override fun onReadPage(p0: Bundle?) { // override fun onReadPage(p0: Bundle?) {
} // }
//
override fun onChangeNight(p0: Boolean) { // override fun onChangeNight(p0: Boolean) {
} // }
} }
\ No newline at end of file
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