設定画面などの左右余白を入れるしきい値を420dpから460dpに変更。PH-1が短辺440dpなのだった

This commit is contained in:
tateisu 2020-02-01 16:53:48 +09:00
parent 335e36f3e6
commit 6e10b6fa97
2 changed files with 18 additions and 10 deletions

View File

@ -100,6 +100,14 @@ class ActAppSetting : AppCompatActivity(), ColorPickerDialogListener, View.OnCli
}
}
initUi()
removeDefaultPref()
load(null, null)
}
private fun initUi(){
setContentView(R.layout.act_app_setting)
App1.initEdgeToEdge(this)
@ -138,17 +146,16 @@ class ActAppSetting : AppCompatActivity(), ColorPickerDialogListener, View.OnCli
findViewById<View>(R.id.btnSearchReset).apply {
setOnClickListener(this@ActAppSetting)
}
val e = pref.edit()
var dirty = false
appSettingRoot.scan{
if( it.pref?.removeDefault(pref,e) ==true ) dirty = true
}
if(dirty) e.apply()
load(null, null)
}
private fun removeDefaultPref(){
val e = pref.edit()
var changed = false
appSettingRoot.scan{
if( it.pref?.removeDefault(pref,e) ==true ) changed = true
}
if(changed) e.apply()
}
override fun onSaveInstanceState(outState : Bundle) {
super.onSaveInstanceState(outState)

View File

@ -253,7 +253,8 @@ object Styler {
}
private fun getHorizontalPadding(v : View, delta_dp : Float ) : Int {
val form_width_max = 420f
// Essential Phone PH-1は 短辺439dp
val form_width_max = 460f
val dm = v.resources.displayMetrics
val screen_w = dm.widthPixels
val content_w = (0.5f + form_width_max * dm.density).toInt()