diff --git a/app/src/full/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt b/app/src/full/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt index 2e5809d40..fa23227dd 100644 --- a/app/src/full/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt +++ b/app/src/full/java/com/celzero/bravedns/ui/activity/MiscSettingsActivity.kt @@ -871,6 +871,12 @@ class MiscSettingsActivity : AppCompatActivity(R.layout.activity_misc_settings) } fun showAppTriggerPackageDialog(context: Context, onPackageSet: (String) -> Unit) { + // Detect tablet and adjust padding accordingly + val isTablet = context.resources.configuration.smallestScreenWidthDp >= 720 + val dialogPadding = if (isTablet) 80 else 50 + val scrollPadding = if (isTablet) 60 else 40 + val textSize = if (isTablet) 18f else 16f + val editText = AppCompatEditText(context).apply { hint = context.getString(R.string.adv_tasker_dialog_edit_hint) inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE @@ -878,23 +884,24 @@ class MiscSettingsActivity : AppCompatActivity(R.layout.activity_misc_settings) if (persistentState.appTriggerPackages.isNotEmpty()) { setText(persistentState.appTriggerPackages) } - setPadding(50, 40, 50, 40) + setPadding(dialogPadding, 40, dialogPadding, 40) gravity = Gravity.TOP or Gravity.START android.R.style.Widget_Material_EditText + this.textSize = textSize } val selectableTextView = AppCompatTextView(context).apply { text = context.getString(R.string.adv_tasker_dialog_msg) setTextIsSelectable(true) - setPadding(50, 40, 50, 0) - textSize = 16f + setPadding(dialogPadding, 40, dialogPadding, 0) + textSize = this@apply.textSize } val instructionsTextView = AppCompatTextView(context).apply { text = context.getString(R.string.adv_tasker_dialog_instructions) setTextIsSelectable(true) - setPadding(50, 40, 50, 0) - textSize = 16f + setPadding(dialogPadding, 40, dialogPadding, 0) + textSize = this@apply.textSize } // add a LinearLayout as the single child of the ScrollView, then add the text view and @@ -907,7 +914,7 @@ class MiscSettingsActivity : AppCompatActivity(R.layout.activity_misc_settings) } val scrollView = ScrollView(context).apply { - setPadding(40, 10, 40, 0) + setPadding(scrollPadding, 10, scrollPadding, 0) addView(linearLayout) } diff --git a/app/src/full/res/layout-sw720dp-land/fragment_home_screen.xml b/app/src/full/res/layout-sw720dp-land/fragment_home_screen.xml new file mode 100644 index 000000000..70c488149 --- /dev/null +++ b/app/src/full/res/layout-sw720dp-land/fragment_home_screen.xml @@ -0,0 +1,835 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +