pull/1303/head
gedoor 3 years ago
parent b6c5a3ab8d
commit 427b71fabd
  1. 6
      app/src/main/assets/updateLog.md
  2. 9
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt
  3. 14
      app/src/main/java/io/legado/app/ui/rss/article/RssSortActivity.kt

@ -12,6 +12,12 @@
* 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源! * 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源!
* 关于最近版本有时候界面没有数据的问题是因为把LiveData组件换成了谷歌推荐的Flow组件导致的问题,正在查找解决办法 * 关于最近版本有时候界面没有数据的问题是因为把LiveData组件换成了谷歌推荐的Flow组件导致的问题,正在查找解决办法
**2021/09/08**
1. 优化离线缓存
2. 听书界面添加登录菜单,和拷贝播放url
3.
**2021/09/06** **2021/09/06**
1. 采用exoPlayer播放音频,支持更多格式 1. 采用exoPlayer播放音频,支持更多格式

@ -84,7 +84,7 @@ class BookInfoActivity :
} }
} }
private val infoEditResult = registerForActivityResult( private val infoEditResult = registerForActivityResult(
ActivityResultContracts.StartActivityForResult() StartActivityForResult(BookInfoEditActivity::class.java)
) { ) {
if (it.resultCode == RESULT_OK) { if (it.resultCode == RESULT_OK) {
viewModel.upEditBook() viewModel.upEditBook()
@ -127,10 +127,9 @@ class BookInfoActivity :
R.id.menu_edit -> { R.id.menu_edit -> {
if (viewModel.inBookshelf) { if (viewModel.inBookshelf) {
viewModel.bookData.value?.let { viewModel.bookData.value?.let {
infoEditResult.launch( infoEditResult.launch {
Intent(this, BookInfoEditActivity::class.java) putExtra("bookUrl", it.bookUrl)
.putExtra("bookUrl", it.bookUrl) }
)
} }
} else { } else {
toastOnUi(R.string.after_add_bookshelf) toastOnUi(R.string.after_add_bookshelf)

@ -2,12 +2,10 @@
package io.legado.app.ui.rss.article package io.legado.app.ui.rss.article
import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.view.ViewGroup import android.view.ViewGroup
import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.viewModels import androidx.activity.viewModels
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentStatePagerAdapter import androidx.fragment.app.FragmentStatePagerAdapter
@ -15,6 +13,7 @@ import io.legado.app.R
import io.legado.app.base.VMBaseActivity import io.legado.app.base.VMBaseActivity
import io.legado.app.databinding.ActivityRssArtivlesBinding import io.legado.app.databinding.ActivityRssArtivlesBinding
import io.legado.app.ui.rss.source.edit.RssSourceEditActivity import io.legado.app.ui.rss.source.edit.RssSourceEditActivity
import io.legado.app.utils.StartActivityForResult
import io.legado.app.utils.gone import io.legado.app.utils.gone
import io.legado.app.utils.viewbindingdelegate.viewBinding import io.legado.app.utils.viewbindingdelegate.viewBinding
import io.legado.app.utils.visible import io.legado.app.utils.visible
@ -26,8 +25,8 @@ class RssSortActivity : VMBaseActivity<ActivityRssArtivlesBinding, RssSortViewMo
private lateinit var adapter: TabFragmentPageAdapter private lateinit var adapter: TabFragmentPageAdapter
private val sortList = mutableListOf<Pair<String, String>>() private val sortList = mutableListOf<Pair<String, String>>()
private val fragmentMap = hashMapOf<String, Fragment>() private val fragmentMap = hashMapOf<String, Fragment>()
private val upSourceResult = registerForActivityResult( private val editSourceResult = registerForActivityResult(
ActivityResultContracts.StartActivityForResult() StartActivityForResult(RssSourceEditActivity::class.java)
) { ) {
if (it.resultCode == RESULT_OK) { if (it.resultCode == RESULT_OK) {
viewModel.initData(intent) { viewModel.initData(intent) {
@ -56,10 +55,9 @@ class RssSortActivity : VMBaseActivity<ActivityRssArtivlesBinding, RssSortViewMo
override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { override fun onCompatOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) { when (item.itemId) {
R.id.menu_edit_source -> viewModel.rssSource?.sourceUrl?.let { R.id.menu_edit_source -> viewModel.rssSource?.sourceUrl?.let {
upSourceResult.launch( editSourceResult.launch {
Intent(this, RssSourceEditActivity::class.java) putExtra("data", it)
.putExtra("data", it) }
)
} }
R.id.menu_clear -> { R.id.menu_clear -> {
viewModel.url?.let { viewModel.url?.let {

Loading…
Cancel
Save