Merge branch 'feature/prepare_for_release' into develop

This commit is contained in:
jacques 2021-10-03 17:16:47 +02:00
commit 686dfbd006
7 changed files with 52 additions and 56 deletions

View file

@ -2,14 +2,19 @@
apply plugin: 'com.android.application'
ext.versionMajor = 0
ext.versionMinor = 10
ext.versionPatch = 20210709
ext.versionMinor = 50
ext.versionPatch = 20210929
ext.versionClassifier = null
ext.isSnapshot = true
ext.isSnapshot = false
ext.minimumSdkVersion = defaultMinSdkVersion
ext.git_version= ("git rev-parse --short HEAD".execute().text.trim())
android {
signingConfigs {
release {
}
}
compileSdkVersion 29
defaultConfig {
@ -20,24 +25,31 @@ android {
versionName generateVersionName() // 1.2.3-SNAPSHOT
multiDexEnabled true
}
/* flavorDimensions "version"
productFlavors {
unsigned {
applicationIdSuffix ".unsigned"
}
}*/
buildTypes {
release {
minifyEnabled false
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
/*dexOptions {
dexOptions {
incremental false
}*/
javaMaxHeapSize "4g"
}
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
@ -64,12 +76,12 @@ dependencies {
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.1.0'
implementation 'com.journeyapps:zxing-android-embedded:4.2.0'
implementation 'androidx.core:core:1.6.0'
// debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
implementation 'io.sentry:sentry-android:4.3.0'
implementation 'io.sentry:sentry-android:5.2.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -15,3 +15,12 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int v(...);
public static int i(...);
public static int w(...);
public static int d(...);
public static int e(...);
public static java.lang.String getStackTraceString(java.lang.Throwable);
}

View file

@ -138,19 +138,10 @@ public class DrugDetailActivity extends AppCompatActivity {
TextView warningTextView = warningView.findViewById(R.id.value);
String warningValue = warningTextView.getText().toString();
/* Log.d(TAG, "StockValue == "+ stockValue);
Log.d(TAG, "TakeValue == "+ takeValue);
Log.d(TAG, "AlertValue == "+ alertValue);
Log.d(TAG, "WarningValue == "+ warningValue);
Log.d(TAG, "medicamentID == "+ drug.getId());
Log.d(TAG, "drug == "+ drug.toString());*/
newDrug.setStock(Double.parseDouble(stockValue));
newDrug.setTake(Double.parseDouble(takeValue));
newDrug.setWarnThreshold(Integer.parseInt(warningValue));
newDrug.setAlertThreshold(Integer.parseInt(alertValue));
// newDrug.setDateLastUpdate(UtilDate.dateAtNoon(new Date()).getTime());
newDrug.setDateLastUpdate(new Date().getTime());
newDrug.setDateEndOfStock();

View file

@ -237,26 +237,31 @@ public class DrugListActivity extends AppCompatActivity {
return;
}
if (requestCode == CUSTOMIZED_REQUEST_CODE) {
Toast.makeText(this, "REQUEST_CODE = " + requestCode + "RESULT_CODE = " + resultCode, Toast.LENGTH_LONG).show();
if (BuildConfig.DEBUG) { Toast.makeText(this, "REQUEST_CODE = " + requestCode +
"RESULT_CODE = " + resultCode, Toast.LENGTH_LONG).show(); }
Log.d(TAG, "REQUEST_CODE = " + requestCode + " RESULT_CODE = " + resultCode);
constructDrugsList();
} else {
IntentResult result = IntentIntegrator.parseActivityResult(resultCode, data);
Toast.makeText(this, "REQUEST_CODE = " + requestCode, Toast.LENGTH_LONG).show();
if (BuildConfig.DEBUG) { Toast.makeText(this, "REQUEST_CODE = " + requestCode,
Toast.LENGTH_LONG).show(); }
Log.d(TAG, "REQUEST_CODE = " + requestCode + "resultCode = " + resultCode);
if (result.getContents() == null) {
Intent originalIntent = result.getOriginalIntent();
if (originalIntent == null) {
if (resultCode == 3) {
Toast.makeText(this, "Keyboard input", Toast.LENGTH_SHORT).show();
if(BuildConfig.DEBUG) { Toast.makeText(this, "Keyboard input",
Toast.LENGTH_SHORT).show(); }
Log.d(TAG, "Keyboard Input");
showInputDialog();
} else {
Log.d(TAG, "Cancelled scan");
Log.d(TAG, "REQUEST_CODE = " + requestCode + " RESULT_CODE = " + resultCode);
}
Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show();
if(BuildConfig.DEBUG) { Toast.makeText(this, "Cancelled",
Toast.LENGTH_LONG).show(); }
} else if (originalIntent.hasExtra(Intents.Scan.MISSING_CAMERA_PERMISSION)) {
Log.d(TAG, "Cancelled scan due to missing camera permission");
Log.d(TAG, "REQUEST_CODE = " + requestCode + " RESULT_CODE = " + resultCode);
@ -268,7 +273,8 @@ public class DrugListActivity extends AppCompatActivity {
Log.d(TAG, "result.getContents = " + result.getContents());
Log.d(TAG, "format = " + result.getFormatName());
Toast.makeText(this, "Scanned: " + result.getContents(), Toast.LENGTH_LONG).show();
if (BuildConfig.DEBUG) { Toast.makeText(this, "Scanned: " +
result.getContents(), Toast.LENGTH_LONG).show(); }
String cip13;
@ -377,33 +383,11 @@ public class DrugListActivity extends AppCompatActivity {
Context context = this;
Intent intent = new Intent(context, DrugDetailActivity.class);
intent.putExtra("drug", aDrug);
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE); // todo deprecated
//openActivityForResult(intent);
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
}
/* void openActivityForResult(Intent intent) {
// Intent intent = new Intent(this,DrugDetailActivity.class);
DrugDetailActivityLaucher.launch(intent);
}
ActivityResultLauncher<Intent> DrugDetailActivityLaucher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
new ActivityResultCallback<ActivityResult>() {
@Override
public void onActivityResult(ActivityResult result) {
if (result.getResultCode() == Activity.RESULT_OK) {
// Here, no request code
try {
result.getData();
Intent data = result.getData();
Log.d(TAG, "Result data = " +data.getDataString());
}
catch (Exception ignored){};
}
}
});*/
/**
/**
* setupRecyclerView (list of drugs
* @param recyclerView RecyclerView
*/
@ -467,7 +451,6 @@ public class DrugListActivity extends AppCompatActivity {
Log.d(TAG, "alert == " + mValues.get(position).getAlertThreshold());
holder.mItem = mValues.get(position);
// holder.mIDView.setText(mValues.get(position).getCip13());
holder.mContentView.setText(mValues.get(position).getName());
holder.mEndOfStock.setText(dateEndOfStock);
@ -498,8 +481,7 @@ public class DrugListActivity extends AppCompatActivity {
Context context = v.getContext();
Intent intent = new Intent(context, DrugDetailActivity.class);
intent.putExtra("drug", drugCourant);
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE); // todo: deprecated
//openActivityForResult(intent);
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
}
});

View file

@ -19,7 +19,7 @@ ext {
compileSdkVersion = '28'
buildToolsVersion = '28.0.1'
var = '3.4.2'
buildToolsVersion1 = '29.0.3'
//buildToolsVersion1 = '29.0.3'
defaultMinSdkVersion = 24
defaultTargetSdkVersion = 30
defaultVersionCode = 1

View file

@ -18,4 +18,6 @@
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
org.gradle.unsafe.configuration-cache=true
org.gradle.unsafe.configuration-cache=true
org.gradle.warning.mode=none
org.gradle.unsafe.configuration-cache-problems=warn

View file

@ -1,6 +1,6 @@
#Fri Mar 12 10:02:22 CET 2021
#Wed Sep 29 16:41:02 CEST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME