diff --git a/android_app/app/build.gradle b/android_app/app/build.gradle index 7d43366c..98b8cc1c 100644 --- a/android_app/app/build.gradle +++ b/android_app/app/build.gradle @@ -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 diff --git a/android_app/app/src/main/AndroidManifest.xml b/android_app/app/src/main/AndroidManifest.xml index ec446aff..f1a01bce 100644 --- a/android_app/app/src/main/AndroidManifest.xml +++ b/android_app/app/src/main/AndroidManifest.xml @@ -22,7 +22,7 @@ diff --git a/android_app/app/src/main/java/com/health/openscale/gui/MainActivity.java b/android_app/app/src/main/java/com/health/openscale/gui/MainActivity.java index ad617c73..f824a5cb 100644 --- a/android_app/app/src/main/java/com/health/openscale/gui/MainActivity.java +++ b/android_app/app/src/main/java/com/health/openscale/gui/MainActivity.java @@ -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 openScale pro version to enable Bluetooth support")) + .setMessage(Html.fromHtml(getResources().getString(R.string.label_upgrade_to_openScale_pro) + "

Install openScale pro version")) .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(); diff --git a/android_app/app/src/main/res/drawable-hdpi/ic_launcher_openscale_light.png b/android_app/app/src/main/res/drawable-hdpi/ic_launcher_openscale_light.png new file mode 100644 index 00000000..e4e8ad3a Binary files /dev/null and b/android_app/app/src/main/res/drawable-hdpi/ic_launcher_openscale_light.png differ diff --git a/android_app/app/src/main/res/drawable-hdpi/ic_launcher_openscale_pro.png b/android_app/app/src/main/res/drawable-hdpi/ic_launcher_openscale_pro.png new file mode 100644 index 00000000..eb4104bd Binary files /dev/null and b/android_app/app/src/main/res/drawable-hdpi/ic_launcher_openscale_pro.png differ diff --git a/android_app/app/src/main/res/drawable-ldpi/ic_launcher_openscale_light.png b/android_app/app/src/main/res/drawable-ldpi/ic_launcher_openscale_light.png new file mode 100644 index 00000000..f024cd73 Binary files /dev/null and b/android_app/app/src/main/res/drawable-ldpi/ic_launcher_openscale_light.png differ diff --git a/android_app/app/src/main/res/drawable-ldpi/ic_launcher_openscale_pro.png b/android_app/app/src/main/res/drawable-ldpi/ic_launcher_openscale_pro.png new file mode 100644 index 00000000..98c7c018 Binary files /dev/null and b/android_app/app/src/main/res/drawable-ldpi/ic_launcher_openscale_pro.png differ diff --git a/android_app/app/src/main/res/drawable-mdpi/ic_launcher_openscale_light.png b/android_app/app/src/main/res/drawable-mdpi/ic_launcher_openscale_light.png new file mode 100644 index 00000000..5b7b08c1 Binary files /dev/null and b/android_app/app/src/main/res/drawable-mdpi/ic_launcher_openscale_light.png differ diff --git a/android_app/app/src/main/res/drawable-mdpi/ic_launcher_openscale_pro.png b/android_app/app/src/main/res/drawable-mdpi/ic_launcher_openscale_pro.png new file mode 100644 index 00000000..0a2ce45e Binary files /dev/null and b/android_app/app/src/main/res/drawable-mdpi/ic_launcher_openscale_pro.png differ diff --git a/android_app/app/src/main/res/drawable-xhdpi/ic_launcher_openscale_light.png b/android_app/app/src/main/res/drawable-xhdpi/ic_launcher_openscale_light.png new file mode 100644 index 00000000..5f2db23b Binary files /dev/null and b/android_app/app/src/main/res/drawable-xhdpi/ic_launcher_openscale_light.png differ diff --git a/android_app/app/src/main/res/drawable-xhdpi/ic_launcher_openscale_pro.png b/android_app/app/src/main/res/drawable-xhdpi/ic_launcher_openscale_pro.png new file mode 100644 index 00000000..7318001e Binary files /dev/null and b/android_app/app/src/main/res/drawable-xhdpi/ic_launcher_openscale_pro.png differ diff --git a/android_app/app/src/main/res/drawable-xxhdpi/ic_launcher_openscale_light.png b/android_app/app/src/main/res/drawable-xxhdpi/ic_launcher_openscale_light.png new file mode 100644 index 00000000..af9b11ad Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxhdpi/ic_launcher_openscale_light.png differ diff --git a/android_app/app/src/main/res/drawable-xxhdpi/ic_launcher_openscale_pro.png b/android_app/app/src/main/res/drawable-xxhdpi/ic_launcher_openscale_pro.png new file mode 100644 index 00000000..25963432 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxhdpi/ic_launcher_openscale_pro.png differ diff --git a/android_app/app/src/main/res/drawable-xxxhdpi/ic_launcher_openscale_light.png b/android_app/app/src/main/res/drawable-xxxhdpi/ic_launcher_openscale_light.png new file mode 100644 index 00000000..6151badf Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxxhdpi/ic_launcher_openscale_light.png differ diff --git a/android_app/app/src/main/res/drawable-xxxhdpi/ic_launcher_openscale_pro.png b/android_app/app/src/main/res/drawable-xxxhdpi/ic_launcher_openscale_pro.png new file mode 100644 index 00000000..81510560 Binary files /dev/null and b/android_app/app/src/main/res/drawable-xxxhdpi/ic_launcher_openscale_pro.png differ diff --git a/android_app/app/src/main/res/values/strings.xml b/android_app/app/src/main/res/values/strings.xml index ca4d4ea9..1e7421f4 100644 --- a/android_app/app/src/main/res/values/strings.xml +++ b/android_app/app/src/main/res/values/strings.xml @@ -255,4 +255,5 @@ Moderate Heavy Extreme + Please upgrade to the openScale pro version to enable Bluetooth support \ No newline at end of file