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

Have DefaultDialog automatically launch Play Store for the user (#14) #22

Merged
merged 8 commits into from
Oct 5, 2021

Conversation

ssawchenko
Copy link
Collaborator

Related Issue: #14

Summary of Problem:

Update button current does nothing on default dialog handler; would be nice to have it automatically open the Play Store page for the given application when clicked.

Proposed Solution:

DefaultUpgradeDialog takes packageName and will now attempt to launch the Play Store for that package

Testing Steps:

Launch the sample app and click on the Update button; the Play Store app should launch. Because there is no listing for the sample app this will come up empty, but I tested this out by manually setting the packageName to be one of our public apps and the store page did load.

…reTestUpdatesSupported)

* Now responsible for indicating app version, as well as if the build is a development build or a testers build
* Allows more control for app to decide how these are determined
# Conflicts:
#	app/src/main/java/com/steamclock/versioncheckkotlinsample/App.kt

// Add the following lines if you want a default alert dialog to handle the displayStates
// and allow the user to jump out to the Play Store to get updates.
val upgradeDialog = DefaultUpgradeDialog(versionChecker.displayStateFlow, packageName)
Copy link
Collaborator Author

@ssawchenko ssawchenko Oct 5, 2021

Choose a reason for hiding this comment

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

Now using same comments and setup in App and Readme for UpgradeDialog

}

if (canDismiss) {
setPositiveButton("OK") { _, _ ->
setNegativeButton("Close") { _, _ ->
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed button wording to imply that action would close dialog

getButton(AlertDialog.BUTTON_NEUTRAL)?.setOnClickListener {
// todo Proxy out to Play Store.
getButton(AlertDialog.BUTTON_POSITIVE)?.setOnClickListener {
launchPlayStorePage()
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Set BUTTON_POSITIVE instead, since it is the affirmative action

@ssawchenko ssawchenko requested a review from jacobminer October 5, 2021 19:38
@ssawchenko ssawchenko changed the title Ss/14 play store launch Have DefaultDialog automatically launch Play Store for the user (#14) Oct 5, 2021
@jacobminer jacobminer assigned ssawchenko and unassigned jacobminer Oct 5, 2021
@ssawchenko ssawchenko merged commit 54c1a9a into main Oct 5, 2021
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.

2 participants