master
Z 4 years ago
parent 0d4eb3cb38
commit 4f34c3637c
  1. 2
      app/.gitignore
  2. 18
      app/release/output-metadata.json
  3. BIN
      app/release/reader_app_1.0.0.apk
  4. 33
      app/src/main/java/com/novel/read/ui/read/ReadMenu.kt
  5. 10
      app/src/main/res/layout/view_read_menu.xml

2
app/.gitignore vendored

@ -1,3 +1 @@
/build /build
/release
/google

@ -0,0 +1,18 @@
{
"version": 2,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "com.novel.read",
"variantName": "processAppReleaseResources",
"elements": [
{
"type": "SINGLE",
"filters": [],
"versionCode": 1,
"versionName": "1.0.0",
"outputFile": "reader_app_1.0.0.apk"
}
]
}

Binary file not shown.

@ -1,10 +1,8 @@
package com.novel.read.ui.read package com.novel.read.ui.read
import android.content.Context import android.content.Context
import android.content.Intent
import android.content.res.ColorStateList import android.content.res.ColorStateList
import android.graphics.drawable.GradientDrawable import android.graphics.drawable.GradientDrawable
import android.net.Uri
import android.util.AttributeSet import android.util.AttributeSet
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.WindowManager import android.view.WindowManager
@ -118,14 +116,6 @@ class ReadMenu @JvmOverloads constructor(
private fun bindEvent() = with(binding){ private fun bindEvent() = with(binding){
tvChapterName.onClick { tvChapterName.onClick {
}
tvChapterUrl.onClick {
runCatching {
val url = tvChapterUrl.text.toString()
val intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse(url)
context.startActivity(intent)
}
} }
//阅读进度 //阅读进度
seekReadPage.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener { seekReadPage.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener {
@ -145,7 +135,7 @@ class ReadMenu @JvmOverloads constructor(
//搜索 //搜索
fabSearch.onClick { fabSearch.onClick {
runMenuOut { runMenuOut {
callBack?.openSearchActivity(null) callBack.openSearchActivity(null)
} }
} }
@ -164,31 +154,31 @@ class ReadMenu @JvmOverloads constructor(
//目录 //目录
llCatalog.onClick { llCatalog.onClick {
runMenuOut { runMenuOut {
callBack?.openChapterList() callBack.openChapterList()
} }
} }
//朗读 //朗读
llReadAloud.onClick { llReadAloud.onClick {
runMenuOut { runMenuOut {
callBack?.onClickReadAloud() callBack.onClickReadAloud()
} }
} }
llReadAloud.onLongClick { llReadAloud.onLongClick {
runMenuOut { callBack?.showReadAloudDialog() } runMenuOut { callBack.showReadAloudDialog() }
true true
} }
//界面 //界面
llFont.onClick { llFont.onClick {
runMenuOut { runMenuOut {
callBack?.showAdjust() callBack.showAdjust()
} }
} }
//设置 //设置
llSetting.onClick { llSetting.onClick {
runMenuOut { runMenuOut {
callBack?.showReadStyle() callBack.showReadStyle()
} }
} }
} }
@ -199,7 +189,7 @@ class ReadMenu @JvmOverloads constructor(
menuBottomIn = AnimationUtilsSupport.loadAnimation(context, R.anim.anim_readbook_bottom_in) menuBottomIn = AnimationUtilsSupport.loadAnimation(context, R.anim.anim_readbook_bottom_in)
menuTopIn.setAnimationListener(object : Animation.AnimationListener { menuTopIn.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) { override fun onAnimationStart(animation: Animation) {
callBack?.upSystemUiVisibility() callBack.upSystemUiVisibility()
} }
override fun onAnimationEnd(animation: Animation) { override fun onAnimationEnd(animation: Animation) {
@ -232,7 +222,7 @@ class ReadMenu @JvmOverloads constructor(
binding.bottomMenu.invisible() binding.bottomMenu.invisible()
cnaShowMenu = false cnaShowMenu = false
onMenuOutEnd?.invoke() onMenuOutEnd?.invoke()
callBack?.upSystemUiVisibility() callBack.upSystemUiVisibility()
} }
override fun onAnimationRepeat(animation: Animation) = Unit override fun onAnimationRepeat(animation: Animation) = Unit
@ -248,19 +238,12 @@ class ReadMenu @JvmOverloads constructor(
ReadBook.curTextChapter?.let { ReadBook.curTextChapter?.let {
binding.tvChapterName.text = it.title binding.tvChapterName.text = it.title
binding.tvChapterName.visible() binding.tvChapterName.visible()
if (!ReadBook.isLocalBook) {
binding.tvChapterUrl.text = it.title
binding.tvChapterUrl.visible()
} else {
binding.tvChapterUrl.gone()
}
binding.seekReadPage.max = it.pageSize.minus(1) binding.seekReadPage.max = it.pageSize.minus(1)
binding.seekReadPage.progress = ReadBook.durPageIndex binding.seekReadPage.progress = ReadBook.durPageIndex
binding.tvPre.isEnabled = ReadBook.durChapterIndex != 0 binding.tvPre.isEnabled = ReadBook.durChapterIndex != 0
binding.tvNext.isEnabled = ReadBook.durChapterIndex != ReadBook.chapterSize - 1 binding.tvNext.isEnabled = ReadBook.durChapterIndex != ReadBook.chapterSize - 1
} ?: let { } ?: let {
binding.tvChapterName.gone() binding.tvChapterName.gone()
binding.tvChapterUrl.gone()
} }
} }

@ -30,16 +30,6 @@
android:textSize="12sp" android:textSize="12sp"
android:visibility="gone" /> android:visibility="gone" />
<TextView
android:id="@+id/tv_chapter_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:singleLine="true"
android:textSize="12sp"
android:visibility="gone" />
</com.novel.read.ui.widget.TitleBar> </com.novel.read.ui.widget.TitleBar>
<LinearLayout <LinearLayout

Loading…
Cancel
Save