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 =
App.INSTANCE.getSharedPreferences("local", Context.MODE_PRIVATE)
var isFirstOpenApp: Boolean
get() = localConfig.getBoolean("firstOpen", true)
set(value) {
localConfig.edit { putBoolean("firstOpen", value) }
val isFirstOpenApp: Boolean
get() {
val value = localConfig.getBoolean("firstOpen", true)
if (value) {
localConfig.edit { putBoolean("firstOpen", false) }
}
return value
}
var isFirstRead: Boolean
get() = localConfig.getBoolean("firstRead", true)
set(value) {
localConfig.edit { putBoolean("firstRead", value) }
val isFirstRead: Boolean
get() {
val value = localConfig.getBoolean("firstRead", true)
if (value) {
localConfig.edit { putBoolean("firstRead", false) }
}
return value
}
var isFirstOpenBackup: Boolean
get() = localConfig.getBoolean("firstBackup", true)
set(value) {
localConfig.edit { putBoolean("firstBackup", value) }
val isFirstOpenBackup: Boolean
get() {
val value = localConfig.getBoolean("firstBackup", true)
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_help -> showReadMenuHelp()
}
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()
if (LocalConfig.isFirstRead) {
showClickRegionalConfig()
LocalConfig.isFirstRead = false
}
}

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

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

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

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

Loading…
Cancel
Save