set for every build type a own icon
@@ -10,6 +10,10 @@ android {
|
||||
versionCode 43
|
||||
versionName "2.0.2"
|
||||
|
||||
manifestPlaceholders = [
|
||||
appIcon: "@drawable/ic_launcher_openscale"
|
||||
]
|
||||
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
|
||||
@@ -30,12 +34,18 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
||||
}
|
||||
light {
|
||||
manifestPlaceholders = [
|
||||
appIcon: "@drawable/ic_launcher_openscale_light"
|
||||
]
|
||||
applicationIdSuffix ".light"
|
||||
versionNameSuffix "-light"
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
||||
}
|
||||
pro {
|
||||
manifestPlaceholders = [
|
||||
appIcon: "@drawable/ic_launcher_openscale_pro"
|
||||
]
|
||||
applicationIdSuffix ".pro"
|
||||
versionNameSuffix "-pro"
|
||||
minifyEnabled false
|
||||
|
@@ -22,7 +22,7 @@
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_launcher_openscale"
|
||||
android:icon="${appIcon}"
|
||||
android:label="@string/app_name"
|
||||
android:name=".core.Application"
|
||||
android:theme="@style/AppTheme_Light" >
|
||||
|
@@ -33,6 +33,7 @@ import android.text.Html;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -137,6 +138,14 @@ public class MainActivity extends BaseAppCompatActivity
|
||||
|
||||
navBottomDrawer.setSelectedItemId(prefs.getInt("lastFragmentId", R.id.nav_overview));
|
||||
|
||||
if (BuildConfig.BUILD_TYPE == "light") {
|
||||
ImageView launcherIcon = navDrawer.getHeaderView(0).findViewById(R.id.profileImageView);
|
||||
launcherIcon.setImageResource(R.drawable.ic_launcher_openscale_light);
|
||||
} else if (BuildConfig.BUILD_TYPE == "pro") {
|
||||
ImageView launcherIcon = navDrawer.getHeaderView(0).findViewById(R.id.profileImageView);
|
||||
launcherIcon.setImageResource(R.drawable.ic_launcher_openscale_pro);
|
||||
}
|
||||
|
||||
if (prefs.getBoolean("firstStart", true)) {
|
||||
Intent intent = new Intent(this, UserSettingsActivity.class);
|
||||
intent.putExtra(UserSettingsActivity.EXTRA_MODE, UserSettingsActivity.ADD_USER_REQUEST);
|
||||
@@ -442,9 +451,9 @@ public class MainActivity extends BaseAppCompatActivity
|
||||
private void invokeConnectToBluetoothDevice() {
|
||||
if (BuildConfig.BUILD_TYPE == "light") {
|
||||
AlertDialog infoDialog = new AlertDialog.Builder(this)
|
||||
.setMessage(Html.fromHtml("Please upgrade to the <a href=\"https://play.google.com/store/apps/details?id=com.health.openscale.pro\">openScale pro version</a> to enable Bluetooth support"))
|
||||
.setMessage(Html.fromHtml(getResources().getString(R.string.label_upgrade_to_openScale_pro) + "<br><br> <a href=\"https://play.google.com/store/apps/details?id=com.health.openscale.pro\">Install openScale pro version</a>"))
|
||||
.setPositiveButton(getResources().getString(R.string.label_ok), null)
|
||||
.setIcon(R.drawable.ic_launcher_openscale)
|
||||
.setIcon(R.drawable.ic_launcher_openscale_light)
|
||||
.setTitle("openScale " + BuildConfig.VERSION_NAME)
|
||||
.create();
|
||||
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 452 B |
After Width: | Height: | Size: 450 B |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 7.9 KiB |
After Width: | Height: | Size: 7.6 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 12 KiB |
@@ -255,4 +255,5 @@
|
||||
<string name="activity_level_moderate">Moderate</string>
|
||||
<string name="activity_level_heavy">Heavy</string>
|
||||
<string name="activity_level_extreme">Extreme</string>
|
||||
<string name="label_upgrade_to_openScale_pro">Please upgrade to the openScale pro version to enable Bluetooth support</string>
|
||||
</resources>
|