Skip to content

Commit

Permalink
set for every build type a own icon
Browse files Browse the repository at this point in the history
  • Loading branch information
oliexdev committed Mar 24, 2019
1 parent 6b23a12 commit 2c528e9
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 3 deletions.
10 changes: 10 additions & 0 deletions android_app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion android_app/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
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;

Expand Down Expand Up @@ -137,6 +138,14 @@ public boolean onNavigationItemSelected(@NonNull MenuItem item) {

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);
Expand Down Expand Up @@ -442,9 +451,9 @@ public void onConfigurationChanged(Configuration newConfig){
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();

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions android_app/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit 2c528e9

Please sign in to comment.