Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Nov 30, 2024
1 parent b7db2a0 commit e389185
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/io/legado/app/constant/AppConst.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ object AppConst {
)

@SuppressLint("PrivateResource")
val sysElevation = if (AppConfig.isEInkMode) 0 else appCtx.resources
val sysElevation = appCtx.resources
.getDimension(com.google.android.material.R.dimen.design_appbar_elevation)
.toInt()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class ChangeChapterSourceDialog() : BaseDialogFragment(R.layout.dialog_chapter_c
binding.ivHideToc.setOnClickListener {
binding.clToc.gone()
}
binding.flHideToc.elevation = if (AppConfig.isEInkMode) 0f else requireContext().elevation
binding.flHideToc.elevation = requireContext().elevation
}

private fun initRecyclerView() {
Expand Down
6 changes: 2 additions & 4 deletions app/src/main/java/io/legado/app/ui/book/read/ReadMenu.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import android.graphics.PorterDuff
import android.graphics.drawable.GradientDrawable
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View.OnClickListener
import android.view.View.OnLongClickListener
import android.view.WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE
import android.view.animation.Animation
import android.widget.FrameLayout
Expand Down Expand Up @@ -100,7 +98,7 @@ class ReadMenu @JvmOverloads constructor(
private val showBrightnessView
get() = context.getPrefBoolean(
PreferKey.showBrightnessView,
!AppConfig.isEInkMode
true
)
private val sourceMenu by lazy {
PopupMenu(context, binding.tvSourceAction).apply {
Expand Down Expand Up @@ -202,7 +200,7 @@ class ReadMenu @JvmOverloads constructor(
brightnessBackground.cornerRadius = 5F.dpToPx()
brightnessBackground.setColor(ColorUtils.adjustAlpha(bgColor, 0.5f))
llBrightness.background = brightnessBackground
if(AppConfig.isEInkMode) {
if (AppConfig.isEInkMode) {
titleBar.setBackgroundResource(R.drawable.bg_eink_border_bottom)
llBottomBg.setBackgroundResource(R.drawable.bg_eink_border_top)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ class ReadStyleDialog : BaseDialogFragment(R.layout.dialog_read_book_style),
}
}
}
if(AppConfig.isEInkMode) {
binding.vwBgFg1.visibility = View.INVISIBLE
binding.llBgTs.visibility = View.GONE
binding.rvStyle.visibility = View.GONE
}
}

private fun initData() {
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/io/legado/app/ui/main/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ import io.legado.app.utils.viewbindingdelegate.viewBinding
import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import kotlin.collections.set
import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine

Expand Down Expand Up @@ -112,7 +111,7 @@ class MainActivity : VMBaseActivity<ActivityMainBinding, MainViewModel>(),
return@addCallback
}
}
if (!AppConfig.isEInkMode && System.currentTimeMillis() - exitTime > 2000) {
if (System.currentTimeMillis() - exitTime > 2000) {
toastOnUi(R.string.double_click_exit)
exitTime = System.currentTimeMillis()
} else {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/dialog_read_book_style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:id="@+id/ll_bg_ts"
android:orientation="horizontal">

<TextView
Expand Down
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#Tue Aug 27 18:19:17 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
#distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://mirrors.aliyun.com/macports/distfiles/gradle/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit e389185

Please sign in to comment.