Skip to content

Commit

Permalink
added build types for light and pro version of openScale
Browse files Browse the repository at this point in the history
  • Loading branch information
oliexdev committed Mar 19, 2019
1 parent f24fc35 commit 6b23a12
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
33 changes: 17 additions & 16 deletions android_app/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,46 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 28

defaultConfig {
applicationId "com.health.openscale"
testApplicationId "com.health.openscale.test"
minSdkVersion 19
targetSdkVersion 28
versionCode 42
versionName "2.0.1"
versionCode 43
versionName "2.0.2"

javaCompileOptions {
annotationProcessorOptions { arguments = ["room.schemaLocation":"$projectDir/schemas".toString()] }
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

sourceSets {
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
}

lintOptions {
abortOnError false
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
light {
applicationIdSuffix ".light"
versionNameSuffix "-light"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
pro {
applicationIdSuffix ".pro"
versionNameSuffix "-pro"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand All @@ -44,33 +53,25 @@ dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.recyclerview:recyclerview:1.0.0'

// MPAndroidChart
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha'

// Simple CSV
implementation 'com.j256.simplecsv:simplecsv:2.3'

// RxAndroidBle
implementation 'com.polidea.rxandroidble2:rxandroidble:1.8.2'
implementation 'io.reactivex.rxjava2:rxjava:2.2.7'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'com.jakewharton.rx2:replaying-share:2.1.0'

// CustomActivityOnCrash
implementation 'cat.ereza:customactivityoncrash:2.2.0'

// Room
implementation 'androidx.room:room-runtime:2.1.0-alpha04'
annotationProcessor 'androidx.room:room-compiler:2.1.0-alpha04'
androidTestImplementation 'androidx.room:room-testing:2.1.0-alpha04'

// Timber
implementation 'com.jakewharton.timber:timber:4.7.1'

// Local unit tests
testImplementation 'junit:junit:4.12'

// Instrumented unit tests
androidTestImplementation 'androidx.annotation:annotation:1.0.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@
import android.os.Handler;
import android.os.Message;
import android.preference.PreferenceManager;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.material.bottomnavigation.BottomNavigationView;
Expand Down Expand Up @@ -437,6 +440,21 @@ 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"))
.setPositiveButton(getResources().getString(R.string.label_ok), null)
.setIcon(R.drawable.ic_launcher_openscale)
.setTitle("openScale " + BuildConfig.VERSION_NAME)
.create();

infoDialog.show();

((TextView)infoDialog.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());

return;
}

final OpenScale openScale = OpenScale.getInstance();

if (openScale.getSelectedScaleUserId() == -1) {
Expand Down
2 changes: 1 addition & 1 deletion android_app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.android.tools.build:gradle:3.3.2'
}
}

Expand Down
Binary file added doc/sync/openscale_sync.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6b23a12

Please sign in to comment.