Skip to content

Commit

Permalink
Added ability to force update check (ignoring remind timer)
Browse files Browse the repository at this point in the history
  • Loading branch information
revanmj committed Jul 8, 2018
1 parent 9407e75 commit 5e29e09
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
Binary file removed jar/wversionmanager-1.4.jar
Binary file not shown.
Binary file removed jar/wversionmanager-1.5.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions library/wversionmanager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ext {
siteUrl = 'https://github.com/revanmj/Android-WVersionManager'
gitUrl = 'https://github.com/revanmj/Android-WVersionManager.git'

libraryVersion = "1.6"
libraryVersion = "1.6.1"

developerId = 'revanmj'
developerName = 'Michal Jakubowski'
Expand All @@ -32,7 +32,7 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 27
versionCode 6
versionCode 7
versionName "$libraryVersion"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,21 @@ public interface IWVersionManager {
* Displays a dialog asking user to rate your app
*/
public void askForRate();

/**
* Initiates check for updates that may result in displaying a dialog with release notes
* and options to update now, remind user about it later or ignore that version
*/
public void checkVersion();

/**
* Initiates check for updates that may result in displaying a dialog with release notes
* and options to update now, remind user about it later or ignore that version
* @param forced <code>true</code> if you want to ignore reminder timer,
* <code>false</code> otherwise
*/
public void checkVersion(boolean forced);

/**
* @param icon Drawable of icon in dialog
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ public WVersionManager(Activity act) {
*/
@Override
public void checkVersion() {
checkVersion(false);
}

/*
* (non-Javadoc)
*
* @see
* com.winsontan520.wversionmanager.IWVersionManager#checkVersion(boolean)
*/
@Override
public void checkVersion(boolean forced) {
mMode = MODE_CHECK_VERSION;
String versionContentUrl = getVersionContentUrl();
if (versionContentUrl == null) {
Expand All @@ -93,7 +104,7 @@ public void checkVersion() {
Log.v(TAG, "reminderTimeStamp=" + reminderTimeStamp);
}

if (currentTimeStamp > reminderTimeStamp) {
if (currentTimeStamp > reminderTimeStamp || forced) {
// fire request to get update version content
if (BuildConfig.DEBUG) {
Log.v(TAG, "getting update content...");
Expand Down

0 comments on commit 5e29e09

Please sign in to comment.