Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix modal contents overlapping screen lock pin #2692 #2874

Merged
merged 4 commits into from
May 21, 2024

Conversation

ganfra
Copy link
Contributor

@ganfra ganfra commented May 17, 2024

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Extract PinUnlock to a separate Activity so we are sure it's always rendered on top of everything else.

Motivation and context

Closes #2692

Screenshots / GIFs

Tests

  • Setup a pin
  • Open a modal content (dialog, bottomsheet)
  • Put the app in background
  • Open the app
  • You should see only the Pin unlock screen

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@ganfra ganfra marked this pull request as ready for review May 17, 2024 16:42
@ganfra ganfra requested a review from a team as a code owner May 17, 2024 16:42
@ganfra ganfra requested review from bmarty and removed request for a team May 17, 2024 16:42
Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 36.95652% with 29 lines in your changes are missing coverage. Please review.

Project coverage is 74.28%. Comparing base (4919cd6) to head (5c4326e).
Report is 13 commits behind head on develop.

Files Patch % Lines
...ckscreen/impl/unlock/activity/PinUnlockActivity.kt 0.00% 18 Missing ⚠️
...c/main/kotlin/io/element/android/x/MainActivity.kt 0.00% 9 Missing ⚠️
...res/lockscreen/impl/DefaultLockScreenEntryPoint.kt 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2874      +/-   ##
===========================================
- Coverage    74.30%   74.28%   -0.03%     
===========================================
  Files         1530     1532       +2     
  Lines        36524    36550      +26     
  Branches      7054     7058       +4     
===========================================
+ Hits         27140    27150      +10     
- Misses        5698     5714      +16     
  Partials      3686     3686              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented May 17, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/pSpG9A

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Nice work, thanks! Some remarks / questions

<activity
android:name="io.element.android.features.lockscreen.impl.unlock.activity.PinUnlockActivity"
android:configChanges="screenSize|screenLayout|orientation|keyboardHidden|keyboard|navigation|uiMode"/>

Copy link
Member

Choose a reason for hiding this comment

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

Can this be moved to an new Android Manifest in the lockscreen:impl module?

.fillMaxSize()
.background(MaterialTheme.colorScheme.background),
.fillMaxSize()
.background(MaterialTheme.colorScheme.background),
Copy link
Member

Choose a reason for hiding this comment

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

We need to find a solution to avoid such change

lockScreenService.lockState.collect { state ->
if (state == LockScreenLockState.Locked) {
startActivity(PinUnlockActivity.newIntent(this@MainActivity))
}
Copy link
Member

Choose a reason for hiding this comment

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

This is working, but can we try to use only things from the api module?
Maybe expose a getIntent(): Intent? api and do nothing when null is returned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's ok for me to use impl in the app module as it's the glue, but I can still expose something in the EntryPoint if u prefer.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks!

lockScreenEntryPoint.nodeBuilder(this, buildContext)
.target(LockScreenEntryPoint.Target.Unlock)
.build()
}
Copy link
Member

Choose a reason for hiding this comment

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

I think that Target.Unlock can be removed, since it's not used anymore.
Same for LockScreenFlowNode.NavTarget.Unlock and PinUnlockNode.Inputs since isInAppUnlockwill always be false.

setContent {
ElementTheme {
val state = presenter.present()
PinUnlockView(state = state, isInAppUnlock = false)
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't isInAppUnlock be set to true here? The parameter is always false in production code (i.e. not counting preview, can you double check please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, isInAppUnlock is true when used for accessing the pin settings here

Copy link
Member

Choose a reason for hiding this comment

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

OK, thanks. Strange that I missed on it during the first review.

@ganfra ganfra requested a review from bmarty May 20, 2024 13:57
Copy link

sonarcloud bot commented May 21, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots

See analysis details on SonarCloud

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks, tested OK right now!

@ganfra
Copy link
Contributor Author

ganfra commented May 21, 2024

@bmarty should we handle the SonarCloud failure?

@ganfra ganfra added the Run-Maestro Starts a Maestro Cloud session to run integration tests label May 21, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label May 21, 2024
@ganfra ganfra merged commit ac123bd into develop May 21, 2024
22 of 25 checks passed
@ganfra ganfra deleted the feature/fga/fix_2692 branch May 21, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Message context menu overlaps Screen lock pin
2 participants