pull/32/head
parent
b1952be9e6
commit
af887cb083
@ -1,4 +0,0 @@ |
||||
package io.legado.app.ui.readbook.config; |
||||
|
||||
public class PaddingConfigDialog { |
||||
} |
@ -0,0 +1,41 @@ |
||||
package io.legado.app.ui.readbook.config |
||||
|
||||
import android.os.Bundle |
||||
import android.util.DisplayMetrics |
||||
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 PaddingConfigDialog : 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 |
||||
it.attributes = attr |
||||
it.setLayout((dm.widthPixels * 0.9).toInt(), ViewGroup.LayoutParams.WRAP_CONTENT) |
||||
Help.upSystemUiVisibility(it) |
||||
} |
||||
} |
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
||||
super.onViewCreated(view, savedInstanceState) |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue