Merge branch 'develop' into Release/V0.350-beta

This commit is contained in:
Jacques Foucry 2024-07-30 10:12:16 +00:00 committed by GitHub
commit f1d14dde4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
103 changed files with 1953 additions and 3217 deletions

6
.gitignore vendored
View file

@ -46,4 +46,8 @@ Thumbs.db
gen/ gen/
/android-signing-keystore.jks /android-signing-keystore.jks
/secrets.properties /secrets.properties
/java_pid9513.hprof *.hprof
# Other considerations
*.html
*~

View file

@ -1,62 +1,79 @@
# Pilldroid # Pilldroid
> I apologize. For know, even string exist in English, _Pilldroid_ is a French
> only application. That because the global drugs database contain only French
> drug's nommage. If you can find a way to provide another country global
> database,feel free to [contact
> me](mailto://pilldroid@foucry,net?Subject="Another database")
>
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 à
destination des personnes résidant en France. destination des personnes résidant en France.
## Ce que n'est pas Pilldroid <a href="https://f-droid.org/packages/net.foucry.pilldroid">
<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">
</a>
- Pilldroid n'est pas un pilulier. Pilldroid ne vous rappellera pas de prendre ## Qu'est-ce que Pilldroid ?
vos médicaments, c'est **VOTRE** responsabilité ;
- Pilldroid n'est pas fiable, ce n'est qu'une aide. Seul votre stock réel est bon Pilldroid est une applicaton de gestion de stock _théorique_ de médicaments,
; pour téléphone Android©.
- Pilldroid ne vous surveille pas.
## Pourquoi « Stock théorique » ? ## Pourquoi « Stock théorique » ?
Pilldroid ne sait (et n'a aucun moyen de savoir) si vous avez ou non pris vos Pilldroid ne sait ipas (et n'a aucun moyen de savoir) si vous avez ou non pris vos
médicaments. Pilldroid effectue, simple calcul : `stock connus - prise par médicaments. Pilldroid effectue, simple calcul : `stock connu - prise par
jour`. Ce calcul est fait tous les jours entre 11h et midi. 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 a 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-barres des boîtes de médicaments.
- Pilldroid a besoin de pouvoir vous envoyer des alarmes ; - Pilldroid a besoin de pouvoir vous envoyer des notifications.
- 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 notifications.
## L'application Pilldroid embarque-t-elle des bibliothèques tierce ? ## L'application Pilldroid embarque-t-elle des bibliothèques tierce ?
Oui. Pour la lecture de code barre, Pilldroid utilise le projet Oui. Pour la lecture de code-barres, 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.
## L'application Pilldroid contient-elle des pisteurs ? ## L'application Pilldroid contient-elle des pisteurs ?
[NON !](https://reports.exodus-privacy.eu.org/fr/reports/234531/) [NON !](https://reports.exodus-privacy.eu.org/fr/reports/net.foucry.pilldroid/latest/)
## D'où viennent les données de Pilldroid ? ## D'où viennent les données de Pilldroid ?
Elles sont issues de plusieurs fichiers de l'Agence pour la Sécurité des Elles sont issues de plusieurs fichiers de l'Agence pour la Sécurité des
Médicaments, agrégés dans une base de données grâce à script Python qui sera Médicaments, agrégés dans une base de données grâce à script Python qui est disponible sur le dépôt [TransformMeds](https://github.com/jfoucry/TransformMeds).
prochainement mis sur mon compte `github`.
## Ce que n'est pas Pilldroid
- Pilldroid n'est pas un pilulier. Pilldroid ne vous rappellera pas de prendre
vos médicaments, c'est **VOTRE** responsabilité.
- Pilldroid n'est pas fiable, ce n'est qu'une aide. Seul votre stock réel est bon.
## 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 bienvenue (je n'ai pas pigé les amélioration **que je comprends** sera la bienvenue.
`lambda` par exemple).
Marché de niche, Pilldroid a besoin de testeuses et testeurs. Marché de niche, Pilldroid a besoin de testeuses et testeurs.
Prochainement, vous pourrez glisser quelques menues monnaies dans une tirelire Et si vous ne pouvez-vous pas par ces moyens, vous pouvez m'aider à payer mon
en ligne. électricité et mon accès internet :
<script src="https://liberapay.com/Pilldroid/widgets/button.js"></script>
<noscript><a href="https://liberapay.com/Pilldroid/donate"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></noscript>
## L'application Pilldroid dispose telle d'un site web ? ## L'application Pilldroid dispose telle d'un site web ?
Oui, [Pilldroid](https://pilldroid.foucry.net) Oui, bien sûr : [Pilldroid](https://pilldroid.foucry.net)
## Contact
Le site web en premier lieu et l'adresse mail
[pilldroid@foucry.net](mailto://pilldroid@foucry.net:Subject="Contact")

View file

@ -18,7 +18,7 @@ else {
android { android {
signingConfigs { signingConfigs {
release { release {
storeFile file("../android-signing-keystore.jks") storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password'] storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_key_alias'] keyAlias secretProperties['signing_key_alias']
keyPassword secretProperties['signing_key_password'] keyPassword secretProperties['signing_key_password']
@ -30,21 +30,26 @@ android {
keyPassword secretProperties['signing_key_password'] keyPassword secretProperties['signing_key_password']
} }
} }
compileSdk 31 compileSdk 34
defaultConfig { defaultConfig {
applicationId "net.foucry.pilldroid" applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion targetSdkVersion defaultTargetSdkVersion
versionCode 350 versionCode 350
versionName "v0.350-beta" versionName "v0.350-beta"
multiDexEnabled true multiDexEnabled true
javaCompileOptions { javaCompileOptions {
annotationProcessorOptions { annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()] arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
} }
} }
} }
buildFeatures {
buildConfig = true
}
buildTypes { buildTypes {
debug { debug {
@ -59,7 +64,7 @@ android {
signingConfig signingConfigs.release signingConfig signingConfigs.release
} }
} }
flavorDimensions "version" flavorDimensions = ["version"]
productFlavors { productFlavors {
dev { dev {
resValue "string", "app_name", "PillDroid dev" resValue "string", "app_name", "PillDroid dev"
@ -77,7 +82,7 @@ android {
targetCompatibility JavaVersion.VERSION_11 targetCompatibility JavaVersion.VERSION_11
} }
buildToolsVersion = "32.0.0" namespace 'net.foucry.pilldroid'
allprojects { allprojects {
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
@ -92,26 +97,28 @@ repositories {
sourceSets { sourceSets {
main { main {
java { java {
exclude 'net/foucry/pilldroid/scanActivity.java' exclude 'net/foucry/pilldroid/ViewDialog.java'
} }
} }
} }
dependencies { dependencies {
implementation "androidx.room:room-common:2.4.2" implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
annotationProcessor "androidx.room:room-compiler:2.4.2" implementation "androidx.room:room-common:2.6.1"
implementation "androidx.room:room-testing:2.4.2" annotationProcessor "androidx.room:room-compiler:2.6.1"
implementation "androidx.room:room-rxjava3:2.4.2" implementation "androidx.room:room-testing:2.6.1"
implementation "androidx.room:room-runtime:2.4.2" implementation "androidx.room:room-rxjava3:2.6.1"
implementation "androidx.room:room-runtime:2.6.1"
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.4.2' implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'com.google.android.material:material:1.6.1' implementation 'com.google.android.material:material:1.11.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.8.0' implementation 'androidx.core:core:1.12.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.0' //coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.0'
} }

View file

@ -1,121 +0,0 @@
//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'
}

View file

@ -1,121 +0,0 @@
//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'
}

View file

@ -1,121 +0,0 @@
//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'
}

View file

@ -1,121 +0,0 @@
//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'
}

View file

@ -1,117 +0,0 @@
//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'
}

View file

@ -1,117 +0,0 @@
//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'
}

View file

@ -1,117 +0,0 @@
//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'
}

View file

@ -1,117 +0,0 @@
//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'
}

View file

@ -1,117 +0,0 @@
//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'
}

View file

@ -1,117 +0,0 @@
//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'
}

View file

@ -1,117 +0,0 @@
//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'
}

View file

@ -1,117 +0,0 @@
//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'
}

View file

@ -1,117 +0,0 @@
//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'
}

View file

@ -1,117 +0,0 @@
//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'
}

View file

@ -1,117 +0,0 @@
//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'
}

View file

@ -1,117 +0,0 @@
//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'
}

View file

@ -1,20 +0,0 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "net.foucry.pilldroid",
"variantName": "preproductPrerelease",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 24065,
"versionName": "0.65.20220101-d04e132",
"outputFile": "app-preproduct-prerelease.apk"
}
],
"elementType": "File"
}

View file

@ -1,12 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="net.foucry.pilldroid">
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY"/>
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/> <uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<application <application
android:fullBackupContent="true" android:fullBackupContent="true"
@ -59,5 +64,8 @@
<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="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
</application> </application>
</manifest> </manifest>

View file

@ -20,6 +20,7 @@
<body> <body>
<div style="text-align: center;"><img src="file:///android_asset/icon_pilldroid.png" width="64" alt="Icône de l'application Pilldroid"/></div> <div style="text-align: center;"><img src="file:///android_asset/icon_pilldroid.png" width="64" alt="Icône de l'application Pilldroid"/></div>
<div class="build"><p>[feb95329be7d05c6fd17d4ba4b72ca48c7bb294e]</p></div> <div class="build"><p>[feb95329be7d05c6fd17d4ba4b72ca48c7bb294e]</p></div>
<h5>Pilldroid &copy;&nbsp;2024 Jacques Foucry </h5> <h5>Pilldroid &copy;&nbsp;2024 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>

View file

@ -2,15 +2,14 @@ package net.foucry.pilldroid;
import android.graphics.Color; import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.webkit.WebView;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import android.webkit.WebView;
/** /**
* Created by jacques on 12/06/16. * Created by jacques on 12/06/16.
*/ */
public class About extends AppCompatActivity{ public class About extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {

View file

@ -31,9 +31,54 @@ public class AlarmReceiver extends BroadcastReceiver {
NotificationManager notificationManager; NotificationManager notificationManager;
public static void scheduleAlarm(Context context) {
Calendar calendar = Calendar.getInstance();
Date today;
Date tomorrow;
LocalTime todayNow = LocalTime.now();
if (BuildConfig.DEBUG) {
Date nextSchedule = calendar.getTime();
calendar.setTimeInMillis(nextSchedule.getTime());
} else {
calendar.set(Calendar.HOUR_OF_DAY, 11);
calendar.set(Calendar.MINUTE, 15);
today = calendar.getTime();
calendar.add(Calendar.DAY_OF_YEAR, 1);
tomorrow = calendar.getTime();
if (todayNow.isBefore(LocalTime.NOON)) {
calendar.setTimeInMillis(today.getTime());
} else {
calendar.setTimeInMillis(tomorrow.getTime());
}
}
PendingIntent alarmIntent;
Intent intent = new Intent(context, AlarmReceiver.class);
alarmIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
if (BuildConfig.DEBUG) {
alarmManager.setExact(AlarmManager.RTC_WAKEUP, (calendar.getTimeInMillis()), alarmIntent);
} else {
alarmManager.setExact(AlarmManager.RTC_WAKEUP, (calendar.getTimeInMillis()), alarmIntent);
}
Log.d(TAG, "Alarm scheduled for " + UtilDate.convertDate(calendar.getTimeInMillis()));
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;
}
@Override @Override
public void onReceive(Context context, Intent intent) public void onReceive(Context context, Intent intent) {
{
// Show the toast like in above screen shot // Show the toast like in above screen shot
Log.d(TAG, "onReceive"); Log.d(TAG, "onReceive");
@ -45,7 +90,9 @@ public class AlarmReceiver extends BroadcastReceiver {
scheduleAlarm(context); scheduleAlarm(context);
} }
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);
PrescriptionDatabase prescriptions = PrescriptionDatabase.getInstanceDatabase(context.getApplicationContext()); PrescriptionDatabase prescriptions = PrescriptionDatabase.getInstanceDatabase(context.getApplicationContext());
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO(); PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
@ -53,7 +100,7 @@ public class AlarmReceiver extends BroadcastReceiver {
Prescription firstPrescription = null; Prescription firstPrescription = null;
Prescription currentPrescription; Prescription currentPrescription;
for (int i=0 ; i < prescriptionList.size(); i++ ) { for (int i = 0; i < prescriptionList.size(); i++) {
currentPrescription = prescriptionList.get(i); currentPrescription = prescriptionList.get(i);
currentPrescription.newStock(); currentPrescription.newStock();
prescriptionsDAO.update(currentPrescription); prescriptionsDAO.update(currentPrescription);
@ -63,15 +110,14 @@ public class AlarmReceiver extends BroadcastReceiver {
Utils.sortPrescriptionList(prescriptionList); Utils.sortPrescriptionList(prescriptionList);
try { try {
firstPrescription = prescriptionList.get(0); firstPrescription = prescriptionList.get(0);
} } catch (Exception e) {
catch (Exception e){
Log.e(TAG, e.toString()); Log.e(TAG, e.toString());
e.printStackTrace(); e.printStackTrace();
} }
if (firstPrescription != null) { if (firstPrescription != null) {
if (firstPrescription.getTake() != 0) { if (firstPrescription.getTake() != 0) {
if(firstPrescription.getStock() <= firstPrescription.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);
@ -92,8 +138,7 @@ public class AlarmReceiver extends BroadcastReceiver {
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
int notificationId = 666; int notificationId = 666;
notificationManager.notify(notificationId, builder.build()); notificationManager.notify(notificationId, builder.build());
} else } else {
{
double dummy = (firstPrescription.getStock() - firstPrescription.getAlertThreshold()); double dummy = (firstPrescription.getStock() - firstPrescription.getAlertThreshold());
Log.d(TAG, "no notification scheduled " + dummy); Log.d(TAG, "no notification scheduled " + dummy);
} }
@ -102,8 +147,8 @@ public class AlarmReceiver extends BroadcastReceiver {
} }
private void createNotificationChannel(Context context) { private void createNotificationChannel(Context context) {
Log.d(TAG, "start create notification channel"); Log.d(TAG, "start create notification channel");
CharSequence name = context.getString(R.string.channel_name); CharSequence name = context.getString(R.string.channel_name);
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;
@ -128,49 +173,4 @@ public class AlarmReceiver extends BroadcastReceiver {
e.printStackTrace(); e.printStackTrace();
} }
} }
public static void scheduleAlarm(Context context) {
Calendar calendar = Calendar.getInstance();
Date today;
Date tomorrow;
LocalTime todayNow = LocalTime.now();
/*if (BuildConfig.DEBUG) {
Date nextSchedule = calendar.getTime();
calendar.setTimeInMillis(nextSchedule.getTime());
} else {*/
calendar.set(Calendar.HOUR_OF_DAY, 11);
today = calendar.getTime();
calendar.add(Calendar.DAY_OF_YEAR, 1);
tomorrow = calendar.getTime();
if (todayNow.isBefore(LocalTime.NOON)) {
calendar.setTimeInMillis(today.getTime());
} else {
calendar.setTimeInMillis(tomorrow.getTime());
}
//}
PendingIntent alarmIntent;
Intent intent = new Intent(context, AlarmReceiver.class);
alarmIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
/*if (BuildConfig.DEBUG) {
alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP,(calendar.getTimeInMillis()),
AlarmManager.ELAPSED_REALTIME, alarmIntent);
} else {*/
alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, (calendar.getTimeInMillis()),
AlarmManager.INTERVAL_DAY, alarmIntent);
//}
Log.d(TAG, "Alarm scheduled for " + UtilDate.convertDate(calendar.getTimeInMillis()));
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;
}
} }

View file

@ -1,6 +1,5 @@
package net.foucry.pilldroid; package net.foucry.pilldroid;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Bundle; import android.os.Bundle;
@ -11,8 +10,7 @@ import android.widget.ImageButton;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.journeyapps.barcodescanner.BarcodeCallback; import androidx.appcompat.app.AppCompatActivity;
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;
@ -20,17 +18,15 @@ import com.journeyapps.barcodescanner.ViewfinderView;
/** /**
* 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 DecoratedBarcodeView.TorchListener { public class CustomScannerActivity extends AppCompatActivity implements DecoratedBarcodeView.TorchListener {
private static final String TAG = CustomScannerActivity.class.getName(); private static final String TAG = CustomScannerActivity.class.getName();
final Bundle captureIntentBundle = new Bundle();
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);
@ -59,9 +55,7 @@ public class CustomScannerActivity extends Activity implements DecoratedBarcodeV
//changeMaskColor(null); //changeMaskColor(null);
changeLaserVisibility(true); changeLaserVisibility(true);
barcodeScannerView.decodeSingle(new BarcodeCallback() { barcodeScannerView.decodeSingle(result -> {
@Override
public void barcodeResult(BarcodeResult result) {
Intent scanResult = new Intent(); Intent scanResult = new Intent();
//Bundle scanResultBundle = new Bundle(); //Bundle scanResultBundle = new Bundle();
scanResult.putExtra("Barcode Content", result.getText()); scanResult.putExtra("Barcode Content", result.getText());
@ -71,7 +65,6 @@ public class CustomScannerActivity extends Activity implements DecoratedBarcodeV
CustomScannerActivity.this.setResult(RESULT_OK, scanResult); CustomScannerActivity.this.setResult(RESULT_OK, scanResult);
Log.d(TAG, "scanResult == " + scanResult); Log.d(TAG, "scanResult == " + scanResult);
finish(); finish();
}
}); });
} }
@ -93,6 +86,11 @@ public class CustomScannerActivity extends Activity implements DecoratedBarcodeV
capture.onDestroy(); capture.onDestroy();
} }
@Override
public void onBackPressed(){
onCancel(this.getCurrentFocus());
}
@Override @Override
protected void onSaveInstanceState(Bundle outState) { protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
@ -147,7 +145,7 @@ public class CustomScannerActivity extends Activity implements DecoratedBarcodeV
public void onKeyboard(View view) { public void onKeyboard(View view) {
Log.d(TAG, "onkeyboard"); Log.d(TAG, "onkeyboard");
Intent resultIntent = new Intent(); Intent resultIntent = new Intent();
resultIntent.putExtra("returnCode",3); resultIntent.putExtra("returnCode", 3);
CustomScannerActivity.this.setResult(RESULT_OK, resultIntent); CustomScannerActivity.this.setResult(RESULT_OK, resultIntent);
finish(); finish();
} }

View file

@ -22,9 +22,6 @@ class DBDrugs extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 1; private static final int DATABASE_VERSION = 1;
private static final String dbName = "drugs.db"; private static final String dbName = "drugs.db";
private final Context myContext;
private final SQLiteDatabase myDataBase = null;
private static final String TABLE_NAME = "drugs"; private static final String TABLE_NAME = "drugs";
private static final String DRUG_CIS = "cis"; private static final String DRUG_CIS = "cis";
private static final String DRUG_CIP13 = "cip13"; private static final String DRUG_CIP13 = "cip13";
@ -32,11 +29,10 @@ class DBDrugs extends SQLiteOpenHelper {
private static final String DRUG_ADMIN = "administration_mode"; private static final String DRUG_ADMIN = "administration_mode";
private static final String DRUG_NAME = "name"; private static final String DRUG_NAME = "name";
private static final String DRUG_PRES = "presentation"; private static final String DRUG_PRES = "presentation";
private static final String[] COLUMNS_NAMES = {DRUG_CIS, DRUG_CIP13, DRUG_CIP7, DRUG_ADMIN, DRUG_NAME, DRUG_PRES}; private static final String[] COLUMNS_NAMES = {DRUG_CIS, DRUG_CIP13, DRUG_CIP7, DRUG_ADMIN, DRUG_NAME, DRUG_PRES};
private static final String TAG = DBDrugs.class.getName(); private static final String TAG = DBDrugs.class.getName();
private final Context myContext;
private final SQLiteDatabase myDataBase = null;
DBDrugs(Context context) { DBDrugs(Context context) {
@ -44,12 +40,10 @@ class DBDrugs extends SQLiteOpenHelper {
this.myContext = context; this.myContext = context;
} }
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 e) {
catch (final Exception e){
return false; return false;
} }
return true; return true;
@ -169,19 +163,17 @@ class DBDrugs extends SQLiteOpenHelper {
String cip13 = null; String cip13 = null;
try { try {
Cursor c = this.getReadableDatabase().rawQuery("SELECT cip13 FROM "+ TABLE_NAME + " where cip7 = "+cip7, null); Cursor c = this.getReadableDatabase().rawQuery("SELECT cip13 FROM " + TABLE_NAME + " where cip7 = " + cip7, null);
Log.d(TAG, "Cursor == " + DatabaseUtils.dumpCursorToString(c)); Log.d(TAG, "Cursor == " + DatabaseUtils.dumpCursorToString(c));
c.moveToFirst(); c.moveToFirst();
if(c.getCount()>0) if (c.getCount() > 0) {
{
cip13 = c.getString(0); cip13 = c.getString(0);
} }
c.close(); c.close();
} catch(Exception e) } catch (Exception e) {
{
e.printStackTrace(); e.printStackTrace();
} }
return cip13; return cip13;

View file

@ -10,7 +10,6 @@ import android.text.format.DateUtils;
import android.util.Log; import android.util.Log;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.List; import java.util.List;
/** /**
@ -18,7 +17,6 @@ import java.util.List;
*/ */
class DBHelper extends SQLiteOpenHelper { class DBHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 1; private static final int DATABASE_VERSION = 1;
@ -36,13 +34,10 @@ class DBHelper extends SQLiteOpenHelper {
private static final String KEY_THRESHOLD_WARN = "warning"; private static final String KEY_THRESHOLD_WARN = "warning";
private static final String KEY_THRESHOLD_ALERT = "alert"; private static final String KEY_THRESHOLD_ALERT = "alert";
private static final String KEY_LAST_UPDATE = "last_update"; private static final String KEY_LAST_UPDATE = "last_update";
final List<Drug> drugs = new ArrayList<>();
private static final String TAG = DBHelper.class.getName(); private static final String TAG = DBHelper.class.getName();
private static final String[] COLUMNS = {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};
final List<Drug> drugs = new ArrayList<>();
DBHelper(Context context) { DBHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION); super(context, DATABASE_NAME, null, DATABASE_VERSION);
@ -88,6 +83,7 @@ class DBHelper extends SQLiteOpenHelper {
/** /**
* Split drug values into database record and record it to the DB * Split drug values into database record and record it to the DB
*
* @param drug the drug object to be saved * @param drug the drug object to be saved
*/ */
void addDrug(Drug drug) { void addDrug(Drug drug) {
@ -123,6 +119,7 @@ class DBHelper extends SQLiteOpenHelper {
/** /**
* return a drug from the DB with is id * return a drug from the DB with is id
*
* @param id of the drug we looking for (not used) * @param id of the drug we looking for (not used)
* @return return the found drug of null * @return return the found drug of null
*/ */
@ -134,7 +131,7 @@ class DBHelper extends SQLiteOpenHelper {
Cursor cursor = db.query(TABLE_DRUG, // Which table Cursor cursor = db.query(TABLE_DRUG, // Which table
COLUMNS, // 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
null, // having null, // having
null, // order by null, // order by
@ -161,7 +158,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); Log.d(TAG, "getDrug(" + id + ")" + drug);
assert cursor != null; assert cursor != null;
cursor.close(); cursor.close();
@ -172,7 +169,6 @@ class DBHelper extends SQLiteOpenHelper {
} }
/** /**
*
* @param cip13 drug id in French nomenclature * @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
*/ */
@ -218,7 +214,6 @@ class DBHelper extends SQLiteOpenHelper {
} }
/** /**
*
* @return a Sorted and updated by dateEndOfStock List of All drugs presents in database * @return a Sorted and updated by dateEndOfStock List of All drugs presents in database
*/ */
@ -262,43 +257,36 @@ class DBHelper extends SQLiteOpenHelper {
db.close(); db.close();
Drug currentDrug; Drug currentDrug;
for (int position = 0 ; position < getCount() ; position++ ) { for (int position = 0; position < getCount(); position++) {
currentDrug = getItem(position); currentDrug = getItem(position);
if (!DateUtils.isToday(currentDrug.getDateLastUpdate())) if (!DateUtils.isToday(currentDrug.getDateLastUpdate())) {
{
currentDrug.newStock(); currentDrug.newStock();
updateDrug(currentDrug); updateDrug(currentDrug);
} }
} }
Log.d(TAG, "Before sort == " + drugs); Log.d(TAG, "Before sort == " + drugs);
drugs.sort(new Comparator<Drug>() { drugs.sort((lhs, rhs) -> {
@Override
public int compare(Drug lhs, Drug rhs) {
if (lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock()) != 0) if (lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock()) != 0)
return lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock()); return lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock());
else else
return (int) (lhs.getStock() - rhs.getStock()); return (int) (lhs.getStock() - rhs.getStock());
}
}); });
Log.d(TAG, "After sort " + drugs); 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
int position = 0 ; int position = 0;
for ( int nbOps = 0; nbOps < getCount() ; nbOps ++ ) { for (int nbOps = 0; nbOps < getCount(); nbOps++) {
currentDrug = getItem(position); currentDrug = getItem(position);
double currentTake = currentDrug.getTake(); double currentTake = currentDrug.getTake();
if (currentTake == 0) if (currentTake == 0) {
{
drug = drugs.remove(position); drug = drugs.remove(position);
drugs.add(drug); drugs.add(drug);
} else } else {
{
position++; position++;
} }
} }
@ -306,7 +294,6 @@ class DBHelper extends SQLiteOpenHelper {
} }
/** /**
*
* @param drug object to be updated in DB * @param drug object to be updated in DB
*/ */
public void updateDrug(Drug drug) { public void updateDrug(Drug drug) {
@ -331,7 +318,7 @@ class DBHelper extends SQLiteOpenHelper {
values.put(KEY_THRESHOLD_ALERT, drug.getAlertThreshold()); values.put(KEY_THRESHOLD_ALERT, drug.getAlertThreshold());
values.put(KEY_LAST_UPDATE, drug.getDateLastUpdate()); values.put(KEY_LAST_UPDATE, drug.getDateLastUpdate());
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
@ -345,6 +332,7 @@ class DBHelper extends SQLiteOpenHelper {
/** /**
* Delete a drug object in database * Delete a drug object in database
*
* @param drug object to be delete in the DB * @param drug object to be delete in the DB
*/ */
public void deleteDrug(Drug drug) { public void deleteDrug(Drug drug) {
@ -353,18 +341,19 @@ class DBHelper extends SQLiteOpenHelper {
// Delete record // Delete record
db.delete(TABLE_DRUG, // table db.delete(TABLE_DRUG, // table
KEY_ID+ " = ?", // selections KEY_ID + " = ?", // selections
new String[] { String.valueOf(drug.getId()) } ); // selections args new String[]{String.valueOf(drug.getId())}); // selections args
// Close DB // Close DB
db.close(); db.close();
// log // log
Log.d(TAG, "delete drug "+ drug); Log.d(TAG, "delete drug " + drug);
} }
/** /**
* Get count of all drug present in database * Get count of all drug present in database
*
* @return number of drug in DB * @return number of drug in DB
*/ */
int getCount() { int getCount() {
@ -389,15 +378,13 @@ class DBHelper extends SQLiteOpenHelper {
boolean isDrugExist(String cip13) { boolean isDrugExist(String cip13) {
boolean value = false; boolean value = false;
try { try {
Cursor c = this.getReadableDatabase().rawQuery("SELECT * FROM "+ TABLE_DRUG + " where cip13 = "+cip13, null); Cursor c = this.getReadableDatabase().rawQuery("SELECT * FROM " + TABLE_DRUG + " where cip13 = " + cip13, null);
if(c.getCount()>0) if (c.getCount() > 0) {
{
value = true; value = true;
} }
c.close(); c.close();
} catch(Exception e) } catch (Exception e) {
{
e.printStackTrace(); e.printStackTrace();
} }
return value; return value;

View file

@ -1,5 +1,8 @@
package net.foucry.pilldroid; package net.foucry.pilldroid;
import static net.foucry.pilldroid.UtilDate.dateAtNoon;
import static net.foucry.pilldroid.UtilDate.nbOfDaysBetweenDateAndToday;
import android.util.Log; import android.util.Log;
import java.io.Serializable; import java.io.Serializable;
@ -7,9 +10,6 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.Objects; import java.util.Objects;
import static net.foucry.pilldroid.UtilDate.dateAtNoon;
import static net.foucry.pilldroid.UtilDate.nbOfDaysBetweenDateAndToday;
/** /**
* Created by jacques on 26/11/15. * Created by jacques on 26/11/15.
*/ */
@ -56,86 +56,68 @@ public class Drug implements Serializable {
return id; return id;
} }
String getName() {
return name;
}
String getCip13() {
return cip13;
}
String getCis() {
return cis;
}
String getAdministration_mode() {
return administration_mode;
}
String getPresentation() {
return presentation;
}
double getStock() {
return stock;
}
double getTake() {
return take;
}
int getAlertThreshold() {
return alertThreshold;
}
int getWarnThreshold() {
return warnThreshold;
}
long getDateLastUpdate() {
return dateLastUpdate;
}
Date getDateEndOfStock() {
return dateEndOfStock;
}
public void setId(int id) { public void setId(int id) {
this.id = id; this.id = id;
} }
String getName() {
return name;
}
void setName(String name) { void setName(String name) {
this.name = name; this.name = name;
} }
String getCip13() {
return cip13;
}
void setCip13(String cip13) { void setCip13(String cip13) {
this.cip13 = cip13; this.cip13 = cip13;
} }
String getCis() {
return cis;
}
void setCis(String cis) { void setCis(String cis) {
this.cis = cis; this.cis = cis;
} }
String getAdministration_mode() {
return administration_mode;
}
void setAdministration_mode(String administration_mode) { void setAdministration_mode(String administration_mode) {
this.administration_mode = administration_mode; this.administration_mode = administration_mode;
} }
String getPresentation() {
return presentation;
}
void setPresentation(String presentation) { void setPresentation(String presentation) {
this.presentation = presentation; this.presentation = presentation;
} }
double getStock() {
return stock;
}
void setStock(double stock) { void setStock(double stock) {
this.stock = stock; this.stock = stock;
} }
double getTake() {
return take;
}
void setTake(double take) { void setTake(double take) {
this.take = take; this.take = take;
} }
void setWarnThreshold(int warn) { int getAlertThreshold() {
if (warn == 0) return alertThreshold;
warn = 14;
this.warnThreshold = warn;
} }
void setAlertThreshold(int alert) { void setAlertThreshold(int alert) {
@ -144,10 +126,28 @@ public class Drug implements Serializable {
this.alertThreshold = alert; this.alertThreshold = alert;
} }
int getWarnThreshold() {
return warnThreshold;
}
void setWarnThreshold(int warn) {
if (warn == 0)
warn = 14;
this.warnThreshold = warn;
}
long getDateLastUpdate() {
return dateLastUpdate;
}
void setDateLastUpdate(long l) { void setDateLastUpdate(long l) {
this.dateLastUpdate = l; this.dateLastUpdate = l;
} }
Date getDateEndOfStock() {
return dateEndOfStock;
}
void setDateEndOfStock() { void setDateEndOfStock() {
int numberDayOfTake; int numberDayOfTake;
if (this.take > 0) { if (this.take > 0) {
@ -176,6 +176,7 @@ public class Drug implements Serializable {
setDateLastUpdate(new Date().getTime()); setDateLastUpdate(new Date().getTime());
} }
} }
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;

View file

@ -1,20 +1,17 @@
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;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.TextView; import android.widget.TextView;
import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar; import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton;
import net.foucry.pilldroid.dao.PrescriptionsDAO; import net.foucry.pilldroid.dao.PrescriptionsDAO;
import net.foucry.pilldroid.databases.PrescriptionDatabase; import net.foucry.pilldroid.databases.PrescriptionDatabase;
import net.foucry.pilldroid.models.Prescription; import net.foucry.pilldroid.models.Prescription;
@ -43,23 +40,20 @@ public class DrugDetailActivity extends AppCompatActivity {
Log.d(TAG, "aPrescription == " + aPrescription); Log.d(TAG, "aPrescription == " + aPrescription);
setContentView(R.layout.drug_detail_activity); setContentView(R.layout.drug_detail_activity);
Toolbar toolbar = findViewById(detail_toolbar); MaterialToolbar toolbar = findViewById(R.id.toolbar);
if (toolbar != null) { if (toolbar != null) {
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
} }
ImageButton fab = findViewById(R.id.fab); ExtendedFloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() { fab.setOnClickListener(v -> {
@Override
public void onClick(View view) {
Log.d(TAG, "Click on save icon"); Log.d(TAG, "Click on save icon");
getDrugChanges(); 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);
}
}); });
// Show the Up button in the action bar. // Show the Up button in the action bar.
@ -129,13 +123,14 @@ public class DrugDetailActivity extends AppCompatActivity {
String takeValue = takeTextView.getText().toString(); String takeValue = takeTextView.getText().toString();
alertView = findViewById(R.id.alert_cell); alertView = findViewById(R.id.alert_cell);
alertView.setContentDescription("R.string.Drug_warningThreshold_label");
TextView alertTextView = alertView.findViewById(R.id.value); TextView alertTextView = alertView.findViewById(R.id.value);
String alertValue = alertTextView.getText().toString(); String alertValue = alertTextView.getText().toString();
warningView = findViewById(R.id.warning_cell); warningView = findViewById(R.id.warning_cell);
warningView.setContentDescription("R.string.drug_alertThreshold_label");
TextView warningTextView = warningView.findViewById(R.id.value); TextView warningTextView = warningView.findViewById(R.id.value);
String warningValue = warningTextView.getText().toString(); String warningValue = warningTextView.getText().toString();
newPrescription.setStock(Float.parseFloat(stockValue)); newPrescription.setStock(Float.parseFloat(stockValue));
newPrescription.setTake(Float.parseFloat(takeValue)); newPrescription.setTake(Float.parseFloat(takeValue));
newPrescription.setWarning(Integer.parseInt(warningValue)); newPrescription.setWarning(Integer.parseInt(warningValue));

View file

@ -26,6 +26,7 @@ public class DrugDetailContract extends ActivityResultContract<Intent, Integer>
/** /**
* Convert result obtained from to O * Convert result obtained from to O
*
* @param resultCode Integer * @param resultCode Integer
* @param intent Intent * @param intent Intent
* @return Integer * @return Integer

View file

@ -5,12 +5,11 @@ 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.widget.TextView;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.appbar.CollapsingToolbarLayout; import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textview.MaterialTextView;
import net.foucry.pilldroid.models.Prescription; import net.foucry.pilldroid.models.Prescription;
/** /**
@ -52,7 +51,7 @@ public class DrugDetailFragment extends Fragment {
Activity activity = this.getActivity(); Activity activity = this.getActivity();
assert activity != null; assert activity != null;
CollapsingToolbarLayout appBarLayout = activity.findViewById(R.id.toolbar_layout); MaterialToolbar appBarLayout = activity.findViewById(R.id.toolbar);
if (appBarLayout != null) { if (appBarLayout != null) {
appBarLayout.setTitle(prescription.getName()); appBarLayout.setTitle(prescription.getName());
} }
@ -74,34 +73,34 @@ public class DrugDetailFragment extends Fragment {
if (prescription != 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); MaterialTextView nameLabel = nameView.findViewById(R.id.label);
TextView nameValue = nameView.findViewById(R.id.value); MaterialTextView nameValue = nameView.findViewById(R.id.value);
nameLabel.setText(R.string.drug_name_label); nameLabel.setText(R.string.drug_name_label);
nameValue.setText(prescription.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); MaterialTextView presentationLabel = presentationView.findViewById(R.id.label);
TextView presentationValue = presentationView.findViewById(R.id.value); MaterialTextView presentationValue = presentationView.findViewById(R.id.value);
presentationLabel.setText(R.string.drug_presentation_label); presentationLabel.setText(R.string.drug_presentation_label);
presentationValue.setText(prescription.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); MaterialTextView adminModeLabel = adminModeView.findViewById(R.id.label);
TextView adminModeValue = adminModeView.findViewById(R.id.value); MaterialTextView adminModeValue = adminModeView.findViewById(R.id.value);
adminModeLabel.setText(R.string.drug_administrationMode_label); adminModeLabel.setText(R.string.drug_administrationMode_label);
adminModeValue.setText(prescription.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)); MaterialTextView stockLibelle = (stockView.findViewById(R.id.label));
TextView stockValue = stockView.findViewById(R.id.value); TextInputEditText stockValue = stockView.findViewById(R.id.value);
stockLibelle.setText(R.string.drug_current_stock_label); stockLibelle.setText(R.string.drug_current_stock_label);
stockValue.setText(Utils.fmt(prescription.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 takeLabel = takeView.findViewById(R.id.label); MaterialTextView takeLabel = takeView.findViewById(R.id.label);
TextView takeValue = (takeView.findViewById(R.id.value)); TextInputEditText takeValue = (takeView.findViewById(R.id.value));
takeLabel.setText(R.string.drug_take_label); takeLabel.setText(R.string.drug_take_label);
//takeValue.setText(Double.toString(prescription.getTake())); //takeValue.setText(Double.toString(prescription.getTake()));
takeValue.setText(Utils.fmt(prescription.getTake())); takeValue.setText(Utils.fmt(prescription.getTake()));
@ -109,8 +108,8 @@ public class DrugDetailFragment extends Fragment {
takeValue.setSelectAllOnFocus(true); takeValue.setSelectAllOnFocus(true);
warningView = detailView.findViewById(R.id.warning_cell); warningView = detailView.findViewById(R.id.warning_cell);
TextView warningLibelle = warningView.findViewById(R.id.label); MaterialTextView warningLibelle = warningView.findViewById(R.id.label);
TextView warningValue = warningView.findViewById(R.id.value); TextInputEditText warningValue = warningView.findViewById(R.id.value);
warningLibelle.setText(R.string.drug_warningThreshold_label); warningLibelle.setText(R.string.drug_warningThreshold_label);
//warningValue.setText(Integer.toString(prescription.getWarnThreshold())); //warningValue.setText(Integer.toString(prescription.getWarnThreshold()));
warningValue.setText(Utils.fmt(prescription.getWarning())); warningValue.setText(Utils.fmt(prescription.getWarning()));
@ -118,8 +117,8 @@ public class DrugDetailFragment extends Fragment {
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); MaterialTextView alertLibelle = alertView.findViewById(R.id.label);
TextView alertValue = alertView.findViewById(R.id.value); TextInputEditText alertValue = alertView.findViewById(R.id.value);
alertLibelle.setText(R.string.drug_alertThreshold_label); alertLibelle.setText(R.string.drug_alertThreshold_label);
//alertValue.setText(Integer.toString(prescription.getAlertThreshold())); //alertValue.setText(Integer.toString(prescription.getAlertThreshold()));
alertValue.setText(Utils.fmt(prescription.getAlert())); alertValue.setText(Utils.fmt(prescription.getAlert()));

View file

@ -4,13 +4,16 @@ import static net.foucry.pilldroid.UtilDate.date2String;
import static net.foucry.pilldroid.Utils.intRandomExclusive; import static net.foucry.pilldroid.Utils.intRandomExclusive;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Dialog;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -23,22 +26,26 @@ import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.Window;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import androidx.activity.result.ActivityResultLauncher; import androidx.activity.result.ActivityResultLauncher;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.room.Room; import androidx.room.Room;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textview.MaterialTextView;
import com.google.zxing.client.android.BuildConfig;
import com.google.zxing.client.android.Intents; import com.google.zxing.client.android.Intents;
import com.journeyapps.barcodescanner.ScanOptions; import com.journeyapps.barcodescanner.ScanOptions;
@ -53,8 +60,7 @@ 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 java.util.Objects;
import com.google.zxing.client.android.BuildConfig;
/** /**
* An activity representing a list of Drugs is activity * An activity representing a list of Drugs is activity
@ -65,19 +71,15 @@ import com.google.zxing.client.android.BuildConfig;
* 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 private static final String TAG = DrugListActivity.class.getName();
final Boolean DEMO = 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_FORMAT_NAME = "Barcode Format name";
public final String BARCODE_CONTENT = "Barcode Content"; public final String BARCODE_CONTENT = "Barcode Content";
// Used for dev and debug
private ActivityResultLauncher<ScanOptions> mBarcodeScannerLauncher; final Boolean DEMO = false;
private static final String TAG = DrugListActivity.class.getName();
public PrescriptionDatabase prescriptions; public PrescriptionDatabase prescriptions;
public MedicineDatabase medicines; public MedicineDatabase medicines;
private ActivityResultLauncher<ScanOptions> mBarcodeScannerLauncher;
private List<Prescription> prescriptionList; // used for prescriptions private List<Prescription> prescriptionList; // used for prescriptions
private RecyclerViewAdapter mAdapter; private RecyclerViewAdapter mAdapter;
@ -86,7 +88,7 @@ public class DrugListActivity extends AppCompatActivity {
public void onStart() { public void onStart() {
super.onStart(); super.onStart();
if(BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
String manufacturer = Build.MANUFACTURER; String manufacturer = Build.MANUFACTURER;
String model = Build.MODEL; String model = Build.MODEL;
int version = Build.VERSION.SDK_INT; int version = Build.VERSION.SDK_INT;
@ -108,13 +110,13 @@ public class DrugListActivity extends AppCompatActivity {
// Manually migrate old database to room // Manually migrate old database to room
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO(); PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
DBHelper dbHelper = new DBHelper(this); DBHelper dbHelper = new DBHelper(this);
if (dbHelper.getCount() !=0) { if (dbHelper.getCount() != 0) {
List<Drug> drugs=dbHelper.getAllDrugs(); List<Drug> drugs = dbHelper.getAllDrugs();
for (int count=0; count < dbHelper.getCount(); count++) { for (int count = 0; count < dbHelper.getCount(); count++) {
Drug drug = drugs.get(count); Drug drug = drugs.get(count);
Prescription prescription = new Prescription(); Prescription prescription = new Prescription();
if(prescriptionsDAO.getMedicByCIP13(drug.getCip13()) == null) { if (prescriptionsDAO.getMedicByCIP13(drug.getCip13()) == null) {
prescription.setName(drug.getName()); prescription.setName(drug.getName());
prescription.setCip13(drug.getCip13()); prescription.setCip13(drug.getCip13());
prescription.setCis(drug.getCis()); prescription.setCis(drug.getCis());
@ -127,8 +129,7 @@ public class DrugListActivity extends AppCompatActivity {
prescription.setLast_update(drug.getDateLastUpdate()); prescription.setLast_update(drug.getDateLastUpdate());
prescriptionsDAO.insert(prescription); prescriptionsDAO.insert(prescription);
} } else {
else {
Log.i(TAG, "Already in the database"); Log.i(TAG, "Already in the database");
} }
} }
@ -146,14 +147,6 @@ public class DrugListActivity extends AppCompatActivity {
Log.i(TAG, "Launch tutorial"); Log.i(TAG, "Launch tutorial");
startActivity(new Intent(this, WelcomeActivity.class)); startActivity(new Intent(this, WelcomeActivity.class));
// } // }
PrefManager prefManager = new PrefManager(this);
if (!prefManager.isUnderstood()) {
askForComprehensive();
prefManager.setUnderstood(true);
}
} }
@Override @Override
@ -165,11 +158,12 @@ public class DrugListActivity extends AppCompatActivity {
super.onPause(); super.onPause();
Log.d(TAG, "onPause"); Log.d(TAG, "onPause");
if (!AlarmReceiver.isAlarmScheduled(this)){ if (!AlarmReceiver.isAlarmScheduled(this)) {
AlarmReceiver.scheduleAlarm(this); AlarmReceiver.scheduleAlarm(this);
} }
} }
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -184,12 +178,14 @@ public class DrugListActivity extends AppCompatActivity {
// Set view content // Set view content
setContentView(R.layout.drug_list_activity); setContentView(R.layout.drug_list_activity);
Toolbar toolbar = findViewById(R.id.toolbar); MaterialToolbar toolbar = findViewById(R.id.toolbar);
if (toolbar != null) { if (toolbar != null) {
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
toolbar.setTitle(getTitle()); toolbar.setTitle(getTitle());
} }
FloatingActionButton mFloatingActionButton = findViewById(R.id.fab);
mFloatingActionButton.setOnClickListener(v-> onButtonClick());
if (DEMO) { if (DEMO) {
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO(); PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
@ -230,6 +226,7 @@ public class DrugListActivity extends AppCompatActivity {
Log.d(TAG, "Missing camera permission"); Log.d(TAG, "Missing camera permission");
Toast.makeText(this, R.string.missing_camera_permission, Toast.LENGTH_LONG).show(); Toast.makeText(this, R.string.missing_camera_permission, Toast.LENGTH_LONG).show();
} else { } else {
assert bundle != null;
Log.d(TAG, "bundle == " + bundle.getInt("returnCode")); Log.d(TAG, "bundle == " + bundle.getInt("returnCode"));
int returnCode = bundle.getInt("returnCode"); int returnCode = bundle.getInt("returnCode");
int resultCode = bundle.getInt("resultCode"); int resultCode = bundle.getInt("resultCode");
@ -253,13 +250,13 @@ public class DrugListActivity extends AppCompatActivity {
} }
String cip13; String cip13;
switch (bundle.getString(BARCODE_FORMAT_NAME)) { switch (Objects.requireNonNull(bundle.getString(BARCODE_FORMAT_NAME))) {
case "CODE_128": case "CODE_128":
case "EAN_13": //CODE_128 || EAN 13 case "EAN_13": //CODE_128 || EAN 13
cip13 = bundle.getString(BARCODE_CONTENT); cip13 = bundle.getString(BARCODE_CONTENT);
break; break;
case "DATA_MATRIX": case "DATA_MATRIX":
cip13 = bundle.getString(BARCODE_CONTENT).substring(4, 17); cip13 = Objects.requireNonNull(bundle.getString(BARCODE_CONTENT)).substring(4, 17);
break; break;
default: default:
scanNotOK(); scanNotOK();
@ -323,7 +320,7 @@ public class DrugListActivity extends AppCompatActivity {
} }
// Launch scan // Launch scan
public void onButtonClick(View v) { public void onButtonClick() {
Log.d(TAG, "add medication"); Log.d(TAG, "add medication");
ScanOptions options = new ScanOptions(); ScanOptions options = new ScanOptions();
options.setDesiredBarcodeFormats(ScanOptions.DATA_MATRIX, ScanOptions.CODE_128); options.setDesiredBarcodeFormats(ScanOptions.DATA_MATRIX, ScanOptions.CODE_128);
@ -332,7 +329,6 @@ public class DrugListActivity extends AppCompatActivity {
options.setBarcodeImageEnabled(true); options.setBarcodeImageEnabled(true);
options.setTimeout(60); options.setTimeout(60);
options.setCaptureActivity(CustomScannerActivity.class); 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.MIXED_SCAN);
options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.INVERTED_SCAN); options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.INVERTED_SCAN);
@ -344,42 +340,62 @@ public class DrugListActivity extends AppCompatActivity {
* show keyboardInput dialog * show keyboardInput dialog
*/ */
protected void showInputDialog() { protected void showInputDialog() {
// get prompts.xml view final Dialog dialog = new Dialog(this);
LayoutInflater layoutInflater = LayoutInflater.from(DrugListActivity.this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
View promptView = layoutInflater.inflate(R.layout.input_dialog, null); Objects.requireNonNull(dialog.getWindow()).setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(DrugListActivity.this);
alertDialogBuilder.setView(promptView);
final EditText editText = promptView.findViewById(R.id.edittext); dialog.setCancelable(true);
// setup a dialog window dialog.setCanceledOnTouchOutside(true);
dialog.setContentView(R.layout.input_dialog);
alertDialogBuilder.setCancelable(false) MaterialButton ok = dialog.findViewById(R.id.agreed);
.setPositiveButton("OK", (dialog, id) -> { MaterialButton cancel = dialog.findViewById(R.id.notagreed);
//String cip13 = editText.getText().toString(); ok.setEnabled(false);
String cip13 = "34009" + editText.getText().toString(); ok.setBackground(Objects.requireNonNull(ContextCompat.getDrawable(this, R.drawable.rounded_btn_disabled)));
MedicinesDAO medicineDAO = medicines.getMedicinesDAO(); MaterialTextView title = dialog.findViewById(R.id.title);
Medicine aMedicine = medicineDAO.getMedicineByCIP13(cip13); final EditText editText = dialog.findViewById(R.id.editcip13);
askToAddInDB(aMedicine); String cip13 = String.valueOf(editText.getText());
})
.setNegativeButton("Cancel",
(dialog, id) -> dialog.cancel());
// create an alert dialog // TODO change the color of ok button when the number of character is correct.
AlertDialog alert = alertDialogBuilder.create();
ok.setText(R.string.button_ok);
cancel.setText(R.string.button_cancel);
editText.addTextChangedListener(new TextWatcher() { editText.addTextChangedListener(new TextWatcher() {
@Override @Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override @Override
public void onTextChanged(CharSequence s, int start, int before, int count) { } public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override @Override
public void afterTextChanged(Editable s) { public void afterTextChanged(Editable s) {
alert.getButton(alert.BUTTON_POSITIVE).setEnabled(s.length() == 8); //alert.getButton(alert.BUTTON_POSITIVE).setEnabled(s.length() == 8);
if (s.length() == 8) {
ok.setEnabled(true);
ok.setBackground(Objects.requireNonNull(ContextCompat.getDrawable(editText.getContext(), R.drawable.rounded_btn)));
}
else {
ok.setEnabled(false);
ok.setBackground(Objects.requireNonNull(ContextCompat.getDrawable(editText.getContext(), R.drawable.rounded_btn_disabled)));
}
} }
}); });
alert.show(); ok.setOnClickListener(v -> {
dialog.cancel();
Log.i("EditText Value",editText.getEditableText().toString());
MedicinesDAO medicinesDAO = medicines.getMedicinesDAO();
Medicine aMedicine = medicinesDAO.getMedicineByCIP13(cip13);
askToAddInDB(aMedicine);
});
cancel.setOnClickListener(v -> {
dialog.cancel();
Log.i(TAG, "dismiss dialog");
});
dialog.show();
} }
/** /**
@ -389,24 +405,40 @@ public class DrugListActivity extends AppCompatActivity {
* @param aMedicine Prescription- medication to be added * @param aMedicine Prescription- medication to be added
*/ */
private void askToAddInDB(Medicine aMedicine) { private void askToAddInDB(Medicine aMedicine) {
AlertDialog.Builder dlg = new AlertDialog.Builder(this); final Dialog dlg = new Dialog(this);
dlg.setTitle(getString(R.string.app_name)); dlg.requestWindowFeature(Window.FEATURE_NO_TITLE);
Objects.requireNonNull(dlg.getWindow()).setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dlg.setContentView(R.layout.custom_dialog_layout_one_button);
dlg.setCancelable(true);
MaterialTextView msg = dlg.findViewById(R.id.msg);
String msgString;
MaterialTextView cpl = dlg.findViewById(R.id.cpl);
ShapeableImageView icon = dlg.findViewById(R.id.image);
MaterialButton btn = dlg.findViewById(R.id.txtClose);
dlg.show();
if (aMedicine != null) { if (aMedicine != null) {
String msg = aMedicine.getName() + " " + getString(R.string.msgFound); msgString = aMedicine.getName() + " " + getString(R.string.msgFound);
msg.setText(msgString);
dlg.setMessage(msg); cpl.setText(getString(R.string.addInList));
dlg.setNegativeButton(getString(R.string.button_cancel), (dialog, which) -> { icon.setImageResource(R.drawable.tickmark);
// Nothing to do in case of cancel btn.setText(getString(R.string.Yes));
}); btn.setOnClickListener(v -> {
dlg.setPositiveButton(getString(R.string.button_ok), (dialog, which) -> { // TODO Auto-generated method stub
// Add Drug to DB then try to show it dlg.dismiss();
finish();
addDrugToList(Utils.medicine2prescription(aMedicine)); addDrugToList(Utils.medicine2prescription(aMedicine));
}); });
} else { } else {
dlg.setMessage(getString(R.string.msgNotFound)); msgString = getString(R.string.msgNotFound);
dlg.setPositiveButton("OK", (dialog, which) -> { msg.setText(msgString);
// nothing to do to just dismiss dialog cpl.setText("");
icon.setImageResource(R.drawable.tickcross);
btn.setText(getString(R.string.button_close));
btn.setOnClickListener(v -> {
// TODO Auto-generated method stub
dlg.dismiss();
finish();
}); });
} }
dlg.show(); dlg.show();
@ -416,7 +448,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); MaterialAlertDialogBuilder dlg = new MaterialAlertDialogBuilder(this);
dlg.setTitle(getString(R.string.app_name)); dlg.setTitle(getString(R.string.app_name));
dlg.setMessage(R.string.notInterpreted); dlg.setMessage(R.string.notInterpreted);
@ -426,20 +458,6 @@ public class DrugListActivity extends AppCompatActivity {
dlg.show(); dlg.show();
} }
/**
* askForCompréhensive
*/
private void askForComprehensive() {
AlertDialog.Builder dlg = new AlertDialog.Builder(this);
dlg.setTitle(getString(R.string.app_name));
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 * Add New drug to the user database
@ -460,6 +478,7 @@ public class DrugListActivity extends AppCompatActivity {
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)
* *
@ -470,7 +489,7 @@ public class DrugListActivity extends AppCompatActivity {
mAdapter = new RecyclerViewAdapter(prescriptionList); mAdapter = new RecyclerViewAdapter(prescriptionList);
recyclerView.setAdapter(mAdapter); recyclerView.setAdapter(mAdapter);
new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, (ItemTouchHelper.RIGHT|ItemTouchHelper.LEFT)) { new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, (ItemTouchHelper.RIGHT | ItemTouchHelper.LEFT)) {
@Override @Override
public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) { public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) {
return false; return false;
@ -497,13 +516,11 @@ public class DrugListActivity extends AppCompatActivity {
} }
Snackbar.make(recyclerView, prescription.getName(), Snackbar.make(recyclerView, prescription.getName(),
Snackbar.LENGTH_LONG).setAction(R.string.Undo, new View.OnClickListener() { Snackbar.LENGTH_LONG).setAction(R.string.Undo, v -> {
@Override
public void onClick(View v) {
prescriptionList.add(position, prescription); prescriptionList.add(position, prescription);
mAdapter.notifyItemInserted(position); mAdapter.notifyItemInserted(position);
} }).setActionTextColor(getResources().getColor(R.color.bg_screen1))
}).show(); .show();
} }
@Override @Override
@ -561,6 +578,16 @@ 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) : "???");
}
/** /**
* SimpleItemRecyclerViewAdapter * SimpleItemRecyclerViewAdapter
*/ */
@ -620,9 +647,7 @@ public class DrugListActivity extends AppCompatActivity {
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() { holder.mView.setOnClickListener(v -> {
@Override
public void onClick(View v) {
Prescription aPrescription = mValues.get(position); Prescription aPrescription = mValues.get(position);
Context context = v.getContext(); Context context = v.getContext();
Intent intent = new Intent(context, DrugDetailActivity.class); Intent intent = new Intent(context, DrugDetailActivity.class);
@ -630,7 +655,6 @@ public class DrugListActivity extends AppCompatActivity {
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);
}
}); });
} 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());
@ -646,16 +670,13 @@ public class DrugListActivity extends AppCompatActivity {
holder.mIconView.setImageResource(R.drawable.ok_stock_vect); holder.mIconView.setImageResource(R.drawable.ok_stock_vect);
} }
holder.mView.setOnClickListener(new View.OnClickListener() { holder.mView.setOnClickListener(v -> {
@Override
public void onClick(View v) {
Prescription prescription = mValues.get(position); Prescription prescription = mValues.get(position);
Context context = v.getContext(); Context context = v.getContext();
Intent intent = new Intent(context, DrugDetailActivity.class); Intent intent = new Intent(context, DrugDetailActivity.class);
intent.putExtra("prescription", prescription); intent.putExtra("prescription", prescription);
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);
}
}); });
} }
} }
@ -667,9 +688,9 @@ public class DrugListActivity extends AppCompatActivity {
class ViewHolder extends RecyclerView.ViewHolder { class ViewHolder extends RecyclerView.ViewHolder {
final View mView; final View mView;
final TextView mContentView; final MaterialTextView mContentView;
final TextView mEndOfStock; final MaterialTextView mEndOfStock;
final ImageView mIconView; final ShapeableImageView mIconView;
public Prescription mItem; public Prescription mItem;
ViewHolder(View view) { ViewHolder(View view) {
@ -687,14 +708,4 @@ 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) : "???");
}
} }

View file

@ -13,8 +13,9 @@ import com.journeyapps.barcodescanner.ScanIntentResult;
import com.journeyapps.barcodescanner.ScanOptions; import com.journeyapps.barcodescanner.ScanOptions;
public class PilldroidScanContract extends ActivityResultContract<ScanOptions, ScanIntentResult>{ public class PilldroidScanContract extends ActivityResultContract<ScanOptions, ScanIntentResult> {
private static final String TAG = PilldroidScanContract.class.getName(); private static final String TAG = PilldroidScanContract.class.getName();
@NonNull @NonNull
@Override @Override
public Intent createIntent(@NonNull Context context, ScanOptions input) { public Intent createIntent(@NonNull Context context, ScanOptions input) {
@ -25,7 +26,7 @@ public class PilldroidScanContract extends ActivityResultContract<ScanOptions, S
intent.setAction(Intents.Scan.ACTION); intent.setAction(Intents.Scan.ACTION);
Log.d(TAG, "intent ==" + intent); Log.d(TAG, "intent ==" + intent);
return(intent); return (intent);
} }
@Override @Override

View file

@ -4,49 +4,51 @@ package net.foucry.pilldroid;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
/** /**
* Created by Lincoln on 05/05/16. * Created by Lincoln on 05/05/16.
*/ */
public class PrefManager { public class PrefManager {
final SharedPreferences pref;
SharedPreferences.Editor editor;
// shared pref mode
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"; private static final String IS_UNDERSTOOD = "IsUnderStood";
final SharedPreferences pref;
// shared pref mode
final int PRIVATE_MODE = 0;
SharedPreferences.Editor editor;
public PrefManager(Context context) { public PrefManager(Context context) {
pref = context.getSharedPreferences(PREF_NAME, PRIVATE_MODE); pref = context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
} }
public boolean isFirstTimeLaunch() {
return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
}
public void setFirstTimeLaunch(boolean isFirstTime) { public void setFirstTimeLaunch(boolean isFirstTime) {
editor = pref.edit(); editor = pref.edit();
editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime); editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime);
editor.apply(); editor.apply();
} }
public int getDatabaseVersion() {
return pref.getInt(DATABASE_VERSION, 0);
}
public void setDatabaseVersion(int version) { public void setDatabaseVersion(int version) {
editor = pref.edit(); editor = pref.edit();
editor.putInt(DATABASE_VERSION, version); editor.putInt(DATABASE_VERSION, version);
editor.apply(); editor.apply();
} }
public boolean isUnderstood() {
return pref.getBoolean(IS_UNDERSTOOD, false);
}
public void setUnderstood(boolean isUnderstood) { public void setUnderstood(boolean isUnderstood) {
editor = pref.edit(); editor = pref.edit();
editor.putBoolean(IS_UNDERSTOOD, isUnderstood); editor.putBoolean(IS_UNDERSTOOD, isUnderstood);
editor.apply(); editor.apply();
} }
}
public boolean isFirstTimeLaunch() {
return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
}
public int getDatabaseVersion() {
return pref.getInt(DATABASE_VERSION, 0);
}
public boolean isUnderstood() {return pref.getBoolean(IS_UNDERSTOOD, false); }
}

View file

@ -86,11 +86,12 @@ public class UtilDate {
Date oldDate = dateAtNoon(date); // Be sure that the old date is at Noon Date oldDate = dateAtNoon(date); // Be sure that the old date is at Noon
Date todayDate = dateAtNoon(new Date()); // Be sure that we use today at Noon Date todayDate = dateAtNoon(new Date()); // Be sure that we use today at Noon
return (int) (todayDate.getTime() - oldDate.getTime())/(86400*1000); return (int) (todayDate.getTime() - oldDate.getTime()) / (86400 * 1000);
} }
/** /**
* Convert dateInMilliseconds into string formatted date * Convert dateInMilliseconds into string formatted date
*
* @param dateInMilliseconds long * @param dateInMilliseconds long
* @return formatted Date String * @return formatted Date String
*/ */

View file

@ -3,7 +3,6 @@ package net.foucry.pilldroid;
import net.foucry.pilldroid.models.Medicine; import net.foucry.pilldroid.models.Medicine;
import net.foucry.pilldroid.models.Prescription; import net.foucry.pilldroid.models.Prescription;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
@ -14,21 +13,21 @@ public class Utils {
/** /**
* Return a random number between two values - use to generate 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
*/ */
static int intRandomExclusive(int min, int max) { static int intRandomExclusive(int min, int max) {
Random r = new Random(); Random r = new Random();
return r.nextInt(max - min) +max; return r.nextInt(max - min) + max;
} }
public static String fmt(double d) public static String fmt(double d) {
{ if (d == (long) d)
if(d == (long) d) return String.format(Locale.getDefault(), "%d", (long) d);
return String.format(Locale.getDefault(),"%d",(long)d);
else else
return String.format("%s",d); return String.format("%s", d);
} }
public static Prescription medicine2prescription(Medicine aMedicine) { public static Prescription medicine2prescription(Medicine aMedicine) {
@ -49,14 +48,11 @@ public class Utils {
} }
public static void sortPrescriptionList(List<Prescription> prescriptionList) { public static void sortPrescriptionList(List<Prescription> prescriptionList) {
prescriptionList.sort(new Comparator<>() { prescriptionList.sort((lhs, rhs) -> {
@Override
public int compare(Prescription lhs, Prescription rhs) {
if (lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock()) != 0) if (lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock()) != 0)
return lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock()); return lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock());
else else
return (int) (lhs.getStock() - rhs.getStock()); return (int) (lhs.getStock() - rhs.getStock());
}
}); });
} }

View file

@ -1,7 +1,9 @@
package net.foucry.pilldroid; package net.foucry.pilldroid;
import android.app.Dialog;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -11,22 +13,52 @@ import android.view.Window;
import android.view.WindowInsets; import android.view.WindowInsets;
import android.view.WindowInsetsController; import android.view.WindowInsetsController;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull; 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;
import androidx.viewpager.widget.ViewPager; import androidx.viewpager.widget.ViewPager;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.textview.MaterialTextView;
public class WelcomeActivity extends AppCompatActivity { public class WelcomeActivity extends AppCompatActivity {
private ViewPager viewPager; private ViewPager viewPager;
private LinearLayout dotsLayout; private LinearLayout dotsLayout;
private int[] layouts; private int[] layouts;
private Button btnSkip, btnNext; private MaterialButton btnSkip, btnNext;
// viewpager change listener
final ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {
@Override
public void onPageSelected(int position) {
addBottomDots(position);
// changing the next button text 'NEXT' / 'GOT IT'
if (position == layouts.length - 1) {
// last page. make button text to GOT IT
btnNext.setText(getString(R.string.start));
btnSkip.setVisibility(View.GONE);
} else {
// still pages are left
btnNext.setText(getString(R.string.next));
btnSkip.setVisibility(View.VISIBLE);
}
}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
}
@Override
public void onPageScrollStateChanged(int arg0) {
}
};
private PrefManager prefManager; private PrefManager prefManager;
@Override @Override
@ -45,6 +77,12 @@ public class WelcomeActivity extends AppCompatActivity {
} }
prefManager.setFirstTimeLaunch(false); prefManager.setFirstTimeLaunch(false);
if (!prefManager.isUnderstood()) {
askForComprehensive();
prefManager.setUnderstood(true);
}
setContentView(R.layout.welcome_activity); setContentView(R.layout.welcome_activity);
setFullScreen(); setFullScreen();
@ -81,16 +119,9 @@ public class WelcomeActivity extends AppCompatActivity {
viewPager.setAdapter(myViewPagerAdapter); viewPager.setAdapter(myViewPagerAdapter);
viewPager.addOnPageChangeListener(viewPagerPageChangeListener); viewPager.addOnPageChangeListener(viewPagerPageChangeListener);
btnSkip.setOnClickListener(new View.OnClickListener() { btnSkip.setOnClickListener(v -> launchHomeScreen());
@Override
public void onClick(View v) {
launchHomeScreen();
}
});
btnNext.setOnClickListener(new View.OnClickListener() { btnNext.setOnClickListener(v -> {
@Override
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(); int current = getItem();
@ -101,16 +132,39 @@ public class WelcomeActivity extends AppCompatActivity {
} else { } else {
launchHomeScreen(); launchHomeScreen();
} }
});
} }
private void askForComprehensive() {
final Dialog dlg = new Dialog(this);
dlg.requestWindowFeature(Window.FEATURE_NO_TITLE);
dlg.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dlg.setContentView(R.layout.custom_dialog_layout_one_button);
dlg.setCancelable(false);
MaterialTextView msg = dlg.findViewById(R.id.msg);
String msgString;
MaterialTextView cpl = dlg.findViewById(R.id.cpl);
ShapeableImageView icon = dlg.findViewById(R.id.image);
MaterialButton btn = dlg.findViewById(R.id.txtClose);
dlg.show();
msgString = getString(R.string.understood);
msg.setText(msgString);
cpl.setVisibility(View.GONE);
//icon.setImageResource(R.drawable.pilldroid_icon);
btn.setText(R.string.Yes_understood);
btn.setOnClickListener(v -> {
// TODO Auto-generated method stub
dlg.dismiss();
}); });
} }
private void addBottomDots(int currentPage) { private void addBottomDots(int currentPage) {
TextView[] dots = new TextView[layouts.length]; MaterialTextView[] dots = new MaterialTextView[layouts.length];
dotsLayout.removeAllViews(); dotsLayout.removeAllViews();
for (int i = 0; i < dots.length; i++) { for (int i = 0; i < dots.length; i++) {
dots[i] = new TextView(this); dots[i] = new MaterialTextView(this);
dots[i].setText(""); dots[i].setText("");
dots[i].setTextSize(65); dots[i].setTextSize(65);
dots[i].setTextColor(ContextCompat.getColor(this, R.color.dot_dark)); dots[i].setTextColor(ContextCompat.getColor(this, R.color.dot_dark));
@ -131,36 +185,6 @@ public class WelcomeActivity extends AppCompatActivity {
finish(); finish();
} }
// viewpager change listener
final ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {
@Override
public void onPageSelected(int position) {
addBottomDots(position);
// changing the next button text 'NEXT' / 'GOT IT'
if (position == layouts.length - 1) {
// last page. make button text to GOT IT
btnNext.setText(getString(R.string.start));
btnSkip.setVisibility(View.GONE);
} else {
// still pages are left
btnNext.setText(getString(R.string.next));
btnSkip.setVisibility(View.VISIBLE);
}
}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
}
@Override
public void onPageScrollStateChanged(int arg0) {
}
};
/** /**
* Making notification bar transparent * Making notification bar transparent
*/ */
@ -170,17 +194,16 @@ public class WelcomeActivity extends AppCompatActivity {
window.setStatusBarColor(Color.TRANSPARENT); window.setStatusBarColor(Color.TRANSPARENT);
} }
private void setFullScreen(){ @SuppressWarnings("deprecation")
private void setFullScreen() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
getWindow().setDecorFitsSystemWindows(false); getWindow().setDecorFitsSystemWindows(false);
WindowInsetsController controller = getWindow().getInsetsController(); WindowInsetsController controller = getWindow().getInsetsController();
if(controller != null) { if (controller != null) {
controller.hide(WindowInsets.Type.statusBars() | WindowInsets.Type.navigationBars()); controller.hide(WindowInsets.Type.statusBars() | WindowInsets.Type.navigationBars());
controller.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE); controller.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
} }
} } else {
else {
//noinspection
getWindow().getDecorView().setSystemUiVisibility( getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_FULLSCREEN View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
@ -222,7 +245,7 @@ public class WelcomeActivity extends AppCompatActivity {
@Override @Override
public void destroyItem(ViewGroup container, int position, @NonNull Object object) { public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
View view = (View) object; View view = (View) object;
container.removeView(view); container.removeView(view);
} }

View file

@ -16,7 +16,7 @@ import net.foucry.pilldroid.models.Medicine;
public abstract class MedicineDatabase extends RoomDatabase { public abstract class MedicineDatabase extends RoomDatabase {
private static MedicineDatabase INSTANCE; private static MedicineDatabase INSTANCE;
public abstract MedicinesDAO getMedicinesDAO();
public static MedicineDatabase getInstanceDatabase(Context context) { public static MedicineDatabase getInstanceDatabase(Context context) {
if (INSTANCE == null) { if (INSTANCE == null) {
INSTANCE = INSTANCE =
@ -32,4 +32,6 @@ public abstract class MedicineDatabase extends RoomDatabase {
public static void destroyInstance() { public static void destroyInstance() {
INSTANCE = null; INSTANCE = null;
} }
public abstract MedicinesDAO getMedicinesDAO();
} }

View file

@ -28,11 +28,6 @@ import net.foucry.pilldroid.models.Prescription;
public abstract class PrescriptionDatabase extends RoomDatabase { public abstract class PrescriptionDatabase extends RoomDatabase {
private static PrescriptionDatabase INSTANCE; private static PrescriptionDatabase INSTANCE;
public abstract PrescriptionsDAO getPrescriptionsDAO();
@RenameColumn(tableName = "prescriptions", fromColumnName = "genetic_type", toColumnName = "generic_type")
static class generic_typeMigration implements AutoMigrationSpec { }
public static PrescriptionDatabase getInstanceDatabase(Context context) { public static PrescriptionDatabase getInstanceDatabase(Context context) {
if (INSTANCE == null) { if (INSTANCE == null) {
INSTANCE = INSTANCE =
@ -44,7 +39,14 @@ public abstract class PrescriptionDatabase extends RoomDatabase {
} }
return INSTANCE; return INSTANCE;
} }
public static void destroyInstance() { public static void destroyInstance() {
INSTANCE = null; INSTANCE = null;
} }
public abstract PrescriptionsDAO getPrescriptionsDAO();
@RenameColumn(tableName = "prescriptions", fromColumnName = "genetic_type", toColumnName = "generic_type")
static class generic_typeMigration implements AutoMigrationSpec {
}
} }

View file

@ -7,7 +7,8 @@ import androidx.room.PrimaryKey;
@Entity(tableName = "drugs") @Entity(tableName = "drugs")
public class Medicine { public class Medicine {
@PrimaryKey @PrimaryKey
@NonNull private Integer _id; @NonNull
private Integer _id;
private String cis; private String cis;
private String cip13; private String cip13;
private String cip7; private String cip7;

View file

@ -1,8 +1,5 @@
package net.foucry.pilldroid.models; package net.foucry.pilldroid.models;
import android.util.Log;
import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.room.Entity; import androidx.room.Entity;
import androidx.room.PrimaryKey; import androidx.room.PrimaryKey;
@ -15,7 +12,7 @@ import java.util.Date;
@Entity(tableName = "prescriptions") @Entity(tableName = "prescriptions")
public class Prescription implements Serializable { public class Prescription implements Serializable {
private static final String TAG = Prescription.class.getName();; private static final String TAG = Prescription.class.getName();
@PrimaryKey @PrimaryKey
@NonNull @NonNull
private String cis; private String cis;
@ -31,87 +28,87 @@ public class Prescription implements Serializable {
private String label_group; private String label_group;
private Integer generic_type; private Integer generic_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 @NonNull
public String getCis() { public String getCis() {
return this.cis; return this.cis;
} }
public void setCis(@NonNull String cis) {
this.cis = cis;
}
public Integer getWarning() { public Integer getWarning() {
return warning; return warning;
} }
public void setWarning(Integer warning) {
this.warning = warning;
}
public String getCip13() { public String getCip13() {
return cip13; return cip13;
} }
public void setCip13(String cip13) {
this.cip13 = cip13;
}
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) {
this.name = name;
}
public String getAdministration_mode() { public String getAdministration_mode() {
return administration_mode; return administration_mode;
} }
public void setAdministration_mode(String administration_mode) {
this.administration_mode = administration_mode;
}
public String getPresentation() { public String getPresentation() {
return presentation; return presentation;
} }
public void setPresentation(String presentation) {
this.presentation = presentation;
}
public Float getStock() { public Float getStock() {
return stock; return stock;
} }
public void setStock(Float stock) {
this.stock = stock;
}
public Float getTake() { public Float getTake() {
return take; return take;
} }
public void setTake(Float take) {
this.take = take;
}
public Integer getAlert() { public Integer getAlert() {
return alert; return alert;
} }
public void setAlert(Integer alert) {
this.alert = alert;
}
public Long getLast_update() { public Long getLast_update() {
return last_update; return last_update;
} }
public void setLast_update(Long last_update) {
this.last_update = last_update;
}
public int getAlertThreshold() { public int getAlertThreshold() {
return this.alert; return this.alert;
} }
@ -167,8 +164,12 @@ public class Prescription implements Serializable {
}*/ }*/
if (numberOfDays > 0) { if (numberOfDays > 0) {
float currentStock = 0;
float newStock = 0;
double takeDuringPeriod = this.take * numberOfDays; double takeDuringPeriod = this.take * numberOfDays;
setStock((float) (getStock() - takeDuringPeriod)); currentStock = getStock();
newStock = (float) (currentStock - takeDuringPeriod);
setStock(newStock);
setLast_update(new Date().getTime()); setLast_update(new Date().getTime());
} }
} }

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"> <set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="-100%p" android:toXDelta="0" <translate
android:duration="@integer/slide_animation_duration"
android:fromXDelta="-100%p"
android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:duration="@integer/slide_animation_duration"/> android:toXDelta="0" />
</set> </set>

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"> <set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="100%p" android:toXDelta="0" <translate
android:duration="@integer/slide_animation_duration"
android:fromXDelta="100%p"
android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:duration="@integer/slide_animation_duration"/> android:toXDelta="0" />
</set> </set>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"> <set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0" android:toXDelta="-100%p" <translate android:duration="@integer/slide_animation_duration" android:fromXDelta="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:duration="@integer/slide_animation_duration"/> android:toXDelta="-100%p"/>
</set> </set>

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"> <set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromXDelta="0" android:toXDelta="100%p" <translate
android:duration="@integer/slide_animation_duration"
android:fromXDelta="0"
android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:interpolator="@android:anim/accelerate_decelerate_interpolator"
android:duration="@integer/slide_animation_duration"/> android:toXDelta="100%p" />
</set> </set>

View file

@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="?attr/colorControlNormal"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M313,520L537,744L480,800L160,480L480,160L537,216L313,440L800,440L800,520L313,520Z"/>
</vector>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#eeffffff" />
<corners android:bottomRightRadius="8dp"
android:bottomLeftRadius="8dp"
android:topRightRadius="8dp"
android:topLeftRadius="8dp"/>
</shape>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:fillColor="@android:color/white"
android:pathData="M440,520L200,520L200,440L440,440L440,200L520,200L520,440L760,440L760,520L520,520L520,760L440,760L440,520Z"/>
</vector>

View file

@ -1,4 +1,4 @@
<vector android:height="60dp" android:viewportHeight="24.0" <vector android:height="60dp" android:viewportHeight="24.0"
android:viewportWidth="24.0" android:width="60dp" xmlns:android="http://schemas.android.com/apk/res/android"> android:viewportWidth="24.0" android:width="60dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z"/> <path android:fillColor="#FFFFFF" android:pathData="M17,3L5,3c-1.11,0 -2,0.9 -2,2v14c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,7l-4,-4zM12,19c-1.66,0 -3,-1.34 -3,-3s1.34,-3 3,-3 3,1.34 3,3 -1.34,3 -3,3zM15,9L5,9L5,5h10v4z"/>
</vector> </vector>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/bg_screen1" />
<corners android:bottomRightRadius="24dp"
android:bottomLeftRadius="24dp"
android:topRightRadius="24dp"
android:topLeftRadius="24dp"/>
</shape>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/grey" />
<corners android:bottomRightRadius="24dp"
android:bottomLeftRadius="24dp"
android:topRightRadius="24dp"
android:topLeftRadius="24dp"/>
</shape>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item >
<shape
android:shape="rectangle">
<solid android:color="#CCCBCB" />
<corners android:radius="50dp"/>
</shape>
</item>
<item android:right="5dp" android:bottom="2dp">
<shape
android:shape="rectangle">
<solid android:color="@android:color/white"/>
<corners android:radius="50dp"/>
</shape>
</item>
</layer-list>

View file

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FF0000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M14.59,8L12,10.59 9.41,8 8,9.41 10.59,12 8,14.59 9.41,16 12,13.41 14.59,16 16,14.59 13.41,12 16,9.41 14.59,8zM12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
</vector>

View file

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="@color/bg_screen3">
<group android:scaleX="1.1136"
android:scaleY="1.1136"
android:translateX="-1.3632"
android:translateY="-1.3632">
<path
android:fillColor="@android:color/white"
android:pathData="M16.59,7.58L10,14.17l-3.59,-3.58L5,12l5,5 8,-8zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"/>
</group>
</vector>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
app:fontProviderAuthority="com.google.android.gms.fonts"
app:fontProviderPackage="com.google.android.gms"
app:fontProviderQuery="Open Sans"
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
</font-family>

Binary file not shown.

View file

@ -3,8 +3,8 @@
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"
android:layout_marginLeft="16dp" android:layout_marginStart="16dp"
android:layout_marginRight="16dp" android:layout_marginEnd="16dp"
android:baselineAligned="false" android:baselineAligned="false"
android:divider="?android:attr/dividerHorizontal" android:divider="?android:attr/dividerHorizontal"
android:orientation="horizontal" android:orientation="horizontal"
@ -23,8 +23,8 @@
android:name="net.foucry.pilldroid.MedicamentListFragment" android:name="net.foucry.pilldroid.MedicamentListFragment"
android:layout_width="@dimen/item_width" android:layout_width="@dimen/item_width"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="16dp" android:layout_marginStart="16dp"
android:layout_marginRight="16dp" android:layout_marginEnd="16dp"
app:layoutManager="LinearLayoutManager" app:layoutManager="LinearLayoutManager"
tools:context="net.foucry.pilldroid.DrugListActivity" tools:context="net.foucry.pilldroid.DrugListActivity"
tools:listitem="@layout/drug_list_content" /> tools:listitem="@layout/drug_list_content" />

View file

@ -1,11 +1,23 @@
<?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" xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical" android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@android:color/white" android:background="@android:color/white"
android:orientation="vertical"
tools:ignore="Overdraw"> tools:ignore="Overdraw">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
app:layout_collapseMode="pin"
app:titleTextColor="@color/white"
app:title="@string/about"/>
<WebView <WebView
android:id="@+id/aboutHtml" android:id="@+id/aboutHtml"
android:layout_width="match_parent" android:layout_width="match_parent"

View file

@ -1,15 +1,14 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android" <merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:tools="http://schemas.android.com/tools">
<com.journeyapps.barcodescanner.BarcodeView <com.journeyapps.barcodescanner.BarcodeView
android:id="@+id/zxing_barcode_surface"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:id="@+id/zxing_barcode_surface" app:zxing_framing_rect_height="150dp"
app:zxing_framing_rect_width="300dp" app:zxing_framing_rect_width="300dp"/>
app:zxing_framing_rect_height="150dp">
</com.journeyapps.barcodescanner.BarcodeView>
<com.journeyapps.barcodescanner.ViewfinderView <com.journeyapps.barcodescanner.ViewfinderView
android:id="@+id/zxing_viewfinder_view" android:id="@+id/zxing_viewfinder_view"
@ -20,9 +19,9 @@
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/grey"/> app:zxing_viewfinder_mask="@color/grey" />
<TextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/zxing_status_view" android:id="@+id/zxing_status_view"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -30,10 +29,12 @@
android:layout_marginTop="@dimen/app_bar_height" android:layout_marginTop="@dimen/app_bar_height"
android:background="@color/zxing_transparent" android:background="@color/zxing_transparent"
android:fontFamily="sans-serif-black" android:fontFamily="sans-serif-black"
android:textSize="32sp" android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:text="@string/scan_label"
android:textAlignment="center" android:textAlignment="center"
android:text="@string/zxing_msg_default_status"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="32sp"
tools:ignore="PrivateResource" /> tools:ignore="PrivateResource" />
<ImageButton <ImageButton
@ -43,13 +44,11 @@
android:layout_gravity="bottom|start" android:layout_gravity="bottom|start"
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
android:accessibilityHeading="true" android:accessibilityHeading="true"
android:backgroundTint="@android:color/transparent" app:backgroundTint="@android:color/transparent"
android:clickable="false"
android:contentDescription="@string/button_cancel" android:contentDescription="@string/button_cancel"
android:cropToPadding="false" android:cropToPadding="false"
android:foregroundTint="@android:color/darker_gray" app:background="@android:color/darker_gray"
android:onClick="onCancel" app:srcCompat="@drawable/ic_cancel_black_24dp" />
android:src="@drawable/ic_cancel_black_24dp" />
<ImageButton <ImageButton
android:id="@+id/keyboard_button" android:id="@+id/keyboard_button"
@ -57,10 +56,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
android:backgroundTint="@android:color/transparent" app:backgroundTint="@android:color/transparent"
android:contentDescription="@string/button_keyboard" android:contentDescription="@string/button_keyboard"
android:onClick="onKeyboard" app:srcCompat="@drawable/ic_keyboard_black_24dp"
android:src="@drawable/ic_keyboard_black_24dp"
tools:ignore="PrivateResource" /> tools:ignore="PrivateResource" />
</merge> </merge>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.google.android.material.button.MaterialButton
android:id="@+id/custom_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ok"
android:background="@drawable/rounded_btn"/>
</LinearLayout>

View file

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="MissingDefaultResource">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
app:cardCornerRadius="11dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/image"
android:layout_width="61dp"
android:layout_height="61dp"
android:layout_gravity="center"
android:layout_marginTop="12dp"
app:srcCompat="@drawable/ic_launcher_foreground"
android:background="@drawable/shadow_bg"
tools:ignore="ContentDescription"/>
<com.google.android.material.textview.MaterialTextView
android:id="@id/msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="22dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="12dp"
android:fontFamily="@font/opensans_semibold"
android:text="@string/app_name"
android:textColor="@color/grey"
android:textSize="15dp"
tools:ignore="HardcodedText,SpUsage"/>
<com.google.android.material.textview.MaterialTextView
android:id="@id/cpl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="22dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="12dp"
android:fontFamily="@font/opensans_regular"
android:text="@string/app_version"
android:textColor="#757575"
android:textSize="14dp"
tools:ignore="HardcodedText,SpUsage" />
<com.google.android.material.button.MaterialButton
android:id="@+id/txtClose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="38dp"
android:layout_marginBottom="38dp"
android:autoSizeMaxTextSize="100sp"
android:autoSizeMinTextSize="12sp"
android:autoSizeStepGranularity="2sp"
android:autoSizeTextType="uniform"
android:background="@drawable/rounded_btn"
android:gravity="center"
android:maxLines="1"
android:paddingStart="25dp"
android:paddingEnd="25dp"
android:text="@string/button_close"
android:textColor="@color/white"
android:textSize="16sp"
tools:ignore="HardcodedText,SpUsage" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="MissingDefaultResource">
<com.google.android.material.card.MaterialCardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
app:cardCornerRadius="11dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="61dp"
android:layout_height="61dp"
android:layout_gravity="center"
android:layout_marginTop="12dp"
android:background="@drawable/shadow_bg"
app:srcCompat="@drawable/ic_launcher_foreground" />
<com.google.android.material.textview.MaterialTextView
android:id="@id/msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="22dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="12dp"
android:fontFamily="@font/opensans_semibold"
android:text="@string/app_name"
android:textColor="@color/grey"
android:textSize="15dp"
android:labelFor="@+id/msg"
tools:ignore="HardcodedText,SpUsage" />
<com.google.android.material.textview.MaterialTextView
android:id="@id/cpl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="22dp"
android:layout_marginTop="18dp"
android:layout_marginEnd="12dp"
android:fontFamily="@font/opensans_regular"
android:text="@string/app_version"
android:textColor="@color/grey"
android:textSize="14dp"
tools:ignore="HardcodedText,SpUsage" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.google.android.material.button.MaterialButton
android:id="@+id/notagreed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="170dp"
android:layout_marginStart="30dp"
android:layout_marginBottom="38dp"
android:background="@drawable/rounded_btn"
android:text="@string/button_cancel"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="16sp" />
<Space
android:layout_width="100dp"
android:layout_height="wrap_content" />
<com.google.android.material.button.MaterialButton
android:id="@+id/agreed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginTop="170dp"
android:layout_marginBottom="38dp"
android:background="@drawable/rounded_btn"
android:text="@string/button_ok"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
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:context="net.foucry.pilldroid.CustomScannerActivity"> tools:context="net.foucry.pilldroid.CustomScannerActivity">
@ -21,10 +21,9 @@
android:layout_marginTop="@dimen/fab_margin" android:layout_marginTop="@dimen/fab_margin"
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" app:backgroundTint="@android:color/transparent"
android:contentDescription="@string/flashlightButton" android:contentDescription="@string/flashlightButton"
android:onClick="switchFlashlight" app:srcCompat="@drawable/ic_baseline_highlight_24" />
android:src="@drawable/ic_baseline_highlight_24" />
</com.journeyapps.barcodescanner.DecoratedBarcodeView> </com.journeyapps.barcodescanner.DecoratedBarcodeView>
</RelativeLayout> </RelativeLayout>

View file

@ -8,47 +8,47 @@
<include <include
android:id="@+id/name_cell" android:id="@+id/name_cell"
layout="@layout/info_cell"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" />
layout="@layout/info_cell" />
<include <include
android:id="@+id/presentation_cell" android:id="@+id/presentation_cell"
layout="@layout/info_cell"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" />
layout="@layout/info_cell"/> <!-- android:layout_marginTop="5sp" />-->
<!-- android:layout_marginTop="5sp" />-->
<include <include
android:id="@+id/administration_cell" android:id="@+id/administration_cell"
layout="@layout/info_cell"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" />
layout="@layout/info_cell"/> <!-- android:layout_marginTop="5sp" />-->
<!-- android:layout_marginTop="5sp" />-->
<include <include
android:id="@+id/stock_cell" android:id="@+id/stock_cell"
layout="@layout/value_input"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
layout="@layout/value_input"/> <!-- android:layout_marginTop="30sp" />-->
<!-- android:layout_marginTop="30sp" />-->
<include <include
android:id="@+id/take_cell" android:id="@+id/take_cell"
layout="@layout/value_input" layout="@layout/value_input"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content" />
<include <include
android:id="@+id/warning_cell" android:id="@+id/warning_cell"
layout="@layout/value_input_threshold"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content" />
layout="@layout/value_input"/> <!-- android:layout_marginTop="15sp" />-->
<!-- android:layout_marginTop="15sp" />-->
<include <include
android:id="@+id/alert_cell" android:id="@+id/alert_cell"
layout="@layout/value_input" layout="@layout/value_input_threshold"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" /> android:layout_gravity="center_horizontal" />

View file

@ -12,27 +12,25 @@
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar" android:id="@+id/app_bar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height" android:layout_height="wrap_content">
android:background="@color/ic_launcher_background"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<com.google.android.material.appbar.CollapsingToolbarLayout <com.google.android.material.appbar.CollapsingToolbarLayout
android:id="@+id/toolbar_layout" android:id="@+id/toolbar_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="25dp" android:layout_height="wrap_content"
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary" app:contentScrim="#0000"
app:layout_scrollFlags="scroll|exitUntilCollapsed" app:layout_scrollFlags="scroll|exitUntilCollapsed" />
app:toolbarId="@+id/detail_toolbar" />
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/detail_toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
app:layout_collapseMode="pin" app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
</com.google.android.material.appbar.AppBarLayout> app:titleTextColor="@color/white"/>
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/drug_detail_container" android:id="@+id/drug_detail_container"
@ -43,15 +41,18 @@
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
<ImageButton <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/fab" android:id="@+id/fab"
android:layout_width="@dimen/fab_width" android:layout_width="wrap_content"
android:layout_height="@dimen/fab_height" android:layout_height="wrap_content"
android:layout_gravity="end|bottom" app:fabSize="normal"
android:layout_marginTop="?attr/actionBarSize" android:layout_gravity="center|bottom"
android:layout_marginBottom="?attr/actionBarSize" android:scaleType="center"
android:layout_marginEnd="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
android:contentDescription="@string/save_button" android:contentDescription="@string/save_button"
android:src="@drawable/ic_save_black_24dp" android:text="@string/save_button"
app:backgroundTint="@android:color/transparent"/> android:textColor="@color/white"
app:icon="@drawable/ic_save_black_24dp"
app:backgroundTint="@color/colorPrimary"
app:iconTint="@color/white"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -6,7 +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"
app:layoutManager="LinearLayoutManager"
android:background="@drawable/list_selector" android:background="@drawable/list_selector"
app:layoutManager="LinearLayoutManager"
tools:context="net.foucry.pilldroid.DrugListActivity" tools:context="net.foucry.pilldroid.DrugListActivity"
tools:listitem="@layout/drug_list_content" /> tools:listitem="@layout/drug_list_content" />

View file

@ -13,11 +13,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"> android:theme="@style/AppTheme.AppBarOverlay">
<androidx.appcompat.widget.Toolbar <com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height" android:layout_height="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay" /> android:background="@color/colorPrimary"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:titleTextColor="@color/white"/>
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
@ -25,31 +28,24 @@
android:id="@+id/frameLayout" android:id="@+id/frameLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"> android:layout_marginTop="?attr/actionBarSize">
<include <include
layout="@layout/drug_list" layout="@layout/drug_list"
android:layout_height="match_parent" android:layout_width="match_parent"
android:layout_width="match_parent"/> android:layout_height="match_parent" />
</FrameLayout> </FrameLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab" android:id="@+id/fab"
android:layout_width="60dp" android:layout_width="wrap_content"
android:layout_height="60dp" android:layout_height="wrap_content"
android:layout_gravity="bottom|end" android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin" android:layout_margin="@dimen/fab_margin"
android:accessibilityHeading="true" android:accessibilityHeading="true"
android:adjustViewBounds="true"
android:backgroundTint="@android:color/transparent"
android:baselineAlignBottom="false"
android:clickable="false"
android:onClick="onButtonClick"
android:src="@drawable/ic_add_circle_black_24dp"
app:backgroundTint="@android:color/darker_gray"
app:fabCustomSize="60dp"
app:maxImageSize="60dp"
android:contentDescription="@string/add_button" android:contentDescription="@string/add_button"
tools:ignore="OnClick" /> app:srcCompat="@drawable/ic_add"
app:backgroundTint="@color/colorPrimary"
app:tint="@color/white"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -1,7 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="80dp" android:layout_height="80dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"> android:orientation="horizontal">
<!-- Drug's name--> <!-- Drug's name-->
@ -9,30 +11,30 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ImageView <com.google.android.material.imageview.ShapeableImageView
android:id="@+id/list_image" android:id="@+id/list_image"
android:layout_width="50sp" android:layout_width="50sp"
android:layout_height="50sp" android:layout_height="50sp"
android:layout_marginStart="5dp" android:layout_alignParentStart="true"
android:src="@drawable/ok_stock_vect"
android:contentDescription="@string/stockIcon"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_alignParentStart="true" /> android:layout_marginStart="5dp"
android:contentDescription="@string/stockIcon"
app:srcCompat="@drawable/ok_stock_vect" />
<TextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/value" android:id="@+id/value"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignTop="@+id/list_image"
android:layout_marginStart="5dp"
android:layout_toEndOf="@+id/list_image"
android:text="@string/drugName" android:text="@string/drugName"
android:textColor="#040404" android:textColor="#040404"
android:typeface="sans"
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold" android:textStyle="bold"
android:layout_alignTop="@+id/list_image" android:typeface="sans" />
android:layout_toEndOf="@+id/list_image"
android:layout_marginStart="5dp" />
<TextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/endOfStock" android:id="@+id/endOfStock"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -52,13 +54,13 @@
<!-- dateEndOfStock --> <!-- dateEndOfStock -->
<!-- Rightend Arrow --> <!-- Rightend Arrow -->
<ImageView <com.google.android.material.imageview.ShapeableImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginEnd="10sp" android:layout_marginEnd="10sp"
android:contentDescription="@string/detail_view" android:contentDescription="@string/detail_view"
android:src="@drawable/ic_navigate_next_black_24dp" /> app:srcCompat="@drawable/ic_navigate_next_black_24dp" />
</RelativeLayout> </RelativeLayout>

View file

@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/list_selector"> android:background="@color/white"
android:orientation="vertical">
<TextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/value" android:id="@+id/value"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="10sp" android:paddingStart="10sp"
android:paddingEnd="10sp"
android:paddingTop="5dp" android:paddingTop="5dp"
android:paddingEnd="10sp"
android:text="@string/Value" android:text="@string/Value"
android:textColor="#040404" android:textColor="#040404"
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/label" android:id="@+id/label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -30,5 +30,10 @@
android:text="@string/label" android:text="@string/label"
android:textColor="#0c4758" android:textColor="#0c4758"
android:textStyle="italic" /> android:textStyle="italic" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?android:attr/listDivider"
android:layout_below="@id/label"/>
</RelativeLayout> </RelativeLayout>

View file

@ -1,46 +1,114 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
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="wrap_content" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:padding="10dp"
tools:ignore="MissingDefaultResource"> tools:ignore="MissingDefaultResource">
<TextView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/textView" android:id="@+id/cardView"
android:layout_width="371dp"
android:layout_height="209dp"
android:layout_marginTop="16dp"
android:background="@drawable/background_dialog"
app:cardCornerRadius="25dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.google.android.material.button.MaterialButton
android:id="@+id/notagreed"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/enter_cip_13" android:layout_marginStart="28dp"
android:textAppearance="?android:attr/textAppearanceMedium" /> android:layout_marginBottom="16dp"
android:background="@drawable/rounded_btn"
android:gravity="center"
android:maxLines="1"
android:minWidth="100dp"
android:paddingStart="25dp"
android:paddingEnd="25dp"
android:text="@string/button_cancel"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:ignore="HardcodedText,SpUsage" />
<Space
android:id="@+id/space"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
app:layout_constraintEnd_toStartOf="@+id/agreed"
app:layout_constraintStart_toEndOf="@+id/notagreed" />
<com.google.android.material.button.MaterialButton
android:id="@+id/agreed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="28dp"
android:background="@drawable/rounded_btn"
android:gravity="center"
android:maxLines="1"
android:minWidth="100dp"
android:paddingStart="25dp"
android:paddingEnd="25dp"
android:text="@string/button_ok"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="@+id/notagreed"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/notagreed"
app:layout_constraintVertical_bias="0.0"
tools:ignore="HardcodedText,SpUsage" />
<EditText <EditText
android:id="@+id/edittext" android:id="@+id/editcip13"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_marginEnd="28dp"
android:layout_centerVertical="true" android:autofillHints="cip13"
android:layout_marginEnd="16dp"
android:autofillHints="@string/enter_cip_13_here"
android:hint="@string/enter_cip_13_here"
android:inputType="number"
android:minHeight="48dp"
android:padding="10dp"
tools:ignore="RelativeOverlap" />
<TextView
android:id="@+id/startcip13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginStart="29dp"
android:layout_marginTop="52dp"
android:layout_marginEnd="39dp"
android:layout_marginBottom="16dp"
android:layout_toStartOf="@+id/edittext"
android:ems="10" android:ems="10"
android:text="34009" android:hint="@string/enter_cip_13"
android:textAlignment="viewEnd" android:inputType="number"
android:textSize="24dp" /> android:labelFor="@id/editcip13"
</RelativeLayout> android:minHeight="48dp"
android:textAlignment="textStart"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.416" />
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/imageView"
android:layout_width="60dp"
android:layout_height="60dp"
android:contentDescription="@string/app_name"
android:background="@drawable/shadow_bg"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/ic_launcher_foreground" />
<com.google.android.material.textview.MaterialTextView
android:id="@+id/textView4"
android:layout_width="75dp"
android:layout_height="34dp"
android:text="340009"
android:textAlignment="textEnd"
android:textSize="20sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/editcip13"
app:layout_constraintHorizontal_bias="0.525"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.438" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -3,18 +3,18 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal" android:orientation="horizontal"
android:padding="10dp" android:padding="10dp"
android:background="@drawable/list_selector"
android:weightSum="1"> android:weightSum="1">
<TextView <com.google.android.material.textview.MaterialTextView
android:id="@+id/label" android:id="@+id/label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@+id/value" android:layout_alignBottom="@+id/inputLayout"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_toStartOf="@id/value" android:layout_toStartOf="@id/inputLayout"
android:gravity="center_vertical" android:gravity="center_vertical"
android:paddingStart="5dp" android:paddingStart="5dp"
android:paddingEnd="25dp" android:paddingEnd="25dp"
@ -22,23 +22,28 @@
android:textAppearance="?android:attr/textAppearanceMedium" android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#040404" android:textColor="#040404"
android:textStyle="bold" /> android:textStyle="bold" />
<com.google.android.material.textfield.TextInputLayout
<EditText android:id="@+id/inputLayout"
android:id="@+id/value" android:layout_width="200dp"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="50dp"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" android:ems="10"
android:gravity="end|fill_vertical" android:gravity="end|fill_vertical"
android:importantForAutofill="no"
android:inputType="numberDecimal" android:inputType="numberDecimal"
android:labelFor="@id/value" android:labelFor="@id/value"
android:paddingEnd="25dp"
android:paddingStart="5dp" android:paddingStart="5dp"
android:hint="@string/zero" android:paddingEnd="25dp"
android:textColorHint="@color/grey"
android:textAlignment="gravity" android:textAlignment="gravity"
android:importantForAutofill="no" android:textColorHint="@color/grey"
tools:ignore="LabelFor" /> tools:ignore="LabelFor" />
</com.google.android.material.textfield.TextInputLayout>
</RelativeLayout> </RelativeLayout>

View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:padding="10dp"
android:weightSum="1">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/inputLayout"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_toStartOf="@id/inputLayout"
android:gravity="center_vertical"
android:paddingStart="5dp"
android:paddingEnd="25dp"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#040404"
android:textStyle="bold" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/inputLayout"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:gravity="end|fill_vertical"
android:importantForAutofill="no"
android:inputType="numberSigned"
android:labelFor="@id/value"
android:paddingStart="5dp"
android:paddingEnd="25dp"
android:textAlignment="gravity"
android:textColorHint="@color/grey"
tools:ignore="LabelFor" />
</com.google.android.material.textfield.TextInputLayout>
</RelativeLayout>

View file

@ -1,21 +1,21 @@
<?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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen1" android:background="@color/bg_screen1"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.google.android.material.imageview.ShapeableImageView
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/pilldroid_icon" android:contentDescription="@string/pilldroid_icon"
android:src="@drawable/pilldroid_icon" /> app:srcCompat="@drawable/pilldroid_icon" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/slide1_Pilldroid" android:text="@string/slide1_Pilldroid"
@ -23,12 +23,12 @@
android:textSize="@dimen/slide_title" android:textSize="@dimen/slide_title"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="58dp" android:layout_height="58dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:paddingLeft="@dimen/desc_padding" android:paddingStart="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding" android:paddingEnd="@dimen/desc_padding"
android:text="@string/slide1_desc" android:text="@string/slide1_desc"
android:textAlignment="center" android:textAlignment="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"

View file

@ -1,19 +1,21 @@
<?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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen5" android:background="@color/bg_screen5"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.google.android.material.imageview.ShapeableImageView
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/suspended_treatment_icon" android:contentDescription="@string/suspended_treatment_icon"
android:src="@drawable/ic_suspended_pill" /> app:srcCompat="@drawable/ic_suspended_pill" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding" android:paddingStart="@dimen/title_padding"
@ -24,12 +26,12 @@
android:textSize="@dimen/slide_title" android:textSize="@dimen/slide_title"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:paddingLeft="@dimen/desc_padding" android:paddingStart="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding" android:paddingEnd="@dimen/desc_padding"
android:text="@string/slide10_desc" android:text="@string/slide10_desc"
android:textAlignment="center" android:textAlignment="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"

View file

@ -1,19 +1,21 @@
<?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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen3" android:background="@color/bg_screen3"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.google.android.material.imageview.ShapeableImageView
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/save_icon" android:contentDescription="@string/save_icon"
android:src="@drawable/ic_save_black_24dp" /> app:srcCompat="@drawable/ic_save_black_24dp" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding" android:paddingStart="@dimen/title_padding"
@ -24,12 +26,12 @@
android:textSize="@dimen/slide_title" android:textSize="@dimen/slide_title"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:paddingLeft="@dimen/desc_padding" android:paddingStart="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding" android:paddingEnd="@dimen/desc_padding"
android:text="@string/slide11_desc" android:text="@string/slide11_desc"
android:textAlignment="center" android:textAlignment="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"

View file

@ -1,5 +1,6 @@
<?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: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"
android:layout_centerInParent="true" android:layout_centerInParent="true"
@ -7,13 +8,13 @@
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.google.android.material.imageview.ShapeableImageView
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/pilldroid_icon" android:contentDescription="@string/pilldroid_icon"
android:src="@drawable/pilldroid_icon" /> app:srcCompat="@drawable/pilldroid_icon" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding" android:paddingStart="@dimen/title_padding"
@ -24,14 +25,15 @@
android:textSize="@dimen/slide_title" android:textSize="@dimen/slide_title"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="350dp" android:layout_width="350dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:paddingLeft="@dimen/desc_padding" android:paddingStart="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding" android:paddingEnd="@dimen/desc_padding"
android:text="@string/slide12_desc" android:text="@string/slide12_desc"
android:textAlignment="center" android:textAlignment="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"
android:textSize="@dimen/slide_desc" /> android:textSize="@dimen/slide_desc"
android:autoLink="web"/>
</LinearLayout> </LinearLayout>

View file

@ -1,19 +1,20 @@
<?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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen2" android:background="@color/bg_screen2"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.google.android.material.imageview.ShapeableImageView
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/the_plus_icon" android:contentDescription="@string/the_plus_icon"
android:src="@drawable/ic_add_circle_black_24dp" /> android:src="@drawable/ic_add" />
<com.google.android.material.textview.MaterialTextView
<TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding" android:paddingStart="@dimen/title_padding"
@ -24,12 +25,12 @@
android:textSize="@dimen/slide_title" android:textSize="@dimen/slide_title"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:paddingLeft="@dimen/desc_padding" android:paddingStart="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding" android:paddingEnd="@dimen/desc_padding"
android:text="@string/slide2_desc" android:text="@string/slide2_desc"
android:textAlignment="center" android:textAlignment="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"

View file

@ -1,19 +1,21 @@
<?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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen3" android:background="@color/bg_screen3"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.google.android.material.imageview.ShapeableImageView
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/barcode_icon" android:contentDescription="@string/barcode_icon"
android:src="@drawable/ic_barcode" /> app:srcCompat="@drawable/ic_barcode" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding" android:paddingStart="@dimen/title_padding"
@ -24,12 +26,12 @@
android:textSize="@dimen/slide_title" android:textSize="@dimen/slide_title"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="33dp" android:layout_height="33dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:paddingLeft="@dimen/desc_padding" android:paddingStart="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding" android:paddingEnd="@dimen/desc_padding"
android:text="@string/slide3_desc" android:text="@string/slide3_desc"
android:textAlignment="center" android:textAlignment="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"

View file

@ -1,18 +1,20 @@
<?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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/bg_screen4" android:background="@color/bg_screen4"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.google.android.material.imageview.ShapeableImageView
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/qr_code_icon" android:contentDescription="@string/qr_code_icon"
android:src="@drawable/ic_qr_code" /> app:srcCompat="@drawable/ic_qr_code" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/slide4_Pilldroid" android:text="@string/slide4_Pilldroid"
@ -20,12 +22,12 @@
android:textSize="@dimen/slide_title" android:textSize="@dimen/slide_title"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="36dp" android:layout_height="36dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:paddingLeft="@dimen/desc_padding" android:paddingStart="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding" android:paddingEnd="@dimen/desc_padding"
android:text="@string/slide4_desc" android:text="@string/slide4_desc"
android:textAlignment="center" android:textAlignment="center"
android:textColor="@android:color/white" android:textColor="@android:color/white"

View file

@ -1,21 +1,21 @@
<?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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen3" android:background="@color/bg_screen3"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.google.android.material.imageview.ShapeableImageView
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/happy_face" android:contentDescription="@string/happy_face"
android:src="@drawable/ok_stock_vect" /> app:srcCompat="@drawable/ok_stock_vect" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding" android:paddingStart="@dimen/title_padding"

View file

@ -1,20 +1,21 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen2" android:background="@color/bg_screen2"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.google.android.material.imageview.ShapeableImageView
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/neutral_face" android:contentDescription="@string/neutral_face"
android:src="@drawable/warning_stock_vect" /> app:srcCompat="@drawable/warning_stock_vect" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding" android:paddingStart="@dimen/title_padding"

View file

@ -1,18 +1,20 @@
<?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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/bg_screen4" android:background="@color/bg_screen4"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.google.android.material.imageview.ShapeableImageView
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/unhappy_face" android:contentDescription="@string/unhappy_face"
android:src="@drawable/lower_stock_vect" /> app:srcCompat="@drawable/lower_stock_vect" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="349dp" android:layout_width="349dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding" android:paddingStart="@dimen/title_padding"

View file

@ -1,19 +1,21 @@
<?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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen1" android:background="@color/bg_screen1"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.google.android.material.imageview.ShapeableImageView
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/drug_info" android:contentDescription="@string/drug_info"
android:src="@drawable/info" /> app:srcCompat="@drawable/info" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding" android:paddingStart="@dimen/title_padding"

View file

@ -1,19 +1,21 @@
<?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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:background="@color/bg_screen2" android:background="@color/bg_screen2"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<ImageView <com.google.android.material.imageview.ShapeableImageView
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/tunable" android:contentDescription="@string/tunable"
android:src="@drawable/tunable" /> app:srcCompat="@drawable/tunable" />
<TextView <com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingStart="@dimen/title_padding" android:paddingStart="@dimen/title_padding"

View file

@ -17,31 +17,31 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dots_height" android:layout_height="@dimen/dots_height"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dots_margin_bottom" android:layout_marginBottom="20dp"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal"/>
</LinearLayout>
<Button <com.google.android.material.button.MaterialButton
android:id="@+id/btn_next" android:id="@+id/btn_next"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/button_margin_bottom"
android:background="@null" android:background="@null"
android:text="@string/next" android:text="@string/next"
android:layout_marginBottom="@dimen/dots_margin_bottom" android:textColor="@android:color/white" />
android:textColor="@android:color/white"
tools:ignore="RelativeOverlap,RtlSymmetry"/>
<Button <com.google.android.material.button.MaterialButton
android:id="@+id/btn_skip" android:id="@+id/btn_skip"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dots_margin_bottom" android:layout_marginBottom="@dimen/button_margin_bottom"
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>

View file

@ -2,6 +2,15 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/about" <item android:id="@+id/about"
android:title="@string/about"/> android:title="@string/about"/>
<item android:title="@string/backup">
<menu>
<item android:id="@+id/export_prescription"
android:title="@string/export_prescriptions"/>
<item android:id="@+id/import_prescription"
android:title="@string/import_prescriptions"/>
</menu>
</item>
<item android:id="@+id/help" <item android:id="@+id/help"
android:title="@string/help"/> android:title="@string/help"/>
</menu> </menu>

View file

@ -21,6 +21,8 @@
<string name="flashlightButton">Allumer/Eteindre le Flash</string> <string name="flashlightButton">Allumer/Eteindre le Flash</string>
<string name="enter_cip_13_here">Saisir la fin du code CIP 13 ici..</string> <string name="enter_cip_13_here">Saisir la fin du code CIP 13 ici..</string>
<string name="enter_cip_13">Saisir le code CIP 13</string> <string name="enter_cip_13">Saisir le code CIP 13</string>
<string name="button_close">Fermer</string>
<string name="scan_label">Visez le code-barres pour le scanner</string>
<!-- Slide Strings --> <!-- Slide Strings -->
<string name="slide1_Pilldroid">Bienvenue dans Pilldroid</string> <string name="slide1_Pilldroid">Bienvenue dans Pilldroid</string>
@ -66,8 +68,13 @@
<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="cancelled_scan">Scan annulé</string>
<string name="missing_camera_permission">Autorisation appareil photo manquante</string> <string name="missing_camera_permission">Autorisation appareil photo manquante</string>
<string name="Yes">Oui, j\'ai compris</string> <string name="Yes">Oui</string>
<string name="Yes_understood">Oui, j\'ai compris</string>
<string name="understood">Je comprends que le développeur de Pilldroid n\'est pas responsable de la gestion de vos médicaments. CELA RELÈVE DE VOTRE SEULE RESPONSABILITÉ.</string> <string name="understood">Je comprends que le développeur de Pilldroid n\'est pas responsable de la gestion de vos médicaments. CELA RELÈVE DE VOTRE SEULE RESPONSABILITÉ.</string>
<string name="Undo">Annuler</string> <string name="Undo">Annuler</string>
<string name="trash_icon">Icône de poubelle</string> <string name="trash_icon">Icône de poubelle</string>
<string name="addInList">Ajouter à votre liste de médicament</string>
<string name="backup">Backup</string>
<string name="export_prescriptions">Export</string>
<string name="import_prescriptions">Import</string>
</resources> </resources>

View file

@ -10,11 +10,14 @@
<!-- Slide dimens --> <!-- Slide dimens -->
<dimen name="dots_height">75dp</dimen> <dimen name="dots_height">75dp</dimen>
<dimen name="dots_margin_bottom">20dp</dimen> <dimen name="dots_margin_bottom">20dp</dimen>
<dimen name="button_margin_bottom">25dp</dimen>
<dimen name="img_width_height">240dp</dimen> <dimen name="img_width_height">240dp</dimen>
<dimen name="slide_title">30sp</dimen> <dimen name="slide_title">30sp</dimen>
<dimen name="slide_desc">16sp</dimen> <dimen name="slide_desc">16sp</dimen>
<dimen name="desc_padding">40dp</dimen> <dimen name="desc_padding">40dp</dimen>
<dimen name="title_padding">20dp</dimen> <dimen name="title_padding">20dp</dimen>
<dimen name="screen_shot_height">250dp</dimen> <dimen name="screen_shot_height">250dp</dimen>
<dimen name="ten_dp">10dp</dimen>
<dimen name="thirty_dp">30dp</dimen>
</resources> </resources>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="com_google_android_gms_fonts_certs">
<item>@array/com_google_android_gms_fonts_certs_dev</item>
<item>@array/com_google_android_gms_fonts_certs_prod</item>
</array>
<string-array name="com_google_android_gms_fonts_certs_dev">
<item>
MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
</item>
</string-array>
<string-array name="com_google_android_gms_fonts_certs_prod">
<item>
MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
</item>
</string-array>
</resources>

View file

@ -23,4 +23,6 @@
<item type="id" name="restart_preview"/> <item type="id" name="restart_preview"/>
<item type="id" name="return_scan_result"/> <item type="id" name="return_scan_result"/>
<item type="id" name="startcip13" /> <item type="id" name="startcip13" />
<item type="id" name="msg" />
<item type="id" name="cpl" />
</resources> </resources>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="preloaded_fonts" translatable="false">
<item>@font/opensans_regular</item>
</array>
</resources>

View file

@ -22,6 +22,8 @@
<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>
<string name="button_close">Close</string>
<string name="scan_label">Aim at the barcode to scan it</string>
<!-- slides strings --> <!-- slides strings -->
<string name="slide1_Pilldroid">Welcome on Pilldroid</string> <string name="slide1_Pilldroid">Welcome on Pilldroid</string>
@ -68,8 +70,13 @@
<string name="notInterpreted">Bar code cannot be interpreted</string> <string name="notInterpreted">Bar code cannot be interpreted</string>
<string name="cancelled_scan">Scan canceled</string> <string name="cancelled_scan">Scan canceled</string>
<string name="missing_camera_permission">Missing camera permission</string> <string name="missing_camera_permission">Missing camera permission</string>
<string name="Yes">Yes, I understood</string> <string name="Yes">Yes</string>
<string name="Yes_understood">Yes, I understood</string>
<string name="understood">I understood that the developer of Pilldroid cannot be responsible of your medication management. IT\'S YOU OWN RESPONSIBILITY.</string> <string name="understood">I understood that the developer of Pilldroid cannot be responsible of your medication management. IT\'S YOU OWN RESPONSIBILITY.</string>
<string name="Undo">Undo</string> <string name="Undo">Undo</string>
<string name="trash_icon">Trash icon</string> <string name="trash_icon">Trash icon</string>
<string name="addInList">add to your list of medicine</string>
<string name="backup">Backup</string>
<string name="export_prescriptions">Export</string>
<string name="import_prescriptions">Import</string>
</resources> </resources>

View file

@ -1,11 +1,14 @@
<resources> <resources>
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <style name="AppTheme" parent="Theme.Material3.Light.NoActionBar">
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item>
<item name="backgroundTint">@color/white</item>
<item name="android:textColorSecondary">@android:color/white</item>
<item name="popupMenuBackground">@color/white</item>
</style> </style>
<style name="AppTheme.NoActionBar"> <style name="AppTheme.NoActionBar">
@ -13,8 +16,17 @@
<item name="windowNoTitle">true</item> <item name="windowNoTitle">true</item>
</style> </style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.Material3.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.Material3.Light" />
<style name="MyDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">
<!--buttons color-->
<item name="colorAccent">@color/material_dynamic_neutral20</item>
<!--title and message color-->
<item name="android:textColorPrimary">@android:color/white</item>
<!--dialog background-->
<item name="android:windowBackground">@drawable/background_dialog</item>
</style>
</resources> </resources>

View file

@ -9,7 +9,7 @@ buildscript {
google() google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.2.1' classpath 'com.android.tools.build:gradle:8.0.2'
// 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
@ -17,9 +17,6 @@ buildscript {
} }
ext { ext {
compileSdkVersion = '28' compileSdkVersion = '28'
buildToolsVersion = '28.0.1'
var = '3.4.2'
//buildToolsVersion1 = '29.0.3'
defaultMinSdkVersion = 26 defaultMinSdkVersion = 26
defaultTargetSdkVersion = 30 defaultTargetSdkVersion = 30
defaultVersionCode = 1 defaultVersionCode = 1
@ -35,9 +32,8 @@ allprojects {
} }
} }
task clean(type: Delete) { tasks.register('clean', Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }
dependencies { dependencies {}
}

View file

@ -1,6 +1,6 @@
# v0.300-beta - Nouvelles fonctionnalités # v0.300-beta - Nouvelles fonctionnalités
- La gestion de la liste des prescriptions (les médicaments que vous prenez) à été revue ; - La gestion de la liste des prescriptions (les médicaments que vous prenez) a été revue ;
- un glissement de la droite vers la gauche supprime le médicament de la liste ET de - un glissement de la droite vers la gauche supprime le médicament de la liste ET de
la base données ; la base données ;
- un glissement de la gauche vers la droite permet de modifier les détails du médicament, - un glissement de la gauche vers la droite permet de modifier les détails du médicament,
@ -8,9 +8,9 @@
Ces changements vont vous permettre de supprimer les médicaments dont la prise est à zéro (0) Ces changements vont vous permettre de supprimer les médicaments dont la prise est à zéro (0)
depuis longtemps et que vous ne prendrez plus. depuis longtemps et que vous ne prendrez plus.
Ils vont également me permettre d'avancer sur la prochaine étape qui est de plus présenter les noms Ils vont également me permettre d'avancer sur la prochaine étape qui est de plus présenté les noms
des médicaments, mais la molécule (doliprane, efferalgan, dafalgan deviendront paracétamol). des médicaments, mais la molécule (doliprane, efferalgan, dafalgan deviendront paracétamol).
Je vous en dirais plus prochainement. Je vous en dirai plus prochainement.
Merci de me faire des retours sur ces nouveautés, [Pilldroid](mailto:jacques+pilldroid@foucry.net) Merci de me faire des retours sur ces nouveautés, [Pilldroid](mailto:jacques+pilldroid@foucry.net)
[Pilldroid](mailto:pilldroid@foucry.net)ou pilldroid@foucry.net. [Pilldroid](mailto:pilldroid@foucry.net)ou pilldroid@foucry.net.

View file

@ -1,12 +1,12 @@
# V0.302-beta - bugs fix and small interface changes # V0.302-beta - bugs fix and small interface changes
- Résolution de la bogue qui empéchait la calcul dv stock et l'émission de l'alarme, - Résolution de la bogue qui empêchait le calcul du stock et l'émission de l'alarme,
bogue qui est apparu dans la version v0.201-beta. Je suis désolé pour cette bogue et le temps bogue qui est apparu dans la version v0.201-beta. Je suis désolé pour cette bogue et le temps
que j'ai mis à la corriger ; que j'ai mis à la corriger ;
- Suppression de vieux code et vieux commentaires ; - Suppression de vieux code et vieux commentaires ;
- Changement dans le dialogue de saisie d'un CIP13, vous n'avez plvs qve les 7 - Changement dans le dialogue de saisie d'un CIP13, vous n'avez plus que les 7
derniers chiffres à entrer; derniers chiffres à entrer;
- Changement dans l'apparence de la saisie des valeurs, j'ai supprimer les coins arrondis. - Changement dans l'apparence de la saisie des valeurs, j'ai supprimé les coins arrondis.
De nombreux autres bogues restent présentes, mais je ne les ai pas encore trouvé. De nombreux autres bogues restent présentes, mais je ne les ai pas encore trouvé.
@ -25,7 +25,7 @@ Merci pour votre aide et votre patience. Un petit mot fait toujours plaisir.
# v0.300-beta - Nouvelles fonctionnalités # v0.300-beta - Nouvelles fonctionnalités
- La gestion de la liste des prescriptions (les médicaments que vous prenez) à été revue ; - La gestion de la liste des prescriptions (les médicaments que vous prenez) a été revue ;
- un glissement de la droite vers la gauche supprime le médicament de la liste ET de - un glissement de la droite vers la gauche supprime le médicament de la liste ET de
la base données ; la base données ;
- un glissement de la gauche vers la droite permet de modifier les détails du médicament, - un glissement de la gauche vers la droite permet de modifier les détails du médicament,
@ -33,9 +33,9 @@ Merci pour votre aide et votre patience. Un petit mot fait toujours plaisir.
Ces changements vont vous permettre de supprimer les médicaments dont la prise est à zéro (0) Ces changements vont vous permettre de supprimer les médicaments dont la prise est à zéro (0)
depuis longtemps et que vous ne prendrez plus. depuis longtemps et que vous ne prendrez plus.
Ils vont également me permettre d'avancer sur la prochaine étape qui est de plus présenter les noms Ils vont également me permettre d'avancer sur la prochaine étape qui est de plus présenté les noms
des médicaments, mais la molécule (doliprane, efferalgan, dafalgan deviendront paracétamol). des médicaments, mais la molécule (doliprane, efferalgan, dafalgan deviendront paracétamol).
Je vous en dirais plus prochainement. Je vous en dirai plus prochainement.
Merci de me faire des retours sur ces nouveautés, [Pilldroid](mailto:jacques+pilldroid@foucry.net) Merci de me faire des retours sur ces nouveautés, [Pilldroid](mailto:jacques+pilldroid@foucry.net)
[Pilldroid](mailto:pilldroid@foucry.net)ou pilldroid@foucry.net. [Pilldroid](mailto:pilldroid@foucry.net)ou pilldroid@foucry.net.

View file

@ -1,23 +1,19 @@
# Project-wide Gradle settings. ## For more details on how to configure your build environment visit
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html # http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process. # Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings. # The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m # Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode. # When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit # This option should only be used with decoupled projects. For more details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
# org.gradle.parallel=true # org.gradle.parallel=true
android.enableJetifier=true #Wed Apr 17 19:53:26 CEST 2024
android.enableJetifier=false
android.nonFinalResIds=true
android.nonTransitiveRClass=false
android.useAndroidX=true android.useAndroidX=true
org.gradle.unsafe.configuration-cache=true org.gradle.jvmargs=-Xmx2048M
org.gradle.warning.mode=none org.gradle.warning.mode=none
org.gradle.unsafe.configuration-cache-problems=warn

Binary file not shown.

View file

@ -1,6 +1,6 @@
#Wed Sep 29 16:41:02 CEST 2021 #Fri Sep 22 18:17:05 CEST 2023
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

Some files were not shown because too many files have changed in this diff Show more