starting new versioning for beta builds, only show changelog on release builds

This commit is contained in:
Thialfihar 2010-08-18 00:42:45 +00:00
parent 4f25edbe97
commit 18de5178f8
3 changed files with 16 additions and 2 deletions

View File

@ -17,7 +17,7 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="org.thialfihar.android.apg"
android:versionCode="21" android:versionName="1.0.7">
android:versionCode="10800" android:versionName="1.0.8 beta 00">
<application
android:icon="@drawable/icon"

View File

@ -1959,6 +1959,20 @@ public class Apg {
return nlBytes;
}
public static boolean isReleaseVersion(Context context) {
try {
PackageInfo pi = context.getPackageManager().getPackageInfo(mApgPackageName, 0);
if (pi.versionCode % 100 == 99) {
return true;
} else {
return false;
}
} catch (NameNotFoundException e) {
// unpossible!
return false;
}
}
public static String getVersion(Context context) {
if (VERSION != null) {
return VERSION;

View File

@ -126,7 +126,7 @@ public class MainActivity extends BaseActivity {
showDialog(Id.dialog.help);
}
if (!mPreferences.hasSeenChangeLog(Apg.getVersion(this))) {
if (Apg.isReleaseVersion(this) && !mPreferences.hasSeenChangeLog(Apg.getVersion(this))) {
showDialog(Id.dialog.change_log);
}
}