Skip to content

Commit

Permalink
Fixed multiple display when no action has been done
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Vitti committed Mar 7, 2018
1 parent 1927856 commit 0bb393c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.compileSdkVersion
versionCode 1
versionName "1.0-rc1-SNAPSHOT"
versionName "1.0-rc2-SNAPSHOT"
resourcePrefix 'smartappupdate_'
consumerProguardFiles 'proguard-rules.pro'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ protected void onCreate(Bundle savedInstanceState)
sendBlockingUpdateDisplayed();
break;
case SmartAppUpdateManager.INFORMATION_ABOUT_UPDATE:
// store current version information in shared_pref
SettingsUtil.setLastSeenInformativeUpdate(preferences, updateInformation.versionCode);
sendUpdateInfoDisplayed();
break;
case SmartAppUpdateManager.RECOMMENDED_UPDATE:
SettingsUtil.increaseRecommendedScreenDisplayCount(preferences);
//NOTE: We must store this timestamp because user can click without really updating
SettingsUtil.setUpdateLaterTimestamp(preferences, System.currentTimeMillis());
sendRecomendedUpdateDisplayed();
break;
}
Expand Down Expand Up @@ -165,8 +169,6 @@ else if (updateInformation.updatePopupType == SmartAppUpdateManager.RECOMMENDED_
openPlayStore();
SettingsUtil.increaseActionOnRecommendedScreenDisplayCount(preferences);
sendRecommendedActionButtonEvent();
//NOTE: We must store this timestamp because user can click without really updating
SettingsUtil.setUpdateLaterTimestamp(preferences, System.currentTimeMillis());
finish();
}
else if (updateInformation.updatePopupType == SmartAppUpdateManager.BLOCKING_UPDATE)
Expand Down Expand Up @@ -210,14 +212,8 @@ protected void closePopup()
{
if (updateInformation.updatePopupType == SmartAppUpdateManager.RECOMMENDED_UPDATE)
{
SettingsUtil.setUpdateLaterTimestamp(preferences, System.currentTimeMillis());
sendAskLaterEvent();
}
else if (updateInformation.updatePopupType == SmartAppUpdateManager.INFORMATION_ABOUT_UPDATE)
{
// store current version information in shared_pref
SettingsUtil.setLastSeenInformativeUpdate(preferences, updateInformation.versionCode);
}
// We can finally close this popup
finish();
}
Expand Down

0 comments on commit 0bb393c

Please sign in to comment.