Compare commits

...
2 Commits
Author SHA1 Message Date
shihaam 97a0cb218f release v1.0.30
Auto Tag on Version Change / check-version (push) Successful in 7s
Build and Release APK / build (push) Successful in 3m50s
2026-09-26 21:29:16 +05:00
shihaam 0158d6dcd8 Always show fullscreen recipt toggle 2026-09-26 21:28:29 +05:00
6 changed files with 62 additions and 7 deletions
+2 -2
View File
@@ -21,8 +21,8 @@ android {
applicationId = "sh.sar.basedbank" applicationId = "sh.sar.basedbank"
minSdk = 26 minSdk = 26
targetSdk = 36 targetSdk = 36
versionCode = 30 versionCode = 31
versionName = "1.0.29" versionName = "1.0.30"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
@@ -167,6 +167,12 @@ class SettingsAppearanceFragment : Fragment() {
val isDark = prefs.getString("theme", "system") == "dark" val isDark = prefs.getString("theme", "system") == "dark"
updatePitchBlackState(isDark) updatePitchBlackState(isDark)
// Receipts
binding.switchFullscreenReceipt.isChecked = prefs.getBoolean("always_fullscreen_receipt", false)
binding.switchFullscreenReceipt.setOnCheckedChangeListener { _, checked ->
prefs.edit().putBoolean("always_fullscreen_receipt", checked).apply()
}
// Accent color // Accent color
val savedPreset = prefs.getString("accent_preset", ThemeHelper.PRESET_BLUE) val savedPreset = prefs.getString("accent_preset", ThemeHelper.PRESET_BLUE)
binding.accentToggle.check(when (savedPreset) { binding.accentToggle.check(when (savedPreset) {
@@ -168,6 +168,15 @@ class TransferReceiptFragment : Fragment() {
view.findViewById<MaterialButton>(R.id.btnSave).setOnClickListener { view.findViewById<MaterialButton>(R.id.btnSave).setOnClickListener {
saveReceipt() saveReceipt()
} }
val alwaysFullScreen = requireContext().getSharedPreferences("prefs", Context.MODE_PRIVATE)
.getBoolean("always_fullscreen_receipt", false)
if (alwaysFullScreen) {
// The normal page is skipped: keep it laid out (share/save capture its card) but hidden,
// and leave the receipt entirely when the full-screen view is closed
view.alpha = 0f
view.post { if (_receiptCard != null) showFullScreenReceipt(closePageOnDismiss = true) }
}
} }
// ── Data binding ────────────────────────────────────────────────────────── // ── Data binding ──────────────────────────────────────────────────────────
@@ -483,11 +492,11 @@ class TransferReceiptFragment : Fragment() {
return bm return bm
} }
private fun showFullScreenReceipt() { private fun showFullScreenReceipt(closePageOnDismiss: Boolean = false) {
val ctx = requireContext() val ctx = requireContext()
val bank = arguments?.getString(ARG_BANK, "MIB") ?: "MIB" val bank = arguments?.getString(ARG_BANK, "MIB") ?: "MIB"
if (bank == "BML") { showBmlFullScreenReceipt(); return } if (bank == "BML") { showBmlFullScreenReceipt(closePageOnDismiss); return }
if (bank == "MIB") { showMibFullScreenReceipt(); return } if (bank == "MIB") { showMibFullScreenReceipt(closePageOnDismiss); return }
val dialog = Dialog(ctx, android.R.style.Theme_Black_NoTitleBar_Fullscreen) val dialog = Dialog(ctx, android.R.style.Theme_Black_NoTitleBar_Fullscreen)
val scrollView = android.widget.ScrollView(ctx).apply { val scrollView = android.widget.ScrollView(ctx).apply {
@@ -529,6 +538,7 @@ class TransferReceiptFragment : Fragment() {
android.content.res.Configuration.UI_MODE_NIGHT_MASK) == android.content.res.Configuration.UI_MODE_NIGHT_MASK) ==
android.content.res.Configuration.UI_MODE_NIGHT_NO android.content.res.Configuration.UI_MODE_NIGHT_NO
insetsCtrl.isAppearanceLightStatusBars = isLight insetsCtrl.isAppearanceLightStatusBars = isLight
if (closePageOnDismiss) closeReceiptPage()
} }
dialog.show() dialog.show()
dialog.window?.let { win -> dialog.window?.let { win ->
@@ -545,7 +555,7 @@ class TransferReceiptFragment : Fragment() {
* edge-to-edge card right under it, BML-styled Save/Share buttons directly below the card. * edge-to-edge card right under it, BML-styled Save/Share buttons directly below the card.
* Follows the app theme (light/dark). * Follows the app theme (light/dark).
*/ */
private fun showBmlFullScreenReceipt() { private fun showBmlFullScreenReceipt(closePageOnDismiss: Boolean) {
val ctx = requireContext() val ctx = requireContext()
val dialog = Dialog(ctx, R.style.Theme_BasedBank) val dialog = Dialog(ctx, R.style.Theme_BasedBank)
val page = DialogReceiptFullscreenBmlBinding.inflate(layoutInflater) val page = DialogReceiptFullscreenBmlBinding.inflate(layoutInflater)
@@ -557,6 +567,7 @@ class TransferReceiptFragment : Fragment() {
)) ))
page.btnBack.setOnClickListener { dialog.dismiss() } page.btnBack.setOnClickListener { dialog.dismiss() }
if (closePageOnDismiss) dialog.setOnDismissListener { closeReceiptPage() }
page.btnSaveFull.setOnClickListener { saveReceipt() } page.btnSaveFull.setOnClickListener { saveReceipt() }
page.btnShareFull.setOnClickListener { shareReceipt() } page.btnShareFull.setOnClickListener { shareReceipt() }
@@ -594,7 +605,7 @@ class TransferReceiptFragment : Fragment() {
* (visible) status bar, a floating close button top-right just below the status bar, * (visible) status bar, a floating close button top-right just below the status bar,
* and MIB-styled Share/Save buttons pinned to the bottom. Follows the app theme. * and MIB-styled Share/Save buttons pinned to the bottom. Follows the app theme.
*/ */
private fun showMibFullScreenReceipt() { private fun showMibFullScreenReceipt(closePageOnDismiss: Boolean) {
val ctx = requireContext() val ctx = requireContext()
val dialog = Dialog(ctx, R.style.Theme_BasedBank) val dialog = Dialog(ctx, R.style.Theme_BasedBank)
val page = DialogReceiptFullscreenMibBinding.inflate(layoutInflater) val page = DialogReceiptFullscreenMibBinding.inflate(layoutInflater)
@@ -607,6 +618,7 @@ class TransferReceiptFragment : Fragment() {
)) ))
page.btnClose.setOnClickListener { dialog.dismiss() } page.btnClose.setOnClickListener { dialog.dismiss() }
if (closePageOnDismiss) dialog.setOnDismissListener { closeReceiptPage() }
page.btnShareFull.setOnClickListener { shareReceipt() } page.btnShareFull.setOnClickListener { shareReceipt() }
page.btnSaveFull.setOnClickListener { saveReceipt() } page.btnSaveFull.setOnClickListener { saveReceipt() }
@@ -647,6 +659,12 @@ class TransferReceiptFragment : Fragment() {
dialog.show() dialog.show()
} }
/** Pops this receipt off the back stack, returning to whatever screen opened it. */
private fun closeReceiptPage() {
if (!isAdded || parentFragmentManager.isStateSaved) return
parentFragmentManager.popBackStack()
}
private fun copyOnLongClick(vararg views: android.widget.TextView) { private fun copyOnLongClick(vararg views: android.widget.TextView) {
for (tv in views) { for (tv in views) {
tv.setOnLongClickListener { tv.setOnLongClickListener {
@@ -304,6 +304,34 @@
</com.google.android.material.button.MaterialButtonToggleGroup> </com.google.android.material.button.MaterialButtonToggleGroup>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settings_receipts"
android:textAppearance="?attr/textAppearanceTitleMedium"
android:layout_marginTop="24dp"
android:layout_marginBottom="12dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/settings_always_fullscreen_receipt"
android:textAppearance="?attr/textAppearanceBodyLarge" />
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switchFullscreenReceipt"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
+2
View File
@@ -157,6 +157,8 @@
<string name="theme_dark">Dark</string> <string name="theme_dark">Dark</string>
<string name="settings_pitch_black">Pitch Black</string> <string name="settings_pitch_black">Pitch Black</string>
<string name="settings_accent_color">Accent Color</string> <string name="settings_accent_color">Accent Color</string>
<string name="settings_receipts">Receipts</string>
<string name="settings_always_fullscreen_receipt">Always show full screen receipt</string>
<string name="accent_blue">Blue</string> <string name="accent_blue">Blue</string>
<string name="accent_orange">Red</string> <string name="accent_orange">Red</string>
<string name="accent_green">Green</string> <string name="accent_green">Green</string>
@@ -0,0 +1 @@
- New setting to always show recipt full screen