From 6be1d6e1c276c359e8f52e49a0d2bb101c81a505 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 18 Aug 2025 14:43:47 +0000 Subject: [PATCH 1/3] Initial plan From cb7afbe57a9580ebdf44af5e9e5141269a09fd0a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 18 Aug 2025 14:58:24 +0000 Subject: [PATCH 2/3] Implement tablet-optimized layouts and responsive design improvements Co-authored-by: hussainmohd-a <56958445+hussainmohd-a@users.noreply.github.com> --- .../ui/activity/MiscSettingsActivity.kt | 19 +- .../fragment_home_screen.xml | 835 +++++++++++++++++ .../layout-sw720dp/activity_home_screen.xml | 36 + .../bottom_sheet_home_screen.xml | 397 ++++++++ .../layout-sw720dp/fragment_home_screen.xml | 857 ++++++++++++++++++ app/src/main/res/values-sw720dp/dimens.xml | 41 + app/src/main/res/values-sw720dp/styles.xml | 37 + 7 files changed, 2216 insertions(+), 6 deletions(-) create mode 100644 app/src/full/res/layout-sw720dp-land/fragment_home_screen.xml create mode 100644 app/src/full/res/layout-sw720dp/activity_home_screen.xml create mode 100644 app/src/full/res/layout-sw720dp/bottom_sheet_home_screen.xml create mode 100644 app/src/full/res/layout-sw720dp/fragment_home_screen.xml create mode 100644 app/src/main/res/values-sw720dp/dimens.xml create mode 100644 app/src/main/res/values-sw720dp/styles.xml 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +