From 28d0355a679016c475a22be14821f1a501cc251e Mon Sep 17 00:00:00 2001 From: "Luis Guzman (AppDevForAll)" Date: Sat, 5 Sep 2026 17:41:13 -0600 Subject: [PATCH 01/10] K2GO-385 refactor(maps): recolor landing trait pills by valence Recolor the five outlined trait pills on the Maps landing so the stroke and text carry meaning, not one flat accent: - After download, Light, Heavy -> neutral hairline outline (metadata). - Online -> amber outline (needs connectivity, a caveat). - Offline -> leaf outline (works without a network, positive). The basic-maps Included badge stays leaf. No strings change. --- .../res/layout/fragment_k2go_maps_landing.xml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/controller/app/src/main/res/layout/fragment_k2go_maps_landing.xml b/controller/app/src/main/res/layout/fragment_k2go_maps_landing.xml index c2c7555fd..52228c18e 100644 --- a/controller/app/src/main/res/layout/fragment_k2go_maps_landing.xml +++ b/controller/app/src/main/res/layout/fragment_k2go_maps_landing.xml @@ -202,10 +202,10 @@ android:paddingRight="12dp" android:paddingTop="5dp" android:paddingBottom="5dp" - android:background="@drawable/k2go_pill_teal" + android:background="@drawable/k2go_pill_bg" android:text="@string/k2go_maps_fqr_pill_after" android:textAppearance="?attr/textAppearanceBodySmall" - android:textColor="@color/k2go_teal" /> + android:textColor="@color/k2go_muted" /> + android:textColor="@color/k2go_muted" /> + android:textColor="@color/k2go_amber" /> @@ -359,10 +359,10 @@ android:paddingRight="12dp" android:paddingTop="5dp" android:paddingBottom="5dp" - android:background="@drawable/k2go_pill_amber" + android:background="@drawable/k2go_pill_bg" android:text="@string/k2go_maps_rebuild_pill_heavy" android:textAppearance="?attr/textAppearanceBodySmall" - android:textColor="@color/k2go_amber" /> + android:textColor="@color/k2go_muted" /> + android:textColor="@color/k2go_leaf" /> From 38b2c4e9b121bfb78c95331627b66fa49fb8637e Mon Sep 17 00:00:00 2001 From: "Luis Guzman (AppDevForAll)" Date: Sat, 5 Sep 2026 17:46:39 -0600 Subject: [PATCH 02/10] K2GO-385 refactor(fqr): download controls role ladder (filled + text-clay) The FQR download overlay had Stop/Retry and Cancel as two identical outlined teal buttons, so the keep-the-download action and the discard action looked the same. Apply the download-controls role ladder (design k2go-download-card-style-sizes-v1): - Stop/Retry -> filled teal primary (keep the download). - Cancel -> text button in clay (it discards the transfer). Add a reusable Widget.K2Go.Button.Text.Destructive style plus its ThemeOverlay; the role colour lives only in the style, not in Java. No strings change. --- .../appdevforall/k2go/redesign/FqrController.java | 15 +++++++++------ .../app/src/main/res/values/themes_k2go.xml | 10 ++++++++++ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/FqrController.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/FqrController.java index ab42de623..86ad1aa6a 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/FqrController.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/FqrController.java @@ -443,15 +443,18 @@ private void showOverlay(String name, long sizeBytes) { // ADFA-4896: Stop/Retry beside Cancel. The label follows the reported state; the tap fires the // matching verb and the poll (onPaused/onProgress) is the source of truth. overlayStopped = false; - // K2GO-385 (PR3): the download controls use the app button system (K2Go outlined stadium) via the - // shared overlay, not a bare Material3 outlined button. FQR's overlay is a themed (day/night) - // surface, so the K2Go outlined style's theme teal is right here -- not the fixed boot tokens. - ContextThemeWrapper btnCtx = new ContextThemeWrapper(themed, R.style.ThemeOverlay_K2Go_Button_Outlined); - overlayStop = new MaterialButton(btnCtx, null); + // K2GO-385: download-controls role ladder (design k2go-download-card-style-sizes-v1) -- the + // keep-the-download primary (Stop/Retry) is the FILLED teal button; Cancel, which discards the + // transfer, is a TEXT button in clay. Never two equal outline pills. FQR's overlay is a themed + // (day/night) surface, so the app button styles' theme teal/clay are right here -- not the fixed + // boot tokens. The role look lives only in the styles; no colour is set in Java. + ContextThemeWrapper filledCtx = new ContextThemeWrapper(themed, R.style.ThemeOverlay_K2Go_Button_Filled); + overlayStop = new MaterialButton(filledCtx, null); overlayStop.setText(R.string.k2go_clone_stop_confirm); overlayStop.setOnClickListener(v -> toggleStop()); row.addView(overlayStop); - MaterialButton cancel = new MaterialButton(btnCtx, null); + ContextThemeWrapper textDangerCtx = new ContextThemeWrapper(themed, R.style.ThemeOverlay_K2Go_Button_Text_Destructive); + MaterialButton cancel = new MaterialButton(textDangerCtx, null); cancel.setText(R.string.k2go_cancel); cancel.setOnClickListener(v -> { client.cancel(); hideOverlay(); }); row.addView(cancel); diff --git a/controller/app/src/main/res/values/themes_k2go.xml b/controller/app/src/main/res/values/themes_k2go.xml index 537e81bb0..45685092e 100644 --- a/controller/app/src/main/res/values/themes_k2go.xml +++ b/controller/app/src/main/res/values/themes_k2go.xml @@ -89,6 +89,13 @@ @color/k2go_teal + + + + + + + + + + + + + diff --git a/controller/app/src/main/res/values-night/colors_k2go.xml b/controller/app/src/main/res/values-night/colors_k2go.xml index 99f16a0ac..a27978e92 100644 --- a/controller/app/src/main/res/values-night/colors_k2go.xml +++ b/controller/app/src/main/res/values-night/colors_k2go.xml @@ -4,6 +4,8 @@ #0F1A19 #17302E #4FB3BA + + #1E3A33 #2E9E5B #F2A23C #F2A23C diff --git a/controller/app/src/main/res/values/colors_k2go.xml b/controller/app/src/main/res/values/colors_k2go.xml index 63f5cdf0a..0f25e3def 100644 --- a/controller/app/src/main/res/values/colors_k2go.xml +++ b/controller/app/src/main/res/values/colors_k2go.xml @@ -23,6 +23,9 @@ #D9D4C8 #EFEBE2 #0E5C63 + + #DCE9E5 #2E9E5B #F2A23C #B0740F From a0baf3e5e0975f64156ee35ab6bd1d28c8f7af4f Mon Sep 17 00:00:00 2001 From: "Luis Guzman (AppDevForAll)" Date: Sat, 5 Sep 2026 22:11:13 -0600 Subject: [PATCH 08/10] K2GO-385 refactor(recovery): interrupted-install dialog uses BrandDialog (C2) The 'Installation interrupted' recovery dialog was a raw AlertDialog: a white surface, no state colour, and three equal teal actions in a split layout with no primary emphasis. Move it onto the shared BrandDialog (design k2go-install-interrupted-dialog): - A clay error icon carries the state; the title stays ink. - Recover -> filled teal primary; Close -> text secondary; Report the problem -> a quiet muted tertiary that does not compete. Extend BrandDialog generically (all additive; existing dialogs unchanged): setIcon(drawable, tint) for an optional leading state icon, and setDismissOnNeutral(false) so Report can send feedback plus a screenshot of this dialog without closing it. The neutral slot is now the muted tertiary and sits last. New ic_error_outline_24 drawable and a Widget.K2Go.Button.Text.Muted style. Non-cancelable, as before. No strings change. --- .../k2go/redesign/LibraryActivity.java | 39 +++++++++---------- .../k2go/ui/dialog/BrandDialog.java | 33 +++++++++++++++- .../main/res/drawable/ic_error_outline_24.xml | 10 +++++ .../app/src/main/res/layout/dialog_brand.xml | 38 +++++++++++++----- .../app/src/main/res/values/themes_k2go.xml | 6 +++ 5 files changed, 96 insertions(+), 30 deletions(-) create mode 100644 controller/app/src/main/res/drawable/ic_error_outline_24.xml diff --git a/controller/app/src/main/java/org/appdevforall/k2go/redesign/LibraryActivity.java b/controller/app/src/main/java/org/appdevforall/k2go/redesign/LibraryActivity.java index b279ec8dd..b5d19bcbe 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/redesign/LibraryActivity.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/redesign/LibraryActivity.java @@ -950,33 +950,32 @@ private void evaluateRecovery() { * Both paths work without a healthy rootfs. Blocking, non-cancelable; "Close" still exits. */ private void showDamagedDialog() { if (isFinishing()) return; - androidx.appcompat.app.AlertDialog d = new androidx.appcompat.app.AlertDialog.Builder(this) - .setCancelable(false) + // K2GO-385: the interrupted/damaged error uses the shared BrandDialog, like the other confirms + // (design k2go-install-interrupted-dialog). A clay error icon carries the state (the title stays + // ink); Recover is the filled primary; Close the text secondary; "Report the problem" a quiet + // muted tertiary. Non-cancelable: the user must pick recover or close. + // + // ADFA-5119: report it from here, where the user is standing when it matters. The app knows what + // happened and they do not, so the description is filled from the install log. The screenshot the + // report captures is this dialog, which is the right picture (routing is ADFA-5130's: email keeps + // the attachment, Slack gets the text). setDismissOnNeutral(false) keeps the dialog up so the two + // real choices -- recover, or close -- are still there after reporting. + new org.appdevforall.k2go.ui.dialog.BrandDialog(this) + .setIcon(R.drawable.ic_error_outline_24, R.color.k2go_clay) .setTitle(R.string.k2go_damaged_title) .setMessage(R.string.k2go_damaged_body) - .setPositiveButton(R.string.k2go_damaged_recover, (dlg, w) -> { + .setPositive(R.string.k2go_damaged_recover, () -> { SetupLibraryActivity.recover(this); // ADFA-5150: the shared route finish(); // the dialog closes so the user can't fall back onto the held gate }) - // ADFA-5119: report it from here, where the user is standing when it matters. The app - // knows what happened and they do not, so the description is filled from the install - // log rather than left as a blank box in front of someone who just watched a download - // give up. The screenshot the report captures is this dialog, which is the right - // picture. Routing is ADFA-5130's, so email keeps the attachment and Slack gets the - // text. - .setNeutralButton(R.string.k2go_damaged_report, null) - .setNegativeButton(R.string.k2go_damaged_close, (dlg, w) -> finishAffinity()) - .create(); - // Attached after show() so the neutral button does NOT dismiss: reporting is not a decision - // about the system, and the two that are — recover, or close — must still be there - // afterwards. A dialog that vanished on "Report" would leave the user behind a closed gate - // with nothing to press. - d.setOnShowListener(dlg -> d.getButton(androidx.appcompat.app.AlertDialog.BUTTON_NEUTRAL) - .setOnClickListener(v -> org.appdevforall.k2go.feedback.presentation.FeedbackFab + .setNegative(R.string.k2go_damaged_close, () -> finishAffinity()) + .setNeutral(R.string.k2go_damaged_report, () -> org.appdevforall.k2go.feedback.presentation.FeedbackFab .sendFeedback(this, "install-failed", org.appdevforall.k2go.feedback.domain.FeedbackType.BUG, - installFailureReport()))); - d.show(); + installFailureReport())) + .setDismissOnNeutral(false) + .setCancelable(false) + .show(); } /** diff --git a/controller/app/src/main/java/org/appdevforall/k2go/ui/dialog/BrandDialog.java b/controller/app/src/main/java/org/appdevforall/k2go/ui/dialog/BrandDialog.java index 5517cbbc4..ac8c585a3 100644 --- a/controller/app/src/main/java/org/appdevforall/k2go/ui/dialog/BrandDialog.java +++ b/controller/app/src/main/java/org/appdevforall/k2go/ui/dialog/BrandDialog.java @@ -7,9 +7,12 @@ import android.view.View; import android.widget.Button; import android.widget.FrameLayout; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; +import androidx.annotation.ColorRes; +import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.StringRes; @@ -80,6 +83,9 @@ public void setContent(@NonNull View view) { private boolean cancelable = true; private OnClick cancelClick; private boolean dismissOnPositive = true; + private boolean dismissOnNeutral = true; + private int iconRes; // 0 = no leading title icon + private int iconTintRes; // 0 = no tint private OnConfirm positiveConfirm; private CharSequence checkboxLabel; private boolean checkboxChecked; @@ -228,6 +234,21 @@ public BrandDialog setDismissOnPositive(boolean dismissOnPositive) { return this; } + /** Keep the dialog open when the neutral (tertiary) button is tapped -- e.g. "Report the problem", + * which sends feedback but must leave the two real choices (recover / close) on screen. */ + public BrandDialog setDismissOnNeutral(boolean dismissOnNeutral) { + this.dismissOnNeutral = dismissOnNeutral; + return this; + } + + /** Optional leading state icon beside the title (e.g. a clay error icon). tintRes 0 leaves the + * drawable's own colour. */ + public BrandDialog setIcon(@DrawableRes int iconRes, @ColorRes int tintRes) { + this.iconRes = iconRes; + this.iconTintRes = tintRes; + return this; + } + public Handle create() { View root = LayoutInflater.from(context).inflate(R.layout.dialog_brand, null, false); TextView titleView = root.findViewById(R.id.brand_dialog_title); @@ -237,6 +258,14 @@ public Handle create() { Button neutral = root.findViewById(R.id.brand_dialog_neutral); Button negative = root.findViewById(R.id.brand_dialog_negative); + ImageView iconView = root.findViewById(R.id.brand_dialog_icon); + if (iconRes != 0) { + iconView.setImageResource(iconRes); + if (iconTintRes != 0) { + iconView.setColorFilter(ContextCompat.getColor(context, iconTintRes)); + } + iconView.setVisibility(View.VISIBLE); + } if (title != null) { titleView.setText(title); titleView.setVisibility(View.VISIBLE); @@ -342,10 +371,12 @@ public Handle create() { neutral.setText(neutralText); neutral.setVisibility(View.VISIBLE); neutral.setOnClickListener(v -> { - dialog.dismiss(); if (neutralClick != null) { neutralClick.onClick(); } + if (dismissOnNeutral) { + dialog.dismiss(); + } }); } if (negativeText != null) { diff --git a/controller/app/src/main/res/drawable/ic_error_outline_24.xml b/controller/app/src/main/res/drawable/ic_error_outline_24.xml new file mode 100644 index 000000000..c90c04847 --- /dev/null +++ b/controller/app/src/main/res/drawable/ic_error_outline_24.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/controller/app/src/main/res/layout/dialog_brand.xml b/controller/app/src/main/res/layout/dialog_brand.xml index 05be8904d..7bf12c40b 100644 --- a/controller/app/src/main/res/layout/dialog_brand.xml +++ b/controller/app/src/main/res/layout/dialog_brand.xml @@ -15,14 +15,32 @@ android:orientation="vertical" android:padding="20dp"> - + + android:orientation="horizontal" + android:gravity="center_vertical"> + + + + + + @color/k2go_clay + + +