pull/475/head
gedoor 4 years ago
parent a1baddf8e8
commit 8a894f9c55
  1. 1
      app/src/main/assets/help/readHelp.md
  2. 16
      app/src/main/assets/help/readMenuHelp.md
  3. 42
      app/src/main/java/io/legado/app/help/LocalConfig.kt
  4. 6
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  5. 1
      app/src/main/java/io/legado/app/ui/book/read/ReadBookBaseActivity.kt
  6. 36
      app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt
  7. 1
      app/src/main/java/io/legado/app/ui/config/BackupConfigFragment.kt
  8. 1
      app/src/main/java/io/legado/app/ui/main/MainActivity.kt
  9. 5
      app/src/main/res/menu/read_book.xml

@ -1 +0,0 @@
# 阅读界面帮助文档

@ -0,0 +1,16 @@
# 阅读界面帮助文档
1.阅读界面主菜单
* 顶部操作
* 章节名称:点击可编辑书源
* 章节url:点击可打开浏览器浏览
* 菜单:不同类型的书籍显示的菜单不同,详情查看菜单文字,长按菜单图标可显示文字
* 中间左侧-亮度调节
* 亮度调节的顶端有跟随系统亮度的开关,打开后亮度跟随系统,关闭后才可以调节亮度条
* 底部操作
* 4个圆形按钮依次为 全文搜索✧自动翻页✧替换净化✧切换夜间模式
* 上一章✧下一章中间的进度条为页数进度,要快速跳转章节点击目录按钮进入目录快速跳转
* 目录->目录和书签界面
* 朗读->单击开始朗读,长按进入朗读设置界面
* 界面->所有排版设置都在里面
* 设置->其它一些设置,找不到的设置去这里看看,可滚动

@ -9,22 +9,40 @@ object LocalConfig {
private val localConfig = private val localConfig =
App.INSTANCE.getSharedPreferences("local", Context.MODE_PRIVATE) App.INSTANCE.getSharedPreferences("local", Context.MODE_PRIVATE)
var isFirstOpenApp: Boolean val isFirstOpenApp: Boolean
get() = localConfig.getBoolean("firstOpen", true) get() {
set(value) { val value = localConfig.getBoolean("firstOpen", true)
localConfig.edit { putBoolean("firstOpen", value) } if (value) {
localConfig.edit { putBoolean("firstOpen", false) }
}
return value
} }
var isFirstRead: Boolean val isFirstRead: Boolean
get() = localConfig.getBoolean("firstRead", true) get() {
set(value) { val value = localConfig.getBoolean("firstRead", true)
localConfig.edit { putBoolean("firstRead", value) } if (value) {
localConfig.edit { putBoolean("firstRead", false) }
}
return value
} }
var isFirstOpenBackup: Boolean val isFirstOpenBackup: Boolean
get() = localConfig.getBoolean("firstBackup", true) get() {
set(value) { val value = localConfig.getBoolean("firstBackup", true)
localConfig.edit { putBoolean("firstBackup", value) } if (value) {
localConfig.edit { putBoolean("firstBackup", false) }
}
return value
}
val isFirstReadMenuShow: Boolean
get() {
val value = localConfig.getBoolean("firstReadMenu", true)
if (value) {
localConfig.edit { putBoolean("firstReadMenu", false) }
}
return value
} }
} }

@ -229,6 +229,7 @@ class ReadBookActivity : ReadBookBaseActivity(),
) )
} }
R.id.menu_set_charset -> showCharsetConfig() R.id.menu_set_charset -> showCharsetConfig()
R.id.menu_help -> showReadMenuHelp()
} }
return super.onCompatOptionsItemSelected(item) return super.onCompatOptionsItemSelected(item)
} }
@ -571,6 +572,11 @@ class ReadBookActivity : ReadBookBaseActivity(),
} }
} }
override fun showReadMenuHelp() {
val text = String(assets.open("help/readMenuHelp.md").readBytes())
TextDialog.show(supportFragmentManager, text, TextDialog.MD)
}
/** /**
* 显示朗读菜单 * 显示朗读菜单
*/ */

@ -63,7 +63,6 @@ abstract class ReadBookBaseActivity :
initView() initView()
if (LocalConfig.isFirstRead) { if (LocalConfig.isFirstRead) {
showClickRegionalConfig() showClickRegionalConfig()
LocalConfig.isFirstRead = false
} }
} }

@ -13,6 +13,7 @@ import io.legado.app.App
import io.legado.app.R import io.legado.app.R
import io.legado.app.constant.PreferKey import io.legado.app.constant.PreferKey
import io.legado.app.help.AppConfig import io.legado.app.help.AppConfig
import io.legado.app.help.LocalConfig
import io.legado.app.help.ReadBookConfig import io.legado.app.help.ReadBookConfig
import io.legado.app.lib.theme.* import io.legado.app.lib.theme.*
import io.legado.app.service.help.ReadBook import io.legado.app.service.help.ReadBook
@ -29,7 +30,7 @@ class ReadMenu @JvmOverloads constructor(
attrs: AttributeSet? = null attrs: AttributeSet? = null
) : FrameLayout(context, attrs) { ) : FrameLayout(context, attrs) {
var cnaShowMenu: Boolean = false var cnaShowMenu: Boolean = false
private val callBack: CallBack? get() = activity as? CallBack private val callBack: CallBack get() = activity as CallBack
private lateinit var menuTopIn: Animation private lateinit var menuTopIn: Animation
private lateinit var menuTopOut: Animation private lateinit var menuTopOut: Animation
private lateinit var menuBottomIn: Animation private lateinit var menuBottomIn: Animation
@ -166,19 +167,19 @@ class ReadMenu @JvmOverloads constructor(
//搜索 //搜索
fabSearch.onClick { fabSearch.onClick {
runMenuOut { runMenuOut {
callBack?.openSearchActivity(null) callBack.openSearchActivity(null)
} }
} }
//自动翻页 //自动翻页
fabAutoPage.onClick { fabAutoPage.onClick {
runMenuOut { runMenuOut {
callBack?.autoPage() callBack.autoPage()
} }
} }
//替换 //替换
fabReplaceRule.onClick { callBack?.openReplaceRule() } fabReplaceRule.onClick { callBack.openReplaceRule() }
//夜间模式 //夜间模式
fabNightTheme.onClick { fabNightTheme.onClick {
@ -195,31 +196,31 @@ class ReadMenu @JvmOverloads constructor(
//目录 //目录
ll_catalog.onClick { ll_catalog.onClick {
runMenuOut { runMenuOut {
callBack?.openChapterList() callBack.openChapterList()
} }
} }
//朗读 //朗读
ll_read_aloud.onClick { ll_read_aloud.onClick {
runMenuOut { runMenuOut {
callBack?.onClickReadAloud() callBack.onClickReadAloud()
} }
} }
ll_read_aloud.onLongClick { ll_read_aloud.onLongClick {
runMenuOut { callBack?.showReadAloudDialog() } runMenuOut { callBack.showReadAloudDialog() }
true true
} }
//界面 //界面
ll_font.onClick { ll_font.onClick {
runMenuOut { runMenuOut {
callBack?.showReadStyle() callBack.showReadStyle()
} }
} }
//设置 //设置
ll_setting.onClick { ll_setting.onClick {
runMenuOut { runMenuOut {
callBack?.showMoreSetting() callBack.showMoreSetting()
} }
} }
} }
@ -230,19 +231,19 @@ 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()
ll_brightness.visible(showBrightnessView) ll_brightness.visible(showBrightnessView)
} }
override fun onAnimationEnd(animation: Animation) { override fun onAnimationEnd(animation: Animation) {
vw_menu_bg.onClick { runMenuOut() } vw_menu_bg.onClick { runMenuOut() }
val hasNavigationBar = ReadBookConfig.hideNavigationBar
&& SystemUtils.isNavigationBarExist(activity)
vwNavigationBar.layoutParams = vwNavigationBar.layoutParams.apply { vwNavigationBar.layoutParams = vwNavigationBar.layoutParams.apply {
height = height = if (hasNavigationBar) context.navigationBarHeight else 0
if (ReadBookConfig.hideNavigationBar }
&& SystemUtils.isNavigationBarExist(activity) if (LocalConfig.isFirstReadMenuShow) {
) callBack.showReadMenuHelp()
context.navigationBarHeight
else 0
} }
} }
@ -264,7 +265,7 @@ class ReadMenu @JvmOverloads constructor(
bottom_menu.invisible() bottom_menu.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
@ -292,6 +293,7 @@ class ReadMenu @JvmOverloads constructor(
fun showReadAloudDialog() fun showReadAloudDialog()
fun upSystemUiVisibility() fun upSystemUiVisibility()
fun onClickReadAloud() fun onClickReadAloud()
fun showReadMenuHelp()
} }
} }

@ -63,7 +63,6 @@ class BackupConfigFragment : BasePreferenceFragment(),
setHasOptionsMenu(true) setHasOptionsMenu(true)
if (LocalConfig.isFirstOpenBackup) { if (LocalConfig.isFirstOpenBackup) {
showHelp() showHelp()
LocalConfig.isFirstOpenBackup = false
} }
} }

@ -106,7 +106,6 @@ class MainActivity : VMBaseActivity<MainViewModel>(R.layout.activity_main),
if (LocalConfig.isFirstOpenApp) { if (LocalConfig.isFirstOpenApp) {
val text = String(assets.open("help/appHelp.md").readBytes()) val text = String(assets.open("help/appHelp.md").readBytes())
TextDialog.show(supportFragmentManager, text, TextDialog.MD) TextDialog.show(supportFragmentManager, text, TextDialog.MD)
LocalConfig.isFirstOpenApp = false
} else if (!BuildConfig.DEBUG) { } else if (!BuildConfig.DEBUG) {
val log = String(assets.open("updateLog.md").readBytes()) val log = String(assets.open("updateLog.md").readBytes())
TextDialog.show(supportFragmentManager, log, TextDialog.MD, 5000, true) TextDialog.show(supportFragmentManager, log, TextDialog.MD, 5000, true)

@ -96,4 +96,9 @@
android:title="@string/book_info" android:title="@string/book_info"
app:showAsAction="never" /> app:showAsAction="never" />
<item
android:id="@+id/menu_help"
android:title="@string/help"
app:showAsAction="never" />
</menu> </menu>

Loading…
Cancel
Save