Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Conversation

sebkur
Copy link
Contributor

@sebkur sebkur commented Aug 6, 2018

Added features as discussed in #230.

When using setOpenInNewTask() for building the dialog, the app settings screen will be opened using an Intent that has the flag Intent.FLAG_ACTIVITY_NEW_TASK added before calling startActivityForResult(). Hence the settings Activity will not appear as a screen within the task of the activity it has been opened from but instead as a separate task that can be brought to front and back separately by the user.

When using setOpenInNewTask() for building the dialog, the app settings
screen will be opened using an Intent that has the flag
Intent.FLAG_ACTIVITY_NEW_TASK added before calling
startActivityForResult(). Hence the settings Activity will not appear as
a screen within the task of the activity it has been opened from but
instead as a separate task that can be brought to front and back
separately by the user.
@Nullable String negativeButtonText,
int requestCode) {
int requestCode,
boolean openInNewTask) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Even though the Builder method is setOpenInNewTask(boolean) I think we should make the AppSettingsDialog object take an int here called intentFlags rather than a boolean? What do you think? IMO it makes the purpose clearer and lets us add more flags in the future without adding any new fields.

The default can be 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I thought about that option, too. I think it is a good idea

@samtstern
Copy link
Contributor

samtstern commented Aug 6, 2018

@sebkur thanks for the submission!

instead of storing a boolean whether the settings screen should be
opened using the Intent.FLAG_ACTIVITY_NEW_TASK flag, store an int that
will be able to store different flags in the future, too.
@sebkur
Copy link
Contributor Author

sebkur commented Aug 6, 2018

I just pushed a new version

@samtstern
Copy link
Contributor

@sebkur LGTM, thank you!

@samtstern samtstern merged commit 986babb into googlesamples:master Aug 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants