mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +01:00
Merge branch 'hotfix/fix_button'
This commit is contained in:
commit
98ad33034a
69 changed files with 3371 additions and 570 deletions
25
LICENSE
Normal file
25
LICENSE
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
The BSD 3-Clause License The following is a BSD 3-Clause ("BSD New" or "BSD Simplified") license template. To generate your own license, change the values of OWNER, ORGANIZATION and YEAR from their original values as given here, and substitute your own.
|
||||||
|
|
||||||
|
Note: You may omit clause 3 and still be OSD-conformant. Despite its colloquial name "BSD New", this is not the newest version of the BSD license; it was followed by the even newer BSD-2-Clause version, sometimes known as the "Simplified BSD License". On January 9th, 2008 the OSI Board approved BSD-2-Clause, which is used by FreeBSD and others. It omits the final "no-endorsement" clause and is thus roughly equivalent to the MIT License.
|
||||||
|
|
||||||
|
Historical Background: The original license used on BSD Unix had four clauses. The advertising clause (the third of four clauses) required you to acknowledge use of U.C. Berkeley code in your advertising of any product using that code. It was officially rescinded by the Director of the Office of Technology Licensing of the University of California on July 22nd, 1999. He states that clause 3 is "hereby deleted in its entirety." The four clause license has not been approved by OSI. The license below does not contain the advertising clause.
|
||||||
|
|
||||||
|
This prelude is not part of the license.
|
||||||
|
|
||||||
|
OWNER = Regents of the University of California
|
||||||
|
|
||||||
|
ORGANIZATION = University of California, Berkeley
|
||||||
|
|
||||||
|
YEAR = 1998
|
||||||
|
|
||||||
|
In the original BSD license, both occurrences of the phrase "COPYRIGHT HOLDERS AND CONTRIBUTORS" in the disclaimer read "REGENTS AND CONTRIBUTORS".
|
||||||
|
|
||||||
|
Copyright (c) $2022 Jacques Foucry, All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
13
README.md
13
README.md
|
@ -1,7 +1,7 @@
|
||||||
# Pilldroid
|
# Pilldroid
|
||||||
|
|
||||||
Pilldroid est une application de gestion de stock **théorique** de médicament à
|
Pilldroid est une application de gestion de stock **théorique** de médicament à
|
||||||
destinations des personnes résidant en France.
|
destination des personnes résidant en France.
|
||||||
|
|
||||||
## Ce que n'est pas Pilldroid
|
## Ce que n'est pas Pilldroid
|
||||||
|
|
||||||
|
@ -21,13 +21,13 @@ jour`. Ce calcul est fait tous les jours entre 11h et midi.
|
||||||
|
|
||||||
## De quelles autorisations l'application Pilldroid a-t-elle besoin ?
|
## De quelles autorisations l'application Pilldroid a-t-elle besoin ?
|
||||||
|
|
||||||
- Pilldroid à besoin de savoir que le téléphone a été redémarré pour elle-même
|
- Pilldroid a besoin de savoir que le téléphone a été redémarré pour elle-même
|
||||||
lancer son cycle de réveil journalier ;
|
lancer son cycle de réveil journalier ;
|
||||||
- Pilldroid a besoin d'accéder à l'appareil photo de votre téléphone pour
|
- Pilldroid a besoin d'accéder à l'appareil photo de votre téléphone pour
|
||||||
scanner le code barre des boites de médicaments ;
|
scanner le code barre des boites de médicaments ;
|
||||||
- Pilldroid a besoin de pouvoir vous envoyer des alarmes ;
|
- Pilldroid a besoin de pouvoir vous envoyer des alarmes ;
|
||||||
- Pilldroid a besoin de faire vibrer le téléphone pour les alarmes ;
|
- Pilldroid a besoin de faire vibrer le téléphone pour les alarmes ;
|
||||||
- Pilldroid utilise un accès Internet pour les remontée de crash *via* la bibliothèque [sentry.io](https://sentry.io).
|
|
||||||
|
|
||||||
## L'application Pilldroid embarque-t-elle des bibliothèques tierce ?
|
## L'application Pilldroid embarque-t-elle des bibliothèques tierce ?
|
||||||
|
|
||||||
|
@ -35,11 +35,6 @@ Oui. Pour la lecture de code barre, Pilldroid utilise le projet
|
||||||
[zxing](https://github.com/journeyapps/zxing-android-embedded) lui-même libre et
|
[zxing](https://github.com/journeyapps/zxing-android-embedded) lui-même libre et
|
||||||
ouvert.
|
ouvert.
|
||||||
|
|
||||||
A terme Pilldroid utilisera la bibliothèque
|
|
||||||
[sentry.io](https://sentry.io/for/android/) quand j'aurais compris comment cela
|
|
||||||
fonctionne. Le but est d'avoir des remontées les crashs de l'application sans
|
|
||||||
collecter de données à caractère personnel.
|
|
||||||
Déjà embarquée mais non fonctionnelle, `sentry.io` à besoin de l'accès Internet.
|
|
||||||
|
|
||||||
## L'application Pilldroid contient-elle des pisteurs ?
|
## L'application Pilldroid contient-elle des pisteurs ?
|
||||||
|
|
||||||
|
@ -54,7 +49,7 @@ prochainement mis sur mon compte `github`.
|
||||||
## Comment peut-on participer à Pilldroid ?
|
## Comment peut-on participer à Pilldroid ?
|
||||||
|
|
||||||
Mon code est de piètre qualité et mes connaissances Java maigrelettes toute
|
Mon code est de piètre qualité et mes connaissances Java maigrelettes toute
|
||||||
amélioration **que je comprends** sera la bien venue (je n'ai pas pigé les
|
amélioration **que je comprends** sera la bienvenue (je n'ai pas pigé les
|
||||||
`lambda` par exemple).
|
`lambda` par exemple).
|
||||||
|
|
||||||
Marché de niche, Pilldroid a besoin de testeuses et testeurs.
|
Marché de niche, Pilldroid a besoin de testeuses et testeurs.
|
||||||
|
|
|
@ -1,14 +1,6 @@
|
||||||
//noinspection GradleCompatible
|
//noinspection GradleCompatible
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
ext.versionMajor = 0
|
|
||||||
ext.versionMinor = 65
|
|
||||||
ext.versionPatch = new Date().format("yyyyMMdd")
|
|
||||||
ext.versionClassifier = null
|
|
||||||
ext.isSnapshot = false
|
|
||||||
ext.minimumSdkVersion = defaultMinSdkVersion
|
|
||||||
ext.git_version= ("git rev-parse --short HEAD".execute().text.trim())
|
|
||||||
|
|
||||||
// Try reading secrets from file
|
// Try reading secrets from file
|
||||||
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
def secretProperties = new Properties()
|
def secretProperties = new Properties()
|
||||||
|
@ -40,9 +32,14 @@ android {
|
||||||
applicationId "net.foucry.pilldroid"
|
applicationId "net.foucry.pilldroid"
|
||||||
minSdkVersion defaultMinSdkVersion
|
minSdkVersion defaultMinSdkVersion
|
||||||
targetSdkVersion defaultTargetSdkVersion
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
versionCode generateVersionCode() // 190010203
|
versionCode 201
|
||||||
versionName generateVersionName() // 1.2.3-SNAPSHOT
|
versionName "v0.201-beta"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
|
javaCompileOptions {
|
||||||
|
annotationProcessorOptions {
|
||||||
|
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
@ -55,6 +52,7 @@ android {
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
debuggable false
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
}
|
}
|
||||||
prerelease {
|
prerelease {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
|
@ -81,15 +79,11 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
coreLibraryDesugaringEnabled true
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
buildToolsVersion = "32.0.0"
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
|
||||||
}
|
|
||||||
dexOptions {
|
|
||||||
incremental false
|
|
||||||
javaMaxHeapSize "4g"
|
|
||||||
}
|
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
|
@ -109,43 +103,21 @@ sourceSets {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation "androidx.room:room-common:2.4.2"
|
||||||
|
annotationProcessor "androidx.room:room-compiler:2.4.2"
|
||||||
|
implementation "androidx.room:room-testing:2.4.2"
|
||||||
|
implementation "androidx.room:room-rxjava3:2.4.2"
|
||||||
|
implementation "androidx.room:room-runtime:2.4.2"
|
||||||
|
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
testImplementation 'junit:junit:4.13.2'
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
implementation 'com.google.android.material:material:1.4.0'
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
|
||||||
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||||
implementation 'androidx.core:core:1.6.0'
|
implementation 'androidx.core:core:1.7.0'
|
||||||
|
|
||||||
// debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
|
|
||||||
|
|
||||||
implementation 'io.sentry:sentry-android:5.4.0'
|
|
||||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
}
|
|
||||||
|
|
||||||
private Integer generateVersionCode() {
|
|
||||||
Integer versionCode = ext.minimumSdkVersion * 1000 + ext.versionMajor * 100 + ext.versionMinor
|
|
||||||
print "versionCode = " + versionCode +"\n"
|
|
||||||
return versionCode
|
|
||||||
}
|
|
||||||
|
|
||||||
private String generateVersionName() {
|
|
||||||
String versionName = "${ext.versionMajor}.${ext.versionMinor}.${ext.versionPatch}"
|
|
||||||
if (ext.versionClassifier == null && ext.isSnapshot) {
|
|
||||||
ext.versionClassifier = "SNAPSHOT"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ext.versionClassifier != null) {
|
|
||||||
versionName += "-" + ext.versionClassifier
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ext.git_version != null) {
|
|
||||||
versionName += "-" + ext.git_version
|
|
||||||
}
|
|
||||||
|
|
||||||
print "versionName = " + versionName
|
|
||||||
return versionName
|
|
||||||
}
|
}
|
121
app/build_BACKUP_2537.gradle
Normal file
121
app/build_BACKUP_2537.gradle
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 31
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
|
=======
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.0'
|
||||||
|
>>>>>>> 5fe29e5 (Change compileSskVersion)
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
|
||||||
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||||
|
implementation 'androidx.core:core:1.7.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
121
app/build_BACKUP_2948.gradle
Normal file
121
app/build_BACKUP_2948.gradle
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 31
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
|
=======
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.0'
|
||||||
|
>>>>>>> 5fe29e5 (Change compileSskVersion)
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
|
||||||
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||||
|
implementation 'androidx.core:core:1.7.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
121
app/build_BACKUP_3178.gradle
Normal file
121
app/build_BACKUP_3178.gradle
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 31
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
|
=======
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.0'
|
||||||
|
>>>>>>> 5fe29e5 (Change compileSskVersion)
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
|
||||||
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||||
|
implementation 'androidx.core:core:1.7.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
121
app/build_BACKUP_3356.gradle
Normal file
121
app/build_BACKUP_3356.gradle
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 31
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
|
=======
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.0'
|
||||||
|
>>>>>>> 5fe29e5 (Change compileSskVersion)
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
|
||||||
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||||
|
implementation 'androidx.core:core:1.7.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
117
app/build_BASE_2537.gradle
Normal file
117
app/build_BASE_2537.gradle
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 30
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
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.3.0'
|
||||||
|
implementation 'androidx.core:core:1.6.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
117
app/build_BASE_2948.gradle
Normal file
117
app/build_BASE_2948.gradle
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 30
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
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.3.0'
|
||||||
|
implementation 'androidx.core:core:1.6.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
117
app/build_BASE_3178.gradle
Normal file
117
app/build_BASE_3178.gradle
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 30
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
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.3.0'
|
||||||
|
implementation 'androidx.core:core:1.6.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
117
app/build_BASE_3356.gradle
Normal file
117
app/build_BASE_3356.gradle
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 30
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
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.3.0'
|
||||||
|
implementation 'androidx.core:core:1.6.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
117
app/build_LOCAL_2537.gradle
Normal file
117
app/build_LOCAL_2537.gradle
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 31
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
|
||||||
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||||
|
implementation 'androidx.core:core:1.7.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
117
app/build_LOCAL_2948.gradle
Normal file
117
app/build_LOCAL_2948.gradle
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 31
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
|
||||||
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||||
|
implementation 'androidx.core:core:1.7.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
117
app/build_LOCAL_3178.gradle
Normal file
117
app/build_LOCAL_3178.gradle
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 31
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
|
||||||
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||||
|
implementation 'androidx.core:core:1.7.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
117
app/build_LOCAL_3356.gradle
Normal file
117
app/build_LOCAL_3356.gradle
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 31
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
|
||||||
|
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||||
|
implementation 'androidx.core:core:1.7.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
117
app/build_REMOTE_2537.gradle
Normal file
117
app/build_REMOTE_2537.gradle
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 31
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.0'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
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.3.0'
|
||||||
|
implementation 'androidx.core:core:1.6.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
117
app/build_REMOTE_2948.gradle
Normal file
117
app/build_REMOTE_2948.gradle
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 31
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.0'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
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.3.0'
|
||||||
|
implementation 'androidx.core:core:1.6.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
117
app/build_REMOTE_3178.gradle
Normal file
117
app/build_REMOTE_3178.gradle
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 31
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.0'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
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.3.0'
|
||||||
|
implementation 'androidx.core:core:1.6.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
117
app/build_REMOTE_3356.gradle
Normal file
117
app/build_REMOTE_3356.gradle
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
//noinspection GradleCompatible
|
||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Try reading secrets from file
|
||||||
|
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||||
|
def secretProperties = new Properties()
|
||||||
|
|
||||||
|
if (secretsPropertiesFile.exists()) {
|
||||||
|
secretProperties.load(new FileInputStream(secretsPropertiesFile))
|
||||||
|
}
|
||||||
|
// Otherwise read from environment variables, this happens in CI
|
||||||
|
else {
|
||||||
|
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
|
||||||
|
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
signingConfigs {
|
||||||
|
release {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_release_alias_key']
|
||||||
|
keyPassword secretProperties['signing_release_key_password']
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
storeFile rootProject.file("android-signing-keystore.jks")
|
||||||
|
storePassword secretProperties['signing_keystore_password']
|
||||||
|
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||||
|
keyPassword secretProperties['signing_pre-release_key_password']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
compileSdkVersion 31
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "net.foucry.pilldroid"
|
||||||
|
minSdkVersion defaultMinSdkVersion
|
||||||
|
targetSdkVersion defaultTargetSdkVersion
|
||||||
|
versionCode 100
|
||||||
|
versionName "v0.100-beta"
|
||||||
|
multiDexEnabled true
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
debuggable true
|
||||||
|
applicationIdSuffix ".debug"
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
minifyEnabled true
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.release
|
||||||
|
}
|
||||||
|
prerelease {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
debuggable false
|
||||||
|
signingConfig signingConfigs.prerelease
|
||||||
|
}
|
||||||
|
}
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
dev {
|
||||||
|
resValue "string", "app_name", "PillDroid dev"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
|
||||||
|
product {
|
||||||
|
resValue "string", "app_name", "PillDroid"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
preproduct {
|
||||||
|
resValue "string", "app_name", "PillDroid Pre-Release"
|
||||||
|
dimension ="version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
|
}
|
||||||
|
|
||||||
|
buildToolsVersion '32.0.0'
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
java {
|
||||||
|
exclude 'net/foucry/pilldroid/scanActivity.java'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
|
testImplementation 'junit:junit:4.13.2'
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.4.0'
|
||||||
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
|
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.3.0'
|
||||||
|
implementation 'androidx.core:core:1.6.0'
|
||||||
|
|
||||||
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
{
|
||||||
|
"formatVersion": 1,
|
||||||
|
"database": {
|
||||||
|
"version": 1,
|
||||||
|
"identityHash": "96dc5c4ccb337047e323d613eb86bdd1",
|
||||||
|
"entities": [
|
||||||
|
{
|
||||||
|
"tableName": "drugs",
|
||||||
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER NOT NULL, `cis` TEXT, `cip13` TEXT, `cip7` TEXT, `administration_mode` TEXT, `name` TEXT, `presentation` TEXT, `label_group` TEXT, `generic_type` INTEGER, PRIMARY KEY(`_id`))",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"fieldPath": "_id",
|
||||||
|
"columnName": "_id",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "cis",
|
||||||
|
"columnName": "cis",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "cip13",
|
||||||
|
"columnName": "cip13",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "cip7",
|
||||||
|
"columnName": "cip7",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "administration_mode",
|
||||||
|
"columnName": "administration_mode",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "name",
|
||||||
|
"columnName": "name",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "presentation",
|
||||||
|
"columnName": "presentation",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "label_group",
|
||||||
|
"columnName": "label_group",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "generic_type",
|
||||||
|
"columnName": "generic_type",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primaryKey": {
|
||||||
|
"columnNames": [
|
||||||
|
"_id"
|
||||||
|
],
|
||||||
|
"autoGenerate": false
|
||||||
|
},
|
||||||
|
"indices": [],
|
||||||
|
"foreignKeys": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"views": [],
|
||||||
|
"setupQueries": [
|
||||||
|
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||||
|
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '96dc5c4ccb337047e323d613eb86bdd1')"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,100 @@
|
||||||
|
{
|
||||||
|
"formatVersion": 1,
|
||||||
|
"database": {
|
||||||
|
"version": 1,
|
||||||
|
"identityHash": "7d1384a7162a98602e19c3ee54b7aee5",
|
||||||
|
"entities": [
|
||||||
|
{
|
||||||
|
"tableName": "prescriptions",
|
||||||
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`cis` TEXT NOT NULL, `cip13` TEXT, `name` TEXT, `administration_mode` TEXT, `presentation` TEXT, `stock` REAL, `take` REAL, `warning` INTEGER, `alert` INTEGER, `last_update` INTEGER, `label_group` TEXT, `genetic_type` INTEGER, PRIMARY KEY(`cis`))",
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"fieldPath": "cis",
|
||||||
|
"columnName": "cis",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "cip13",
|
||||||
|
"columnName": "cip13",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "name",
|
||||||
|
"columnName": "name",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "administration_mode",
|
||||||
|
"columnName": "administration_mode",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "presentation",
|
||||||
|
"columnName": "presentation",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "stock",
|
||||||
|
"columnName": "stock",
|
||||||
|
"affinity": "REAL",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "take",
|
||||||
|
"columnName": "take",
|
||||||
|
"affinity": "REAL",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "warning",
|
||||||
|
"columnName": "warning",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "alert",
|
||||||
|
"columnName": "alert",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "last_update",
|
||||||
|
"columnName": "last_update",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "label_group",
|
||||||
|
"columnName": "label_group",
|
||||||
|
"affinity": "TEXT",
|
||||||
|
"notNull": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldPath": "genetic_type",
|
||||||
|
"columnName": "genetic_type",
|
||||||
|
"affinity": "INTEGER",
|
||||||
|
"notNull": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"primaryKey": {
|
||||||
|
"columnNames": [
|
||||||
|
"cis"
|
||||||
|
],
|
||||||
|
"autoGenerate": false
|
||||||
|
},
|
||||||
|
"indices": [],
|
||||||
|
"foreignKeys": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"views": [],
|
||||||
|
"setupQueries": [
|
||||||
|
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||||
|
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '7d1384a7162a98602e19c3ee54b7aee5')"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,12 +13,12 @@
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppTheme"
|
android:theme="@style/AppTheme"
|
||||||
android:allowBackup="true">
|
android:allowBackup="true">
|
||||||
<activity
|
<activity
|
||||||
android:name=".DrugListActivity"
|
android:name=".DrugListActivity"
|
||||||
android:label="@string/app_name"
|
|
||||||
android:theme="@style/AppTheme.NoActionBar"
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
android:exported="true">
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
@ -30,7 +30,8 @@
|
||||||
android:name=".DrugDetailActivity"
|
android:name=".DrugDetailActivity"
|
||||||
android:label="@string/title_drug_detail"
|
android:label="@string/title_drug_detail"
|
||||||
android:parentActivityName=".DrugListActivity"
|
android:parentActivityName=".DrugListActivity"
|
||||||
android:theme="@style/AppTheme.NoActionBar">
|
android:theme="@style/AppTheme.NoActionBar"
|
||||||
|
android:windowSoftInputMode="adjustResize">
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
android:value="net.foucry.pilldroid.DrugListActivity" />
|
android:value="net.foucry.pilldroid.DrugListActivity" />
|
||||||
|
@ -59,7 +60,5 @@
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
<meta-data android:name="io.sentry.dsn" android:value="https://ba17f240b58144e398c862bb953256ef@o755123.ingest.sentry.io/5792286" />
|
|
||||||
</application>
|
</application>
|
||||||
|
</manifest>
|
||||||
</manifest>
|
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
}</style>
|
}</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<center><img src="file:///android_asset/ic_launcher-web.png" width="64"/></center>
|
<center><img src="file:///android_asset/icon_pilldroid.png" width="64"/></center>
|
||||||
<!--<div class="build">[[[about_string]]]</div>-->
|
<!--<div class="build">[[[about_string]]]</div>-->
|
||||||
<h5>PillDroid © 2021 Jacques Foucry </h5>
|
<h5>Pilldroid © 2022 Jacques Foucry </h5>
|
||||||
<p>PillDroid est une gestion théorique de votre stock de médicaments.</p>
|
<p>Pilldroid est une gestion théorique de votre stock de médicaments.</p>
|
||||||
<p>PillDroid n'a aucune connaissance des interactions des médicaments entre eux.</p>
|
<p>Pilldroid n'a aucune connaissance des interactions des médicaments entre eux.</p>
|
||||||
<p class="red">EN CAS DE DOUTE, CONSULTEZ VOTRE MÉDECIN OU VOTRE PHARMACIEN.</p>
|
<p class="red">EN CAS DE DOUTE, CONSULTEZ VOTRE MÉDECIN OU VOTRE PHARMACIEN.</p>
|
||||||
<p>PillDroid ne vous rappelle pas de prendre vos médicaments.</p>
|
<p>PillDroid ne vous rappelle pas de prendre vos médicaments.</p>
|
||||||
<p class="red">LA RESPONSABILITÉ DE L'AUTEUR NE SAURAIT ÊTRE ENGAGÉE EN CAS DE SURDOSAGE OU D'OUBLI DE PRISE.</p>
|
<p class="red">LA RESPONSABILITÉ DE L'AUTEUR NE SAURAIT ÊTRE ENGAGÉE EN CAS DE SURDOSAGE OU D'OUBLI DE PRISE.</p>
|
||||||
|
@ -28,9 +28,9 @@
|
||||||
<hr width=45%/>
|
<hr width=45%/>
|
||||||
<p>Les conseils et aides de <a href="https://mob-dev.fr">mob-dev.fr</a>.</p>
|
<p>Les conseils et aides de <a href="https://mob-dev.fr">mob-dev.fr</a>.</p>
|
||||||
<p>Le soutien actif et les conseils du Dr Kauffmann me permettent de faire
|
<p>Le soutien actif et les conseils du Dr Kauffmann me permettent de faire
|
||||||
évoluer PillDroid.</p>
|
évoluer Pilldroid.</p>
|
||||||
<p>Vous pouvez me contacter à l'adresse suivante : <a
|
<p>Vous pouvez me contacter à l'adresse suivante : <a
|
||||||
href="mailto:jacques+PillDroid@foucry.net?subject=À propos de
|
href="mailto:pilldroidd@foucry.net?subject=À propos de
|
||||||
PillDroid">jacques+pilldroid@foucry.net</a></p>.
|
PillDroid">jacques+pilldroid@foucry.net</a></p>.
|
||||||
<p>Le site web de l'<a href="https://pilldroid.foucry.net">application</a>.
|
<p>Le site web de l'<a href="https://pilldroid.foucry.net">application</a>.
|
||||||
</body>
|
</body>
|
||||||
|
|
Binary file not shown.
BIN
app/src/main/assets/icon_pilldroid.png
Normal file
BIN
app/src/main/assets/icon_pilldroid.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
|
@ -14,6 +14,10 @@ import android.widget.Toast;
|
||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
import androidx.core.app.NotificationManagerCompat;
|
import androidx.core.app.NotificationManagerCompat;
|
||||||
|
|
||||||
|
import net.foucry.pilldroid.dao.PrescriptionsDAO;
|
||||||
|
import net.foucry.pilldroid.databases.PrescriptionDatabase;
|
||||||
|
import net.foucry.pilldroid.models.Prescription;
|
||||||
|
|
||||||
import java.time.LocalTime;
|
import java.time.LocalTime;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -41,24 +45,24 @@ public class AlarmReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
if (BuildConfig.DEBUG) { Toast.makeText(context, "New stock calculated", Toast.LENGTH_LONG).show(); }
|
if (BuildConfig.DEBUG) { Toast.makeText(context, "New stock calculated", Toast.LENGTH_LONG).show(); }
|
||||||
createNotificationChannel(context);
|
createNotificationChannel(context);
|
||||||
DBHelper dbHelper = new DBHelper(context);
|
PrescriptionDatabase prescriptions = null;
|
||||||
dbHelper.getAllDrugs();
|
assert false;
|
||||||
|
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
|
||||||
List<Drug> drugs = dbHelper.getAllDrugs();
|
List<Prescription> prescriptionList = prescriptionsDAO.getAllMedics();
|
||||||
|
Prescription firstPrescription = null ;
|
||||||
Drug firstDrug = null;
|
//List<Drug> drugs = dbHelper.getAllDrugs();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
firstDrug = drugs.get(0);
|
firstPrescription = prescriptionList.get(1);
|
||||||
}
|
}
|
||||||
catch (Exception e){
|
catch (Exception e){
|
||||||
Log.e(TAG, e.toString());
|
Log.e(TAG, e.toString());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstDrug != null) {
|
if (firstPrescription != null) {
|
||||||
if (firstDrug.getTake() != 0) {
|
if (firstPrescription.getTake() != 0) {
|
||||||
if(firstDrug.getStock() <= firstDrug.getAlertThreshold()) {
|
if(firstPrescription.getStock() <= firstPrescription.getAlertThreshold()) {
|
||||||
notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
|
||||||
Intent notificationIntent = new Intent(context, DrugListActivity.class);
|
Intent notificationIntent = new Intent(context, DrugListActivity.class);
|
||||||
|
@ -81,7 +85,7 @@ public class AlarmReceiver extends BroadcastReceiver {
|
||||||
notificationManager.notify(notificationId, builder.build());
|
notificationManager.notify(notificationId, builder.build());
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
double dummy = (firstDrug.getStock() - firstDrug.getAlertThreshold());
|
double dummy = (firstPrescription.getStock() - firstPrescription.getAlertThreshold());
|
||||||
Log.d(TAG, "no notification scheduled " + dummy);
|
Log.d(TAG, "no notification scheduled " + dummy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,26 +100,24 @@ public class AlarmReceiver extends BroadcastReceiver {
|
||||||
String description = context.getString(R.string.channel_description);
|
String description = context.getString(R.string.channel_description);
|
||||||
int importance = NotificationManager.IMPORTANCE_DEFAULT;
|
int importance = NotificationManager.IMPORTANCE_DEFAULT;
|
||||||
String CHANNEL_ID = "PillDroid";
|
String CHANNEL_ID = "PillDroid";
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
|
||||||
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
|
channel.setDescription(description);
|
||||||
channel.setDescription(description);
|
channel.enableLights(true);
|
||||||
channel.enableLights(true);
|
channel.setLightColor(R.color.led);
|
||||||
channel.setLightColor(R.color.led);
|
channel.enableVibration(true);
|
||||||
channel.enableVibration(true);
|
channel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
|
||||||
channel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
|
// Register the channel with the system; you can't change the importance
|
||||||
// Register the channel with the system; you can't change the importance
|
// or other notification behaviors after this
|
||||||
// or other notification behaviors after this
|
NotificationManager notificationManager = context.getSystemService(NotificationManager.class);
|
||||||
NotificationManager notificationManager = context.getSystemService(NotificationManager.class);
|
try {
|
||||||
try {
|
notificationManager.createNotificationChannel(channel);
|
||||||
notificationManager.createNotificationChannel(channel);
|
} catch (Exception e) {
|
||||||
} catch (Exception e) {
|
// This will catch any exception, because they are all descended from Exception
|
||||||
// This will catch any exception, because they are all descended from Exception
|
Log.e(TAG, e.toString());
|
||||||
Log.e(TAG, e.toString());
|
//At the level Exception Class handle the error in Exception Table
|
||||||
//At the level Exception Class handle the error in Exception Table
|
// Exception Create That Error Object and throw it
|
||||||
// Exception Create That Error Object and throw it
|
//E.g: FileNotFoundException ,etc
|
||||||
//E.g: FileNotFoundException ,etc
|
e.printStackTrace();
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void scheduleAlarm(Context context) {
|
public static void scheduleAlarm(Context context) {
|
||||||
|
@ -150,4 +152,10 @@ public class AlarmReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
if (BuildConfig.DEBUG) { Toast.makeText(context, "Alarm scheduled for " + UtilDate.convertDate(calendar.getTimeInMillis()), Toast.LENGTH_SHORT).show(); }
|
if (BuildConfig.DEBUG) { Toast.makeText(context, "Alarm scheduled for " + UtilDate.convertDate(calendar.getTimeInMillis()), Toast.LENGTH_SHORT).show(); }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public static Boolean isAlarmScheduled(Context context) {
|
||||||
|
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
|
||||||
|
|
||||||
|
return alarmManager.getNextAlarmClock() != null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,15 +1,19 @@
|
||||||
package net.foucry.pilldroid;
|
package net.foucry.pilldroid;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.journeyapps.barcodescanner.BarcodeCallback;
|
||||||
|
import com.journeyapps.barcodescanner.BarcodeResult;
|
||||||
import com.journeyapps.barcodescanner.CaptureManager;
|
import com.journeyapps.barcodescanner.CaptureManager;
|
||||||
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
|
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
|
||||||
import com.journeyapps.barcodescanner.ViewfinderView;
|
import com.journeyapps.barcodescanner.ViewfinderView;
|
||||||
|
@ -19,39 +23,59 @@ import java.util.Random;
|
||||||
/**
|
/**
|
||||||
* Custom Scanner Activity extending from Activity to display a custom layout form scanner view.
|
* Custom Scanner Activity extending from Activity to display a custom layout form scanner view.
|
||||||
*/
|
*/
|
||||||
public class CustomScannerActivity extends Activity implements
|
public class CustomScannerActivity extends Activity implements DecoratedBarcodeView.TorchListener {
|
||||||
DecoratedBarcodeView.TorchListener {
|
|
||||||
|
private static final String TAG = CustomScannerActivity.class.getName();
|
||||||
|
|
||||||
private CaptureManager capture;
|
private CaptureManager capture;
|
||||||
private DecoratedBarcodeView barcodeScannerView;
|
private DecoratedBarcodeView barcodeScannerView;
|
||||||
private ImageButton switchFlashlightButton;
|
private ImageButton switchFlashlightButton;
|
||||||
private ViewfinderView viewfinderView;
|
private ViewfinderView viewfinderView;
|
||||||
|
|
||||||
|
final Bundle captureIntentBundle = new Bundle();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_custom_scanner);
|
|
||||||
|
setContentView(R.layout.custom_scanner_activty);
|
||||||
|
|
||||||
|
//barcodeScannerView.setTorchListener(this);
|
||||||
|
|
||||||
|
findViewById(R.id.keyboard_button).setOnClickListener(this::onKeyboard);
|
||||||
|
findViewById(R.id.cancel_button).setOnClickListener(this::onCancel);
|
||||||
|
findViewById(R.id.switch_flashlight).setOnClickListener(this::switchFlashlight);
|
||||||
|
switchFlashlightButton = findViewById(R.id.switch_flashlight);
|
||||||
|
viewfinderView = findViewById(R.id.zxing_viewfinder_view);
|
||||||
|
|
||||||
barcodeScannerView = findViewById(R.id.zxing_barcode_scanner);
|
barcodeScannerView = findViewById(R.id.zxing_barcode_scanner);
|
||||||
barcodeScannerView.setTorchListener(this);
|
|
||||||
|
|
||||||
switchFlashlightButton = findViewById(R.id.switch_flashlight);
|
|
||||||
|
|
||||||
viewfinderView = findViewById(R.id.zxing_viewfinder_view);
|
|
||||||
|
|
||||||
// if the device does not have flashlight in its camera,
|
// if the device does not have flashlight in its camera,
|
||||||
// then remove the switch flashlight button...
|
// then remove the switch flashlight button...
|
||||||
if (!hasFlash()) {
|
if (!hasFlash()) {
|
||||||
switchFlashlightButton.setVisibility(View.GONE);
|
findViewById(R.id.switch_flashlight).setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
capture = new CaptureManager(this, barcodeScannerView);
|
capture = new CaptureManager(this, barcodeScannerView);
|
||||||
capture.initializeFromIntent(getIntent(), savedInstanceState);
|
capture.initializeFromIntent(getIntent(), savedInstanceState);
|
||||||
capture.setShowMissingCameraPermissionDialog(false);
|
capture.setShowMissingCameraPermissionDialog(false);
|
||||||
capture.decode();
|
|
||||||
|
|
||||||
changeMaskColor(null);
|
//changeMaskColor(null);
|
||||||
changeLaserVisibility(true);
|
changeLaserVisibility(true);
|
||||||
|
barcodeScannerView.decodeSingle(new BarcodeCallback() {
|
||||||
|
@Override
|
||||||
|
public void barcodeResult(BarcodeResult result) {
|
||||||
|
Intent scanResult = new Intent();
|
||||||
|
//Bundle scanResultBundle = new Bundle();
|
||||||
|
scanResult.putExtra("Barcode Content", result.getText());
|
||||||
|
scanResult.putExtra("Barcode Format name", result.getBarcodeFormat().name());
|
||||||
|
scanResult.putExtra("returnCode", captureIntentBundle.getInt("returnCode"));
|
||||||
|
scanResult.putExtra("resultCode", 1);
|
||||||
|
CustomScannerActivity.this.setResult(RESULT_OK, scanResult);
|
||||||
|
Log.d(TAG, "scanResult == " + scanResult);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -85,6 +109,7 @@ public class CustomScannerActivity extends Activity implements
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the device's camera has a Flashlight.
|
* Check if the device's camera has a Flashlight.
|
||||||
|
*
|
||||||
* @return true if there is Flashlight, otherwise false.
|
* @return true if there is Flashlight, otherwise false.
|
||||||
*/
|
*/
|
||||||
private boolean hasFlash() {
|
private boolean hasFlash() {
|
||||||
|
@ -93,30 +118,27 @@ public class CustomScannerActivity extends Activity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public void switchFlashlight(View view) {
|
public void switchFlashlight(View view) {
|
||||||
|
Log.d(TAG, "Switch torch");
|
||||||
if (switchFlashlightButton.isActivated()) {
|
if (switchFlashlightButton.isActivated()) {
|
||||||
barcodeScannerView.setTorchOff();
|
barcodeScannerView.setTorchOff();
|
||||||
|
switchFlashlightButton.setActivated(false);
|
||||||
} else {
|
} else {
|
||||||
barcodeScannerView.setTorchOn();
|
barcodeScannerView.setTorchOn();
|
||||||
|
switchFlashlightButton.setActivated(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void changeMaskColor(View view) {
|
|
||||||
Random rnd = new Random();
|
|
||||||
int color = Color.argb(100, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));
|
|
||||||
viewfinderView.setMaskColor(color);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void changeLaserVisibility(boolean visible) {
|
public void changeLaserVisibility(boolean visible) {
|
||||||
viewfinderView.setLaserVisibility(visible);
|
viewfinderView.setLaserVisibility(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTorchOn() {
|
public void onTorchOn() {
|
||||||
|
Log.d(TAG, "TorchON");
|
||||||
switchFlashlightButton.setActivated(true);
|
switchFlashlightButton.setActivated(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTorchOff() {
|
public void onTorchOff() {
|
||||||
|
Log.d(TAG, "TorchOFF");
|
||||||
switchFlashlightButton.setActivated(false);
|
switchFlashlightButton.setActivated(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,14 +147,20 @@ public class CustomScannerActivity extends Activity implements
|
||||||
capture.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
capture.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void onKeyboard(View view) {
|
public void onKeyboard(View view) {
|
||||||
setResult(3);
|
Log.d(TAG, "onkeyboard");
|
||||||
|
Intent resultIntent = new Intent();
|
||||||
|
resultIntent.putExtra("returnCode",3);
|
||||||
|
CustomScannerActivity.this.setResult(RESULT_OK, resultIntent);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCancel(View view) {
|
public void onCancel(View view) {
|
||||||
setResult(2);
|
Log.d(TAG, "onCancel");
|
||||||
|
Intent resultIntent = new Intent();
|
||||||
|
resultIntent.putExtra("returnCode", 2);
|
||||||
|
CustomScannerActivity.this.setResult(RESULT_OK, resultIntent);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,9 +46,10 @@ class DBDrugs extends SQLiteOpenHelper {
|
||||||
|
|
||||||
public boolean isDBFileExist(File database)
|
public boolean isDBFileExist(File database)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
myContext.getDatabasePath(String.valueOf(database));
|
myContext.getDatabasePath(String.valueOf(database));
|
||||||
} catch (final Exception exception) {
|
}
|
||||||
|
catch (final Exception e){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -108,9 +109,8 @@ class DBDrugs extends SQLiteOpenHelper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void close() {
|
public synchronized void close() {
|
||||||
if (myDataBase != null) {
|
assert false;
|
||||||
myDataBase.close();
|
myDataBase.close();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -154,7 +154,7 @@ class DBDrugs extends SQLiteOpenHelper {
|
||||||
drug.setAlertThreshold(7);
|
drug.setAlertThreshold(7);
|
||||||
|
|
||||||
// Log
|
// Log
|
||||||
Log.d(TAG, "getDrug(" + cip13 + ")" + drug.toString());
|
Log.d(TAG, "getDrug(" + cip13 + ")" + drug);
|
||||||
|
|
||||||
// Return drug
|
// Return drug
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ class DBDrugs extends SQLiteOpenHelper {
|
||||||
drug.setAlertThreshold(7);
|
drug.setAlertThreshold(7);
|
||||||
|
|
||||||
// Log
|
// Log
|
||||||
Log.d(TAG, "getDrug(" + cip7 + ")" + drug.toString());
|
Log.d(TAG, "getDrug(" + cip7 + ")" + drug);
|
||||||
|
|
||||||
// Return drug
|
// Return drug
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ class DBHelper extends SQLiteOpenHelper {
|
||||||
|
|
||||||
private static final String TAG = DBHelper.class.getName();
|
private static final String TAG = DBHelper.class.getName();
|
||||||
|
|
||||||
private static final String[] COLUMS = {KEY_ID, KEY_CIS,KEY_CIP13, KEY_NAME, KEY_ADMIN, KEY_PRES, KEY_STOCK, KEY_TAKE,
|
private static final String[] COLUMNS = {KEY_ID, KEY_CIS,KEY_CIP13, KEY_NAME, KEY_ADMIN, KEY_PRES, KEY_STOCK, KEY_TAKE,
|
||||||
KEY_THRESHOLD_WARN, KEY_THRESHOLD_ALERT, KEY_LAST_UPDATE};
|
KEY_THRESHOLD_WARN, KEY_THRESHOLD_ALERT, KEY_LAST_UPDATE};
|
||||||
|
|
||||||
DBHelper(Context context) {
|
DBHelper(Context context) {
|
||||||
|
@ -114,7 +114,7 @@ class DBHelper extends SQLiteOpenHelper {
|
||||||
|
|
||||||
// Insert
|
// Insert
|
||||||
db.insert(TABLE_DRUG, // table
|
db.insert(TABLE_DRUG, // table
|
||||||
null, // colunms list not needed
|
null, // columns list not needed
|
||||||
values); // key/value
|
values); // key/value
|
||||||
|
|
||||||
// Close database
|
// Close database
|
||||||
|
@ -132,7 +132,7 @@ class DBHelper extends SQLiteOpenHelper {
|
||||||
|
|
||||||
// Build query
|
// Build query
|
||||||
Cursor cursor = db.query(TABLE_DRUG, // Which table
|
Cursor cursor = db.query(TABLE_DRUG, // Which table
|
||||||
COLUMS, // column names
|
COLUMNS, // column names
|
||||||
" id = ?", // selections
|
" id = ?", // selections
|
||||||
new String[] { String.valueOf(id) }, // selections args
|
new String[] { String.valueOf(id) }, // selections args
|
||||||
null, // group by
|
null, // group by
|
||||||
|
@ -161,7 +161,7 @@ class DBHelper extends SQLiteOpenHelper {
|
||||||
drug.setDateLastUpdate(Long.parseLong(cursor.getString(10)));
|
drug.setDateLastUpdate(Long.parseLong(cursor.getString(10)));
|
||||||
}
|
}
|
||||||
// Log
|
// Log
|
||||||
Log.d(TAG, "getDrug("+id+")" + drug.toString());
|
Log.d(TAG, "getDrug("+id+")" + drug);
|
||||||
|
|
||||||
assert cursor != null;
|
assert cursor != null;
|
||||||
cursor.close();
|
cursor.close();
|
||||||
|
@ -173,7 +173,7 @@ class DBHelper extends SQLiteOpenHelper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param cip13 drug id in French nomemclature
|
* @param cip13 drug id in French nomenclature
|
||||||
* @return the drug object found in DB or null
|
* @return the drug object found in DB or null
|
||||||
*/
|
*/
|
||||||
public Drug getDrugByCIP13(String cip13) {
|
public Drug getDrugByCIP13(String cip13) {
|
||||||
|
@ -182,7 +182,7 @@ class DBHelper extends SQLiteOpenHelper {
|
||||||
|
|
||||||
// Build query
|
// Build query
|
||||||
Cursor cursor = db.query(TABLE_DRUG, // Which table
|
Cursor cursor = db.query(TABLE_DRUG, // Which table
|
||||||
COLUMS, // column names
|
COLUMNS, // column names
|
||||||
" cip13 = ?", // selections
|
" cip13 = ?", // selections
|
||||||
new String[]{String.valueOf(cip13)}, // selections args
|
new String[]{String.valueOf(cip13)}, // selections args
|
||||||
null, // group by
|
null, // group by
|
||||||
|
@ -212,7 +212,7 @@ class DBHelper extends SQLiteOpenHelper {
|
||||||
assert cursor != null;
|
assert cursor != null;
|
||||||
cursor.close();
|
cursor.close();
|
||||||
|
|
||||||
Log.d(TAG, "getDrug(" + cip13 + ")" + drug.toString());
|
Log.d(TAG, "getDrug(" + cip13 + ")" + drug);
|
||||||
|
|
||||||
return drug;
|
return drug;
|
||||||
}
|
}
|
||||||
|
@ -274,10 +274,7 @@ class DBHelper extends SQLiteOpenHelper {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log.d(TAG, "Before sort == " + drugs.toString());
|
Log.d(TAG, "Before sort == " + drugs);
|
||||||
|
|
||||||
/*drugs.sort(Comparator.comparing(Drug::getDateEndOfStock)
|
|
||||||
.thenComparing(Drug::getStock));*/
|
|
||||||
|
|
||||||
drugs.sort(new Comparator<Drug>() {
|
drugs.sort(new Comparator<Drug>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -288,7 +285,7 @@ class DBHelper extends SQLiteOpenHelper {
|
||||||
return (int) (lhs.getStock() - rhs.getStock());
|
return (int) (lhs.getStock() - rhs.getStock());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Log.d(TAG, "After sort " + drugs.toString());
|
Log.d(TAG, "After sort " + drugs);
|
||||||
|
|
||||||
// Move drug with prise = 0 at the end of the list
|
// Move drug with prise = 0 at the end of the list
|
||||||
// todo: If some drug moved, must redo all the loop
|
// todo: If some drug moved, must redo all the loop
|
||||||
|
@ -320,7 +317,7 @@ class DBHelper extends SQLiteOpenHelper {
|
||||||
// Get reference to writable DB
|
// Get reference to writable DB
|
||||||
SQLiteDatabase db = this.getWritableDatabase();
|
SQLiteDatabase db = this.getWritableDatabase();
|
||||||
|
|
||||||
// Create ContentValues to add columnm/value
|
// Create ContentValues to add column/value
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
values.put(KEY_ID, drug.getId());
|
values.put(KEY_ID, drug.getId());
|
||||||
values.put(KEY_CIS, drug.getCis());
|
values.put(KEY_CIS, drug.getCis());
|
||||||
|
@ -336,14 +333,14 @@ class DBHelper extends SQLiteOpenHelper {
|
||||||
|
|
||||||
String[] selectionArgs = { String.valueOf(drug.getId()) };
|
String[] selectionArgs = { String.valueOf(drug.getId()) };
|
||||||
|
|
||||||
db.update(TABLE_DRUG, // table
|
db.update(TABLE_DRUG, // table
|
||||||
values, // column/value
|
values, // column/value
|
||||||
KEY_ID + " = ?", // selections
|
KEY_ID + " = ?", // selections
|
||||||
selectionArgs);
|
selectionArgs);
|
||||||
|
|
||||||
// Close DB
|
// Close DB
|
||||||
db.close();
|
db.close();
|
||||||
Log.d(TAG, "values == " + values.toString());
|
Log.d(TAG, "values == " + values);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -165,7 +165,7 @@ public class Drug implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
void newStock() {
|
void newStock() {
|
||||||
Log.d(TAG, "current drug = " + this.toString());
|
Log.d(TAG, "current drug = " + this);
|
||||||
|
|
||||||
Date lastUpdate = new Date(getDateLastUpdate());
|
Date lastUpdate = new Date(getDateLastUpdate());
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package net.foucry.pilldroid;
|
package net.foucry.pilldroid;
|
||||||
|
|
||||||
|
import static net.foucry.pilldroid.R.id.detail_toolbar;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -13,9 +15,11 @@ import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
|
|
||||||
import java.util.Date;
|
import net.foucry.pilldroid.dao.PrescriptionsDAO;
|
||||||
|
import net.foucry.pilldroid.databases.PrescriptionDatabase;
|
||||||
|
import net.foucry.pilldroid.models.Prescription;
|
||||||
|
|
||||||
import static net.foucry.pilldroid.R.id.detail_toolbar;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An activity representing a single Drug detail screen. This
|
* An activity representing a single Drug detail screen. This
|
||||||
|
@ -27,27 +31,20 @@ public class DrugDetailActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private static final String TAG = DrugDetailActivity.class.getName();
|
private static final String TAG = DrugDetailActivity.class.getName();
|
||||||
|
|
||||||
Drug drug;
|
Prescription aPrescription;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
Bundle extras = getIntent().getExtras();
|
Bundle bundle = getIntent().getExtras();
|
||||||
|
assert bundle != null;
|
||||||
|
aPrescription = (Prescription) bundle.get("prescription");
|
||||||
|
Log.d(TAG, "aPrescription == " + aPrescription);
|
||||||
|
|
||||||
/* fetching the string passed with intent using ‘extras’*/
|
setContentView(R.layout.drug_detail_activity);
|
||||||
|
|
||||||
assert extras != null;
|
|
||||||
drug = (Drug) extras.getSerializable("drug");
|
|
||||||
|
|
||||||
assert drug != null;
|
|
||||||
Log.d(TAG, "drug == " + drug.toString());
|
|
||||||
|
|
||||||
setContentView(R.layout.activity_drug_detail);
|
|
||||||
Toolbar toolbar = findViewById(detail_toolbar);
|
Toolbar toolbar = findViewById(detail_toolbar);
|
||||||
|
|
||||||
|
|
||||||
if (toolbar != null) {
|
if (toolbar != null) {
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
}
|
}
|
||||||
|
@ -58,7 +55,7 @@ public class DrugDetailActivity extends AppCompatActivity {
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
Log.d(TAG, "Click on save icon");
|
Log.d(TAG, "Click on save icon");
|
||||||
|
|
||||||
getMDrugChanges();
|
getDrugChanges();
|
||||||
setResult(1);
|
setResult(1);
|
||||||
finish();
|
finish();
|
||||||
overridePendingTransition(R.anim.slide_from_left, R.anim.slide_to_right);
|
overridePendingTransition(R.anim.slide_from_left, R.anim.slide_to_right);
|
||||||
|
@ -69,7 +66,7 @@ public class DrugDetailActivity extends AppCompatActivity {
|
||||||
ActionBar actionBar = getSupportActionBar();
|
ActionBar actionBar = getSupportActionBar();
|
||||||
if (actionBar != null) {
|
if (actionBar != null) {
|
||||||
actionBar.setDisplayHomeAsUpEnabled(false);
|
actionBar.setDisplayHomeAsUpEnabled(false);
|
||||||
actionBar.setTitle(drug.getName());
|
actionBar.setTitle(aPrescription.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
// savedInstanceState is non-null when there is fragment state
|
// savedInstanceState is non-null when there is fragment state
|
||||||
|
@ -85,8 +82,7 @@ public class DrugDetailActivity extends AppCompatActivity {
|
||||||
// Create the detail fragment and add it to the activity
|
// Create the detail fragment and add it to the activity
|
||||||
// using a fragment transaction.
|
// using a fragment transaction.
|
||||||
Bundle arguments = new Bundle();
|
Bundle arguments = new Bundle();
|
||||||
arguments.putSerializable("drug",
|
arguments.putSerializable("prescription", aPrescription);
|
||||||
getIntent().getSerializableExtra("drug"));
|
|
||||||
DrugDetailFragment fragment = new DrugDetailFragment();
|
DrugDetailFragment fragment = new DrugDetailFragment();
|
||||||
fragment.setArguments(arguments);
|
fragment.setArguments(arguments);
|
||||||
getSupportFragmentManager().beginTransaction()
|
getSupportFragmentManager().beginTransaction()
|
||||||
|
@ -111,12 +107,13 @@ public class DrugDetailActivity extends AppCompatActivity {
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getMDrugChanges() {
|
private void getDrugChanges() {
|
||||||
Log.d(TAG, "Time to save new values");
|
Log.d(TAG, "Time to save new values");
|
||||||
|
|
||||||
DBHelper dbHelper = new DBHelper(this);
|
PrescriptionDatabase prescriptions = PrescriptionDatabase.getInstanceDatabase(this);
|
||||||
|
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
|
||||||
|
|
||||||
Drug newDrug = dbHelper.getDrugByCIP13(drug.getCip13());
|
Prescription newPrescription = prescriptionsDAO.getMedicByCIP13(aPrescription.getCip13());
|
||||||
|
|
||||||
View stockView;
|
View stockView;
|
||||||
View takeView;
|
View takeView;
|
||||||
|
@ -139,18 +136,19 @@ public class DrugDetailActivity extends AppCompatActivity {
|
||||||
TextView warningTextView = warningView.findViewById(R.id.value);
|
TextView warningTextView = warningView.findViewById(R.id.value);
|
||||||
String warningValue = warningTextView.getText().toString();
|
String warningValue = warningTextView.getText().toString();
|
||||||
|
|
||||||
newDrug.setStock(Double.parseDouble(stockValue));
|
newPrescription.setStock(Float.parseFloat(stockValue));
|
||||||
newDrug.setTake(Double.parseDouble(takeValue));
|
newPrescription.setTake(Float.parseFloat(takeValue));
|
||||||
newDrug.setWarnThreshold(Integer.parseInt(warningValue));
|
newPrescription.setWarning(Integer.parseInt(warningValue));
|
||||||
newDrug.setAlertThreshold(Integer.parseInt(alertValue));
|
newPrescription.setAlert(Integer.parseInt(alertValue));
|
||||||
newDrug.setDateEndOfStock();
|
newPrescription.getDateEndOfStock();
|
||||||
|
|
||||||
if (drug.equals(newDrug)) {
|
if (aPrescription.equals(newPrescription)) {
|
||||||
Log.d(TAG, "drug and newDrug are Equals");
|
Log.d(TAG, "medic and newPrescription are Equals");
|
||||||
} else {
|
} else {
|
||||||
Log.d(TAG, "drug and newDrug are NOT Equals");
|
Log.d(TAG, "medic and newPrescription are NOT Equals");
|
||||||
newDrug.setDateLastUpdate(new Date().getTime());
|
newPrescription.setLast_update(new Date().getTime());
|
||||||
dbHelper.updateDrug(newDrug);
|
prescriptionsDAO.update(newPrescription);
|
||||||
|
//dbHelper.updateDrug(newDrug);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
package net.foucry.pilldroid;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
|
||||||
|
import androidx.activity.result.contract.ActivityResultContract;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
public class DrugDetailContract extends ActivityResultContract<Intent, Integer> {
|
||||||
|
/**
|
||||||
|
* Create an intent that can be used for {@link Activity#startActivityForResult}
|
||||||
|
*
|
||||||
|
* @param context Context
|
||||||
|
* @param input Drug
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Intent createIntent(@NonNull Context context, Intent input) {
|
||||||
|
Intent intent = new Intent(context, DrugDetailActivity.class);
|
||||||
|
|
||||||
|
intent.putExtra("Drug", input.getExtras());
|
||||||
|
return (intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert result obtained from to O
|
||||||
|
* @param resultCode Integer
|
||||||
|
* @param intent Intent
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Integer parseResult(int resultCode, @Nullable Intent intent) {
|
||||||
|
|
||||||
|
return resultCode;
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,6 +11,8 @@ import androidx.fragment.app.Fragment;
|
||||||
|
|
||||||
import com.google.android.material.appbar.CollapsingToolbarLayout;
|
import com.google.android.material.appbar.CollapsingToolbarLayout;
|
||||||
|
|
||||||
|
import net.foucry.pilldroid.models.Prescription;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A fragment representing a single Drug detail screen.
|
* A fragment representing a single Drug detail screen.
|
||||||
* This fragment is either contained in a {@link DrugListActivity}
|
* This fragment is either contained in a {@link DrugListActivity}
|
||||||
|
@ -23,12 +25,12 @@ public class DrugDetailFragment extends Fragment {
|
||||||
* The fragment argument representing the item ID that this fragment
|
* The fragment argument representing the item ID that this fragment
|
||||||
* represents.
|
* represents.
|
||||||
*/
|
*/
|
||||||
public static final String ARG_ITEM_ID = "drug";
|
public static final String ARG_ITEM_ID = "prescription";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The dummy content this fragment is presenting.
|
* The dummy content this fragment is presenting.
|
||||||
*/
|
*/
|
||||||
private Drug drug;
|
private Prescription prescription;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mandatory empty constructor for the fragment manager to instantiate the
|
* Mandatory empty constructor for the fragment manager to instantiate the
|
||||||
|
@ -46,13 +48,13 @@ public class DrugDetailFragment extends Fragment {
|
||||||
// Load the dummy content specified by the fragment
|
// Load the dummy content specified by the fragment
|
||||||
// arguments. In a real-world scenario, use a Loader
|
// arguments. In a real-world scenario, use a Loader
|
||||||
// to load content from a content provider.
|
// to load content from a content provider.
|
||||||
drug = (Drug) getArguments().getSerializable(ARG_ITEM_ID);
|
prescription = (Prescription) getArguments().getSerializable(ARG_ITEM_ID);
|
||||||
|
|
||||||
Activity activity = this.getActivity();
|
Activity activity = this.getActivity();
|
||||||
assert activity != null;
|
assert activity != null;
|
||||||
CollapsingToolbarLayout appBarLayout = activity.findViewById(R.id.toolbar_layout);
|
CollapsingToolbarLayout appBarLayout = activity.findViewById(R.id.toolbar_layout);
|
||||||
if (appBarLayout != null) {
|
if (appBarLayout != null) {
|
||||||
appBarLayout.setTitle(drug.getName());
|
appBarLayout.setTitle(prescription.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -69,56 +71,59 @@ public class DrugDetailFragment extends Fragment {
|
||||||
View alertView;
|
View alertView;
|
||||||
|
|
||||||
// Show the dummy content as text in a TextView.
|
// Show the dummy content as text in a TextView.
|
||||||
if (drug != null) {
|
if (prescription != null) {
|
||||||
// Find each component of rootView
|
// Find each component of rootView
|
||||||
nameView = detailView.findViewById(R.id.name_cell);
|
nameView = detailView.findViewById(R.id.name_cell);
|
||||||
TextView nameLabel = nameView.findViewById(R.id.label);
|
TextView nameLabel = nameView.findViewById(R.id.label);
|
||||||
TextView nameValue = nameView.findViewById(R.id.value);
|
TextView nameValue = nameView.findViewById(R.id.value);
|
||||||
nameLabel.setText(R.string.drug_name_label);
|
nameLabel.setText(R.string.drug_name_label);
|
||||||
nameValue.setText(drug.getName());
|
nameValue.setText(prescription.getName());
|
||||||
|
|
||||||
presentationView = detailView.findViewById(R.id.presentation_cell);
|
presentationView = detailView.findViewById(R.id.presentation_cell);
|
||||||
TextView presentationLabel = presentationView.findViewById(R.id.label);
|
TextView presentationLabel = presentationView.findViewById(R.id.label);
|
||||||
TextView presentationValue = presentationView.findViewById(R.id.value);
|
TextView presentationValue = presentationView.findViewById(R.id.value);
|
||||||
presentationLabel.setText(R.string.drug_presention_labal);
|
presentationLabel.setText(R.string.drug_presentation_label);
|
||||||
presentationValue.setText(drug.getPresentation());
|
presentationValue.setText(prescription.getPresentation());
|
||||||
|
|
||||||
adminModeView = detailView.findViewById(R.id.administration_cell);
|
adminModeView = detailView.findViewById(R.id.administration_cell);
|
||||||
TextView adminModeLabel = adminModeView.findViewById(R.id.label);
|
TextView adminModeLabel = adminModeView.findViewById(R.id.label);
|
||||||
TextView adminModeValue = adminModeView.findViewById(R.id.value);
|
TextView adminModeValue = adminModeView.findViewById(R.id.value);
|
||||||
adminModeLabel.setText(R.string.drug_administationMode_label);
|
adminModeLabel.setText(R.string.drug_administrationMode_label);
|
||||||
adminModeValue.setText(drug.getAdministration_mode());
|
adminModeValue.setText(prescription.getAdministration_mode());
|
||||||
|
|
||||||
stockView = detailView.findViewById(R.id.stock_cell);
|
stockView = detailView.findViewById(R.id.stock_cell);
|
||||||
TextView stockLibelle = (stockView.findViewById(R.id.label));
|
TextView stockLibelle = (stockView.findViewById(R.id.label));
|
||||||
TextView stockValue = stockView.findViewById(R.id.value);
|
TextView stockValue = stockView.findViewById(R.id.value);
|
||||||
stockLibelle.setText(R.string.drug_current_stock_label);
|
stockLibelle.setText(R.string.drug_current_stock_label);
|
||||||
stockValue.setText(Double.toString(drug.getStock()));
|
stockValue.setText(Utils.fmt(prescription.getStock()));
|
||||||
stockValue.setHint(R.string.drug_current_stock_label);
|
stockValue.setHint(R.string.drug_current_stock_label);
|
||||||
stockValue.setSelectAllOnFocus(true);
|
stockValue.setSelectAllOnFocus(true);
|
||||||
|
|
||||||
takeView = detailView.findViewById(R.id.take_cell);
|
takeView = detailView.findViewById(R.id.take_cell);
|
||||||
TextView priseLabel = takeView.findViewById(R.id.label);
|
TextView takeLabel = takeView.findViewById(R.id.label);
|
||||||
TextView priseValue = (takeView.findViewById(R.id.value));
|
TextView takeValue = (takeView.findViewById(R.id.value));
|
||||||
priseLabel.setText(R.string.drug_take_label);
|
takeLabel.setText(R.string.drug_take_label);
|
||||||
priseValue.setText(Double.toString(drug.getTake()));
|
//takeValue.setText(Double.toString(prescription.getTake()));
|
||||||
priseValue.setHint(R.string.drug_take_label);
|
takeValue.setText(Utils.fmt(prescription.getTake()));
|
||||||
priseValue.setSelectAllOnFocus(true);
|
takeValue.setHint(R.string.drug_take_label);
|
||||||
|
takeValue.setSelectAllOnFocus(true);
|
||||||
|
|
||||||
warningView = detailView.findViewById(R.id.warning_cell);
|
warningView = detailView.findViewById(R.id.warning_cell);
|
||||||
TextView warningLibelle = warningView.findViewById(R.id.label);
|
TextView warningLibelle = warningView.findViewById(R.id.label);
|
||||||
TextView warningValue = warningView.findViewById(R.id.value);
|
TextView warningValue = warningView.findViewById(R.id.value);
|
||||||
warningLibelle.setText(R.string.drug_warningTherehold_label);
|
warningLibelle.setText(R.string.drug_warningThreshold_label);
|
||||||
warningValue.setText(Integer.toString(drug.getWarnThreshold()));
|
//warningValue.setText(Integer.toString(prescription.getWarnThreshold()));
|
||||||
warningValue.setHint(R.string.drug_warningTherehold_label);
|
warningValue.setText(Utils.fmt(prescription.getWarning()));
|
||||||
|
warningValue.setHint(R.string.drug_warningThreshold_label);
|
||||||
warningValue.setSelectAllOnFocus(true);
|
warningValue.setSelectAllOnFocus(true);
|
||||||
|
|
||||||
alertView = detailView.findViewById(R.id.alert_cell);
|
alertView = detailView.findViewById(R.id.alert_cell);
|
||||||
TextView alertLibelle = alertView.findViewById(R.id.label);
|
TextView alertLibelle = alertView.findViewById(R.id.label);
|
||||||
TextView alertValue = alertView.findViewById(R.id.value);
|
TextView alertValue = alertView.findViewById(R.id.value);
|
||||||
alertLibelle.setText(R.string.drug_alertTherehold_label);
|
alertLibelle.setText(R.string.drug_alertThreshold_label);
|
||||||
alertValue.setText(Integer.toString(drug.getAlertThreshold()));
|
//alertValue.setText(Integer.toString(prescription.getAlertThreshold()));
|
||||||
alertValue.setHint(R.string.drug_alertTherehold_label);
|
alertValue.setText(Utils.fmt(prescription.getAlert()));
|
||||||
|
alertValue.setHint(R.string.drug_alertThreshold_label);
|
||||||
alertValue.setSelectAllOnFocus(true);
|
alertValue.setSelectAllOnFocus(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
package net.foucry.pilldroid;
|
package net.foucry.pilldroid;
|
||||||
|
|
||||||
|
import static net.foucry.pilldroid.UtilDate.date2String;
|
||||||
|
import static net.foucry.pilldroid.Utils.intRandomExclusive;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
@ -21,24 +25,30 @@ import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.activity.result.ActivityResultLauncher;
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
import androidx.room.Room;
|
||||||
|
|
||||||
|
import com.google.zxing.client.android.BuildConfig;
|
||||||
import com.google.zxing.client.android.Intents;
|
import com.google.zxing.client.android.Intents;
|
||||||
import com.google.zxing.integration.android.IntentIntegrator;
|
import com.journeyapps.barcodescanner.ScanOptions;
|
||||||
import com.google.zxing.integration.android.IntentResult;
|
|
||||||
|
import net.foucry.pilldroid.dao.MedicinesDAO;
|
||||||
|
import net.foucry.pilldroid.dao.PrescriptionsDAO;
|
||||||
|
import net.foucry.pilldroid.databases.MedicineDatabase;
|
||||||
|
import net.foucry.pilldroid.databases.PrescriptionDatabase;
|
||||||
|
import net.foucry.pilldroid.models.Medicine;
|
||||||
|
import net.foucry.pilldroid.models.Prescription;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import static net.foucry.pilldroid.UtilDate.date2String;
|
|
||||||
import static net.foucry.pilldroid.Utils.intRandomExclusive;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An activity representing a list of Drugs is activity
|
* An activity representing a list of Drugs is activity
|
||||||
* has different presentations for handset and tablet-size devices. On
|
* has different presentations for handset and tablet-size devices. On
|
||||||
|
@ -48,35 +58,95 @@ import static net.foucry.pilldroid.Utils.intRandomExclusive;
|
||||||
* item details side-by-side using two vertical panes.
|
* item details side-by-side using two vertical panes.
|
||||||
*/
|
*/
|
||||||
public class DrugListActivity extends AppCompatActivity {
|
public class DrugListActivity extends AppCompatActivity {
|
||||||
/**
|
// Used for dev and debug
|
||||||
* Whether or not the activity is in two-pane mode, i.e. running on a tablet
|
|
||||||
* device.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// TODO: Change DEMO/DBDEMO form static to non-static. In order to create fake data at only at launchtime
|
|
||||||
final Boolean DEMO = false;
|
final Boolean DEMO = false;
|
||||||
final Boolean DBDEMO = false;
|
|
||||||
|
|
||||||
public final int CUSTOMIZED_REQUEST_CODE = 0x0000ffff;
|
public final int CUSTOMIZED_REQUEST_CODE = 0x0000ffff;
|
||||||
|
public final String BARCODE_FORMAT_NAME = "Barcode Format name";
|
||||||
|
public final String BARCODE_CONTENT = "Barcode Content";
|
||||||
|
|
||||||
/**
|
private ActivityResultLauncher<ScanOptions> mBarcodeScannerLauncher;
|
||||||
* Start tutorial
|
private static final String TAG = DrugListActivity.class.getName();
|
||||||
*/
|
|
||||||
|
|
||||||
|
public PrescriptionDatabase prescriptions;
|
||||||
|
public MedicineDatabase medicines;
|
||||||
|
|
||||||
|
private List<Prescription> prescriptionList; // used for prescriptions
|
||||||
|
|
||||||
|
private SimpleItemRecyclerViewAdapter mAdapter;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
|
|
||||||
|
if(BuildConfig.DEBUG) {
|
||||||
|
String manufacturer = Build.MANUFACTURER;
|
||||||
|
String model = Build.MODEL;
|
||||||
|
int version = Build.VERSION.SDK_INT;
|
||||||
|
String versionRelease = Build.VERSION.RELEASE;
|
||||||
|
|
||||||
|
Log.e(TAG, "manufacturer " + manufacturer
|
||||||
|
+ " \n model " + model
|
||||||
|
+ " \n version " + version
|
||||||
|
+ " \n versionRelease " + versionRelease
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create medicines Room database from drugs.db files
|
||||||
|
medicines = MedicineDatabase.getInstanceDatabase(this);
|
||||||
|
|
||||||
|
// Create prescriptions Room database
|
||||||
|
prescriptions = PrescriptionDatabase.getInstanceDatabase(this);
|
||||||
|
|
||||||
|
// Manually migrate old database to room
|
||||||
|
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
|
||||||
|
DBHelper dbHelper = new DBHelper(this);
|
||||||
|
if (dbHelper.getCount() !=0) {
|
||||||
|
List<Drug> drugs=dbHelper.getAllDrugs();
|
||||||
|
for (int count=0; count < dbHelper.getCount(); count++) {
|
||||||
|
Drug drug = drugs.get(count);
|
||||||
|
Prescription prescription = new Prescription();
|
||||||
|
|
||||||
|
if(prescriptionsDAO.getMedicByCIP13(drug.getCip13()) == null) {
|
||||||
|
prescription.setName(drug.getName());
|
||||||
|
prescription.setCip13(drug.getCip13());
|
||||||
|
prescription.setCis(drug.getCis());
|
||||||
|
prescription.setPresentation(drug.getPresentation());
|
||||||
|
prescription.setAdministration_mode(drug.getAdministration_mode());
|
||||||
|
prescription.setStock((float) drug.getStock());
|
||||||
|
prescription.setTake((float) drug.getTake());
|
||||||
|
prescription.setWarning(drug.getWarnThreshold());
|
||||||
|
prescription.setAlert(drug.getAlertThreshold());
|
||||||
|
prescription.setLast_update(drug.getDateLastUpdate());
|
||||||
|
|
||||||
|
prescriptionsDAO.insert(prescription);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Log.i(TAG, "Already in the database");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dbHelper.dropDrug();
|
||||||
|
}
|
||||||
|
// remove old notification
|
||||||
Log.d(TAG, "Remove old notification and old job");
|
Log.d(TAG, "Remove old notification and old job");
|
||||||
NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||||
if (nm != null) {
|
if (nm != null) {
|
||||||
nm.cancelAll();
|
nm.cancelAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
// tuto
|
// start tutorial (only in non debug mode)
|
||||||
Log.i(TAG, "Launch tuto");
|
// if(!net.foucry.pilldroid.BuildConfig.DEBUG) {
|
||||||
startActivity(new Intent(this, WelcomeActivity.class));
|
Log.i(TAG, "Launch tutorial");
|
||||||
|
startActivity(new Intent(this, WelcomeActivity.class));
|
||||||
|
// }
|
||||||
|
|
||||||
|
PrefManager prefManager = new PrefManager(this);
|
||||||
|
if (!prefManager.isUnderstood()) {
|
||||||
|
askForComprehensive();
|
||||||
|
prefManager.setUnderstood(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -84,41 +154,28 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String TAG = DrugListActivity.class.getName();
|
public void onPause() {
|
||||||
|
super.onPause();
|
||||||
|
Log.d(TAG, "onPause");
|
||||||
|
|
||||||
private DBHelper dbHelper;
|
if (!AlarmReceiver.isAlarmScheduled(this)){
|
||||||
private DBDrugs dbDrug;
|
AlarmReceiver.scheduleAlarm(this);
|
||||||
|
|
||||||
private List<Drug> drugs;
|
|
||||||
|
|
||||||
private SimpleItemRecyclerViewAdapter mAdapter;
|
|
||||||
|
|
||||||
public void constructDrugsList()
|
|
||||||
{
|
|
||||||
dbHelper = new DBHelper(getApplicationContext());
|
|
||||||
|
|
||||||
if (!(drugs == null)) {
|
|
||||||
if (!drugs.isEmpty()) {
|
|
||||||
drugs.clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
drugs = dbHelper.getAllDrugs();
|
|
||||||
|
|
||||||
View mRecyclerView = findViewById(R.id.drug_list);
|
|
||||||
assert mRecyclerView != null;
|
|
||||||
setupRecyclerView((RecyclerView) mRecyclerView);
|
|
||||||
}
|
}
|
||||||
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.activity_drug_list);
|
// Create Room database
|
||||||
|
prescriptions = Room
|
||||||
|
.databaseBuilder(getApplicationContext(), PrescriptionDatabase.class, "prescriptions")
|
||||||
|
.allowMainThreadQueries()
|
||||||
|
.build();
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
// Set view content
|
||||||
dbHelper = new DBHelper(this);
|
setContentView(R.layout.drug_list_activity);
|
||||||
}
|
|
||||||
dbDrug = new DBDrugs(this);
|
|
||||||
|
|
||||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||||
|
|
||||||
|
@ -127,59 +184,103 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
toolbar.setTitle(getTitle());
|
toolbar.setTitle(getTitle());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Added to drop database each the app is launch.
|
|
||||||
if (DBDEMO) {
|
|
||||||
dbHelper.dropDrug();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DEMO) {
|
if (DEMO) {
|
||||||
if (dbHelper.getCount() == 0) {
|
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
|
||||||
|
|
||||||
// String cis, String cip13, String nom, String mode_administration,
|
if (prescriptionsDAO.getMedicCount() == 0) {
|
||||||
// String presentation,double stock, double prise, int warn, int alert
|
final int min_stock = 5;
|
||||||
|
final int max_stock = 50;
|
||||||
|
final int min_take = 0;
|
||||||
|
final int max_take = 3;
|
||||||
|
|
||||||
// Limit for randoms generator
|
for (int i = 1; i < 9; i++) {
|
||||||
final int min_stock=5;
|
Prescription prescription = new Prescription();
|
||||||
final int max_stock=50;
|
prescription.setName("Medicament test " + i);
|
||||||
final int min_prise=0;
|
prescription.setCip13("340093000001" + i);
|
||||||
final int max_prise=3;
|
prescription.setCis("6000001" + i);
|
||||||
|
prescription.setAdministration_mode("oral");
|
||||||
|
prescription.setPresentation("plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)");
|
||||||
|
prescription.setStock((float) intRandomExclusive(min_stock, max_stock));
|
||||||
|
prescription.setTake((float) intRandomExclusive(min_take, max_take));
|
||||||
|
prescription.setWarning(14);
|
||||||
|
prescription.setAlert(7);
|
||||||
|
prescription.setLast_update(UtilDate.dateAtNoon(new Date()).getTime());
|
||||||
|
|
||||||
dbHelper.addDrug(new Drug("60000011", "3400930000011", "Médicament test 01", "orale",
|
prescriptionsDAO.insert(prescription);
|
||||||
"plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)",
|
}
|
||||||
intRandomExclusive(min_stock, max_stock), intRandomExclusive(min_prise, max_prise), 14, 7, UtilDate.dateAtNoon(new Date()).getTime()));
|
List<Prescription> prescriptions = prescriptionsDAO.getAllMedics();
|
||||||
dbHelper.addDrug(new Drug("60000012", "3400930000012", "Médicament test 02", "orale",
|
System.out.println(prescriptions);
|
||||||
"plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)",
|
Log.d(TAG, "prescriptions ==" + prescriptions);
|
||||||
intRandomExclusive(min_stock, max_stock), intRandomExclusive(min_prise, max_prise), 14, 7, UtilDate.dateAtNoon(new Date()).getTime()));
|
}
|
||||||
dbHelper.addDrug(new Drug("60000013", "3400930000013", "Médicament test 03", "orale",
|
|
||||||
"plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)",
|
|
||||||
intRandomExclusive(min_stock, max_stock), intRandomExclusive(min_prise, max_prise), 14, 7, UtilDate.dateAtNoon(new Date()).getTime()));
|
|
||||||
dbHelper.addDrug(new Drug("60000014", "3400930000014", "Médicament test 04", "orale",
|
|
||||||
"plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)",
|
|
||||||
intRandomExclusive(min_stock, max_stock), intRandomExclusive(min_prise, max_prise), 14, 7, UtilDate.dateAtNoon(new Date()).getTime()));
|
|
||||||
dbHelper.addDrug(new Drug("60000015", "3400930000015", "Médicament test 05", "orale",
|
|
||||||
"plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)",
|
|
||||||
intRandomExclusive(min_stock, max_stock), intRandomExclusive(min_prise, max_prise), 14, 7, UtilDate.dateAtNoon(new Date()).getTime()));
|
|
||||||
dbHelper.addDrug(new Drug("60000016", "3400930000016", "Médicament test 06", "orale",
|
|
||||||
"plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)",
|
|
||||||
intRandomExclusive(min_stock, max_stock), intRandomExclusive(min_prise, max_prise), 14, 7, UtilDate.dateAtNoon(new Date()).getTime()));
|
|
||||||
dbHelper.addDrug(new Drug("60000017", "3400930000017", "Médicament test 07", "orale",
|
|
||||||
"plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)",
|
|
||||||
intRandomExclusive(min_stock, max_stock), intRandomExclusive(min_prise, max_prise), 14, 7, UtilDate.dateAtNoon(new Date()).getTime()));
|
|
||||||
dbHelper.addDrug(new Drug("60000018", "3400930000018", "Médicament test 08", "orale",
|
|
||||||
"plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)",
|
|
||||||
intRandomExclusive(min_stock, max_stock), intRandomExclusive(min_prise, max_prise), 14, 7, UtilDate.dateAtNoon(new Date()).getTime()));
|
|
||||||
dbHelper.addDrug(new Drug("60000019", "3400930000019", "Médicament test 09", "orale",
|
|
||||||
"plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)",
|
|
||||||
intRandomExclusive(min_stock, max_stock), intRandomExclusive(min_prise, max_prise), 14, 7, UtilDate.dateAtNoon(new Date()).getTime()));
|
|
||||||
dbHelper.addDrug(new Drug("60000010", "3400930000010", "Médicament test 10", "orale",
|
|
||||||
"plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)",
|
|
||||||
intRandomExclusive(min_stock, max_stock), intRandomExclusive(min_prise, max_prise), 14, 7, UtilDate.dateAtNoon(new Date()).getTime()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mBarcodeScannerLauncher = registerForActivityResult(new PilldroidScanContract(),
|
||||||
|
result -> {
|
||||||
|
if (result.getContents() == null) {
|
||||||
|
Intent originalIntent = result.getOriginalIntent();
|
||||||
|
Bundle bundle = originalIntent.getExtras();
|
||||||
|
if (originalIntent.hasExtra(Intents.Scan.MISSING_CAMERA_PERMISSION)) {
|
||||||
|
Log.d(TAG, "Missing camera permission");
|
||||||
|
Toast.makeText(this, R.string.missing_camera_permission, Toast.LENGTH_LONG).show();
|
||||||
|
} else {
|
||||||
|
Log.d(TAG, "bundle == " + bundle.getInt("returnCode"));
|
||||||
|
int returnCode = bundle.getInt("returnCode");
|
||||||
|
int resultCode = bundle.getInt("resultCode");
|
||||||
|
|
||||||
|
if (resultCode != 1) {
|
||||||
|
if (returnCode == 3) {
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
Toast.makeText(this, "Keyboard input",
|
||||||
|
Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
Log.d(TAG, "Keyboard Input");
|
||||||
|
showInputDialog();
|
||||||
|
} else if (returnCode == 2) {
|
||||||
|
Toast.makeText(this, R.string.cancelled_scan, Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.d(TAG, "Scanned formatName = " + bundle.getString(BARCODE_FORMAT_NAME));
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
Toast.makeText(this, "Scanned: " + bundle.getString(BARCODE_FORMAT_NAME),
|
||||||
|
Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
String cip13;
|
||||||
|
switch (bundle.getString(BARCODE_FORMAT_NAME)) {
|
||||||
|
case "CODE_128":
|
||||||
|
case "EAN_13": //CODE_128 || EAN 13
|
||||||
|
cip13 = bundle.getString(BARCODE_CONTENT);
|
||||||
|
break;
|
||||||
|
case "DATA_MATRIX":
|
||||||
|
cip13 = bundle.getString(BARCODE_CONTENT).substring(4, 17);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
scanNotOK();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get Drug from database
|
||||||
|
MedicinesDAO medicinesDAO = medicines.getMedicinesDAO();
|
||||||
|
final Medicine scannedMedicine = medicinesDAO.getMedicineByCIP13(cip13);
|
||||||
|
|
||||||
|
// add Drug to prescription database
|
||||||
|
askToAddInDB(scannedMedicine);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
constructDrugsList();
|
constructDrugsList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void constructDrugsList() {
|
||||||
|
|
||||||
|
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
|
||||||
|
prescriptionList = prescriptionsDAO.getAllMedics();
|
||||||
|
|
||||||
|
View mRecyclerView = findViewById(R.id.drug_list);
|
||||||
|
assert mRecyclerView != null;
|
||||||
|
setupRecyclerView((RecyclerView) mRecyclerView);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
MenuInflater inflater = getMenuInflater();
|
MenuInflater inflater = getMenuInflater();
|
||||||
|
@ -188,113 +289,46 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
int id = item.getItemId();
|
||||||
case R.id.about:
|
if (id == R.id.about) {
|
||||||
startActivity(new Intent(this, About.class));
|
startActivity(new Intent(this, About.class));
|
||||||
return true;
|
return true;
|
||||||
case R.id.help:
|
} else if (id == R.id.help) {
|
||||||
PrefManager prefManager = new PrefManager(this);
|
PrefManager prefManager = new PrefManager(this);
|
||||||
prefManager.setFirstTimeLaunch(true);
|
prefManager.setFirstTimeLaunch(true);
|
||||||
|
|
||||||
startActivity(new Intent(this, WelcomeActivity.class));
|
startActivity(new Intent(this, WelcomeActivity.class));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onPause() {
|
@Override
|
||||||
super.onPause();
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
Log.d(TAG, "onPause really!");
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
AlarmReceiver.scheduleAlarm(this);
|
constructDrugsList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** scanNow
|
// Launch scan
|
||||||
*
|
public void onButtonClick(View v) {
|
||||||
* @param view
|
Log.d(TAG, "add medication");
|
||||||
* call ZXing Library to scan a new QR/EAN code
|
ScanOptions options = new ScanOptions();
|
||||||
*/
|
options.setDesiredBarcodeFormats(ScanOptions.DATA_MATRIX, ScanOptions.CODE_128);
|
||||||
public void scanNow(View view) {
|
options.setCameraId(0); // Use a specific camera of the device
|
||||||
new IntentIntegrator(this).setOrientationLocked(false).setCaptureActivity(CustomScannerActivity.class).initiateScan();
|
options.setBeepEnabled(true);
|
||||||
}
|
options.setBarcodeImageEnabled(true);
|
||||||
|
options.setTimeout(60);
|
||||||
|
options.setCaptureActivity(CustomScannerActivity.class);
|
||||||
|
options.setBeepEnabled(true);
|
||||||
|
options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.MIXED_SCAN);
|
||||||
|
options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.INVERTED_SCAN);
|
||||||
|
|
||||||
@Override
|
Log.d(TAG, "scanOptions == " + options);
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
mBarcodeScannerLauncher.launch(options);
|
||||||
if (requestCode != CUSTOMIZED_REQUEST_CODE && requestCode != IntentIntegrator.REQUEST_CODE) {
|
|
||||||
// This is important, otherwise the result will not be passed to the fragment
|
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (requestCode == CUSTOMIZED_REQUEST_CODE) {
|
|
||||||
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);
|
|
||||||
|
|
||||||
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) {
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
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);
|
|
||||||
Toast.makeText(this, "Cancelled due to missing camera permission", Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Log.d(TAG, "Scanned");
|
|
||||||
Log.d(TAG, "REQUEST_CODE = " + requestCode + " RESULT_CODE = " + resultCode);
|
|
||||||
Log.d(TAG, "result.getContents = " + result.getContents());
|
|
||||||
Log.d(TAG, "format = " + result.getFormatName());
|
|
||||||
|
|
||||||
if (BuildConfig.DEBUG) { Toast.makeText(this, "Scanned: " +
|
|
||||||
result.getContents(), Toast.LENGTH_LONG).show(); }
|
|
||||||
|
|
||||||
String cip13;
|
|
||||||
|
|
||||||
// Handle successful scan
|
|
||||||
|
|
||||||
Log.d(TAG, "formatName = " + result.getFormatName());
|
|
||||||
|
|
||||||
switch (result.getFormatName()) {
|
|
||||||
case "CODE_128":
|
|
||||||
case "EAN_13": //CODE_128 || EAN 13
|
|
||||||
cip13 = result.getContents();
|
|
||||||
break;
|
|
||||||
case "CODE_39":
|
|
||||||
cip13 = dbDrug.getCIP13FromCIP7(result.getContents());
|
|
||||||
break;
|
|
||||||
case "DATA_MATRIX":
|
|
||||||
cip13 = result.getContents().substring(4, 17);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
scanNotOK();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get Drug from database
|
|
||||||
final Drug scannedDrug = dbDrug.getDrugByCIP13(cip13);
|
|
||||||
askToAddInDB(scannedDrug);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -315,8 +349,9 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
.setPositiveButton("OK", (dialog, id) -> {
|
.setPositiveButton("OK", (dialog, id) -> {
|
||||||
String cip13 = editText.getText().toString();
|
String cip13 = editText.getText().toString();
|
||||||
|
|
||||||
Drug aDrug = dbDrug.getDrugByCIP13(cip13);
|
MedicinesDAO medicineDAO = medicines.getMedicinesDAO();
|
||||||
askToAddInDB(aDrug);
|
Medicine aMedicine = medicineDAO.getMedicineByCIP13(cip13);
|
||||||
|
askToAddInDB(aMedicine);
|
||||||
})
|
})
|
||||||
.setNegativeButton("Cancel",
|
.setNegativeButton("Cancel",
|
||||||
(dialog, id) -> dialog.cancel());
|
(dialog, id) -> dialog.cancel());
|
||||||
|
@ -346,14 +381,15 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
/**
|
/**
|
||||||
* Ask if the drug found in the database should be include in the
|
* Ask if the drug found in the database should be include in the
|
||||||
* user database
|
* user database
|
||||||
* @param aDrug Drug- drug to be added
|
*
|
||||||
|
* @param aMedicine Prescription- medication to be added
|
||||||
*/
|
*/
|
||||||
private void askToAddInDB(Drug aDrug) {
|
private void askToAddInDB(Medicine aMedicine) {
|
||||||
AlertDialog.Builder dlg = new AlertDialog.Builder(this);
|
AlertDialog.Builder dlg = new AlertDialog.Builder(this);
|
||||||
dlg.setTitle(getString(R.string.app_name));
|
dlg.setTitle(getString(R.string.app_name));
|
||||||
|
|
||||||
if (aDrug != null) {
|
if (aMedicine != null) {
|
||||||
String msg = aDrug.getName() + " " + getString(R.string.msgFound);
|
String msg = aMedicine.getName() + " " + getString(R.string.msgFound);
|
||||||
|
|
||||||
dlg.setMessage(msg);
|
dlg.setMessage(msg);
|
||||||
dlg.setNegativeButton(getString(R.string.button_cancel), (dialog, which) -> {
|
dlg.setNegativeButton(getString(R.string.button_cancel), (dialog, which) -> {
|
||||||
|
@ -361,7 +397,7 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
});
|
});
|
||||||
dlg.setPositiveButton(getString(R.string.button_ok), (dialog, which) -> {
|
dlg.setPositiveButton(getString(R.string.button_ok), (dialog, which) -> {
|
||||||
// Add Drug to DB then try to show it
|
// Add Drug to DB then try to show it
|
||||||
addDrugToList(aDrug);
|
addDrugToList(Utils.medicine2prescription(aMedicine));
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
dlg.setMessage(getString(R.string.msgNotFound));
|
dlg.setMessage(getString(R.string.msgNotFound));
|
||||||
|
@ -375,8 +411,7 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
/**
|
/**
|
||||||
* Tell user that the barre code cannot be interpreted
|
* Tell user that the barre code cannot be interpreted
|
||||||
*/
|
*/
|
||||||
private void scanNotOK()
|
private void scanNotOK() {
|
||||||
{
|
|
||||||
AlertDialog.Builder dlg = new AlertDialog.Builder(this);
|
AlertDialog.Builder dlg = new AlertDialog.Builder(this);
|
||||||
dlg.setTitle(getString(R.string.app_name));
|
dlg.setTitle(getString(R.string.app_name));
|
||||||
|
|
||||||
|
@ -388,56 +423,69 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add New drug to the user database
|
* askForCompréhensive
|
||||||
* @param aDrug Drug - drug to be added
|
|
||||||
*/
|
*/
|
||||||
private void addDrugToList(Drug aDrug)
|
private void askForComprehensive() {
|
||||||
{
|
AlertDialog.Builder dlg = new AlertDialog.Builder(this);
|
||||||
aDrug.setDateEndOfStock();
|
dlg.setTitle(getString(R.string.app_name));
|
||||||
mAdapter.addItem(aDrug);
|
|
||||||
|
dlg.setMessage(R.string.understood);
|
||||||
|
dlg.setPositiveButton(R.string.Yes, (dialog, which) -> {
|
||||||
|
// Nothing to do just dismiss dialog
|
||||||
|
});
|
||||||
|
dlg.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add New drug to the user database
|
||||||
|
*
|
||||||
|
* @param aPrescription Prescription - medication to be added
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
private void addDrugToList(Prescription aPrescription) {
|
||||||
|
aPrescription.getDateEndOfStock();
|
||||||
|
mAdapter.addItem(aPrescription);
|
||||||
|
|
||||||
Log.d(TAG, "Call DrugDetailActivity");
|
Log.d(TAG, "Call DrugDetailActivity");
|
||||||
Context context = this;
|
Context context = this;
|
||||||
Intent intent = new Intent(context, DrugDetailActivity.class);
|
Intent intent = new Intent(context, DrugDetailActivity.class);
|
||||||
intent.putExtra("drug", aDrug);
|
intent.putExtra("prescription", aPrescription);
|
||||||
|
|
||||||
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
|
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
|
||||||
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
|
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* setupRecyclerView (list of drugs
|
* setupRecyclerView (list of drugs)
|
||||||
|
*
|
||||||
* @param recyclerView RecyclerView
|
* @param recyclerView RecyclerView
|
||||||
*/
|
*/
|
||||||
private void setupRecyclerView(@NonNull RecyclerView recyclerView) {
|
private void setupRecyclerView(@NonNull RecyclerView recyclerView) {
|
||||||
recyclerView.addItemDecoration(new SimpleDividerItemDecoration(getApplicationContext()));
|
recyclerView.addItemDecoration(new SimpleDividerItemDecoration(getApplicationContext()));
|
||||||
mAdapter = new SimpleItemRecyclerViewAdapter(drugs);
|
mAdapter = new SimpleItemRecyclerViewAdapter(prescriptionList);
|
||||||
recyclerView.setAdapter(mAdapter);
|
recyclerView.setAdapter(mAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getAppName() {
|
|
||||||
PackageManager packageManager = getApplicationContext().getPackageManager();
|
|
||||||
ApplicationInfo applicationInfo = null;
|
|
||||||
try {
|
|
||||||
applicationInfo = packageManager.getApplicationInfo(this.getPackageName(), 0);
|
|
||||||
} catch (final PackageManager.NameNotFoundException ignored) {}
|
|
||||||
return (String)((applicationInfo != null) ? packageManager.getApplicationLabel(applicationInfo) : "???");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SimpleItemRecyclerViewAdapter
|
* SimpleItemRecyclerViewAdapter
|
||||||
*/
|
*/
|
||||||
public class SimpleItemRecyclerViewAdapter extends RecyclerView.Adapter<SimpleItemRecyclerViewAdapter.ViewHolder> {
|
public class SimpleItemRecyclerViewAdapter extends
|
||||||
|
RecyclerView.Adapter<SimpleItemRecyclerViewAdapter.ViewHolder> {
|
||||||
|
|
||||||
private final List<Drug> mValues;
|
private final List<Prescription> mValues;
|
||||||
SimpleItemRecyclerViewAdapter(List<Drug> items) {
|
|
||||||
|
SimpleItemRecyclerViewAdapter(List<Prescription> items) {
|
||||||
mValues = items;
|
mValues = items;
|
||||||
}
|
}
|
||||||
|
|
||||||
void addItem(Drug scannedDrug) {
|
void addItem(Prescription scannedPrescription) {
|
||||||
if (!dbHelper.isDrugExist(scannedDrug.getCip13())) {
|
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
|
||||||
mValues.add(scannedDrug);
|
if (prescriptionsDAO.getMedicByCIP13(scannedPrescription.getCip13()) == null) {
|
||||||
|
mValues.add(scannedPrescription);
|
||||||
//notifyDataSetChanged();
|
//notifyDataSetChanged();
|
||||||
notifyItemInserted(mValues.size());
|
notifyItemInserted(mValues.size());
|
||||||
dbHelper.addDrug(scannedDrug);
|
prescriptionsDAO.insert(scannedPrescription);
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getApplicationContext(), "already in the database", Toast.LENGTH_LONG).show();
|
Toast.makeText(getApplicationContext(), "already in the database", Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
@ -452,6 +500,7 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public void onBindViewHolder(final ViewHolder holder, int dummy) {
|
public void onBindViewHolder(final ViewHolder holder, int dummy) {
|
||||||
final int position = holder.getBindingAdapterPosition();
|
final int position = holder.getBindingAdapterPosition();
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("EEEE d MMMM yyyy", Locale.getDefault());
|
SimpleDateFormat dateFormat = new SimpleDateFormat("EEEE d MMMM yyyy", Locale.getDefault());
|
||||||
|
@ -473,6 +522,19 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
if (mValues.get(position).getTake() == 0) {
|
if (mValues.get(position).getTake() == 0) {
|
||||||
holder.mView.setBackgroundResource(R.drawable.gradient_bg);
|
holder.mView.setBackgroundResource(R.drawable.gradient_bg);
|
||||||
holder.mIconView.setImageResource(R.drawable.ic_suspended_pill);
|
holder.mIconView.setImageResource(R.drawable.ic_suspended_pill);
|
||||||
|
|
||||||
|
holder.mView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Prescription aPrescription = mValues.get(position);
|
||||||
|
Context context = v.getContext();
|
||||||
|
Intent intent = new Intent(context, DrugDetailActivity.class);
|
||||||
|
intent.putExtra("prescription", aPrescription);
|
||||||
|
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
|
||||||
|
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
int remainingStock = (int) Math.floor(mValues.get(position).getStock() / mValues.get(position).getTake());
|
int remainingStock = (int) Math.floor(mValues.get(position).getStock() / mValues.get(position).getTake());
|
||||||
if (remainingStock <= mValues.get(position).getAlertThreshold()) {
|
if (remainingStock <= mValues.get(position).getAlertThreshold()) {
|
||||||
|
@ -486,19 +548,21 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
holder.mView.setBackgroundResource(R.drawable.gradient_bg_ok);
|
holder.mView.setBackgroundResource(R.drawable.gradient_bg_ok);
|
||||||
holder.mIconView.setImageResource(R.drawable.ok_stock_vect);
|
holder.mIconView.setImageResource(R.drawable.ok_stock_vect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
holder.mView.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Prescription prescription = mValues.get(position);
|
||||||
|
Context context = v.getContext();
|
||||||
|
Intent intent = new Intent(context, DrugDetailActivity.class);
|
||||||
|
intent.putExtra("prescription", prescription);
|
||||||
|
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
|
||||||
|
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.mView.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
Drug drugCourant = mValues.get(position);
|
|
||||||
Context context = v.getContext();
|
|
||||||
Intent intent = new Intent(context, DrugDetailActivity.class);
|
|
||||||
intent.putExtra("drug", drugCourant);
|
|
||||||
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
|
|
||||||
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -511,8 +575,7 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
final TextView mContentView;
|
final TextView mContentView;
|
||||||
final TextView mEndOfStock;
|
final TextView mEndOfStock;
|
||||||
final ImageView mIconView;
|
final ImageView mIconView;
|
||||||
|
public Prescription mItem;
|
||||||
Drug mItem;
|
|
||||||
|
|
||||||
ViewHolder(View view) {
|
ViewHolder(View view) {
|
||||||
super(view);
|
super(view);
|
||||||
|
@ -529,4 +592,14 @@ public class DrugListActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
private String getAppName() {
|
||||||
|
PackageManager packageManager = getApplicationContext().getPackageManager();
|
||||||
|
ApplicationInfo applicationInfo = null;
|
||||||
|
try {
|
||||||
|
applicationInfo = packageManager.getApplicationInfo(this.getPackageName(), 0);
|
||||||
|
} catch (final PackageManager.NameNotFoundException ignored) {
|
||||||
|
}
|
||||||
|
return (String) ((applicationInfo != null) ? packageManager.getApplicationLabel(applicationInfo) : "???");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ import androidx.core.app.NotificationManagerCompat;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by jacques on 17/09/16.
|
* Created by jacques on 17/09/16.
|
||||||
*/
|
*/
|
||||||
|
@ -89,7 +88,7 @@ public class PillDroidJobService extends JobService {
|
||||||
Log.d(TAG, "schedule notification");
|
Log.d(TAG, "schedule notification");
|
||||||
createNotificationChannel();
|
createNotificationChannel();
|
||||||
Intent intent = new Intent(this, DrugListActivity.class);
|
Intent intent = new Intent(this, DrugListActivity.class);
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,0);
|
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,PendingIntent.FLAG_MUTABLE);
|
||||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "PillDroid")
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "PillDroid")
|
||||||
.setSmallIcon(R.drawable.ic_pill_alarm)
|
.setSmallIcon(R.drawable.ic_pill_alarm)
|
||||||
.setContentTitle(getString(R.string.app_name))
|
.setContentTitle(getString(R.string.app_name))
|
||||||
|
@ -114,23 +113,21 @@ public class PillDroidJobService extends JobService {
|
||||||
int importance = NotificationManager.IMPORTANCE_DEFAULT;
|
int importance = NotificationManager.IMPORTANCE_DEFAULT;
|
||||||
String CHANNEL_ID = "PillDroid";
|
String CHANNEL_ID = "PillDroid";
|
||||||
NotificationChannel channel;
|
NotificationChannel channel;
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
channel = new NotificationChannel(CHANNEL_ID, name, importance);
|
||||||
channel = new NotificationChannel(CHANNEL_ID, name, importance);
|
|
||||||
|
|
||||||
channel.setDescription(description);
|
channel.setDescription(description);
|
||||||
// Register the channel with the system; you can't change the importance
|
// Register the channel with the system; you can't change the importance
|
||||||
// or other notification behaviors after this
|
// or other notification behaviors after this
|
||||||
NotificationManager notificationManager = getSystemService(NotificationManager.class);
|
NotificationManager notificationManager = getSystemService(NotificationManager.class);
|
||||||
try {
|
try {
|
||||||
notificationManager.createNotificationChannel(channel);
|
notificationManager.createNotificationChannel(channel);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// This will catch any exception, because they are all descended from Exception
|
// This will catch any exception, because they are all descended from Exception
|
||||||
Log.e(TAG, e.toString());
|
Log.e(TAG, e.toString());
|
||||||
//At the level Exception Class handle the error in Exception Table
|
//At the level Exception Class handle the error in Exception Table
|
||||||
// Exception Create That Error Object and throw it
|
// Exception Create That Error Object and throw it
|
||||||
//E.g: FileNotFoundException ,etc
|
//E.g: FileNotFoundException ,etc
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package net.foucry.pilldroid;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.activity.result.contract.ActivityResultContract;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import com.google.zxing.client.android.Intents;
|
||||||
|
import com.journeyapps.barcodescanner.ScanIntentResult;
|
||||||
|
import com.journeyapps.barcodescanner.ScanOptions;
|
||||||
|
|
||||||
|
|
||||||
|
public class PilldroidScanContract extends ActivityResultContract<ScanOptions, ScanIntentResult>{
|
||||||
|
private static final String TAG = PilldroidScanContract.class.getName();
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Intent createIntent(@NonNull Context context, ScanOptions input) {
|
||||||
|
Log.d(TAG, "create Intent");
|
||||||
|
|
||||||
|
Intent intent = new Intent(context, CustomScannerActivity.class);
|
||||||
|
|
||||||
|
intent.setAction(Intents.Scan.ACTION);
|
||||||
|
|
||||||
|
Log.d(TAG, "intent ==" + intent);
|
||||||
|
return(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ScanIntentResult parseResult(int resultCode, @Nullable Intent intent) {
|
||||||
|
return ScanIntentResult.parseActivityResult(resultCode, intent);
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,16 +8,17 @@ import android.content.SharedPreferences;
|
||||||
* Created by Lincoln on 05/05/16.
|
* Created by Lincoln on 05/05/16.
|
||||||
*/
|
*/
|
||||||
public class PrefManager {
|
public class PrefManager {
|
||||||
SharedPreferences pref;
|
final SharedPreferences pref;
|
||||||
SharedPreferences.Editor editor;
|
SharedPreferences.Editor editor;
|
||||||
|
|
||||||
// shared pref mode
|
// shared pref mode
|
||||||
int PRIVATE_MODE = 0;
|
final int PRIVATE_MODE = 0;
|
||||||
|
|
||||||
// Shared preferences file name
|
// Shared preferences file name
|
||||||
private static final String PREF_NAME = "Pildroid-Prefs";
|
private static final String PREF_NAME = "Pildroid-Prefs";
|
||||||
private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch";
|
private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch";
|
||||||
private static final String DATABASE_VERSION = "DatabaseVersion";
|
private static final String DATABASE_VERSION = "DatabaseVersion";
|
||||||
|
private static final String IS_UNDERSTOOD = "IsUnderStood";
|
||||||
|
|
||||||
public PrefManager(Context context) {
|
public PrefManager(Context context) {
|
||||||
pref = context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
|
pref = context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
|
||||||
|
@ -35,10 +36,17 @@ import android.content.SharedPreferences;
|
||||||
editor.apply();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setUnderstood(boolean isUnderstood) {
|
||||||
|
editor = pref.edit();
|
||||||
|
editor.putBoolean(IS_UNDERSTOOD, isUnderstood);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isFirstTimeLaunch() {
|
public boolean isFirstTimeLaunch() {
|
||||||
return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
|
return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
|
||||||
}
|
}
|
||||||
public int getDatabaseVersion() {
|
public int getDatabaseVersion() {
|
||||||
return pref.getInt(DATABASE_VERSION, 0);
|
return pref.getInt(DATABASE_VERSION, 0);
|
||||||
}
|
}
|
||||||
|
public boolean isUnderstood() {return pref.getBoolean(IS_UNDERSTOOD, false); }
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import android.graphics.drawable.Drawable;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.appcompat.content.res.AppCompatResources;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,7 +16,8 @@ public class SimpleDividerItemDecoration extends RecyclerView.ItemDecoration {
|
||||||
private final Drawable mDivider;
|
private final Drawable mDivider;
|
||||||
|
|
||||||
SimpleDividerItemDecoration(Context context) {
|
SimpleDividerItemDecoration(Context context) {
|
||||||
mDivider = context.getDrawable(R.drawable.line_divider);
|
//mDivider = context.getDrawable(R.drawable.line_divider);
|
||||||
|
mDivider = AppCompatResources.getDrawable(context, R.drawable.line_divider);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,7 +5,6 @@ import android.util.Log;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.ParsePosition;
|
import java.text.ParsePosition;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalTime;
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
@ -13,7 +12,7 @@ import java.util.Locale;
|
||||||
/**
|
/**
|
||||||
* Created by jacques on 05/05/16.
|
* Created by jacques on 05/05/16.
|
||||||
*/
|
*/
|
||||||
class UtilDate {
|
public class UtilDate {
|
||||||
|
|
||||||
private static final String TAG = UtilDate.class.getName();
|
private static final String TAG = UtilDate.class.getName();
|
||||||
|
|
||||||
|
@ -22,7 +21,7 @@ class UtilDate {
|
||||||
* @return date the same date as input but at noon (12:00:00 PM)
|
* @return date the same date as input but at noon (12:00:00 PM)
|
||||||
* set date time at Noon
|
* set date time at Noon
|
||||||
*/
|
*/
|
||||||
static Date dateAtNoon(Date aDate) {
|
public static Date dateAtNoon(Date aDate) {
|
||||||
|
|
||||||
Log.d(TAG, "dateAtNoon " + aDate);
|
Log.d(TAG, "dateAtNoon " + aDate);
|
||||||
|
|
||||||
|
@ -42,7 +41,7 @@ class UtilDate {
|
||||||
* @param days number of days to remove to the ate
|
* @param days number of days to remove to the ate
|
||||||
* @param date date before day removing
|
* @param date date before day removing
|
||||||
* @return date
|
* @return date
|
||||||
* Substract days to date and return a new date
|
* Subtract days to date and return a new date
|
||||||
*/
|
*/
|
||||||
static Date removeDaysToDate(int days, Date date) {
|
static Date removeDaysToDate(int days, Date date) {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
@ -91,7 +90,7 @@ class UtilDate {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert dateInMilliseconds into string formated date
|
* Convert dateInMilliseconds into string formatted date
|
||||||
* @param dateInMilliseconds long
|
* @param dateInMilliseconds long
|
||||||
* @return formatted Date String
|
* @return formatted Date String
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,31 +1,17 @@
|
||||||
package net.foucry.pilldroid;
|
package net.foucry.pilldroid;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import net.foucry.pilldroid.models.Medicine;
|
||||||
import java.io.OutputStream;
|
import net.foucry.pilldroid.models.Prescription;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
public class Utils {
|
public class Utils {
|
||||||
private static final String TAG = UtilDate.class.getName();
|
private static final String TAG = Utils.class.getName();
|
||||||
|
|
||||||
public static void CopyStream(InputStream is, OutputStream os)
|
|
||||||
{
|
|
||||||
final int buffer_size=1024;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
byte[] bytes=new byte[buffer_size];
|
|
||||||
for(;;)
|
|
||||||
{
|
|
||||||
int count=is.read(bytes, 0, buffer_size);
|
|
||||||
if(count==-1)
|
|
||||||
break;
|
|
||||||
os.write(bytes, 0, count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(Exception ignored){}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a random number between twovalues - use to gənerate a false demo DB
|
* Return a random number between two values - use to generate a false demo DB
|
||||||
* @param min minimal value accepted
|
* @param min minimal value accepted
|
||||||
* @param max maximum value accepted
|
* @param max maximum value accepted
|
||||||
* @return int random number
|
* @return int random number
|
||||||
|
@ -35,4 +21,28 @@ public class Utils {
|
||||||
return r.nextInt(max - min) +max;
|
return r.nextInt(max - min) +max;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
public static String fmt(double d)
|
||||||
|
{
|
||||||
|
if(d == (long) d)
|
||||||
|
return String.format(Locale.getDefault(),"%d",(long)d);
|
||||||
|
else
|
||||||
|
return String.format("%s",d);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Prescription medicine2prescription(Medicine aMedicine) {
|
||||||
|
Prescription aPrescription = new Prescription();
|
||||||
|
|
||||||
|
aPrescription.setName(aMedicine.getName());
|
||||||
|
aPrescription.setCis(aMedicine.getCis());
|
||||||
|
aPrescription.setCip13(aMedicine.getCip13());
|
||||||
|
aPrescription.setPresentation(aMedicine.getPresentation());
|
||||||
|
aPrescription.setAdministration_mode(aMedicine.getAdministration_mode());
|
||||||
|
aPrescription.setStock(0F);
|
||||||
|
aPrescription.setAlert(7);
|
||||||
|
aPrescription.setTake(0F);
|
||||||
|
aPrescription.setWarning(14);
|
||||||
|
aPrescription.setLast_update(UtilDate.dateAtNoon(new Date()).getTime());
|
||||||
|
|
||||||
|
return aPrescription;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -2,16 +2,20 @@ package net.foucry.pilldroid;
|
||||||
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
|
import android.view.WindowInsets;
|
||||||
|
import android.view.WindowInsetsController;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.viewpager.widget.PagerAdapter;
|
import androidx.viewpager.widget.PagerAdapter;
|
||||||
|
@ -41,10 +45,9 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
prefManager.setFirstTimeLaunch(false);
|
prefManager.setFirstTimeLaunch(false);
|
||||||
// Making notification bar transparent
|
setContentView(R.layout.welcome_activity);
|
||||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
|
|
||||||
|
|
||||||
setContentView(R.layout.activity_welcome);
|
setFullScreen();
|
||||||
|
|
||||||
viewPager = findViewById(R.id.view_pager);
|
viewPager = findViewById(R.id.view_pager);
|
||||||
dotsLayout = findViewById(R.id.layoutDots);
|
dotsLayout = findViewById(R.id.layoutDots);
|
||||||
|
@ -90,7 +93,7 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
// checking for last page
|
// checking for last page
|
||||||
// if last page home screen will be launched
|
// if last page home screen will be launched
|
||||||
int current = getItem(+1);
|
int current = getItem();
|
||||||
if (current < layouts.length) {
|
if (current < layouts.length) {
|
||||||
// move to next screen
|
// move to next screen
|
||||||
viewPager.setCurrentItem(current);
|
viewPager.setCurrentItem(current);
|
||||||
|
@ -118,8 +121,8 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||||
dots[currentPage].setTextColor(ContextCompat.getColor(this, R.color.dot_light));
|
dots[currentPage].setTextColor(ContextCompat.getColor(this, R.color.dot_light));
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getItem(int i) {
|
private int getItem() {
|
||||||
return viewPager.getCurrentItem() + i;
|
return viewPager.getCurrentItem() + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void launchHomeScreen() {
|
void launchHomeScreen() {
|
||||||
|
@ -129,7 +132,7 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
// viewpager change listener
|
// viewpager change listener
|
||||||
ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {
|
final ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPageSelected(int position) {
|
public void onPageSelected(int position) {
|
||||||
|
@ -167,6 +170,28 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||||
window.setStatusBarColor(Color.TRANSPARENT);
|
window.setStatusBarColor(Color.TRANSPARENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
private void setFullScreen(){
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||||
|
getWindow().setDecorFitsSystemWindows(false);
|
||||||
|
WindowInsetsController controller = getWindow().getInsetsController();
|
||||||
|
if(controller != null) {
|
||||||
|
controller.hide(WindowInsets.Type.statusBars() | WindowInsets.Type.navigationBars());
|
||||||
|
controller.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//noinspection
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(
|
||||||
|
View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||||
|
| View.SYSTEM_UI_FLAG_IMMERSIVE
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
|
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* View pager adapter
|
* View pager adapter
|
||||||
*/
|
*/
|
||||||
|
@ -175,8 +200,9 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||||
public MyViewPagerAdapter() {
|
public MyViewPagerAdapter() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public Object instantiateItem(ViewGroup container, int position) {
|
public Object instantiateItem(@NonNull ViewGroup container, int position) {
|
||||||
LayoutInflater layoutInflater = getLayoutInflater();
|
LayoutInflater layoutInflater = getLayoutInflater();
|
||||||
|
|
||||||
View view = layoutInflater.inflate(layouts[position], container, false);
|
View view = layoutInflater.inflate(layouts[position], container, false);
|
||||||
|
@ -191,13 +217,13 @@ public class WelcomeActivity extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isViewFromObject(View view, Object obj) {
|
public boolean isViewFromObject(@NonNull View view, @NonNull Object obj) {
|
||||||
return view == obj;
|
return view == obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void destroyItem(ViewGroup container, int position, Object object) {
|
public void destroyItem(ViewGroup container, int position, @NonNull Object object) {
|
||||||
View view = (View) object;
|
View view = (View) object;
|
||||||
container.removeView(view);
|
container.removeView(view);
|
||||||
}
|
}
|
||||||
|
|
20
app/src/main/java/net/foucry/pilldroid/dao/MedicinesDAO.java
Normal file
20
app/src/main/java/net/foucry/pilldroid/dao/MedicinesDAO.java
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
package net.foucry.pilldroid.dao;
|
||||||
|
|
||||||
|
import androidx.room.Dao;
|
||||||
|
import androidx.room.Query;
|
||||||
|
|
||||||
|
import net.foucry.pilldroid.models.Medicine;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Dao
|
||||||
|
public interface MedicinesDAO {
|
||||||
|
@Query("SELECT * FROM drugs")
|
||||||
|
List<Medicine> getAllMedicines();
|
||||||
|
|
||||||
|
@Query("SELECT * FROM drugs WHERE cip13 = :cip13")
|
||||||
|
Medicine getMedicineByCIP13(String cip13);
|
||||||
|
|
||||||
|
@Query("SELECT count(*) FROM drugs")
|
||||||
|
int getMedicineCount();
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package net.foucry.pilldroid.dao;
|
||||||
|
|
||||||
|
import androidx.room.Dao;
|
||||||
|
import androidx.room.Delete;
|
||||||
|
import androidx.room.Insert;
|
||||||
|
import androidx.room.Query;
|
||||||
|
import androidx.room.Update;
|
||||||
|
|
||||||
|
import net.foucry.pilldroid.models.Prescription;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Dao
|
||||||
|
public interface PrescriptionsDAO {
|
||||||
|
@Insert
|
||||||
|
void insert(Prescription... prescriptions);
|
||||||
|
|
||||||
|
@Update
|
||||||
|
void update(Prescription... prescriptions);
|
||||||
|
|
||||||
|
@Delete
|
||||||
|
void delete(Prescription prescription);
|
||||||
|
|
||||||
|
@Query("SELECT * FROM prescriptions")
|
||||||
|
List<Prescription> getAllMedics();
|
||||||
|
|
||||||
|
@Query("SELECT * FROM prescriptions WHERE cip13 = :cip13")
|
||||||
|
Prescription getMedicByCIP13(String cip13);
|
||||||
|
|
||||||
|
@Query("SELECT count(*) FROM prescriptions")
|
||||||
|
int getMedicCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
package net.foucry.pilldroid.databases;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.room.Database;
|
||||||
|
import androidx.room.Room;
|
||||||
|
import androidx.room.RoomDatabase;
|
||||||
|
|
||||||
|
import net.foucry.pilldroid.dao.MedicinesDAO;
|
||||||
|
import net.foucry.pilldroid.models.Medicine;
|
||||||
|
|
||||||
|
@Database(
|
||||||
|
version = 1,
|
||||||
|
entities = {Medicine.class}
|
||||||
|
)
|
||||||
|
|
||||||
|
public abstract class MedicineDatabase extends RoomDatabase {
|
||||||
|
private static MedicineDatabase INSTANCE;
|
||||||
|
public abstract MedicinesDAO getMedicinesDAO();
|
||||||
|
public static MedicineDatabase getInstanceDatabase(Context context) {
|
||||||
|
if (INSTANCE == null) {
|
||||||
|
INSTANCE =
|
||||||
|
Room
|
||||||
|
.databaseBuilder(context.getApplicationContext(), MedicineDatabase.class, "medicines")
|
||||||
|
.createFromAsset("drugs.db")
|
||||||
|
.allowMainThreadQueries()
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
return INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void destroyInstance() {
|
||||||
|
INSTANCE = null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package net.foucry.pilldroid.databases;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.room.AutoMigration;
|
||||||
|
import androidx.room.Database;
|
||||||
|
import androidx.room.Room;
|
||||||
|
import androidx.room.RoomDatabase;
|
||||||
|
|
||||||
|
import net.foucry.pilldroid.dao.PrescriptionsDAO;
|
||||||
|
import net.foucry.pilldroid.models.Prescription;
|
||||||
|
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
|
@Database(
|
||||||
|
version = 1,
|
||||||
|
entities = {Prescription.class}
|
||||||
|
)
|
||||||
|
|
||||||
|
public abstract class PrescriptionDatabase extends RoomDatabase {
|
||||||
|
private static PrescriptionDatabase INSTANCE;
|
||||||
|
public abstract PrescriptionsDAO getPrescriptionsDAO();
|
||||||
|
public static PrescriptionDatabase getInstanceDatabase(Context context) {
|
||||||
|
if (INSTANCE == null) {
|
||||||
|
INSTANCE =
|
||||||
|
Room
|
||||||
|
.databaseBuilder(context.getApplicationContext(),
|
||||||
|
PrescriptionDatabase.class, "prescriptions")
|
||||||
|
.allowMainThreadQueries()
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
return INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void destroyInstance() {
|
||||||
|
INSTANCE = null;
|
||||||
|
}
|
||||||
|
}
|
97
app/src/main/java/net/foucry/pilldroid/models/Medicine.java
Normal file
97
app/src/main/java/net/foucry/pilldroid/models/Medicine.java
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
package net.foucry.pilldroid.models;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.room.Entity;
|
||||||
|
import androidx.room.PrimaryKey;
|
||||||
|
|
||||||
|
@Entity(tableName = "drugs")
|
||||||
|
public class Medicine {
|
||||||
|
@PrimaryKey
|
||||||
|
@NonNull private Integer _id;
|
||||||
|
private String cis;
|
||||||
|
private String cip13;
|
||||||
|
private String cip7;
|
||||||
|
private String administration_mode;
|
||||||
|
private String name;
|
||||||
|
private String presentation;
|
||||||
|
private String label_group;
|
||||||
|
private Integer generic_type;
|
||||||
|
|
||||||
|
public Medicine(@NonNull String cis) {
|
||||||
|
this.cis = cis;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public String getCis() {
|
||||||
|
return cis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCis(@NonNull String cis) {
|
||||||
|
this.cis = cis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCip13() {
|
||||||
|
return cip13;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCip13(String cip13) {
|
||||||
|
this.cip13 = cip13;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCip7() {
|
||||||
|
return cip7;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCip7(String cip7) {
|
||||||
|
this.cip7 = cip7;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAdministration_mode() {
|
||||||
|
return administration_mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdministration_mode(String administration_mode) {
|
||||||
|
this.administration_mode = administration_mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPresentation() {
|
||||||
|
return presentation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPresentation(String presentation) {
|
||||||
|
this.presentation = presentation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLabel_group() {
|
||||||
|
return label_group;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel_group(String label_group) {
|
||||||
|
this.label_group = label_group;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getGeneric_type() {
|
||||||
|
return generic_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGeneric_type(Integer generic_type) {
|
||||||
|
this.generic_type = generic_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public Integer get_id() {
|
||||||
|
return _id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set_id(@NonNull Integer _id) {
|
||||||
|
this._id = _id;
|
||||||
|
}
|
||||||
|
}
|
151
app/src/main/java/net/foucry/pilldroid/models/Prescription.java
Normal file
151
app/src/main/java/net/foucry/pilldroid/models/Prescription.java
Normal file
|
@ -0,0 +1,151 @@
|
||||||
|
package net.foucry.pilldroid.models;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.room.Entity;
|
||||||
|
import androidx.room.PrimaryKey;
|
||||||
|
|
||||||
|
import net.foucry.pilldroid.UtilDate;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Entity(tableName = "prescriptions")
|
||||||
|
public class Prescription implements Serializable {
|
||||||
|
@PrimaryKey
|
||||||
|
@NonNull private String cis;
|
||||||
|
private String cip13;
|
||||||
|
private String name;
|
||||||
|
private String administration_mode;
|
||||||
|
private String presentation;
|
||||||
|
private Float stock;
|
||||||
|
private Float take;
|
||||||
|
private Integer warning;
|
||||||
|
private Integer alert;
|
||||||
|
private Long last_update;
|
||||||
|
private String label_group;
|
||||||
|
private Integer genetic_type;
|
||||||
|
|
||||||
|
public void setCis(@NonNull String cis)
|
||||||
|
{
|
||||||
|
this.cis = cis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCip13(String cip13) {
|
||||||
|
this.cip13 = cip13;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAdministration_mode(String administration_mode) {
|
||||||
|
this.administration_mode = administration_mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPresentation(String presentation) {
|
||||||
|
this.presentation = presentation;
|
||||||
|
}
|
||||||
|
public void setStock(Float stock) {
|
||||||
|
this.stock = stock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTake(Float take) {
|
||||||
|
this.take = take;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWarning(Integer warning) {
|
||||||
|
this.warning = warning;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAlert(Integer alert) {
|
||||||
|
this.alert = alert;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLast_update(Long last_update) {
|
||||||
|
this.last_update = last_update;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
public String getCis() {
|
||||||
|
return this.cis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getWarning() {
|
||||||
|
return warning;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCip13() {
|
||||||
|
return cip13;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAdministration_mode() {
|
||||||
|
return administration_mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPresentation() {
|
||||||
|
return presentation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Float getStock() {
|
||||||
|
return stock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Float getTake() {
|
||||||
|
return take;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getAlert() {
|
||||||
|
return alert;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLast_update() {
|
||||||
|
return last_update;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAlertThreshold() {
|
||||||
|
return this.alert;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getWarnThreshold() {
|
||||||
|
return this.warning;
|
||||||
|
}
|
||||||
|
public String getLabel_group() {
|
||||||
|
return label_group;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLabel_group(String label_group) {
|
||||||
|
this.label_group = label_group;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getGenetic_type() {
|
||||||
|
return genetic_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGenetic_type(Integer genetic_type) {
|
||||||
|
this.genetic_type = genetic_type;
|
||||||
|
}
|
||||||
|
public Date getDateEndOfStock() {
|
||||||
|
int numberDayOfTake;
|
||||||
|
if (this.getTake() > 0) {
|
||||||
|
numberDayOfTake = (int) Math.floor(this.getStock() / this.getTake());
|
||||||
|
} else {
|
||||||
|
numberDayOfTake = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Date aDate = UtilDate.dateAtNoon(new Date());
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(aDate);
|
||||||
|
calendar.add(Calendar.DAY_OF_YEAR, numberDayOfTake);
|
||||||
|
|
||||||
|
return calendar.getTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
android:divider="?android:attr/dividerHorizontal"
|
android:divider="?android:attr/dividerHorizontal"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:showDividers="middle"
|
android:showDividers="middle"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
tools:context="net.foucry.pilldroid.DrugListActivity">
|
tools:context="net.foucry.pilldroid.DrugListActivity">
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -17,8 +18,7 @@
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/drug_list"
|
android:id="@+id/drug_list"
|
||||||
android:name="net.foucry.pilldroid.MedicamentListFragment"
|
android:name="net.foucry.pilldroid.MedicamentListFragment"
|
||||||
android:layout_width="@dimen/item_width"
|
android:layout_width="@dimen/item_width"
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:orientation="vertical" android:layout_width="match_parent"
|
android:orientation="vertical" android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@android:color/white">
|
android:background="@android:color/white"
|
||||||
|
tools:ignore="Overdraw">
|
||||||
|
|
||||||
<WebView
|
<WebView
|
||||||
android:id="@+id/aboutHtml"
|
android:id="@+id/aboutHtml"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
app:zxing_result_view="@color/zxing_custom_result_view"
|
app:zxing_result_view="@color/zxing_custom_result_view"
|
||||||
app:zxing_viewfinder_laser="@color/zxing_custom_viewfinder_laser"
|
app:zxing_viewfinder_laser="@color/zxing_custom_viewfinder_laser"
|
||||||
app:zxing_viewfinder_laser_visibility="true"
|
app:zxing_viewfinder_laser_visibility="true"
|
||||||
app:zxing_viewfinder_mask="@color/zxing_custom_viewfinder_mask" />
|
app:zxing_viewfinder_mask="@color/grey"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/zxing_status_view"
|
android:id="@+id/zxing_status_view"
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
android:textSize="32sp"
|
android:textSize="32sp"
|
||||||
android:textAlignment="center"
|
android:textAlignment="center"
|
||||||
android:text="@string/zxing_msg_default_status"
|
android:text="@string/zxing_msg_default_status"
|
||||||
android:textColor="@color/design_default_color_primary_dark"
|
android:textColor="@color/white"
|
||||||
tools:ignore="PrivateResource" />
|
tools:ignore="PrivateResource" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
|
@ -60,6 +60,7 @@
|
||||||
android:backgroundTint="@android:color/transparent"
|
android:backgroundTint="@android:color/transparent"
|
||||||
android:contentDescription="@string/button_keyboard"
|
android:contentDescription="@string/button_keyboard"
|
||||||
android:onClick="onKeyboard"
|
android:onClick="onKeyboard"
|
||||||
android:src="@drawable/ic_keyboard_black_24dp" />
|
android:src="@drawable/ic_keyboard_black_24dp"
|
||||||
|
tools:ignore="PrivateResource" />
|
||||||
|
|
||||||
</merge>
|
</merge>
|
|
@ -4,7 +4,7 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context="example.zxing.CustomScannerActivity">
|
tools:context="net.foucry.pilldroid.CustomScannerActivity">
|
||||||
|
|
||||||
<com.journeyapps.barcodescanner.DecoratedBarcodeView
|
<com.journeyapps.barcodescanner.DecoratedBarcodeView
|
||||||
android:id="@+id/zxing_barcode_scanner"
|
android:id="@+id/zxing_barcode_scanner"
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
android:layout_marginEnd="@dimen/fab_margin"
|
android:layout_marginEnd="@dimen/fab_margin"
|
||||||
android:layout_marginBottom="@dimen/fab_margin"
|
android:layout_marginBottom="@dimen/fab_margin"
|
||||||
android:backgroundTint="@android:color/transparent"
|
android:backgroundTint="@android:color/transparent"
|
||||||
android:contentDescription="@string/flashlighButton"
|
android:contentDescription="@string/flashlightButton"
|
||||||
android:onClick="switchFlashlight"
|
android:onClick="switchFlashlight"
|
||||||
android:src="@drawable/ic_baseline_highlight_24" />
|
android:src="@drawable/ic_baseline_highlight_24" />
|
||||||
</com.journeyapps.barcodescanner.DecoratedBarcodeView>
|
</com.journeyapps.barcodescanner.DecoratedBarcodeView>
|
|
@ -47,8 +47,9 @@
|
||||||
android:id="@+id/fab"
|
android:id="@+id/fab"
|
||||||
android:layout_width="@dimen/fab_width"
|
android:layout_width="@dimen/fab_width"
|
||||||
android:layout_height="@dimen/fab_height"
|
android:layout_height="@dimen/fab_height"
|
||||||
android:layout_gravity="end|top"
|
android:layout_gravity="end|bottom"
|
||||||
android:layout_marginTop="?attr/actionBarSize"
|
android:layout_marginTop="?attr/actionBarSize"
|
||||||
|
android:layout_marginBottom="?attr/actionBarSize"
|
||||||
android:layout_marginEnd="@dimen/fab_margin"
|
android:layout_marginEnd="@dimen/fab_margin"
|
||||||
android:backgroundTint="@android:color/transparent"
|
android:backgroundTint="@android:color/transparent"
|
||||||
android:contentDescription="@string/save_button"
|
android:contentDescription="@string/save_button"
|
|
@ -6,6 +6,7 @@
|
||||||
android:name="net.foucry.pilldroid.MedicamentListFragment"
|
android:name="net.foucry.pilldroid.MedicamentListFragment"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
app:layoutManager="LinearLayoutManager"
|
app:layoutManager="LinearLayoutManager"
|
||||||
android:background="@drawable/list_selector"
|
android:background="@drawable/list_selector"
|
||||||
tools:context="net.foucry.pilldroid.DrugListActivity"
|
tools:context="net.foucry.pilldroid.DrugListActivity"
|
||||||
|
|
|
@ -45,10 +45,11 @@
|
||||||
android:backgroundTint="@android:color/transparent"
|
android:backgroundTint="@android:color/transparent"
|
||||||
android:baselineAlignBottom="false"
|
android:baselineAlignBottom="false"
|
||||||
android:clickable="false"
|
android:clickable="false"
|
||||||
android:onClick="scanNow"
|
android:onClick="onButtonClick"
|
||||||
android:src="@drawable/ic_add_circle_black_24dp"
|
android:src="@drawable/ic_add_circle_black_24dp"
|
||||||
app:backgroundTint="@android:color/darker_gray"
|
app:backgroundTint="@android:color/darker_gray"
|
||||||
app:fabCustomSize="60dp"
|
app:fabCustomSize="60dp"
|
||||||
app:maxImageSize="60dp"
|
app:maxImageSize="60dp"
|
||||||
android:contentDescription="@string/add_button" />
|
android:contentDescription="@string/add_button"
|
||||||
|
tools:ignore="OnClick" />
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
|
@ -10,7 +10,7 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="@dimen/img_width_height"
|
android:layout_width="@dimen/img_width_height"
|
||||||
android:layout_height="@dimen/img_width_height"
|
android:layout_height="@dimen/img_width_height"
|
||||||
android:contentDescription="@string/barre_code_icone"
|
android:contentDescription="@string/barcode_icon"
|
||||||
android:src="@drawable/ic_barcode" />
|
android:src="@drawable/ic_barcode" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_width="@dimen/screen_shot_height"
|
android:layout_width="@dimen/screen_shot_height"
|
||||||
android:layout_height="@dimen/screen_shot_height"
|
android:layout_height="@dimen/screen_shot_height"
|
||||||
android:contentDescription="@string/tunables"
|
android:contentDescription="@string/tunable"
|
||||||
android:src="@drawable/tunable" />
|
android:src="@drawable/tunable" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:showIn="@layout/activity_welcome">
|
tools:showIn="@layout/welcome_activity">
|
||||||
|
|
||||||
|
|
||||||
<androidx.viewpager.widget.ViewPager
|
<androidx.viewpager.widget.ViewPager
|
||||||
|
@ -44,5 +44,4 @@
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:text="@string/skip"
|
android:text="@string/skip"
|
||||||
android:textColor="@android:color/white"/>
|
android:textColor="@android:color/white"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
0
app/src/main/res/mipmap-anydpi
Normal file
0
app/src/main/res/mipmap-anydpi
Normal file
|
@ -3,60 +3,60 @@
|
||||||
<string name="title_drug_detail">Détail Médicament</string>
|
<string name="title_drug_detail">Détail Médicament</string>
|
||||||
<string name="button_cancel">Annuler</string>
|
<string name="button_cancel">Annuler</string>
|
||||||
<string name="button_ok">OK</string>
|
<string name="button_ok">OK</string>
|
||||||
<string name="drug_presention_labal">Présentation</string>
|
<string name="drug_presentation_label">Contenu de la boite</string>
|
||||||
<string name="drug_name_label">Nom</string>
|
<string name="drug_name_label">Nom</string>
|
||||||
<string name="drug_administationMode_label">Mode d\'adminitration</string>
|
<string name="drug_administrationMode_label">Mode d\'administration</string>
|
||||||
<string name="msgNotFound">Médicament introuvable dans la base de données</string>
|
<string name="msgNotFound">Médicament introuvable dans la base de données</string>
|
||||||
<string name="about">À propos</string>
|
<string name="about">À propos</string>
|
||||||
<string name="help">Aide</string>
|
<string name="help">Aide</string>
|
||||||
<string name="drug_take_label">Prise</string>
|
<string name="drug_take_label">Prise</string>
|
||||||
<string name="drug_alertTherehold_label">Seuil critique</string>
|
<string name="drug_alertThreshold_label">Seuil critique</string>
|
||||||
<string name="drug_warningTherehold_label">Seuil d\'alerte</string>
|
<string name="drug_warningThreshold_label">Seuil d\'alerte</string>
|
||||||
<string name="msgFound">Médicament trouvé dans la base de données</string>
|
<string name="msgFound">Médicament trouvé dans la base de données</string>
|
||||||
<string name="drug_current_stock_label">Stock courant</string>
|
<string name="drug_current_stock_label">Stock courant</string>
|
||||||
<string name="notification_text">Vous devez passer à la pharmacie</string>
|
<string name="notification_text">Vous devez passer à la pharmacie</string>
|
||||||
<string name="button_keyboard">Utilisez le clavier</string>
|
<string name="button_keyboard">Utilisez le clavier</string>
|
||||||
<string name="detail_view">Vue de détail</string>
|
<string name="detail_view">Vue de détail</string>
|
||||||
<string name="save_button">Enrefistrez</string>
|
<string name="save_button">Enregistrer</string>
|
||||||
<string name="flashlighButton">Allumez/Éteignez le Flash</string>
|
<string name="flashlightButton">Allumer/Eteindre le Flash</string>
|
||||||
<string name="enter_cip_13_here">Enter cip 13 here..</string>
|
<string name="enter_cip_13_here">Saisir le code CIP 13 ici..</string>
|
||||||
<string name="enter_cip_13">Enter CIP 13</string>
|
<string name="enter_cip_13">Saisir le code CIP 13</string>
|
||||||
|
|
||||||
<!-- Slide Strings -->
|
<!-- Slide Strings -->
|
||||||
<string name="slide1_Pilldroid">Bienvenue dans Pilldroid</string>
|
<string name="slide1_Pilldroid">Bienvenue dans Pilldroid</string>
|
||||||
<string name="slide2_Pilldroid">Pour ajouter un médicament, tapez sur le bouton « Plus »</string>
|
<string name="slide2_Pilldroid">Ajouter un médicament, avec le bouton +</string>
|
||||||
<string name="slide3_Pilldroid">Vous pouvez scanner le code barre</string>
|
<string name="slide3_Pilldroid">Scanner le code barre</string>
|
||||||
<string name="slide4_Pilldroid">Ou le QRCode</string>
|
<string name="slide4_Pilldroid">Ou le QR code</string>
|
||||||
<string name="slide5_Pilldroid">Fond vert, visage souriant, le stock est bon.</string>
|
<string name="slide5_Pilldroid">Fond vert, visage souriant, le stock est bon</string>
|
||||||
<string name="slide6_Pilldroid">Fond orange, visage neutre, le stock diminue.</string>
|
<string name="slide6_Pilldroid">Fond orange, visage neutre, le stock diminue</string>
|
||||||
<string name="slide7_Pilldroid">Fond rouge, visage grincheux le stock est bas.</string>
|
<string name="slide7_Pilldroid">Fond rouge, visage grincheux, le stock est faible</string>
|
||||||
<string name="slide9_Pilldroid">Les valeurs modifiables. Le stock est recalculé tous les jours</string>
|
<string name="slide8_Pilldroid">Consulter les informations sur le médicament</string>
|
||||||
<string name="slide8_Pilldroid">Les informations sur le médicament</string>
|
<string name="slide9_Pilldroid">Les valeurs sont modifiables, le stock est recalculé tous les jours</string>
|
||||||
<string name="slide10_Pilldroid">Traitement suspendu, la prise est mise à zéro, le stock n\'est plus calculé.</string>
|
<string name="slide10_Pilldroid">Traitement suspendu, la prise est à zéro, le stock n\'est plus calculé</string>
|
||||||
<string name="slide11_Pilldroid">L\'icone de sauvegarde de vos modifications.</string>
|
<string name="slide11_Pilldroid">Sauvegarder vos modifications</string>
|
||||||
<string name="slide12_Pilldroid">Merci d\'utiliser PilllDroid.</string>
|
<string name="slide12_Pilldroid">Merci d\'utiliser Pilldroid</string>
|
||||||
<string name="slide1_desc">Le gestionnaire de stock theorique de médicaments</string>
|
<string name="slide1_desc">Le gestionnaire de stock théorique de médicaments</string>
|
||||||
<string name="slide2_desc">Vous ajouter un médicament à la base de données</string>
|
<string name="slide2_desc">Pour ajouter un médicament dans le stock</string>
|
||||||
<string name="slide3_desc">Appellé cip13</string>
|
<string name="slide3_desc">Pour obtenir le CIP 13</string>
|
||||||
<string name="pilldroid_icon">Icône de PillDroid</string>
|
<string name="pilldroid_icon">Icône de Pilldroid</string>
|
||||||
<string name="the_plus_icon">L\'icône Plus</string>
|
<string name="the_plus_icon">L\'icône Plus</string>
|
||||||
<string name="slide4_desc">Pour trouver le CIP13</string>
|
<string name="slide4_desc">Pour obtenir le CIP 13</string>
|
||||||
<string name="happy_face">Visage souriant</string>
|
<string name="happy_face">Visage souriant</string>
|
||||||
<string name="barre_code_icone">Icône de code barre</string>
|
<string name="barcode_icon">Icône de code barre</string>
|
||||||
<string name="qr_code_icon">icône de QR-Code</string>
|
<string name="qr_code_icon">icône de QR code</string>
|
||||||
<string name="neutral_face">Visage neutre</string>
|
<string name="neutral_face">Visage neutre</string>
|
||||||
<string name="unhappy_face">Visage grincheux</string>
|
<string name="unhappy_face">Visage grincheux</string>
|
||||||
<string name="drug_info">Capture d\'écran sur la partie information du médicament</string>
|
<string name="drug_info">Capture d\'écran sur la partie information du médicament</string>
|
||||||
<string name="tunables">Réglages</string>
|
<string name="tunable">Réglages</string>
|
||||||
<string name="slide10_desc">Mettre la prise à zéro suspend le traitement et les calculs de stock</string>
|
<string name="slide10_desc">Mettre la prise à zéro suspend le traitement et le calcul du stock</string>
|
||||||
<string name="suspended_treatment_icon">Icône de traitemernt suspendu</string>
|
<string name="suspended_treatment_icon">Icône de traitement suspendu</string>
|
||||||
<string name="slide11_desc">Pour enregistrer les changements, utilisez l\'icône de sauvegarde</string>
|
<string name="slide11_desc">Pour enregistrer les changements, utilisez l\'icône de sauvegarde</string>
|
||||||
<string name="save_icon">l\'icône de sauvegarde</string>
|
<string name="save_icon">L\'icône de sauvegarde</string>
|
||||||
<string name="slide12_desc">Plus de renseignements sur <a href="https://pilldroid.foucry.net">https://pilldroid.foucry.net</a></string>
|
<string name="slide12_desc">Plus de renseignements sur <a href="https://pilldroid.foucry.net">https://pilldroid.foucry.net</a></string>
|
||||||
<string name="skip">Passer</string>
|
<string name="skip">Passer</string>
|
||||||
<string name="next">Suivant</string>
|
<string name="next">Suivant</string>
|
||||||
<string name="start">Démarrer</string>
|
<string name="start">Démarrer</string>
|
||||||
<string name="add_button">Ajout d\'un médicament à votre liste</string>
|
<string name="add_button">Ajout d\'un médicament dans votre liste</string>
|
||||||
<string name="drugName">Nom Médicament</string>
|
<string name="drugName">Nom Médicament</string>
|
||||||
<string name="stockIcon">Icône de stock</string>
|
<string name="stockIcon">Icône de stock</string>
|
||||||
<string name="Date">lundi 1 janvier 2001</string>
|
<string name="Date">lundi 1 janvier 2001</string>
|
||||||
|
@ -64,4 +64,8 @@
|
||||||
<string name="label">Libellé</string>
|
<string name="label">Libellé</string>
|
||||||
<string name="drug_list">Attributs d\'un médicament</string>
|
<string name="drug_list">Attributs d\'un médicament</string>
|
||||||
<string name="notInterpreted">Le code barre ne peut pas être interprété</string>
|
<string name="notInterpreted">Le code barre ne peut pas être interprété</string>
|
||||||
|
<string name="cancelled_scan">Scan annulé</string>
|
||||||
|
<string name="missing_camera_permission">Autorisation appareil photo manquante</string>
|
||||||
|
<string name="Yes">Oui, j\'ai compris</string>
|
||||||
|
<string name="understood">Je comprends que le développeur de app_name n\'est pas responsable de la gestion de vos médicaments. CELA RELÈVE DE VOTRE SEULE RESPONSABILITË.</string>
|
||||||
</resources>
|
</resources>
|
|
@ -3,6 +3,7 @@
|
||||||
<color name="colorPrimary">#3F51B5</color>
|
<color name="colorPrimary">#3F51B5</color>
|
||||||
<color name="colorPrimaryDark">#303F9F</color>
|
<color name="colorPrimaryDark">#303F9F</color>
|
||||||
<color name="colorAccent">#FF4081</color>
|
<color name="colorAccent">#FF4081</color>
|
||||||
|
<color name="white">#FFFFFF</color>
|
||||||
|
|
||||||
<!-- slide bg -->
|
<!-- slide bg -->
|
||||||
<color name="bg_screen1">#4f91ff</color>
|
<color name="bg_screen1">#4f91ff</color>
|
||||||
|
|
|
@ -8,28 +8,28 @@
|
||||||
<string name="help">Help</string>
|
<string name="help">Help</string>
|
||||||
<string name="notification_text">You have to go to the pharmacy</string>
|
<string name="notification_text">You have to go to the pharmacy</string>
|
||||||
<string name="drug_name_label">Name</string>
|
<string name="drug_name_label">Name</string>
|
||||||
<string name="drug_presention_labal">Presentation</string>
|
<string name="drug_presentation_label">Presentation</string>
|
||||||
<string name="drug_administationMode_label">Administration mode</string>
|
<string name="drug_administrationMode_label">Administration mode</string>
|
||||||
<string name="drug_current_stock_label">Current stock</string>
|
<string name="drug_current_stock_label">Current stock</string>
|
||||||
<string name="drug_take_label">Take</string>
|
<string name="drug_take_label">Take</string>
|
||||||
<string name="drug_warningTherehold_label">Alert therehold</string>
|
<string name="drug_warningThreshold_label">Alert threshold</string>
|
||||||
<string name="drug_alertTherehold_label">Critical therehold</string>
|
<string name="drug_alertThreshold_label">Critical threshold</string>
|
||||||
<string name="button_keyboard">"Use the keyboard"</string>
|
<string name="button_keyboard">"Use the keyboard"</string>
|
||||||
<string name="detail_view">Detail view</string>
|
<string name="detail_view">Detail view</string>
|
||||||
<string name="save_button">Save</string>
|
<string name="save_button">Save</string>
|
||||||
<string name="flashlighButton">Toggle Flash</string>
|
<string name="flashlightButton">Toggle Flash</string>
|
||||||
<string name="enter_cip_13_here">Enter cip 13 here..</string>
|
<string name="enter_cip_13_here">Enter CIP 13 here..</string>
|
||||||
<string name="enter_cip_13">Enter CIP 13</string>
|
<string name="enter_cip_13">Enter CIP 13</string>
|
||||||
<string name="channel_description" translatable="false">PillDroid_NotificationChannel</string>
|
<string name="channel_description" translatable="false">Pilldroid_NotificationChannel</string>
|
||||||
<string name="channel_name" translatable="false">PillDroidChannel</string>
|
<string name="channel_name" translatable="false">PilldroidChannel</string>
|
||||||
|
|
||||||
<!-- slides strings -->
|
<!-- slides strings -->
|
||||||
<string name="slide1_Pilldroid">Welcome on Pilldroid</string>
|
<string name="slide1_Pilldroid">Welcome on Pilldroid</string>
|
||||||
<string name="slide1_desc">The theorical Pill Stock Manager</string>
|
<string name="slide1_desc">The theoretical Pill Stock Manager</string>
|
||||||
<string name="slide2_Pilldroid">To add a med, tap on the "Plus" button</string>
|
<string name="slide2_Pilldroid">To add a med, tap on the "Plus" button</string>
|
||||||
<string name="slide2_desc">You\'ll add a drug to the database</string>
|
<string name="slide2_desc">You\'ll add a drug to the database</string>
|
||||||
<string name="slide3_Pilldroid">You can scan classic barcode</string>
|
<string name="slide3_Pilldroid">You can scan classic barcode</string>
|
||||||
<string name="slide3_desc">called cip13</string>
|
<string name="slide3_desc">called CIP13</string>
|
||||||
<string name="slide4_Pilldroid">Or QRCode</string>
|
<string name="slide4_Pilldroid">Or QRCode</string>
|
||||||
<string name="slide5_Pilldroid">Green background, happy face</string>
|
<string name="slide5_Pilldroid">Green background, happy face</string>
|
||||||
<string name="slide6_Pilldroid">Orange background, neutral face</string>
|
<string name="slide6_Pilldroid">Orange background, neutral face</string>
|
||||||
|
@ -39,16 +39,16 @@
|
||||||
<string name="slide10_Pilldroid">Treatment suspended</string>
|
<string name="slide10_Pilldroid">Treatment suspended</string>
|
||||||
<string name="slide11_Pilldroid">save icon</string>
|
<string name="slide11_Pilldroid">save icon</string>
|
||||||
<string name="slide12_Pilldroid">Thanks</string>
|
<string name="slide12_Pilldroid">Thanks</string>
|
||||||
<string name="pilldroid_icon">PillDroid Icon</string>
|
<string name="pilldroid_icon">Pilldroid Icon</string>
|
||||||
<string name="the_plus_icon">The plus icon</string>
|
<string name="the_plus_icon">The plus icon</string>
|
||||||
<string name="slide4_desc">In order to find the CIP13</string>
|
<string name="slide4_desc">In order to find the CIP13</string>
|
||||||
<string name="happy_face">Happy face</string>
|
<string name="happy_face">Happy face</string>
|
||||||
<string name="barre_code_icone">Barre code icon</string>
|
<string name="barcode_icon">Barre code icon</string>
|
||||||
<string name="qr_code_icon">qr-code icon</string>
|
<string name="qr_code_icon">qr-code icon</string>
|
||||||
<string name="neutral_face">neutral face</string>
|
<string name="neutral_face">neutral face</string>
|
||||||
<string name="unhappy_face">unhappy face</string>
|
<string name="unhappy_face">unhappy face</string>
|
||||||
<string name="drug_info">Drug info screenshot</string>
|
<string name="drug_info">Drug info screenshot</string>
|
||||||
<string name="tunables">Tunables</string>
|
<string name="tunable">Tunable</string>
|
||||||
<string name="slide10_desc">Take to 0 to suspend treatment</string>
|
<string name="slide10_desc">Take to 0 to suspend treatment</string>
|
||||||
<string name="suspended_treatment_icon">Treatment suspended icon</string>
|
<string name="suspended_treatment_icon">Treatment suspended icon</string>
|
||||||
<string name="slide11_desc">To save changes</string>
|
<string name="slide11_desc">To save changes</string>
|
||||||
|
@ -65,5 +65,9 @@
|
||||||
<string name="Value">Value</string>
|
<string name="Value">Value</string>
|
||||||
<string name="label">Label</string>
|
<string name="label">Label</string>
|
||||||
<string name="drug_list">Drug\'s attributes</string>
|
<string name="drug_list">Drug\'s attributes</string>
|
||||||
<string name="notInterpreted">Barre code cannot be intrepreted</string>
|
<string name="notInterpreted">Barre code cannot be interpreted</string>
|
||||||
|
<string name="cancelled_scan">Scan canceled</string>
|
||||||
|
<string name="missing_camera_permission">Missing camera permission</string>
|
||||||
|
<string name="Yes">Yes, I understood</string>
|
||||||
|
<string name="understood">I understood that de developer of app_name cannot be responsible ot your medication management. IT\'S YOU OWN RESPONSIBILITY.</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -9,7 +9,7 @@ buildscript {
|
||||||
google()
|
google()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.0.4'
|
classpath 'com.android.tools.build:gradle:7.1.3'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
@ -20,10 +20,9 @@ ext {
|
||||||
buildToolsVersion = '28.0.1'
|
buildToolsVersion = '28.0.1'
|
||||||
var = '3.4.2'
|
var = '3.4.2'
|
||||||
//buildToolsVersion1 = '29.0.3'
|
//buildToolsVersion1 = '29.0.3'
|
||||||
defaultMinSdkVersion = 24
|
defaultMinSdkVersion = 26
|
||||||
defaultTargetSdkVersion = 30
|
defaultTargetSdkVersion = 30
|
||||||
defaultVersionCode = 1
|
defaultVersionCode = 1
|
||||||
defaultVersionCode1 = defaultVersionCode
|
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# beta-0.100 – First public release
|
# beta-0.100 – First public release
|
||||||
|
|
||||||
**REMENBER** Pilldroid is a French people user only.
|
**REMEMBER** Pilldroid is a French people user only.
|
||||||
|
|
||||||
I made a lot a tests but there must stay some bugs.
|
I made a lot a tests but there must stay some bugs.
|
||||||
|
|
||||||
|
@ -9,10 +9,10 @@ I made a lot a tests but there must stay some bugs.
|
||||||
find the code.
|
find the code.
|
||||||
|
|
||||||
## What is not implemented
|
## What is not implemented
|
||||||
- removing of a medic from the list;
|
- removing of a prescription from the list;
|
||||||
- take medic reminder. It will be never been implemented (by me).
|
- take prescription reminder. It will be never been implemented (by me).
|
||||||
|
|
||||||
**ATTENTION**, Pilldroid does not manage creams, liquids
|
**WARNING**, Pilldroid does not manage creams, liquids
|
||||||
(like insulin).
|
(like insulin).
|
||||||
|
|
||||||
Thanks to use [github](https://github/jfoucry/pilldroid) for bugs
|
Thanks to use [github](https://github/jfoucry/pilldroid) for bugs
|
||||||
|
@ -23,4 +23,4 @@ do not stress me it will be unproductive.
|
||||||
|
|
||||||
Pilldroid will available only from [f-droid](https://f-droid.org)
|
Pilldroid will available only from [f-droid](https://f-droid.org)
|
||||||
|
|
||||||
You can reach me and discuss on [Pildroid](mailto://jacques+pilldroid@foucry.net).
|
You can reach me and discuss on [Pilldroid](mailto://jacques+pilldroid@foucry.net).
|
||||||
|
|
30
fastlane/metadata/android/en-US/changelogs/v0.200-beta.txt
Normal file
30
fastlane/metadata/android/en-US/changelogs/v0.200-beta.txt
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# v0.2.0 – New semantic version number (VMajor.Minor.Patch)
|
||||||
|
|
||||||
|
**REMEMBER** Pilldroid is a French people user only.
|
||||||
|
|
||||||
|
I made a lot a tests but there must stay some bugs.
|
||||||
|
|
||||||
|
## What's new
|
||||||
|
|
||||||
|
A lot of things under the surface :
|
||||||
|
- Add an alert about non responsibility of the author in case of trouble;
|
||||||
|
- Using `Room` to manage databases;
|
||||||
|
- Migration of the old database to the new one, you should not see anything;
|
||||||
|
- Code cleaning.
|
||||||
|
|
||||||
|
## What should work.
|
||||||
|
- QR-code scan on a dark background. The library have an option for that.
|
||||||
|
|
||||||
|
|
||||||
|
**WARNING**, Pilldroid does not manage creams, liquids
|
||||||
|
(like insulin).
|
||||||
|
|
||||||
|
Thanks to use [github](https://github/jfoucry/pilldroid) for bugs
|
||||||
|
reports and new features.
|
||||||
|
|
||||||
|
> I made Pilldroid on my free time which is not expandable. Please
|
||||||
|
do not stress me it will be unproductive.
|
||||||
|
|
||||||
|
Pilldroid will available only from [f-droid](https://f-droid.org)
|
||||||
|
|
||||||
|
You can reach me and discuss on [Pilldroid](mailto:jacques+pilldroid@foucry.net).
|
35
fastlane/metadata/android/en-US/changelogs/v0.201-beta.txt
Normal file
35
fastlane/metadata/android/en-US/changelogs/v0.201-beta.txt
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
# v0.201-beta - fix bug in `alarmReceiver`
|
||||||
|
|
||||||
|
The `alarmReceiver` was still using the old database that *should* be empty. I use `room` database
|
||||||
|
management now.
|
||||||
|
|
||||||
|
# v0.200-beta – New semantic version number (VRelease.MajorMinorPatch)
|
||||||
|
|
||||||
|
**REMEMBER** Pilldroid is a French people user only.
|
||||||
|
|
||||||
|
I made a lot a tests but there must stay some bugs.
|
||||||
|
|
||||||
|
## What's new
|
||||||
|
|
||||||
|
A lot of things under the surface :
|
||||||
|
- Add an alert about non responsibility of the author in case of trouble;
|
||||||
|
- Using `Room` to manage databases;
|
||||||
|
- Migration of the old database to the new one, you should not see anything;
|
||||||
|
- Code cleaning.
|
||||||
|
|
||||||
|
## What should work.
|
||||||
|
- QR-code scan on a dark background. The library have an option for that.
|
||||||
|
|
||||||
|
|
||||||
|
**WARNING**, Pilldroid does not manage creams, liquids
|
||||||
|
(like insulin).
|
||||||
|
|
||||||
|
Thanks to use [github](https://github/jfoucry/pilldroid) for bugs
|
||||||
|
reports and new features.
|
||||||
|
|
||||||
|
> I made Pilldroid on my free time which is not expandable. Please
|
||||||
|
do not stress me it will be unproductive.
|
||||||
|
|
||||||
|
Pilldroid will available only from [f-droid](https://f-droid.org)
|
||||||
|
|
||||||
|
You can reach me and discuss on [Pilldroid](mailto:jacques+pilldroid@foucry.net).
|
|
@ -4,7 +4,7 @@ Malgré de nombreux tests et une utilisation quotidienne,
|
||||||
tout est à tester.
|
tout est à tester.
|
||||||
|
|
||||||
## Ce qui ne fonctionne pas
|
## Ce qui ne fonctionne pas
|
||||||
- le scan de QR-code sur fond foncé. La blibliothèque utilisée n'arrive
|
- le scan de QR-code sur un fond foncé. La bibliothèque utilisée n'arrive
|
||||||
pas à les repérer.
|
pas à les repérer.
|
||||||
|
|
||||||
## Ce qui n'est pas implémenté
|
## Ce qui n'est pas implémenté
|
||||||
|
@ -15,11 +15,11 @@ pas à les repérer.
|
||||||
(l'insuline par exemple).
|
(l'insuline par exemple).
|
||||||
|
|
||||||
Merci d'utiliser [github](https://github/jfoucry/pilldroid) pour
|
Merci d'utiliser [github](https://github/jfoucry/pilldroid) pour
|
||||||
les rapports de bogues et demandes de fonctionnalités.
|
rapporter des bogues et demander des fonctionnalités.
|
||||||
|
|
||||||
> Je fais Pilldroid sur mon temps libre et accesible. Il est inutile
|
> Je fais Pilldroid sur mon temps libre et accessible. Il est inutile
|
||||||
et contre productif de me « mettre la pression ».
|
et contre-productif de me « mettre la pression ».
|
||||||
|
|
||||||
Pilldroid ne sera diffusé que par [f-droid](https://f-droid.org)
|
Pilldroid ne sera diffusé que par [f-droid](https://f-droid.org)
|
||||||
|
|
||||||
Vous pouvez m'écrire pour discuter de [Pildroid](mailto://jacques+pilldroid@foucry.net).
|
Vous pouvez m'écrire pour discuter de [Pilldroid](mailto:jacques+pilldroid@foucry.net).
|
29
fastlane/metadata/android/fr-FR/changelogs/v0.200-beta.txt
Normal file
29
fastlane/metadata/android/fr-FR/changelogs/v0.200-beta.txt
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
# v0.200 – Nouvelle numérotation sémantique (VMajor.Minor.Patch)
|
||||||
|
|
||||||
|
Malgré de nombreux tests et une utilisation quotidienne,
|
||||||
|
tout est à tester.
|
||||||
|
|
||||||
|
## Nouveautés
|
||||||
|
|
||||||
|
Pas grand-chose de visible pour les personnes utilisatrices :
|
||||||
|
- Ajout d'une demande explicite de non-responsabilité de l'auteur en cas de problème ;
|
||||||
|
- Utilisation de `Room` pour gérer les bases de données ;
|
||||||
|
- Migration de l'ancienne base de données à la nouvelle, vous ne devriez rien voir ;
|
||||||
|
- Nettoyage du code.
|
||||||
|
|
||||||
|
## Ce qui devrait fonctionner
|
||||||
|
- le scan de QR-code sur un fond foncé. La bibliothèque utilisée a un paramètre pour cela.
|
||||||
|
|
||||||
|
|
||||||
|
**ATTENTION**, Pilldroid ne sait pas gérer les crèmes, les liquides
|
||||||
|
(l'insuline par exemple).
|
||||||
|
|
||||||
|
Merci d'utiliser [github](https://github/jfoucry/pilldroid) pour
|
||||||
|
rapporter des bogues et demander des fonctionnalités.
|
||||||
|
|
||||||
|
> Je fais Pilldroid sur mon temps libre et accessible. Il est inutile
|
||||||
|
et contre-productif de me « mettre la pression ».
|
||||||
|
|
||||||
|
Pilldroid ne sera diffusé que par [f-droid](https://f-droid.org)
|
||||||
|
|
||||||
|
Vous pouvez m'écrire pour discuter de [Pilldroid](mailto:jacques+pilldroid@foucry.net).
|
34
fastlane/metadata/android/fr-FR/changelogs/v0.201-beta.txt
Normal file
34
fastlane/metadata/android/fr-FR/changelogs/v0.201-beta.txt
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
# v0.201-beta - deverminage dans `alarmReceiver`
|
||||||
|
|
||||||
|
`alarmReceiver` utilisait l'ancienne base de données qui *doit* être vide. J'utilise maintenant
|
||||||
|
la base de données gérée par `room`
|
||||||
|
|
||||||
|
# v0.200 – Nouvelle numérotation sémantique (VMajor.Minor.Patch)
|
||||||
|
|
||||||
|
Malgré de nombreux tests et une utilisation quotidienne,
|
||||||
|
tout est à tester.
|
||||||
|
|
||||||
|
## Nouveautés
|
||||||
|
|
||||||
|
Pas grand-chose de visible pour les personnes utilisatrices :
|
||||||
|
- Ajout d'une demande explicite de non-responsabilité de l'auteur en cas de problème ;
|
||||||
|
- Utilisation de `Room` pour gérer les bases de données ;
|
||||||
|
- Migration de l'ancienne base de données à la nouvelle, vous ne devriez rien voir ;
|
||||||
|
- Nettoyage du code.
|
||||||
|
|
||||||
|
## Ce qui devrait fonctionner
|
||||||
|
- le scan de QR-code sur un fond foncé. La bibliothèque utilisée a un paramètre pour cela.
|
||||||
|
|
||||||
|
|
||||||
|
**ATTENTION**, Pilldroid ne sait pas gérer les crèmes, les liquides
|
||||||
|
(l'insuline par exemple).
|
||||||
|
|
||||||
|
Merci d'utiliser [github](https://github/jfoucry/pilldroid) pour
|
||||||
|
rapporter des bogues et demander des fonctionnalités.
|
||||||
|
|
||||||
|
> Je fais Pilldroid sur mon temps libre et accessible. Il est inutile
|
||||||
|
et contre-productif de me « mettre la pression ».
|
||||||
|
|
||||||
|
Pilldroid ne sera diffusé que par [f-droid](https://f-droid.org) (pour l'instant)
|
||||||
|
|
||||||
|
Vous pouvez m'écrire pour discuter de [Pilldroid](mailto:jacques+pilldroid@foucry.net).
|
|
@ -1 +1 @@
|
||||||
Pilldroid est un gestionnaire théorique de stock de médicaments
|
Pilldroid est un gestionnaire théorique de stock de médicaments.
|
Loading…
Reference in a new issue