Add custom version

This commit is contained in:
Victor Shcherb 2018-03-30 23:57:21 +02:00
parent d2e7893f1d
commit 03ab0467be
6 changed files with 43 additions and 10 deletions

View file

@ -10,11 +10,6 @@
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:resource="@string/facebook_app_id"/>
<activity
android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name_free"/>
<activity
android:name="net.osmand.plus.activities.MapActivity"
android:theme="@style/FirstSplashScreenFree"

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:icon="@mipmap/icon_free"
tools:replace="android:icon">
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:resource="@string/facebook_app_id"/>
<activity
android:name="net.osmand.plus.activities.MapActivity"
android:theme="@style/FirstSplashScreenCustom"
tools:replace="android:theme"/>
<service
android:name="net.osmand.plus.NavigationService"
android:process="net.osmand.freecustom"
tools:replace="android:process"/>
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="net.osmand.freecustom.fileprovider"
tools:replace="android:authorities"/>
</application>
</manifest>

View file

@ -5,6 +5,9 @@
<application
android:icon="@mipmap/icon_nightly"
tools:replace="android:icon">
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:resource="@string/facebook_app_id"/>
<activity
android:name="net.osmand.plus.activities.MapActivity"
android:theme="@style/FirstSplashScreenFreeDev"

View file

@ -95,6 +95,9 @@ android {
freedev {
manifest.srcFile "AndroidManifest-freedev.xml"
}
freecustom {
manifest.srcFile "AndroidManifest-freecustom.xml"
}
legacy {
jniLibs.srcDirs = ["libgnustl"]
@ -147,6 +150,10 @@ android {
applicationId "net.osmand"
resConfig "en"
}
freecustom {
dimension "version"
applicationId "net.osmand.freecustom"
}
full {
dimension "version"
applicationId "net.osmand.plus"

View file

@ -74,6 +74,10 @@
<item name="android:background">?attr/selectableItemBackground</item>
</style>
<style name="FirstSplashScreenCustom" parent="OsmandLightTheme.NoActionbar">
<item name="android:windowBackground">@drawable/first_splash_screen_free</item>
</style>
<style name="FirstSplashScreenPlus" parent="OsmandLightTheme.NoActionbar">
<item name="android:windowBackground">@drawable/first_splash_screen_plus</item>
</style>

View file

@ -12,7 +12,7 @@ public class Version {
private final String appName;
private final static String FREE_VERSION_NAME = "net.osmand";
private final static String FREE_DEV_VERSION_NAME = "net.osmand.dev";
private final static String SHERPAFY_VERSION_NAME = "net.osmand.sherpafy";
private final static String FREE_CUSTOM_VERSION_NAME = "net.osmand.freecustom";
private final static String UTM_REF = "&referrer=utm_source%3Dosmand";
public static boolean isGpsStatusEnabled(OsmandApplication ctx) {
@ -57,9 +57,6 @@ public class Version {
return ctx.getString(R.string.versionFeatures).contains("+play_market");
}
public static boolean isSherpafy(OsmandApplication ctx) {
return ctx.getPackageName().equals(SHERPAFY_VERSION_NAME);
}
private Version(OsmandApplication ctx) {
String appVersion = "";
@ -116,7 +113,10 @@ public class Version {
}
public static boolean isFreeVersion(OsmandApplication ctx){
return ctx.getPackageName().equals(FREE_VERSION_NAME) || ctx.getPackageName().equals(FREE_DEV_VERSION_NAME);
return ctx.getPackageName().equals(FREE_VERSION_NAME) ||
ctx.getPackageName().equals(FREE_DEV_VERSION_NAME) ||
ctx.getPackageName().equals(FREE_CUSTOM_VERSION_NAME)
;
}
public static boolean isPaidVersion(OsmandApplication ctx) {