mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-26 01:43:59 +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 {
|
||||
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'
|
||||
|
@@ -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 <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) {
|
||||
|
@@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
|
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