优化
This commit is contained in:
@@ -95,8 +95,8 @@ object PreferKey {
|
|||||||
const val bitmapCacheSize = "bitmapCacheSize"
|
const val bitmapCacheSize = "bitmapCacheSize"
|
||||||
const val imageRetainNum = "imageRetainNum"
|
const val imageRetainNum = "imageRetainNum"
|
||||||
const val preDownloadNum = "preDownloadNum"
|
const val preDownloadNum = "preDownloadNum"
|
||||||
const val preMangaDownloadNum = "preMangaDownloadNum"
|
const val mangaPreDownloadNum = "mangaPreDownloadNum"
|
||||||
const val singlePageScrolling="singlePageScrolling"
|
const val singlePageScrolling = "singlePageScrolling"
|
||||||
const val autoRefresh = "auto_refresh"
|
const val autoRefresh = "auto_refresh"
|
||||||
const val defaultToRead = "defaultToRead"
|
const val defaultToRead = "defaultToRead"
|
||||||
const val exportCharset = "exportCharset"
|
const val exportCharset = "exportCharset"
|
||||||
@@ -155,8 +155,8 @@ object PreferKey {
|
|||||||
const val streamReadAloudAudio = "streamReadAloudAudio"
|
const val streamReadAloudAudio = "streamReadAloudAudio"
|
||||||
const val pauseReadAloudWhilePhoneCalls = "pauseReadAloudWhilePhoneCalls"
|
const val pauseReadAloudWhilePhoneCalls = "pauseReadAloudWhilePhoneCalls"
|
||||||
const val readAloudByMediaButton = "readAloudByMediaButton"
|
const val readAloudByMediaButton = "readAloudByMediaButton"
|
||||||
const val showMangaUi="showMangaUi"
|
const val showMangaUi = "showMangaUi"
|
||||||
const val disableMangaScaling="disableMangaScaling"
|
const val disableMangaScaling = "disableMangaScaling"
|
||||||
|
|
||||||
const val cPrimary = "colorPrimary"
|
const val cPrimary = "colorPrimary"
|
||||||
const val cAccent = "colorAccent"
|
const val cAccent = "colorAccent"
|
||||||
|
|||||||
@@ -617,10 +617,10 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//漫画预加载数量
|
//漫画预加载数量
|
||||||
var preMangaDownloadNum
|
var mangaPreDownloadNum
|
||||||
get() = appCtx.getPrefInt(PreferKey.preMangaDownloadNum, 10)
|
get() = appCtx.getPrefInt(PreferKey.mangaPreDownloadNum, 10)
|
||||||
set(value) {
|
set(value) {
|
||||||
appCtx.putPrefInt(PreferKey.preMangaDownloadNum, value)
|
appCtx.putPrefInt(PreferKey.mangaPreDownloadNum, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
//单页滚动
|
//单页滚动
|
||||||
|
|||||||
@@ -7,13 +7,10 @@ import android.os.Looper
|
|||||||
import android.view.KeyEvent
|
import android.view.KeyEvent
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.view.ViewGroup
|
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.core.view.WindowInsetsControllerCompat
|
|
||||||
import androidx.core.view.isGone
|
import androidx.core.view.isGone
|
||||||
import androidx.core.view.isVisible
|
import androidx.core.view.isVisible
|
||||||
import androidx.core.view.updateLayoutParams
|
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.PagerSnapHelper
|
import androidx.recyclerview.widget.PagerSnapHelper
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
@@ -27,7 +24,7 @@ import io.legado.app.data.entities.Book
|
|||||||
import io.legado.app.data.entities.BookChapter
|
import io.legado.app.data.entities.BookChapter
|
||||||
import io.legado.app.data.entities.BookProgress
|
import io.legado.app.data.entities.BookProgress
|
||||||
import io.legado.app.data.entities.BookSource
|
import io.legado.app.data.entities.BookSource
|
||||||
import io.legado.app.databinding.ActivityMangeBinding
|
import io.legado.app.databinding.ActivityMangaBinding
|
||||||
import io.legado.app.databinding.ViewLoadMoreBinding
|
import io.legado.app.databinding.ViewLoadMoreBinding
|
||||||
import io.legado.app.help.book.isImage
|
import io.legado.app.help.book.isImage
|
||||||
import io.legado.app.help.config.AppConfig
|
import io.legado.app.help.config.AppConfig
|
||||||
@@ -50,15 +47,14 @@ import io.legado.app.utils.NetworkUtils
|
|||||||
import io.legado.app.utils.StartActivityContract
|
import io.legado.app.utils.StartActivityContract
|
||||||
import io.legado.app.utils.getCompatColor
|
import io.legado.app.utils.getCompatColor
|
||||||
import io.legado.app.utils.gone
|
import io.legado.app.utils.gone
|
||||||
import io.legado.app.utils.immersionFullScreen
|
|
||||||
import io.legado.app.utils.immersionPadding
|
|
||||||
import io.legado.app.utils.printOnDebug
|
import io.legado.app.utils.printOnDebug
|
||||||
import io.legado.app.utils.showDialogFragment
|
import io.legado.app.utils.showDialogFragment
|
||||||
import io.legado.app.utils.toastOnUi
|
import io.legado.app.utils.toastOnUi
|
||||||
|
import io.legado.app.utils.toggleStatusBar
|
||||||
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
|
||||||
|
|
||||||
class ReadMangaActivity : VMBaseActivity<ActivityMangeBinding, MangaViewModel>(),
|
class ReadMangaActivity : VMBaseActivity<ActivityMangaBinding, MangaViewModel>(),
|
||||||
ReadManga.Callback, ChangeBookSourceDialog.CallBack, MangaMenu.CallBack {
|
ReadManga.Callback, ChangeBookSourceDialog.CallBack, MangaMenu.CallBack {
|
||||||
|
|
||||||
private val mLayoutManager by lazy {
|
private val mLayoutManager by lazy {
|
||||||
@@ -68,7 +64,7 @@ class ReadMangaActivity : VMBaseActivity<ActivityMangeBinding, MangaViewModel>()
|
|||||||
MangaAdapter(this@ReadMangaActivity)
|
MangaAdapter(this@ReadMangaActivity)
|
||||||
}
|
}
|
||||||
private val mPreDownloadNum by lazy {
|
private val mPreDownloadNum by lazy {
|
||||||
AppConfig.preMangaDownloadNum
|
AppConfig.mangaPreDownloadNum
|
||||||
}
|
}
|
||||||
private val mSinglePageScroller by lazy {
|
private val mSinglePageScroller by lazy {
|
||||||
AppConfig.singlePageScrolling
|
AppConfig.singlePageScrolling
|
||||||
@@ -105,10 +101,6 @@ class ReadMangaActivity : VMBaseActivity<ActivityMangeBinding, MangaViewModel>()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private val windowInsetsControllerCompat by lazy {
|
|
||||||
WindowInsetsControllerCompat(window, binding.root)
|
|
||||||
}
|
|
||||||
|
|
||||||
//打开目录返回选择章节返回结果
|
//打开目录返回选择章节返回结果
|
||||||
private val tocActivity = registerForActivityResult(TocActivityResult()) {
|
private val tocActivity = registerForActivityResult(TocActivityResult()) {
|
||||||
it?.let {
|
it?.let {
|
||||||
@@ -123,20 +115,13 @@ class ReadMangaActivity : VMBaseActivity<ActivityMangeBinding, MangaViewModel>()
|
|||||||
super.finish()
|
super.finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
override val binding by viewBinding(ActivityMangeBinding::inflate)
|
override val binding by viewBinding(ActivityMangaBinding::inflate)
|
||||||
override val viewModel by viewModels<MangaViewModel>()
|
override val viewModel by viewModels<MangaViewModel>()
|
||||||
|
|
||||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||||
immersionFullScreen(windowInsetsControllerCompat)
|
|
||||||
immersionPadding(binding.root) { view, insets, _ ->
|
|
||||||
binding.mangaMenu.setTitleBarPadding(insets.top)
|
|
||||||
view.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
|
||||||
leftMargin = insets.left
|
|
||||||
rightMargin = insets.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ReadManga.register(this)
|
ReadManga.register(this)
|
||||||
disableMangaScaling(mDisableMangaScaling)
|
disableMangaScaling(mDisableMangaScaling)
|
||||||
|
upSystemUiVisibility(false)
|
||||||
binding.mRecyclerMange.run {
|
binding.mRecyclerMange.run {
|
||||||
adapter = mAdapter
|
adapter = mAdapter
|
||||||
itemAnimator = null
|
itemAnimator = null
|
||||||
@@ -185,7 +170,7 @@ class ReadMangaActivity : VMBaseActivity<ActivityMangeBinding, MangaViewModel>()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.retry.setOnClickListener {
|
binding.tvRetry.setOnClickListener {
|
||||||
binding.llLoading.isVisible = true
|
binding.llLoading.isVisible = true
|
||||||
binding.llRetry.isGone = true
|
binding.llRetry.isGone = true
|
||||||
mFirstLoading = false
|
mFirstLoading = false
|
||||||
@@ -390,10 +375,14 @@ class ReadMangaActivity : VMBaseActivity<ActivityMangeBinding, MangaViewModel>()
|
|||||||
}
|
}
|
||||||
|
|
||||||
R.id.menu_pre_manga_number -> {
|
R.id.menu_pre_manga_number -> {
|
||||||
NumberPickerDialog(this).setTitle(getString(R.string.pre_download))
|
NumberPickerDialog(this)
|
||||||
.setMaxValue(9999).setMinValue(0).setValue(AppConfig.preMangaDownloadNum).show {
|
.setTitle(getString(R.string.pre_download))
|
||||||
AppConfig.preMangaDownloadNum = it
|
.setMaxValue(9999)
|
||||||
item.setTitle(getString(R.string.pre_download_m, it))
|
.setMinValue(0)
|
||||||
|
.setValue(AppConfig.mangaPreDownloadNum)
|
||||||
|
.show {
|
||||||
|
AppConfig.mangaPreDownloadNum = it
|
||||||
|
item.title = getString(R.string.pre_download_m, it)
|
||||||
addRecyclerViewPreloader(it)
|
addRecyclerViewPreloader(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -422,9 +411,8 @@ class ReadMangaActivity : VMBaseActivity<ActivityMangeBinding, MangaViewModel>()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun upSystemUiVisibility(value: Boolean) {
|
override fun upSystemUiVisibility(menuIsVisible: Boolean) {
|
||||||
binding.mangaMenu.isVisible = value
|
toggleStatusBar(menuIsVisible)
|
||||||
immersionFullScreen(WindowInsetsControllerCompat(window, binding.root))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
|
override fun dispatchKeyEvent(event: KeyEvent): Boolean {
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class WebtoonRecyclerView @JvmOverloads constructor(
|
|||||||
|
|
||||||
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
|
||||||
super.onSizeChanged(w, h, oldw, oldh)
|
super.onSizeChanged(w, h, oldw, oldh)
|
||||||
mcRect.set(width * 0.33f, height * 0.33f, width * 0.66f, height * 0.46f)
|
mcRect.set(width * 0.33f, height * 0.33f, width * 0.66f, height * 0.66f)
|
||||||
blRect.set(0f, height * 0.66f, width * 0.33f, height.toFloat())
|
blRect.set(0f, height * 0.66f, width * 0.33f, height.toFloat())
|
||||||
brRect.set(width * 0.66f, height * 0.66f, width.toFloat(), height.toFloat())
|
brRect.set(width * 0.66f, height * 0.66f, width.toFloat(), height.toFloat())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ import android.graphics.Color
|
|||||||
import android.graphics.drawable.GradientDrawable
|
import android.graphics.drawable.GradientDrawable
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View.OnClickListener
|
|
||||||
import android.view.View.OnLongClickListener
|
|
||||||
import android.view.animation.Animation
|
import android.view.animation.Animation
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
import androidx.core.view.isGone
|
import androidx.core.view.isGone
|
||||||
@@ -36,9 +34,6 @@ import io.legado.app.utils.modifyBegin
|
|||||||
import io.legado.app.utils.openUrl
|
import io.legado.app.utils.openUrl
|
||||||
import io.legado.app.utils.startActivity
|
import io.legado.app.utils.startActivity
|
||||||
import io.legado.app.utils.visible
|
import io.legado.app.utils.visible
|
||||||
import splitties.views.bottomPadding
|
|
||||||
import splitties.views.leftPadding
|
|
||||||
import splitties.views.rightPadding
|
|
||||||
|
|
||||||
class MangaMenu @JvmOverloads constructor(
|
class MangaMenu @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
@@ -84,7 +79,8 @@ class MangaMenu @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onAnimationEnd(animation: Animation) {
|
override fun onAnimationEnd(animation: Animation) {
|
||||||
binding.flTitleBar.invisible()
|
this@MangaMenu.invisible()
|
||||||
|
binding.titleBar.invisible()
|
||||||
isMenuOutAnimating = false
|
isMenuOutAnimating = false
|
||||||
canShowMenu = false
|
canShowMenu = false
|
||||||
callBack.upSystemUiVisibility(false)
|
callBack.upSystemUiVisibility(false)
|
||||||
@@ -120,7 +116,6 @@ class MangaMenu @JvmOverloads constructor(
|
|||||||
if (immersiveMenu) {
|
if (immersiveMenu) {
|
||||||
val lightTextColor = ColorUtils.withAlpha(ColorUtils.lightenColor(textColor), 0.75f)
|
val lightTextColor = ColorUtils.withAlpha(ColorUtils.lightenColor(textColor), 0.75f)
|
||||||
titleBar.setTextColor(textColor)
|
titleBar.setTextColor(textColor)
|
||||||
flTitleBar.setBackgroundColor(bgColor)
|
|
||||||
titleBar.setBackgroundColor(bgColor)
|
titleBar.setBackgroundColor(bgColor)
|
||||||
titleBar.setColorFilter(textColor)
|
titleBar.setColorFilter(textColor)
|
||||||
tvChapterName.setTextColor(lightTextColor)
|
tvChapterName.setTextColor(lightTextColor)
|
||||||
@@ -129,7 +124,6 @@ class MangaMenu @JvmOverloads constructor(
|
|||||||
val bgColor = context.primaryColor
|
val bgColor = context.primaryColor
|
||||||
val textColor = context.primaryTextColor
|
val textColor = context.primaryTextColor
|
||||||
titleBar.setTextColor(textColor)
|
titleBar.setTextColor(textColor)
|
||||||
flTitleBar.setBackgroundColor(bgColor)
|
|
||||||
titleBar.setBackgroundColor(bgColor)
|
titleBar.setBackgroundColor(bgColor)
|
||||||
titleBar.setColorFilter(textColor)
|
titleBar.setColorFilter(textColor)
|
||||||
tvChapterName.setTextColor(textColor)
|
tvChapterName.setTextColor(textColor)
|
||||||
@@ -178,7 +172,7 @@ class MangaMenu @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
if (this.isVisible) {
|
if (this.isVisible) {
|
||||||
if (anim) {
|
if (anim) {
|
||||||
binding.flTitleBar.startAnimation(menuTopOut)
|
binding.titleBar.startAnimation(menuTopOut)
|
||||||
} else {
|
} else {
|
||||||
menuOutListener.onAnimationStart(menuBottomOut)
|
menuOutListener.onAnimationStart(menuBottomOut)
|
||||||
menuOutListener.onAnimationEnd(menuBottomOut)
|
menuOutListener.onAnimationEnd(menuBottomOut)
|
||||||
@@ -188,9 +182,9 @@ class MangaMenu @JvmOverloads constructor(
|
|||||||
|
|
||||||
fun runMenuIn(anim: Boolean = !AppConfig.isEInkMode) {
|
fun runMenuIn(anim: Boolean = !AppConfig.isEInkMode) {
|
||||||
this.visible()
|
this.visible()
|
||||||
binding.flTitleBar.visible()
|
binding.titleBar.visible()
|
||||||
if (anim) {
|
if (anim) {
|
||||||
binding.flTitleBar.startAnimation(menuTopIn)
|
binding.titleBar.startAnimation(menuTopIn)
|
||||||
} else {
|
} else {
|
||||||
menuInListener.onAnimationStart(menuBottomIn)
|
menuInListener.onAnimationStart(menuBottomIn)
|
||||||
menuInListener.onAnimationEnd(menuBottomIn)
|
menuInListener.onAnimationEnd(menuBottomIn)
|
||||||
@@ -233,18 +227,9 @@ class MangaMenu @JvmOverloads constructor(
|
|||||||
tvChapterUrl.setOnLongClickListener(chapterViewLongClickListener)
|
tvChapterUrl.setOnLongClickListener(chapterViewLongClickListener)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setTitleBarPadding(top: Int) {
|
|
||||||
if (top <= 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
binding.flTitleBar.run {
|
|
||||||
setPadding(leftPadding, this.paddingTop.plus(top), rightPadding, bottomPadding)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interface CallBack {
|
interface CallBack {
|
||||||
fun openBookInfoActivity()
|
fun openBookInfoActivity()
|
||||||
fun upSystemUiVisibility(value: Boolean)
|
fun upSystemUiVisibility(menuIsVisible: Boolean)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -16,10 +16,8 @@ import android.view.WindowMetrics
|
|||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
import androidx.annotation.ColorInt
|
import androidx.annotation.ColorInt
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.ViewCompat
|
|
||||||
import androidx.core.view.WindowCompat
|
import androidx.core.view.WindowCompat
|
||||||
import androidx.core.view.WindowInsetsCompat
|
import androidx.core.view.WindowInsetsCompat
|
||||||
import androidx.core.view.WindowInsetsControllerCompat
|
|
||||||
import androidx.core.view.WindowInsetsControllerCompat.BEHAVIOR_DEFAULT
|
import androidx.core.view.WindowInsetsControllerCompat.BEHAVIOR_DEFAULT
|
||||||
import androidx.core.view.WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
import androidx.core.view.WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
||||||
import androidx.fragment.app.DialogFragment
|
import androidx.fragment.app.DialogFragment
|
||||||
@@ -191,6 +189,18 @@ fun Activity.toggleNavigationBar(show: Boolean) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun Activity.toggleStatusBar(show: Boolean) {
|
||||||
|
WindowCompat.getInsetsController(window, window.decorView).run {
|
||||||
|
if (show) {
|
||||||
|
show(WindowInsetsCompat.Type.statusBars())
|
||||||
|
systemBarsBehavior = BEHAVIOR_DEFAULT
|
||||||
|
} else {
|
||||||
|
hide(WindowInsetsCompat.Type.statusBars())
|
||||||
|
systemBarsBehavior = BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/////以下方法需要在View完全被绘制出来之后调用,否则判断不了,在比如 onWindowFocusChanged()方法中可以得到正确的结果/////
|
/////以下方法需要在View完全被绘制出来之后调用,否则判断不了,在比如 onWindowFocusChanged()方法中可以得到正确的结果/////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -246,15 +256,3 @@ fun AppCompatActivity.showHelp(fileName: String) {
|
|||||||
val mdText = String(assets.open("web/help/md/${fileName}.md").readBytes())
|
val mdText = String(assets.open("web/help/md/${fileName}.md").readBytes())
|
||||||
showDialogFragment(TextDialog(getString(R.string.help), mdText, TextDialog.Mode.MD))
|
showDialogFragment(TextDialog(getString(R.string.help), mdText, TextDialog.Mode.MD))
|
||||||
}
|
}
|
||||||
|
|
||||||
fun immersionFullScreen(windowInsetsControllerCompat: WindowInsetsControllerCompat) {
|
|
||||||
windowInsetsControllerCompat.systemBarsBehavior = BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
|
|
||||||
windowInsetsControllerCompat.hide(WindowInsetsCompat.Type.systemBars())
|
|
||||||
}
|
|
||||||
|
|
||||||
inline fun immersionPadding(root: View, crossinline viewInsets: (v: View, insets: androidx.core.graphics.Insets, gestureInsets: androidx.core.graphics.Insets) -> Unit) {
|
|
||||||
ViewCompat.setOnApplyWindowInsetsListener(root) { view: View, windowInsetsCompat: WindowInsetsCompat ->
|
|
||||||
viewInsets(view, windowInsetsCompat.getInsets(WindowInsetsCompat.Type.systemBars()), windowInsetsCompat.getInsets(WindowInsetsCompat.Type.systemGestures()))
|
|
||||||
WindowInsetsCompat.CONSUMED
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+8
-10
@@ -34,7 +34,7 @@
|
|||||||
android:id="@+id/fl_loading"
|
android:id="@+id/fl_loading"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/white">
|
android:background="@color/background">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_loading"
|
android:id="@+id/ll_loading"
|
||||||
@@ -60,32 +60,30 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:text="正在加载中..."
|
android:text="正在加载中..."
|
||||||
android:textColor="@color/black" />
|
android:textColor="@color/primaryText" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/ll_retry"
|
android:id="@+id/ll_retry"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:visibility="gone"
|
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_msg"
|
android:id="@+id/tv_msg"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@color/black" />
|
android:textColor="@color/primaryText" />
|
||||||
|
|
||||||
<Button
|
<io.legado.app.ui.widget.text.AccentTextView
|
||||||
android:id="@+id/retry"
|
android:id="@+id/tv_retry"
|
||||||
style="@style/Widget.Material3.Button.TonalButton"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_margin="16dp"
|
||||||
android:text="重新加载"
|
android:text="重新加载"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp"
|
||||||
app:cornerRadius="10dp"
|
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -15,68 +15,61 @@
|
|||||||
tools:layout_editor_absoluteX="0dp"
|
tools:layout_editor_absoluteX="0dp"
|
||||||
tools:layout_editor_absoluteY="0dp" />
|
tools:layout_editor_absoluteY="0dp" />
|
||||||
|
|
||||||
<FrameLayout
|
<io.legado.app.ui.widget.TitleBar
|
||||||
android:id="@+id/fl_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">
|
android:theme="?attr/actionBarStyle">
|
||||||
|
|
||||||
<io.legado.app.ui.widget.TitleBar
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/title_bar"
|
android:id="@+id/title_bar_addition"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content">
|
||||||
android:theme="?attr/actionBarStyle">
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<TextView
|
||||||
android:id="@+id/title_bar_addition"
|
android:id="@+id/tv_chapter_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toLeftOf="@+id/tv_source_action"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_chapter_name"
|
android:id="@+id/tv_chapter_url"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:paddingRight="10dp"
|
android:paddingRight="10dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toLeftOf="@+id/tv_source_action"
|
app:layout_constraintRight_toLeftOf="@+id/tv_source_action"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toBottomOf="@+id/tv_chapter_name"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<TextView
|
<io.legado.app.ui.widget.text.AccentBgTextView
|
||||||
android:id="@+id/tv_chapter_url"
|
android:id="@+id/tv_source_action"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:paddingLeft="10dp"
|
android:layout_margin="1dp"
|
||||||
android:paddingRight="10dp"
|
android:gravity="center"
|
||||||
android:singleLine="true"
|
android:maxWidth="120dp"
|
||||||
android:visibility="gone"
|
android:paddingLeft="6dp"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
android:paddingRight="6dp"
|
||||||
app:layout_constraintRight_toLeftOf="@+id/tv_source_action"
|
android:text="@string/book_source"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/tv_chapter_name"
|
app:layout_constraintBottom_toBottomOf="@+id/tv_chapter_url"
|
||||||
tools:visibility="visible" />
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:radius="2dp"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
<io.legado.app.ui.widget.text.AccentBgTextView
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
android:id="@+id/tv_source_action"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_margin="1dp"
|
|
||||||
android:gravity="center"
|
|
||||||
android:maxWidth="120dp"
|
|
||||||
android:paddingLeft="6dp"
|
|
||||||
android:paddingRight="6dp"
|
|
||||||
android:text="@string/book_source"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/tv_chapter_url"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:radius="2dp"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</io.legado.app.ui.widget.TitleBar>
|
||||||
|
|
||||||
</io.legado.app.ui.widget.TitleBar>
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
Reference in New Issue
Block a user