diff --git a/android_app/app/build.gradle b/android_app/app/build.gradle index 25b1eef8..7d43366c 100644 --- a/android_app/app/build.gradle +++ b/android_app/app/build.gradle @@ -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 @@ -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' 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 ce93a572..ad617c73 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 @@ -29,8 +29,11 @@ import android.os.Bundle; 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; @@ -437,6 +440,21 @@ 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")) + .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) { diff --git a/android_app/build.gradle b/android_app/build.gradle index 2cbcdd39..28fae37e 100644 --- a/android_app/build.gradle +++ b/android_app/build.gradle @@ -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' } } diff --git a/doc/sync/openscale_sync.png b/doc/sync/openscale_sync.png new file mode 100644 index 00000000..2e4e543f Binary files /dev/null and b/doc/sync/openscale_sync.png differ