1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-09 18:26:38 +02:00

set for every build type a own icon

This commit is contained in:
oliexdev
2019-03-24 17:32:55 +01:00
parent 6b23a1272e
commit 2c528e98dd
16 changed files with 23 additions and 3 deletions

View File

@@ -10,6 +10,10 @@ android {
versionCode 43 versionCode 43
versionName "2.0.2" versionName "2.0.2"
manifestPlaceholders = [
appIcon: "@drawable/ic_launcher_openscale"
]
javaCompileOptions { javaCompileOptions {
annotationProcessorOptions { annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()] arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
@@ -30,12 +34,18 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
} }
light { light {
manifestPlaceholders = [
appIcon: "@drawable/ic_launcher_openscale_light"
]
applicationIdSuffix ".light" applicationIdSuffix ".light"
versionNameSuffix "-light" versionNameSuffix "-light"
minifyEnabled false minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
} }
pro { pro {
manifestPlaceholders = [
appIcon: "@drawable/ic_launcher_openscale_pro"
]
applicationIdSuffix ".pro" applicationIdSuffix ".pro"
versionNameSuffix "-pro" versionNameSuffix "-pro"
minifyEnabled false minifyEnabled false

View File

@@ -22,7 +22,7 @@
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@drawable/ic_launcher_openscale" android:icon="${appIcon}"
android:label="@string/app_name" android:label="@string/app_name"
android:name=".core.Application" android:name=".core.Application"
android:theme="@style/AppTheme_Light" > android:theme="@style/AppTheme_Light" >

View File

@@ -33,6 +33,7 @@ import android.text.Html;
import android.text.method.LinkMovementMethod; import android.text.method.LinkMovementMethod;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@@ -137,6 +138,14 @@ public class MainActivity extends BaseAppCompatActivity
navBottomDrawer.setSelectedItemId(prefs.getInt("lastFragmentId", R.id.nav_overview)); 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)) { if (prefs.getBoolean("firstStart", true)) {
Intent intent = new Intent(this, UserSettingsActivity.class); Intent intent = new Intent(this, UserSettingsActivity.class);
intent.putExtra(UserSettingsActivity.EXTRA_MODE, UserSettingsActivity.ADD_USER_REQUEST); intent.putExtra(UserSettingsActivity.EXTRA_MODE, UserSettingsActivity.ADD_USER_REQUEST);
@@ -442,9 +451,9 @@ public class MainActivity extends BaseAppCompatActivity
private void invokeConnectToBluetoothDevice() { private void invokeConnectToBluetoothDevice() {
if (BuildConfig.BUILD_TYPE == "light") { if (BuildConfig.BUILD_TYPE == "light") {
AlertDialog infoDialog = new AlertDialog.Builder(this) 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) .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) .setTitle("openScale " + BuildConfig.VERSION_NAME)
.create(); .create();

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -255,4 +255,5 @@
<string name="activity_level_moderate">Moderate</string> <string name="activity_level_moderate">Moderate</string>
<string name="activity_level_heavy">Heavy</string> <string name="activity_level_heavy">Heavy</string>
<string name="activity_level_extreme">Extreme</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> </resources>