This commit is contained in:
kunfei
2023-08-01 18:10:27 +08:00
parent 9b43df05a7
commit c6afa26991
2 changed files with 10 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package io.legado.app.base
import android.content.DialogInterface
import android.content.DialogInterface.OnDismissListener
import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.annotation.LayoutRes
@@ -35,6 +36,13 @@ abstract class BaseDialogFragment(
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
setStyle(STYLE_NO_TITLE, 0)
}
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
if (adaptationSoftKeyboard) {

View File

@@ -74,8 +74,8 @@ class AboutFragment : PreferenceFragmentCompat() {
/**
* 显示md文件
*/
private fun showMdFile(title: String, FileName: String) {
val mdText = String(requireContext().assets.open(FileName).readBytes())
private fun showMdFile(title: String, fileName: String) {
val mdText = String(requireContext().assets.open(fileName).readBytes())
showDialogFragment(TextDialog(title, mdText, TextDialog.Mode.MD))
}