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/
/android-signing-keystore.jks
/secrets.properties
/java_pid9513.hprof
*.hprof
# Other considerations
*.html
*~

View file

@ -1,62 +1,79 @@
# 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 à
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
vos médicaments, c'est **VOTRE** responsabilité ;
## Qu'est-ce que Pilldroid ?
- Pilldroid n'est pas fiable, ce n'est qu'une aide. Seul votre stock réel est bon
;
- Pilldroid ne vous surveille pas.
Pilldroid est une applicaton de gestion de stock _théorique_ de médicaments,
pour téléphone Android©.
## Pourquoi « Stock théorique » ?
Pilldroid ne sait (et n'a aucun moyen de savoir) si vous avez ou non pris vos
médicaments. Pilldroid effectue, simple calcul : `stock connus - prise par
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 connu - prise par
jour`. Ce calcul est fait tous les jours entre 11h et midi.
## 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
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
scanner le code barre des boites de médicaments ;
- Pilldroid a besoin de pouvoir vous envoyer des alarmes ;
- Pilldroid a besoin de faire vibrer le téléphone pour les alarmes ;
scanner le code-barres des boîtes de médicaments.
- Pilldroid a besoin de pouvoir vous envoyer des notifications.
- Pilldroid a besoin de faire vibrer le téléphone pour les notifications.
## 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
ouvert.
## 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 ?
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
prochainement mis sur mon compte `github`.
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).
## 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 ?
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
`lambda` par exemple).
amélioration **que je comprends** sera la bienvenue.
Marché de niche, Pilldroid a besoin de testeuses et testeurs.
Prochainement, vous pourrez glisser quelques menues monnaies dans une tirelire
en ligne.
Et si vous ne pouvez-vous pas par ces moyens, vous pouvez m'aider à payer mon
é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 ?
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 {
signingConfigs {
release {
storeFile file("../android-signing-keystore.jks")
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_key_alias']
keyPassword secretProperties['signing_key_password']
@ -30,21 +30,26 @@ android {
keyPassword secretProperties['signing_key_password']
}
}
compileSdk 31
compileSdk 34
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 350
versionName "v0.350-beta"
multiDexEnabled true
javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
buildFeatures {
buildConfig = true
}
buildTypes {
debug {
@ -59,7 +64,7 @@ android {
signingConfig signingConfigs.release
}
}
flavorDimensions "version"
flavorDimensions = ["version"]
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
@ -77,7 +82,7 @@ android {
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion = "32.0.0"
namespace 'net.foucry.pilldroid'
allprojects {
tasks.withType(JavaCompile) {
@ -92,26 +97,28 @@ repositories {
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
exclude 'net/foucry/pilldroid/ViewDialog.java'
}
}
}
dependencies {
implementation "androidx.room:room-common:2.4.2"
annotationProcessor "androidx.room:room-compiler:2.4.2"
implementation "androidx.room:room-testing:2.4.2"
implementation "androidx.room:room-rxjava3:2.4.2"
implementation "androidx.room:room-runtime:2.4.2"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.room:room-common:2.6.1"
annotationProcessor "androidx.room:room-compiler:2.6.1"
implementation "androidx.room:room-testing:2.6.1"
implementation "androidx.room:room-rxjava3:2.6.1"
implementation "androidx.room:room-runtime:2.6.1"
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'com.google.android.material:material:1.11.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.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"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="net.foucry.pilldroid">
<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.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY"/>
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<application
android:fullBackupContent="true"
@ -59,5 +64,8 @@
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
</application>
</manifest>

View file

@ -20,6 +20,7 @@
<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 class="build"><p>[feb95329be7d05c6fd17d4ba4b72ca48c7bb294e]</p></div>
<h5>Pilldroid &copy;&nbsp;2024 Jacques Foucry </h5>
<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>

View file

@ -2,11 +2,10 @@ package net.foucry.pilldroid;
import android.graphics.Color;
import android.os.Bundle;
import android.webkit.WebView;
import androidx.appcompat.app.AppCompatActivity;
import android.webkit.WebView;
/**
* Created by jacques on 12/06/16.
*/

View file

@ -31,9 +31,54 @@ public class AlarmReceiver extends BroadcastReceiver {
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
public void onReceive(Context context, Intent intent)
{
public void onReceive(Context context, Intent intent) {
// Show the toast like in above screen shot
Log.d(TAG, "onReceive");
@ -45,7 +90,9 @@ public class AlarmReceiver extends BroadcastReceiver {
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);
PrescriptionDatabase prescriptions = PrescriptionDatabase.getInstanceDatabase(context.getApplicationContext());
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
@ -63,8 +110,7 @@ public class AlarmReceiver extends BroadcastReceiver {
Utils.sortPrescriptionList(prescriptionList);
try {
firstPrescription = prescriptionList.get(0);
}
catch (Exception e){
} catch (Exception e) {
Log.e(TAG, e.toString());
e.printStackTrace();
}
@ -92,8 +138,7 @@ public class AlarmReceiver extends BroadcastReceiver {
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);
int notificationId = 666;
notificationManager.notify(notificationId, builder.build());
} else
{
} else {
double dummy = (firstPrescription.getStock() - firstPrescription.getAlertThreshold());
Log.d(TAG, "no notification scheduled " + dummy);
}
@ -102,8 +147,8 @@ public class AlarmReceiver extends BroadcastReceiver {
}
private void createNotificationChannel(Context context) {
Log.d(TAG, "start create notification channel");
CharSequence name = context.getString(R.string.channel_name);
String description = context.getString(R.string.channel_description);
int importance = NotificationManager.IMPORTANCE_DEFAULT;
@ -128,49 +173,4 @@ public class AlarmReceiver extends BroadcastReceiver {
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;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
@ -11,8 +10,7 @@ import android.widget.ImageButton;
import androidx.annotation.NonNull;
import com.journeyapps.barcodescanner.BarcodeCallback;
import com.journeyapps.barcodescanner.BarcodeResult;
import androidx.appcompat.app.AppCompatActivity;
import com.journeyapps.barcodescanner.CaptureManager;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
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.
*/
public class CustomScannerActivity extends Activity implements DecoratedBarcodeView.TorchListener {
public class CustomScannerActivity extends AppCompatActivity implements DecoratedBarcodeView.TorchListener {
private static final String TAG = CustomScannerActivity.class.getName();
final Bundle captureIntentBundle = new Bundle();
private CaptureManager capture;
private DecoratedBarcodeView barcodeScannerView;
private ImageButton switchFlashlightButton;
private ViewfinderView viewfinderView;
final Bundle captureIntentBundle = new Bundle();
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -59,9 +55,7 @@ public class CustomScannerActivity extends Activity implements DecoratedBarcodeV
//changeMaskColor(null);
changeLaserVisibility(true);
barcodeScannerView.decodeSingle(new BarcodeCallback() {
@Override
public void barcodeResult(BarcodeResult result) {
barcodeScannerView.decodeSingle(result -> {
Intent scanResult = new Intent();
//Bundle scanResultBundle = new Bundle();
scanResult.putExtra("Barcode Content", result.getText());
@ -71,7 +65,6 @@ public class CustomScannerActivity extends Activity implements DecoratedBarcodeV
CustomScannerActivity.this.setResult(RESULT_OK, scanResult);
Log.d(TAG, "scanResult == " + scanResult);
finish();
}
});
}
@ -93,6 +86,11 @@ public class CustomScannerActivity extends Activity implements DecoratedBarcodeV
capture.onDestroy();
}
@Override
public void onBackPressed(){
onCancel(this.getCurrentFocus());
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);

View file

@ -22,9 +22,6 @@ class DBDrugs extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 1;
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 DRUG_CIS = "cis";
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_NAME = "name";
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 TAG = DBDrugs.class.getName();
private final Context myContext;
private final SQLiteDatabase myDataBase = null;
DBDrugs(Context context) {
@ -44,12 +40,10 @@ class DBDrugs extends SQLiteOpenHelper {
this.myContext = context;
}
public boolean isDBFileExist(File database)
{
public boolean isDBFileExist(File database) {
try {
myContext.getDatabasePath(String.valueOf(database));
}
catch (final Exception e){
} catch (final Exception e) {
return false;
}
return true;
@ -175,13 +169,11 @@ class DBDrugs extends SQLiteOpenHelper {
c.moveToFirst();
if(c.getCount()>0)
{
if (c.getCount() > 0) {
cip13 = c.getString(0);
}
c.close();
} catch(Exception e)
{
} catch (Exception e) {
e.printStackTrace();
}
return cip13;

View file

@ -10,7 +10,6 @@ import android.text.format.DateUtils;
import android.util.Log;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
/**
@ -18,7 +17,6 @@ import java.util.List;
*/
class DBHelper extends SQLiteOpenHelper {
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_ALERT = "alert";
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[] 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};
final List<Drug> drugs = new ArrayList<>();
DBHelper(Context context) {
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
*
* @param drug the drug object to be saved
*/
void addDrug(Drug drug) {
@ -123,6 +119,7 @@ class DBHelper extends SQLiteOpenHelper {
/**
* return a drug from the DB with is id
*
* @param id of the drug we looking for (not used)
* @return return the found drug of null
*/
@ -172,7 +169,6 @@ class DBHelper extends SQLiteOpenHelper {
}
/**
*
* @param cip13 drug id in French nomenclature
* @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
*/
@ -265,25 +260,20 @@ class DBHelper extends SQLiteOpenHelper {
for (int position = 0; position < getCount(); position++) {
currentDrug = getItem(position);
if (!DateUtils.isToday(currentDrug.getDateLastUpdate()))
{
if (!DateUtils.isToday(currentDrug.getDateLastUpdate())) {
currentDrug.newStock();
updateDrug(currentDrug);
}
}
Log.d(TAG, "Before sort == " + drugs);
drugs.sort(new Comparator<Drug>() {
@Override
public int compare(Drug lhs, Drug rhs) {
drugs.sort((lhs, rhs) -> {
if (lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock()) != 0)
return lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock());
else
return (int) (lhs.getStock() - rhs.getStock());
}
});
Log.d(TAG, "After sort " + drugs);
@ -293,12 +283,10 @@ class DBHelper extends SQLiteOpenHelper {
for (int nbOps = 0; nbOps < getCount(); nbOps++) {
currentDrug = getItem(position);
double currentTake = currentDrug.getTake();
if (currentTake == 0)
{
if (currentTake == 0) {
drug = drugs.remove(position);
drugs.add(drug);
} else
{
} else {
position++;
}
}
@ -306,7 +294,6 @@ class DBHelper extends SQLiteOpenHelper {
}
/**
*
* @param drug object to be updated in DB
*/
public void updateDrug(Drug drug) {
@ -345,6 +332,7 @@ class DBHelper extends SQLiteOpenHelper {
/**
* Delete a drug object in database
*
* @param drug object to be delete in the DB
*/
public void deleteDrug(Drug drug) {
@ -365,6 +353,7 @@ class DBHelper extends SQLiteOpenHelper {
/**
* Get count of all drug present in database
*
* @return number of drug in DB
*/
int getCount() {
@ -391,13 +380,11 @@ class DBHelper extends SQLiteOpenHelper {
try {
Cursor c = this.getReadableDatabase().rawQuery("SELECT * FROM " + TABLE_DRUG + " where cip13 = " + cip13, null);
if(c.getCount()>0)
{
if (c.getCount() > 0) {
value = true;
}
c.close();
} catch(Exception e)
{
} catch (Exception e) {
e.printStackTrace();
}
return value;

View file

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

View file

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

View file

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

View file

@ -5,12 +5,11 @@ import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.textfield.TextInputEditText;
import com.google.android.material.textview.MaterialTextView;
import net.foucry.pilldroid.models.Prescription;
/**
@ -52,7 +51,7 @@ public class DrugDetailFragment extends Fragment {
Activity activity = this.getActivity();
assert activity != null;
CollapsingToolbarLayout appBarLayout = activity.findViewById(R.id.toolbar_layout);
MaterialToolbar appBarLayout = activity.findViewById(R.id.toolbar);
if (appBarLayout != null) {
appBarLayout.setTitle(prescription.getName());
}
@ -74,34 +73,34 @@ public class DrugDetailFragment extends Fragment {
if (prescription != null) {
// Find each component of rootView
nameView = detailView.findViewById(R.id.name_cell);
TextView nameLabel = nameView.findViewById(R.id.label);
TextView nameValue = nameView.findViewById(R.id.value);
MaterialTextView nameLabel = nameView.findViewById(R.id.label);
MaterialTextView nameValue = nameView.findViewById(R.id.value);
nameLabel.setText(R.string.drug_name_label);
nameValue.setText(prescription.getName());
presentationView = detailView.findViewById(R.id.presentation_cell);
TextView presentationLabel = presentationView.findViewById(R.id.label);
TextView presentationValue = presentationView.findViewById(R.id.value);
MaterialTextView presentationLabel = presentationView.findViewById(R.id.label);
MaterialTextView presentationValue = presentationView.findViewById(R.id.value);
presentationLabel.setText(R.string.drug_presentation_label);
presentationValue.setText(prescription.getPresentation());
adminModeView = detailView.findViewById(R.id.administration_cell);
TextView adminModeLabel = adminModeView.findViewById(R.id.label);
TextView adminModeValue = adminModeView.findViewById(R.id.value);
MaterialTextView adminModeLabel = adminModeView.findViewById(R.id.label);
MaterialTextView adminModeValue = adminModeView.findViewById(R.id.value);
adminModeLabel.setText(R.string.drug_administrationMode_label);
adminModeValue.setText(prescription.getAdministration_mode());
stockView = detailView.findViewById(R.id.stock_cell);
TextView stockLibelle = (stockView.findViewById(R.id.label));
TextView stockValue = stockView.findViewById(R.id.value);
MaterialTextView stockLibelle = (stockView.findViewById(R.id.label));
TextInputEditText stockValue = stockView.findViewById(R.id.value);
stockLibelle.setText(R.string.drug_current_stock_label);
stockValue.setText(Utils.fmt(prescription.getStock()));
stockValue.setHint(R.string.drug_current_stock_label);
stockValue.setSelectAllOnFocus(true);
takeView = detailView.findViewById(R.id.take_cell);
TextView takeLabel = takeView.findViewById(R.id.label);
TextView takeValue = (takeView.findViewById(R.id.value));
MaterialTextView takeLabel = takeView.findViewById(R.id.label);
TextInputEditText takeValue = (takeView.findViewById(R.id.value));
takeLabel.setText(R.string.drug_take_label);
//takeValue.setText(Double.toString(prescription.getTake()));
takeValue.setText(Utils.fmt(prescription.getTake()));
@ -109,8 +108,8 @@ public class DrugDetailFragment extends Fragment {
takeValue.setSelectAllOnFocus(true);
warningView = detailView.findViewById(R.id.warning_cell);
TextView warningLibelle = warningView.findViewById(R.id.label);
TextView warningValue = warningView.findViewById(R.id.value);
MaterialTextView warningLibelle = warningView.findViewById(R.id.label);
TextInputEditText warningValue = warningView.findViewById(R.id.value);
warningLibelle.setText(R.string.drug_warningThreshold_label);
//warningValue.setText(Integer.toString(prescription.getWarnThreshold()));
warningValue.setText(Utils.fmt(prescription.getWarning()));
@ -118,8 +117,8 @@ public class DrugDetailFragment extends Fragment {
warningValue.setSelectAllOnFocus(true);
alertView = detailView.findViewById(R.id.alert_cell);
TextView alertLibelle = alertView.findViewById(R.id.label);
TextView alertValue = alertView.findViewById(R.id.value);
MaterialTextView alertLibelle = alertView.findViewById(R.id.label);
TextInputEditText alertValue = alertView.findViewById(R.id.value);
alertLibelle.setText(R.string.drug_alertThreshold_label);
//alertValue.setText(Integer.toString(prescription.getAlertThreshold()));
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 android.annotation.SuppressLint;
import android.app.Dialog;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
@ -23,22 +26,26 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.result.ActivityResultLauncher;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.RecyclerView;
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.textview.MaterialTextView;
import com.google.zxing.client.android.BuildConfig;
import com.google.zxing.client.android.Intents;
import com.journeyapps.barcodescanner.ScanOptions;
@ -53,8 +60,7 @@ import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import com.google.zxing.client.android.BuildConfig;
import java.util.Objects;
/**
* 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.
*/
public class DrugListActivity extends AppCompatActivity {
// Used for dev and debug
final Boolean DEMO = false;
private static final String TAG = DrugListActivity.class.getName();
public final int CUSTOMIZED_REQUEST_CODE = 0x0000ffff;
public final String BARCODE_FORMAT_NAME = "Barcode Format name";
public final String BARCODE_CONTENT = "Barcode Content";
private ActivityResultLauncher<ScanOptions> mBarcodeScannerLauncher;
private static final String TAG = DrugListActivity.class.getName();
// Used for dev and debug
final Boolean DEMO = false;
public PrescriptionDatabase prescriptions;
public MedicineDatabase medicines;
private ActivityResultLauncher<ScanOptions> mBarcodeScannerLauncher;
private List<Prescription> prescriptionList; // used for prescriptions
private RecyclerViewAdapter mAdapter;
@ -127,8 +129,7 @@ public class DrugListActivity extends AppCompatActivity {
prescription.setLast_update(drug.getDateLastUpdate());
prescriptionsDAO.insert(prescription);
}
else {
} else {
Log.i(TAG, "Already in the database");
}
}
@ -146,14 +147,6 @@ public class DrugListActivity extends AppCompatActivity {
Log.i(TAG, "Launch tutorial");
startActivity(new Intent(this, WelcomeActivity.class));
// }
PrefManager prefManager = new PrefManager(this);
if (!prefManager.isUnderstood()) {
askForComprehensive();
prefManager.setUnderstood(true);
}
}
@Override
@ -170,6 +163,7 @@ public class DrugListActivity extends AppCompatActivity {
}
}
@SuppressLint("NotifyDataSetChanged")
@Override
public void onCreate(Bundle savedInstanceState) {
@ -184,12 +178,14 @@ public class DrugListActivity extends AppCompatActivity {
// Set view content
setContentView(R.layout.drug_list_activity);
Toolbar toolbar = findViewById(R.id.toolbar);
MaterialToolbar toolbar = findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
toolbar.setTitle(getTitle());
}
FloatingActionButton mFloatingActionButton = findViewById(R.id.fab);
mFloatingActionButton.setOnClickListener(v-> onButtonClick());
if (DEMO) {
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
@ -230,6 +226,7 @@ public class DrugListActivity extends AppCompatActivity {
Log.d(TAG, "Missing camera permission");
Toast.makeText(this, R.string.missing_camera_permission, Toast.LENGTH_LONG).show();
} else {
assert bundle != null;
Log.d(TAG, "bundle == " + bundle.getInt("returnCode"));
int returnCode = bundle.getInt("returnCode");
int resultCode = bundle.getInt("resultCode");
@ -253,13 +250,13 @@ public class DrugListActivity extends AppCompatActivity {
}
String cip13;
switch (bundle.getString(BARCODE_FORMAT_NAME)) {
switch (Objects.requireNonNull(bundle.getString(BARCODE_FORMAT_NAME))) {
case "CODE_128":
case "EAN_13": //CODE_128 || EAN 13
cip13 = bundle.getString(BARCODE_CONTENT);
break;
case "DATA_MATRIX":
cip13 = bundle.getString(BARCODE_CONTENT).substring(4, 17);
cip13 = Objects.requireNonNull(bundle.getString(BARCODE_CONTENT)).substring(4, 17);
break;
default:
scanNotOK();
@ -323,7 +320,7 @@ public class DrugListActivity extends AppCompatActivity {
}
// Launch scan
public void onButtonClick(View v) {
public void onButtonClick() {
Log.d(TAG, "add medication");
ScanOptions options = new ScanOptions();
options.setDesiredBarcodeFormats(ScanOptions.DATA_MATRIX, ScanOptions.CODE_128);
@ -332,7 +329,6 @@ public class DrugListActivity extends AppCompatActivity {
options.setBarcodeImageEnabled(true);
options.setTimeout(60);
options.setCaptureActivity(CustomScannerActivity.class);
options.setBeepEnabled(true);
options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.MIXED_SCAN);
options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.INVERTED_SCAN);
@ -344,42 +340,62 @@ public class DrugListActivity extends AppCompatActivity {
* show keyboardInput dialog
*/
protected void showInputDialog() {
// get prompts.xml view
LayoutInflater layoutInflater = LayoutInflater.from(DrugListActivity.this);
View promptView = layoutInflater.inflate(R.layout.input_dialog, null);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(DrugListActivity.this);
alertDialogBuilder.setView(promptView);
final Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
Objects.requireNonNull(dialog.getWindow()).setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
final EditText editText = promptView.findViewById(R.id.edittext);
// setup a dialog window
dialog.setCancelable(true);
dialog.setCanceledOnTouchOutside(true);
dialog.setContentView(R.layout.input_dialog);
alertDialogBuilder.setCancelable(false)
.setPositiveButton("OK", (dialog, id) -> {
//String cip13 = editText.getText().toString();
String cip13 = "34009" + editText.getText().toString();
MedicinesDAO medicineDAO = medicines.getMedicinesDAO();
Medicine aMedicine = medicineDAO.getMedicineByCIP13(cip13);
askToAddInDB(aMedicine);
})
.setNegativeButton("Cancel",
(dialog, id) -> dialog.cancel());
MaterialButton ok = dialog.findViewById(R.id.agreed);
MaterialButton cancel = dialog.findViewById(R.id.notagreed);
ok.setEnabled(false);
ok.setBackground(Objects.requireNonNull(ContextCompat.getDrawable(this, R.drawable.rounded_btn_disabled)));
MaterialTextView title = dialog.findViewById(R.id.title);
final EditText editText = dialog.findViewById(R.id.editcip13);
String cip13 = String.valueOf(editText.getText());
// create an alert dialog
AlertDialog alert = alertDialogBuilder.create();
// TODO change the color of ok button when the number of character is correct.
ok.setText(R.string.button_ok);
cancel.setText(R.string.button_cancel);
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) { }
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
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
*/
private void askToAddInDB(Medicine aMedicine) {
AlertDialog.Builder dlg = new AlertDialog.Builder(this);
dlg.setTitle(getString(R.string.app_name));
final Dialog dlg = new Dialog(this);
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) {
String msg = aMedicine.getName() + " " + getString(R.string.msgFound);
dlg.setMessage(msg);
dlg.setNegativeButton(getString(R.string.button_cancel), (dialog, which) -> {
// Nothing to do in case of cancel
});
dlg.setPositiveButton(getString(R.string.button_ok), (dialog, which) -> {
// Add Drug to DB then try to show it
msgString = aMedicine.getName() + " " + getString(R.string.msgFound);
msg.setText(msgString);
cpl.setText(getString(R.string.addInList));
icon.setImageResource(R.drawable.tickmark);
btn.setText(getString(R.string.Yes));
btn.setOnClickListener(v -> {
// TODO Auto-generated method stub
dlg.dismiss();
finish();
addDrugToList(Utils.medicine2prescription(aMedicine));
});
} else {
dlg.setMessage(getString(R.string.msgNotFound));
dlg.setPositiveButton("OK", (dialog, which) -> {
// nothing to do to just dismiss dialog
msgString = getString(R.string.msgNotFound);
msg.setText(msgString);
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();
@ -416,7 +448,7 @@ public class DrugListActivity extends AppCompatActivity {
* Tell user that the barre code cannot be interpreted
*/
private void scanNotOK() {
AlertDialog.Builder dlg = new AlertDialog.Builder(this);
MaterialAlertDialogBuilder dlg = new MaterialAlertDialogBuilder(this);
dlg.setTitle(getString(R.string.app_name));
dlg.setMessage(R.string.notInterpreted);
@ -426,20 +458,6 @@ public class DrugListActivity extends AppCompatActivity {
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
@ -460,6 +478,7 @@ public class DrugListActivity extends AppCompatActivity {
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
}
/**
* setupRecyclerView (list of drugs)
*
@ -497,13 +516,11 @@ public class DrugListActivity extends AppCompatActivity {
}
Snackbar.make(recyclerView, prescription.getName(),
Snackbar.LENGTH_LONG).setAction(R.string.Undo, new View.OnClickListener() {
@Override
public void onClick(View v) {
Snackbar.LENGTH_LONG).setAction(R.string.Undo, v -> {
prescriptionList.add(position, prescription);
mAdapter.notifyItemInserted(position);
}
}).show();
}).setActionTextColor(getResources().getColor(R.color.bg_screen1))
.show();
}
@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
*/
@ -620,9 +647,7 @@ public class DrugListActivity extends AppCompatActivity {
holder.mView.setBackgroundResource(R.drawable.gradient_bg);
holder.mIconView.setImageResource(R.drawable.ic_suspended_pill);
holder.mView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
holder.mView.setOnClickListener(v -> {
Prescription aPrescription = mValues.get(position);
Context context = v.getContext();
Intent intent = new Intent(context, DrugDetailActivity.class);
@ -630,7 +655,6 @@ public class DrugListActivity extends AppCompatActivity {
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
}
});
} else {
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.mView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
holder.mView.setOnClickListener(v -> {
Prescription prescription = mValues.get(position);
Context context = v.getContext();
Intent intent = new Intent(context, DrugDetailActivity.class);
intent.putExtra("prescription", prescription);
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
}
});
}
}
@ -667,9 +688,9 @@ public class DrugListActivity extends AppCompatActivity {
class ViewHolder extends RecyclerView.ViewHolder {
final View mView;
final TextView mContentView;
final TextView mEndOfStock;
final ImageView mIconView;
final MaterialTextView mContentView;
final MaterialTextView mEndOfStock;
final ShapeableImageView mIconView;
public Prescription mItem;
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

@ -15,6 +15,7 @@ import com.journeyapps.barcodescanner.ScanOptions;
public class PilldroidScanContract extends ActivityResultContract<ScanOptions, ScanIntentResult> {
private static final String TAG = PilldroidScanContract.class.getName();
@NonNull
@Override
public Intent createIntent(@NonNull Context context, ScanOptions input) {

View file

@ -8,45 +8,47 @@ import android.content.SharedPreferences;
* Created by Lincoln on 05/05/16.
*/
public class PrefManager {
final SharedPreferences pref;
SharedPreferences.Editor editor;
// shared pref mode
final int PRIVATE_MODE = 0;
// Shared preferences file name
private static final String PREF_NAME = "Pildroid-Prefs";
private static final String IS_FIRST_TIME_LAUNCH = "IsFirstTimeLaunch";
private static final String DATABASE_VERSION = "DatabaseVersion";
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) {
pref = context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
}
public boolean isFirstTimeLaunch() {
return pref.getBoolean(IS_FIRST_TIME_LAUNCH, true);
}
public void setFirstTimeLaunch(boolean isFirstTime) {
editor = pref.edit();
editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime);
editor.apply();
}
public int getDatabaseVersion() {
return pref.getInt(DATABASE_VERSION, 0);
}
public void setDatabaseVersion(int version) {
editor = pref.edit();
editor.putInt(DATABASE_VERSION, version);
editor.apply();
}
public boolean isUnderstood() {
return pref.getBoolean(IS_UNDERSTOOD, false);
}
public void setUnderstood(boolean isUnderstood) {
editor = pref.edit();
editor.putBoolean(IS_UNDERSTOOD, isUnderstood);
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

@ -91,6 +91,7 @@ public class UtilDate {
/**
* Convert dateInMilliseconds into string formatted date
*
* @param dateInMilliseconds long
* @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.Prescription;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Locale;
@ -14,6 +13,7 @@ public class Utils {
/**
* Return a random number between two values - use to generate a false demo DB
*
* @param min minimal value accepted
* @param max maximum value accepted
* @return int random number
@ -23,8 +23,7 @@ public class Utils {
return r.nextInt(max - min) + max;
}
public static String fmt(double d)
{
public static String fmt(double d) {
if (d == (long) d)
return String.format(Locale.getDefault(), "%d", (long) d);
else
@ -49,14 +48,11 @@ public class Utils {
}
public static void sortPrescriptionList(List<Prescription> prescriptionList) {
prescriptionList.sort(new Comparator<>() {
@Override
public int compare(Prescription lhs, Prescription rhs) {
prescriptionList.sort((lhs, rhs) -> {
if (lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock()) != 0)
return lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock());
else
return (int) (lhs.getStock() - rhs.getStock());
}
});
}

View file

@ -1,7 +1,9 @@
package net.foucry.pilldroid;
import android.app.Dialog;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
@ -11,22 +13,52 @@ import android.view.Window;
import android.view.WindowInsets;
import android.view.WindowInsetsController;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.viewpager.widget.PagerAdapter;
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 {
private ViewPager viewPager;
private LinearLayout dotsLayout;
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;
@Override
@ -45,6 +77,12 @@ public class WelcomeActivity extends AppCompatActivity {
}
prefManager.setFirstTimeLaunch(false);
if (!prefManager.isUnderstood()) {
askForComprehensive();
prefManager.setUnderstood(true);
}
setContentView(R.layout.welcome_activity);
setFullScreen();
@ -81,16 +119,9 @@ public class WelcomeActivity extends AppCompatActivity {
viewPager.setAdapter(myViewPagerAdapter);
viewPager.addOnPageChangeListener(viewPagerPageChangeListener);
btnSkip.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
launchHomeScreen();
}
});
btnSkip.setOnClickListener(v -> launchHomeScreen());
btnNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
btnNext.setOnClickListener(v -> {
// checking for last page
// if last page home screen will be launched
int current = getItem();
@ -101,16 +132,39 @@ public class WelcomeActivity extends AppCompatActivity {
} else {
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) {
TextView[] dots = new TextView[layouts.length];
MaterialTextView[] dots = new MaterialTextView[layouts.length];
dotsLayout.removeAllViews();
for (int i = 0; i < dots.length; i++) {
dots[i] = new TextView(this);
dots[i] = new MaterialTextView(this);
dots[i].setText("");
dots[i].setTextSize(65);
dots[i].setTextColor(ContextCompat.getColor(this, R.color.dot_dark));
@ -131,36 +185,6 @@ public class WelcomeActivity extends AppCompatActivity {
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
*/
@ -170,6 +194,7 @@ public class WelcomeActivity extends AppCompatActivity {
window.setStatusBarColor(Color.TRANSPARENT);
}
@SuppressWarnings("deprecation")
private void setFullScreen() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
getWindow().setDecorFitsSystemWindows(false);
@ -178,9 +203,7 @@ public class WelcomeActivity extends AppCompatActivity {
controller.hide(WindowInsets.Type.statusBars() | WindowInsets.Type.navigationBars());
controller.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
}
}
else {
//noinspection
} else {
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
@ -222,7 +245,7 @@ public class WelcomeActivity extends AppCompatActivity {
@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;
container.removeView(view);
}

View file

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

View file

@ -28,11 +28,6 @@ import net.foucry.pilldroid.models.Prescription;
public abstract class PrescriptionDatabase extends RoomDatabase {
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) {
if (INSTANCE == null) {
INSTANCE =
@ -44,7 +39,14 @@ public abstract class PrescriptionDatabase extends RoomDatabase {
}
return INSTANCE;
}
public static void destroyInstance() {
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")
public class Medicine {
@PrimaryKey
@NonNull private Integer _id;
@NonNull
private Integer _id;
private String cis;
private String cip13;
private String cip7;

View file

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

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<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:duration="@integer/slide_animation_duration"/>
android:toXDelta="0" />
</set>

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<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:duration="@integer/slide_animation_duration"/>
android:toXDelta="0" />
</set>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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:duration="@integer/slide_animation_duration"/>
android:toXDelta="-100%p"/>
</set>

View file

@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<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:duration="@integer/slide_animation_duration"/>
android:toXDelta="100%p" />
</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"
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>

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

View file

@ -1,11 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@android:color/white"
android:orientation="vertical"
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
android:id="@+id/aboutHtml"
android:layout_width="match_parent"

View file

@ -1,15 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<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
android:id="@+id/zxing_barcode_surface"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/zxing_barcode_surface"
app:zxing_framing_rect_width="300dp"
app:zxing_framing_rect_height="150dp">
</com.journeyapps.barcodescanner.BarcodeView>
app:zxing_framing_rect_height="150dp"
app:zxing_framing_rect_width="300dp"/>
<com.journeyapps.barcodescanner.ViewfinderView
android:id="@+id/zxing_viewfinder_view"
@ -22,7 +21,7 @@
app:zxing_viewfinder_laser_visibility="true"
app:zxing_viewfinder_mask="@color/grey" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/zxing_status_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -30,10 +29,12 @@
android:layout_marginTop="@dimen/app_bar_height"
android:background="@color/zxing_transparent"
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:text="@string/zxing_msg_default_status"
android:textColor="@color/white"
android:textSize="32sp"
tools:ignore="PrivateResource" />
<ImageButton
@ -43,13 +44,11 @@
android:layout_gravity="bottom|start"
android:layout_margin="@dimen/fab_margin"
android:accessibilityHeading="true"
android:backgroundTint="@android:color/transparent"
android:clickable="false"
app:backgroundTint="@android:color/transparent"
android:contentDescription="@string/button_cancel"
android:cropToPadding="false"
android:foregroundTint="@android:color/darker_gray"
android:onClick="onCancel"
android:src="@drawable/ic_cancel_black_24dp" />
app:background="@android:color/darker_gray"
app:srcCompat="@drawable/ic_cancel_black_24dp" />
<ImageButton
android:id="@+id/keyboard_button"
@ -57,10 +56,9 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:backgroundTint="@android:color/transparent"
app:backgroundTint="@android:color/transparent"
android:contentDescription="@string/button_keyboard"
android:onClick="onKeyboard"
android:src="@drawable/ic_keyboard_black_24dp"
app:srcCompat="@drawable/ic_keyboard_black_24dp"
tools:ignore="PrivateResource" />
</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"?>
<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:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="net.foucry.pilldroid.CustomScannerActivity">
@ -21,10 +21,9 @@
android:layout_marginTop="@dimen/fab_margin"
android:layout_marginEnd="@dimen/fab_margin"
android:layout_marginBottom="@dimen/fab_margin"
android:backgroundTint="@android:color/transparent"
app:backgroundTint="@android:color/transparent"
android:contentDescription="@string/flashlightButton"
android:onClick="switchFlashlight"
android:src="@drawable/ic_baseline_highlight_24" />
app:srcCompat="@drawable/ic_baseline_highlight_24" />
</com.journeyapps.barcodescanner.DecoratedBarcodeView>
</RelativeLayout>

View file

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

View file

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

View file

@ -6,7 +6,7 @@
android:name="net.foucry.pilldroid.MedicamentListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layoutManager="LinearLayoutManager"
android:background="@drawable/list_selector"
app:layoutManager="LinearLayoutManager"
tools:context="net.foucry.pilldroid.DrugListActivity"
tools:listitem="@layout/drug_list_content" />

View file

@ -13,11 +13,14 @@
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<androidx.appcompat.widget.Toolbar
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
app:popupTheme="@style/AppTheme.PopupOverlay" />
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:titleTextColor="@color/white"/>
</com.google.android.material.appbar.AppBarLayout>
@ -25,31 +28,24 @@
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
android:layout_marginTop="?attr/actionBarSize">
<include
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>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
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"
tools:ignore="OnClick" />
app:srcCompat="@drawable/ic_add"
app:backgroundTint="@color/colorPrimary"
app:tint="@color/white"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

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

View file

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

View file

@ -1,46 +1,114 @@
<?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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp"
tools:ignore="MissingDefaultResource">
<TextView
android:id="@+id/textView"
<androidx.constraintlayout.widget.ConstraintLayout
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_height="wrap_content"
android:text="@string/enter_cip_13"
android:textAppearance="?android:attr/textAppearanceMedium" />
android:layout_marginStart="28dp"
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
android:id="@+id/edittext"
android:id="@+id/editcip13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
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:layout_marginEnd="28dp"
android:autofillHints="cip13"
android:ems="10"
android:text="34009"
android:textAlignment="viewEnd"
android:textSize="24dp" />
</RelativeLayout>
android:hint="@string/enter_cip_13"
android:inputType="number"
android:labelFor="@id/editcip13"
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"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:padding="10dp"
android:background="@drawable/list_selector"
android:weightSum="1">
<TextView
<com.google.android.material.textview.MaterialTextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/value"
android:layout_alignBottom="@+id/inputLayout"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_toStartOf="@id/value"
android:layout_toStartOf="@id/inputLayout"
android:gravity="center_vertical"
android:paddingStart="5dp"
android:paddingEnd="25dp"
@ -22,23 +22,28 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#040404"
android:textStyle="bold" />
<EditText
android:id="@+id/value"
android:layout_width="wrap_content"
android:layout_height="50dp"
<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="numberDecimal"
android:labelFor="@id/value"
android:paddingEnd="25dp"
android:paddingStart="5dp"
android:hint="@string/zero"
android:textColorHint="@color/grey"
android:paddingEnd="25dp"
android:textAlignment="gravity"
android:importantForAutofill="no"
android:textColorHint="@color/grey"
tools:ignore="LabelFor" />
</com.google.android.material.textfield.TextInputLayout>
</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"?>
<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_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true"
android:background="@color/bg_screen1"
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
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_height="wrap_content"
android:text="@string/slide1_Pilldroid"
@ -23,12 +23,12 @@
android:textSize="@dimen/slide_title"
android:textStyle="bold" />
<TextView
<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="58dp"
android:layout_marginTop="20dp"
android:paddingLeft="@dimen/desc_padding"
android:paddingRight="@dimen/desc_padding"
android:paddingStart="@dimen/desc_padding"
android:paddingEnd="@dimen/desc_padding"
android:text="@string/slide1_desc"
android:textAlignment="center"
android:textColor="@android:color/white"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,20 +1,21 @@
<?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_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_centerInParent="true"
android:background="@color/bg_screen2"
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
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_height="wrap_content"
android:paddingStart="@dimen/title_padding"

View file

@ -1,18 +1,20 @@
<?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_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/bg_screen4"
android:gravity="center"
android:orientation="vertical">
<ImageView
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="@dimen/img_width_height"
android:layout_height="@dimen/img_width_height"
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_height="wrap_content"
android:paddingStart="@dimen/title_padding"

View file

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

View file

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

View file

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

View file

@ -2,6 +2,15 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/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"
android:title="@string/help"/>
</menu>

View file

@ -21,6 +21,8 @@
<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">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 -->
<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="cancelled_scan">Scan annulé</string>
<string name="missing_camera_permission">Autorisation appareil photo manquante</string>
<string name="Yes">Oui, j\'ai compris</string>
<string name="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="Undo">Annuler</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>

View file

@ -10,11 +10,14 @@
<!-- Slide dimens -->
<dimen name="dots_height">75dp</dimen>
<dimen name="dots_margin_bottom">20dp</dimen>
<dimen name="button_margin_bottom">25dp</dimen>
<dimen name="img_width_height">240dp</dimen>
<dimen name="slide_title">30sp</dimen>
<dimen name="slide_desc">16sp</dimen>
<dimen name="desc_padding">40dp</dimen>
<dimen name="title_padding">20dp</dimen>
<dimen name="screen_shot_height">250dp</dimen>
<dimen name="ten_dp">10dp</dimen>
<dimen name="thirty_dp">30dp</dimen>
</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="return_scan_result"/>
<item type="id" name="startcip13" />
<item type="id" name="msg" />
<item type="id" name="cpl" />
</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="channel_description" translatable="false">Pilldroid_NotificationChannel</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 -->
<string name="slide1_Pilldroid">Welcome on Pilldroid</string>
@ -68,8 +70,13 @@
<string name="notInterpreted">Bar code cannot be interpreted</string>
<string name="cancelled_scan">Scan canceled</string>
<string name="missing_camera_permission">Missing camera permission</string>
<string name="Yes">Yes, I understood</string>
<string name="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="Undo">Undo</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>

View file

@ -1,11 +1,14 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.Material3.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</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 name="AppTheme.NoActionBar">
@ -13,8 +16,17 @@
<item name="windowNoTitle">true</item>
</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>

View file

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

View file

@ -1,6 +1,6 @@
# 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
la base données ;
- 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)
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).
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)
[Pilldroid](mailto:pilldroid@foucry.net)ou pilldroid@foucry.net.

View file

@ -1,12 +1,12 @@
# 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
que j'ai mis à la corriger ;
- 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;
- 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é.
@ -25,7 +25,7 @@ Merci pour votre aide et votre patience. Un petit mot fait toujours plaisir.
# 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
la base données ;
- 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)
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).
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)
[Pilldroid](mailto:pilldroid@foucry.net)ou pilldroid@foucry.net.

View file

@ -1,23 +1,19 @@
# Project-wide Gradle settings.
# 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
## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# 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
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# This option should only be used with decoupled projects. For more details, visit
# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
# 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
org.gradle.unsafe.configuration-cache=true
org.gradle.jvmargs=-Xmx2048M
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
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

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