Skip to content

CT-3249 Fix for the Token Payments screen rotation state being lost#349

Merged
stefan-tudor merged 2 commits into
masterfrom
CT-3249-token-payments-activity-losing-state-on-rotation
Jun 8, 2026
Merged

CT-3249 Fix for the Token Payments screen rotation state being lost#349
stefan-tudor merged 2 commits into
masterfrom
CT-3249-token-payments-activity-losing-state-on-rotation

Conversation

@RafalOzogJudopay

@RafalOzogJudopay RafalOzogJudopay commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Issue: The state was lost on rotation as in this screen viewmodel was not persisted.

Fix: The viewmodel in Token Payments is now persisted in the same way as in DemoNoUIPaymentActivity.

Testing video:
demo.webm


class TokenPaymentsActivity : ComponentActivity() {
private val viewModel = TokenPaymentsViewModel()
private lateinit var viewModel: TokenPaymentsViewModel

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Viewmodel init adjusted to persist the state (will be initialised from the factory).


val judo = intent.parcelable<Judo>(JUDO_OPTIONS)
check(judo != null) { "Judo object is required" }
val judo = requireNotNull(intent.parcelable<Judo>(JUDO_OPTIONS)) { "Judo object is required" }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check I have adjusted to have the same form as in DemoNoUIPaymentsActivity, for consistency.

@sonarqubecloud

sonarqubecloud Bot commented Jun 6, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@stefan-tudor stefan-tudor merged commit 344f3a3 into master Jun 8, 2026
2 of 3 checks passed
@stefan-tudor stefan-tudor deleted the CT-3249-token-payments-activity-losing-state-on-rotation branch June 8, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants