-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Use TaskStackBuilder
instead of PendingIntent.getActivity
#1293
base: main-ose
Are you sure you want to change the base?
Use TaskStackBuilder
instead of PendingIntent.getActivity
#1293
Conversation
Signed-off-by: Arnau Mora <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not completely sure, so please tell me, what is the reasoning for using addNextIntent
over addNextIntentWithParentStack
in all our use cases?
@@ -26,6 +27,7 @@ import at.bitfire.davdroid.InvalidAccountException | |||
import at.bitfire.davdroid.R | |||
import at.bitfire.davdroid.network.HttpClient | |||
import at.bitfire.davdroid.repository.DavServiceRepository | |||
import at.bitfire.davdroid.servicedetection.RefreshCollectionsWorker.Companion.ARG_SERVICE_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an unused import here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still there. ARG_SERVICE_ID
does not need to be imported for the usages in it's own file.
As far as I my understanding goes, So if you always use |
ok. So is that what we want in every case? |
I don't actually know. I think it's more of a personal choice. When accessing from a notification for example, do we want that going back closes the app or navigates back? |
Should there not be something about that expected user expierence somewhere in the docs? Like maybe in the material guide lines? Personally I would always expect that going back will navigate back - not close the app. |
Although we don't use actual deeplinks yet, I would argue that's what we do when entering a deep screen through a notification. This is the expected behaviour: https://developer.android.com/guide/navigation/design/deep-link#explicit https://developer.android.com/guide/navigation/principles#deep-link Also interesting: |
I think that even though we don't use deeplinks, we kind of have a navigation graph, so I agree that we should act like we have them. |
To sum things up, I think I am going to replace all |
Signed-off-by: Arnau Mora <[email protected]>
I've merged main into here, and replaced some usages. I've left some |
Purpose
The current state-of-the-art seems to be TaskStackBuilder, also for Compose deep links.
Short description
Replaced all usages of
PendingIntent.getActivity
with the equivalentTaskStackBuilder
.Checklist