mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-26 09:44:31 +02:00
added build types for light and pro version of openScale
This commit is contained in:
@@ -2,37 +2,46 @@ apply plugin: 'com.android.application'
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 28
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.health.openscale"
|
applicationId "com.health.openscale"
|
||||||
testApplicationId "com.health.openscale.test"
|
testApplicationId "com.health.openscale.test"
|
||||||
minSdkVersion 19
|
minSdkVersion 19
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 42
|
versionCode 43
|
||||||
versionName "2.0.1"
|
versionName "2.0.2"
|
||||||
|
|
||||||
javaCompileOptions {
|
javaCompileOptions {
|
||||||
annotationProcessorOptions { arguments = ["room.schemaLocation":"$projectDir/schemas".toString()] }
|
annotationProcessorOptions {
|
||||||
|
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
|
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
lintOptions {
|
lintOptions {
|
||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
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 {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility 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.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'androidx.appcompat:appcompat:1.0.2'
|
implementation 'androidx.appcompat:appcompat:1.0.2'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.0.0'
|
implementation 'androidx.recyclerview:recyclerview:1.0.0'
|
||||||
|
|
||||||
// MPAndroidChart
|
// MPAndroidChart
|
||||||
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha'
|
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha'
|
||||||
|
|
||||||
// Simple CSV
|
// Simple CSV
|
||||||
implementation 'com.j256.simplecsv:simplecsv:2.3'
|
implementation 'com.j256.simplecsv:simplecsv:2.3'
|
||||||
|
|
||||||
// RxAndroidBle
|
// RxAndroidBle
|
||||||
implementation 'com.polidea.rxandroidble2:rxandroidble:1.8.2'
|
implementation 'com.polidea.rxandroidble2:rxandroidble:1.8.2'
|
||||||
implementation 'io.reactivex.rxjava2:rxjava:2.2.7'
|
implementation 'io.reactivex.rxjava2:rxjava:2.2.7'
|
||||||
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
|
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
|
||||||
implementation 'com.jakewharton.rx2:replaying-share:2.1.0'
|
implementation 'com.jakewharton.rx2:replaying-share:2.1.0'
|
||||||
|
|
||||||
// CustomActivityOnCrash
|
// CustomActivityOnCrash
|
||||||
implementation 'cat.ereza:customactivityoncrash:2.2.0'
|
implementation 'cat.ereza:customactivityoncrash:2.2.0'
|
||||||
|
|
||||||
// Room
|
// Room
|
||||||
implementation 'androidx.room:room-runtime:2.1.0-alpha04'
|
implementation 'androidx.room:room-runtime:2.1.0-alpha04'
|
||||||
annotationProcessor 'androidx.room:room-compiler:2.1.0-alpha04'
|
annotationProcessor 'androidx.room:room-compiler:2.1.0-alpha04'
|
||||||
androidTestImplementation 'androidx.room:room-testing:2.1.0-alpha04'
|
androidTestImplementation 'androidx.room:room-testing:2.1.0-alpha04'
|
||||||
|
|
||||||
// Timber
|
// Timber
|
||||||
implementation 'com.jakewharton.timber:timber:4.7.1'
|
implementation 'com.jakewharton.timber:timber:4.7.1'
|
||||||
|
|
||||||
// Local unit tests
|
// Local unit tests
|
||||||
testImplementation 'junit:junit:4.12'
|
testImplementation 'junit:junit:4.12'
|
||||||
|
|
||||||
// Instrumented unit tests
|
// Instrumented unit tests
|
||||||
androidTestImplementation 'androidx.annotation:annotation:1.0.0'
|
androidTestImplementation 'androidx.annotation:annotation:1.0.0'
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
|
||||||
|
@@ -29,8 +29,11 @@ import android.os.Bundle;
|
|||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
@@ -437,6 +440,21 @@ public class MainActivity extends BaseAppCompatActivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void invokeConnectToBluetoothDevice() {
|
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();
|
final OpenScale openScale = OpenScale.getInstance();
|
||||||
|
|
||||||
if (openScale.getSelectedScaleUserId() == -1) {
|
if (openScale.getSelectedScaleUserId() == -1) {
|
||||||
|
@@ -5,7 +5,7 @@ buildscript {
|
|||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.3.1'
|
classpath 'com.android.tools.build:gradle:3.3.2'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
doc/sync/openscale_sync.png
Normal file
BIN
doc/sync/openscale_sync.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
Reference in New Issue
Block a user