|
|
@ -3,6 +3,7 @@ package com.novel.read.activity |
|
|
|
import android.annotation.SuppressLint |
|
|
|
import android.annotation.SuppressLint |
|
|
|
import android.app.ProgressDialog |
|
|
|
import android.app.ProgressDialog |
|
|
|
import android.content.Intent |
|
|
|
import android.content.Intent |
|
|
|
|
|
|
|
import android.util.Log |
|
|
|
import android.view.View |
|
|
|
import android.view.View |
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
import androidx.recyclerview.widget.LinearLayoutManager |
|
|
|
import com.mango.mangolib.event.EventManager |
|
|
|
import com.mango.mangolib.event.EventManager |
|
|
@ -39,8 +40,7 @@ class NovelBookDetailActivity : NovelBaseActivity(), View.OnClickListener { |
|
|
|
|
|
|
|
|
|
|
|
private var mProgressDialog: ProgressDialog? = null |
|
|
|
private var mProgressDialog: ProgressDialog? = null |
|
|
|
|
|
|
|
|
|
|
|
override val layoutId: Int |
|
|
|
override val layoutId: Int get() = R.layout.activity_book_detail |
|
|
|
get() = R.layout.activity_book_detail |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun initView() { |
|
|
|
override fun initView() { |
|
|
|
mBookId = intent.getIntExtra(Constant.Bundle.BookId, 0) |
|
|
|
mBookId = intent.getIntExtra(Constant.Bundle.BookId, 0) |
|
|
@ -120,7 +120,7 @@ class NovelBookDetailActivity : NovelBaseActivity(), View.OnClickListener { |
|
|
|
if (mCollBookBean != null) { |
|
|
|
if (mCollBookBean != null) { |
|
|
|
isCollected = true |
|
|
|
isCollected = true |
|
|
|
tv_add_book.text = resources.getString(R.string.already_add) |
|
|
|
tv_add_book.text = resources.getString(R.string.already_add) |
|
|
|
tv_start_read.text = "继续阅读" |
|
|
|
tv_start_read.text = resources.getString(R.string.go_read) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
mCollBookBean = event.result!!.collBookBean |
|
|
|
mCollBookBean = event.result!!.collBookBean |
|
|
|
} |
|
|
|
} |
|
|
@ -130,7 +130,7 @@ class NovelBookDetailActivity : NovelBaseActivity(), View.OnClickListener { |
|
|
|
@Subscribe |
|
|
|
@Subscribe |
|
|
|
fun getRecommendBook(event: GetRecommendBookEvent) { |
|
|
|
fun getRecommendBook(event: GetRecommendBookEvent) { |
|
|
|
if (event.isFail) { |
|
|
|
if (event.isFail) { |
|
|
|
|
|
|
|
Log.e("getRecommendBook", event.er?.msg) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
mList.clear() |
|
|
|
mList.clear() |
|
|
|
mList.addAll(event.result!!.book) |
|
|
|
mList.addAll(event.result!!.book) |
|
|
@ -202,7 +202,7 @@ class NovelBookDetailActivity : NovelBaseActivity(), View.OnClickListener { |
|
|
|
|
|
|
|
|
|
|
|
if (isCollected) { |
|
|
|
if (isCollected) { |
|
|
|
tv_add_book.text = resources.getString(R.string.already_add) |
|
|
|
tv_add_book.text = resources.getString(R.string.already_add) |
|
|
|
tv_start_read.text = "继续阅读" |
|
|
|
tv_start_read.text = resources.getString(R.string.go_read) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|