Merge remote-tracking branch 'origin/master'

pull/67/head
Administrator 5 years ago
commit c2edb204de
  1. 1
      app/src/main/AndroidManifest.xml
  2. 3
      app/src/main/assets/updateLog.md
  3. 2
      app/src/main/java/io/legado/app/service/DownloadService.kt
  4. 4
      app/src/main/java/io/legado/app/ui/about/DonateActivity.kt
  5. 5
      app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt
  6. 10
      app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt
  7. 16
      app/src/main/java/io/legado/app/ui/download/DownloadActivity.kt
  8. 3
      app/src/main/java/io/legado/app/ui/widget/page/ContentSelectActionCallback.kt
  9. 1
      app/src/main/java/io/legado/app/ui/widget/page/ContentTextView.kt
  10. 14
      app/src/main/res/layout/activity_audio_play.xml
  11. 7
      app/src/main/res/layout/activity_download.xml

@ -102,6 +102,7 @@
<activity android:name=".ui.rss.source.manage.RssSourceActivity" /> <activity android:name=".ui.rss.source.manage.RssSourceActivity" />
<activity android:name=".ui.rss.source.debug.RssSourceDebugActivity" /> <activity android:name=".ui.rss.source.debug.RssSourceDebugActivity" />
<activity android:name=".ui.rss.article.RssArticlesActivity" /> <activity android:name=".ui.rss.article.RssArticlesActivity" />
<activity android:name=".ui.download.DownloadActivity" />
<activity <activity
android:name=".receiver.SharedReceiverActivity" android:name=".receiver.SharedReceiverActivity"
android:label="@string/receiving_shared_label"> android:label="@string/receiving_shared_label">

@ -4,6 +4,9 @@
* 先在旧版阅读(2.x)中进行备份,然后在新版阅读(3.x)【我的】->【备份与恢复】,选择【导入旧版本数据】,提示存储权限,选择允许即可导入成功。 * 先在旧版阅读(2.x)中进行备份,然后在新版阅读(3.x)【我的】->【备份与恢复】,选择【导入旧版本数据】,提示存储权限,选择允许即可导入成功。
* 注意:由于安卓10更改了权限策略,还需要给「允许安装其他应用」的权限才能导入源。MIUI11也需要此权限。 * 注意:由于安卓10更改了权限策略,还需要给「允许安装其他应用」的权限才能导入源。MIUI11也需要此权限。
**2019/12/22**
* 更新音频播放界面
**2019/12/20** **2019/12/20**
* 阅读界面的下载菜单可以用了 * 阅读界面的下载菜单可以用了
* rss阅读bug修复,webView内可以用返回建返回上一链接 * rss阅读bug修复,webView内可以用返回建返回上一链接

@ -39,9 +39,9 @@ class DownloadService : BaseService() {
} }
override fun onDestroy() { override fun onDestroy() {
super.onDestroy()
tasks.clear() tasks.clear()
searchPool.close() searchPool.close()
super.onDestroy()
} }
private fun download(bookUrl: String?, start: Int, end: Int) { private fun download(bookUrl: String?, start: Int, end: Int) {

@ -76,8 +76,8 @@ class DonateActivity : BaseActivity(R.layout.activity_donate) {
private fun aliDonate(context: Context) { private fun aliDonate(context: Context) {
try { try {
val qrCode = URLEncoder.encode("tsx06677nwdk3javroq4ef0", "utf-8") val qrCode = URLEncoder.encode("tsx06677nwdk3javroq4ef0", "utf-8")
val aliPayQr = "alipayqr://platformapi/startapp?" + val aliPayQr =
"saId=10000007&qrcode=https://qr.alipay.com/$qrCode" "alipayqr://platformapi/startapp?saId=10000007&qrcode=https://qr.alipay.com/$qrCode"
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(aliPayQr)) val intent = Intent(Intent.ACTION_VIEW, Uri.parse(aliPayQr))
context.startActivity(intent) context.startActivity(intent)
} catch (e: Exception) { } catch (e: Exception) {

@ -16,6 +16,7 @@ import io.legado.app.R
import io.legado.app.base.VMBaseActivity import io.legado.app.base.VMBaseActivity
import io.legado.app.constant.Bus import io.legado.app.constant.Bus
import io.legado.app.constant.Status import io.legado.app.constant.Status
import io.legado.app.constant.Theme
import io.legado.app.data.entities.Book import io.legado.app.data.entities.Book
import io.legado.app.help.BlurTransformation import io.legado.app.help.BlurTransformation
import io.legado.app.help.ImageLoader import io.legado.app.help.ImageLoader
@ -34,7 +35,8 @@ import org.jetbrains.anko.sdk27.listeners.onLongClick
import org.jetbrains.anko.startActivityForResult import org.jetbrains.anko.startActivityForResult
class AudioPlayActivity : VMBaseActivity<AudioPlayViewModel>(R.layout.activity_audio_play), class AudioPlayActivity :
VMBaseActivity<AudioPlayViewModel>(R.layout.activity_audio_play, theme = Theme.Dark),
ChangeSourceDialog.CallBack { ChangeSourceDialog.CallBack {
override val viewModel: AudioPlayViewModel override val viewModel: AudioPlayViewModel
@ -44,6 +46,7 @@ class AudioPlayActivity : VMBaseActivity<AudioPlayViewModel>(R.layout.activity_a
private var adjustProgress = false private var adjustProgress = false
override fun onActivityCreated(savedInstanceState: Bundle?) { override fun onActivityCreated(savedInstanceState: Bundle?) {
title_bar.background.alpha = 0
AudioPlay.titleData.observe(this, Observer { title_bar.title = it }) AudioPlay.titleData.observe(this, Observer { title_bar.title = it })
AudioPlay.coverData.observe(this, Observer { upCover(it) }) AudioPlay.coverData.observe(this, Observer { upCover(it) })
viewModel.initData(intent) viewModel.initData(intent)

@ -40,18 +40,17 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
if (ReadBook.book?.bookUrl != book.bookUrl) { if (ReadBook.book?.bookUrl != book.bookUrl) {
ReadBook.resetData(book) ReadBook.resetData(book)
isInitFinish = true isInitFinish = true
val count = App.db.bookChapterDao().getChapterCount(book.bookUrl) ReadBook.chapterSize = App.db.bookChapterDao().getChapterCount(book.bookUrl)
if (count == 0) { if (ReadBook.chapterSize == 0) {
if (book.tocUrl.isEmpty()) { if (book.tocUrl.isEmpty()) {
loadBookInfo(book) loadBookInfo(book)
} else { } else {
loadChapterList(book) loadChapterList(book)
} }
} else { } else {
if (ReadBook.durChapterIndex > count - 1) { if (ReadBook.durChapterIndex > ReadBook.chapterSize - 1) {
ReadBook.durChapterIndex = count - 1 ReadBook.durChapterIndex = ReadBook.chapterSize - 1
} }
ReadBook.chapterSize = count
ReadBook.loadContent() ReadBook.loadContent()
} }
if (ReadBook.inBookshelf) { if (ReadBook.inBookshelf) {
@ -60,6 +59,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
} else { } else {
isInitFinish = true isInitFinish = true
ReadBook.titleDate.postValue(book.name) ReadBook.titleDate.postValue(book.name)
ReadBook.chapterSize = App.db.bookChapterDao().getChapterCount(book.bookUrl)
if (ReadBook.chapterSize == 0) { if (ReadBook.chapterSize == 0) {
if (book.tocUrl.isEmpty()) { if (book.tocUrl.isEmpty()) {
loadBookInfo(book) loadBookInfo(book)

@ -0,0 +1,16 @@
package io.legado.app.ui.download
import android.os.Bundle
import io.legado.app.R
import io.legado.app.base.BaseActivity
class DownloadActivity : BaseActivity(R.layout.activity_download) {
override fun onActivityCreated(savedInstanceState: Bundle?) {
}
}

@ -3,12 +3,13 @@ package io.legado.app.ui.widget.page
import android.view.ActionMode import android.view.ActionMode
import android.view.Menu import android.view.Menu
import android.view.MenuItem import android.view.MenuItem
import android.widget.TextView
import io.legado.app.R import io.legado.app.R
import io.legado.app.constant.Bus import io.legado.app.constant.Bus
import io.legado.app.utils.postEvent import io.legado.app.utils.postEvent
class ContentSelectActionCallback(private val textView: ContentTextView) : ActionMode.Callback { class ContentSelectActionCallback(private val textView: TextView) : ActionMode.Callback {
override fun onActionItemClicked(mode: ActionMode?, item: MenuItem?): Boolean { override fun onActionItemClicked(mode: ActionMode?, item: MenuItem?): Boolean {
when (item?.itemId) { when (item?.itemId) {

@ -241,4 +241,5 @@ class ContentTextView : AppCompatTextView {
} }
} }
} }
} }

@ -15,20 +15,18 @@
android:scaleType="centerCrop" android:scaleType="centerCrop"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<View
android:id="@+id/vw_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#50000000" />
<io.legado.app.ui.widget.TitleBar <io.legado.app.ui.widget.TitleBar
android:id="@+id/title_bar" android:id="@+id/title_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/vw_bg"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@drawable/bg_gradient"
app:layout_constraintTop_toBottomOf="@+id/title_bar"
app:layout_constraintBottom_toBottomOf="parent" />
<TextView <TextView
android:id="@+id/tv_speed" android:id="@+id/tv_speed"
android:layout_width="wrap_content" android:layout_width="wrap_content"

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
</LinearLayout>
Loading…
Cancel
Save