pull/32/head
kunfei 5 years ago
parent b1187f0463
commit cd11ae9580
  1. 43
      app/src/main/java/io/legado/app/ui/readbook/config/BgTextConfigDiolog.kt
  2. 12
      app/src/main/res/layout/dialog_read_bg_text.xml
  3. 2
      app/src/main/res/values/strings.xml

@ -0,0 +1,43 @@
package io.legado.app.ui.readbook.config
import android.os.Bundle
import android.util.DisplayMetrics
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.DialogFragment
import io.legado.app.R
import io.legado.app.ui.readbook.Help
class BgTextConfigDiolog : DialogFragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return super.onCreateView(inflater, container, savedInstanceState)
}
override fun onStart() {
super.onStart()
val dm = DisplayMetrics()
activity?.windowManager?.defaultDisplay?.getMetrics(dm)
dialog?.window?.let {
it.setBackgroundDrawableResource(R.color.transparent)
it.decorView.setPadding(0, 0, 0, 0)
val attr = it.attributes
attr.dimAmount = 0.0f
attr.gravity = Gravity.BOTTOM
it.attributes = attr
it.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
Help.upSystemUiVisibility(it)
}
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
}

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<io.legado.app.lib.theme.view.ATESwitch
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/dark_status_icon" />
</LinearLayout>

@ -218,7 +218,7 @@
<string name="no_last_chapter">无最新章节信息</string>
<string name="showTimeBattery">显示时间和电量</string>
<string name="showLine">显示分隔线</string>
<string name="darkStatusIcon">深色状态栏图标</string>
<string name="dark_status_icon">深色状态栏图标</string>
<string name="content">内容</string>
<string name="copy_text">拷贝内容</string>
<string name="download_all">一键缓存</string>

Loading…
Cancel
Save