Compare commits

..

96 commits

Author SHA1 Message Date
Jacques Foucry
b073d08f35
v0.350 changelogs files 2024-07-30 15:09:31 +02:00
Jacques Foucry
f1d14dde4d
Merge branch 'develop' into Release/V0.350-beta 2024-07-30 10:12:16 +00:00
jacques
cbd490aca6 Remove not used file witch make the compilation failed. 2024-07-30 11:59:11 +02:00
jacques
ecdedbc73d Change versionCode and versionName 2024-07-30 11:57:24 +02:00
jacques
2ce6c5d0d0 New version of the database with new medicines. 2024-07-30 11:19:03 +02:00
Jacques Foucry
7ec4e0e041
Bugfix/rewrite readme (#58)
* Change README text to be more positive

* Add automatic vim backup files to exclude

---------

Co-authored-by: Jacques <jacques@foucry.net>
2024-05-17 20:36:59 +02:00
Jacques Foucry
0a8bc41f61
Bugfix/gui improvment (#57)
* Change some options in order to make compilation/run in avd work

* Change layout for signedNumber

* Change button style (remove style statement).

* Change according to AndroidStudio. Change button  behaviors in EditCIP13.

---------

Co-authored-by: jacques <jacques+commit@foucry.net>
2024-05-17 19:39:28 +02:00
jacques
2ff8ff9e53 Change some options in order to make compilation/run in avd work 2024-05-17 19:16:49 +02:00
Jean-Baptiste
314112e4f6
Add new string (#56) 2024-05-05 19:04:25 +02:00
Jean-Baptiste
b21d33ee73
Update copyright (#46) 2024-04-21 12:27:29 +02:00
Jean-Baptiste
bd5781d392
Remove finish call method (#50) 2024-04-21 12:26:43 +02:00
Jean-Baptiste
c3625a844e
Add annotation to remove warnings (#51) 2024-04-21 12:25:27 +02:00
Jean-Baptiste
d7c5101820
Migrate to AppCompatActivity (#53) 2024-04-21 12:25:06 +02:00
Jean-Baptiste
fab05c77cf
Update name of french directory strings (#47)
Great Idea
2024-04-17 18:09:36 +02:00
Jean-Baptiste
f12b8cacd1
Update gradle scripts (#48) 2024-04-17 18:08:17 +02:00
Jean-Baptiste
7ab26a4d42
Improve dialog (#43) 2024-04-17 17:50:06 +02:00
Jean-Baptiste
b39a857199
Fix buttons not appears (#45) 2024-04-17 14:36:42 +02:00
Jean-Baptiste
cda6685c58
Improve RTL (#44) 2024-04-17 14:36:02 +02:00
Jean-Baptiste
081759fcfa
Use extend floating button (#42) 2024-04-17 14:35:16 +02:00
Jean-Baptiste
381b937a01
Use more modern method (#40) 2024-03-30 11:13:45 +01:00
Jean-Baptiste
406bb37aa9
Fix icon used in welcome layout (#39)
Co-authored-by: Jacques Foucry <github@foucry.net>
2024-03-30 11:12:57 +01:00
Jean-Baptiste
e92315c0ad
Fix link not opened (#38) 2024-03-30 11:10:22 +01:00
Jean-Baptiste
8668f67aa5
Update changelog (#37) 2024-03-30 11:09:33 +01:00
Jean-Baptiste
6a0a7b0030
Update gradle files (#36) 2024-03-30 11:08:26 +01:00
Jean-Baptiste
0012538cb9
Remove old files (#35) 2024-03-30 11:08:11 +01:00
Jean-Baptiste
fc439cc400
Use compat library to load drawables (#33) 2024-03-30 11:07:44 +01:00
Jean-Baptiste
3e5b0b1c66
Remove duplicate call (#31) 2024-03-30 11:07:13 +01:00
Jean-Baptiste
998fc604db
Improve readme (#34)
* Improve readme

* Remove space
2024-03-30 11:06:50 +01:00
jacques
aa4df4f05b add record in .gitignore 2024-03-29 21:57:00 +01:00
Jean-Baptiste
038e8bb174
Material 3 Migration (#26) 2024-03-29 18:06:38 +01:00
Jean-Baptiste
2d642d7627
Improve code of app (#28) 2024-03-29 16:08:57 +01:00
Jean-Baptiste
478b4751fd
Fix gradle deprecation (#27)
* Remove build config in properties file

* Add build config property in main module
2024-03-29 16:08:42 +01:00
Jean-Baptiste
004c28737b
Add onBackPressed method to do not generate crash (#29) 2024-03-29 16:04:37 +01:00
Jean-Baptiste
51c0bad937
Update gradle (#21) 2024-03-26 21:20:53 +01:00
Jean-Baptiste
3ba1c906cb
Update DrugListActivity (#22) 2024-03-26 21:20:31 +01:00
Jean-Baptiste
2f54326206
Use lambda everywhere (#23) 2024-03-26 21:17:58 +01:00
Jean-Baptiste
d11048d679
Improve welcome activity (#24) 2024-03-26 21:17:42 +01:00
Jean-Baptiste
fb4206f056
Improve drug detail activity (#25) 2024-03-26 21:16:21 +01:00
jacques
0c50427257 update somme dependencies, update compileSDK version, ugrade SDK
androidx.core:core cannot be updated, it generated to much error.
2023-09-22 18:41:19 +02:00
jacques
7785797145 Remove cast 2023-09-19 08:00:14 +02:00
jacques
2890afea19 Add new gray drawable for disabled button
Use the round_btn_disable drawable to show that de number of digit are not set.
2023-09-18 17:49:12 +02:00
jacques
f9b06100d4 Add id to avoid null pointer exception 2023-09-18 17:47:33 +02:00
jacques
faa4f91052 Add Backup Menu item 2023-09-16 13:13:40 +02:00
jacques
a624fea683 Add Todo 2023-09-16 13:13:20 +02:00
jacques
552031cbf1 Add Import/Export strings 2023-09-16 13:12:47 +02:00
jacques
38eeafa550 Change color for contrast 2023-08-25 21:24:03 +02:00
jacques
9e9447c0c7 Add some ids 2023-08-25 21:23:45 +02:00
jacques
d006277ac4 Rename file 2023-08-25 21:18:46 +02:00
jacques
73111c503f Fix minor bugs. 2023-08-17 17:52:10 +02:00
jacques
433f5a4f76 add shadow on Pilldroid icon for custom dialog 2023-08-17 17:51:07 +02:00
jacques
4e54c38452 add shadow on Pilldroid icon for custom dialog 2023-08-03 18:28:34 +02:00
jacques
85154e36e0 use new input_layout dialog 2023-07-26 22:00:23 +02:00
jacques
1558b0182a New dialog input layout 2023-07-26 21:59:31 +02:00
jacques
3a35ccbee5 Small changes 2023-07-24 11:04:43 +02:00
jacques
034d712ab8 Small changes 2023-07-24 11:02:38 +02:00
jacques
c8be494e66 Rewrite layout,stillbuggy with head_icon 2023-07-24 11:01:40 +02:00
jacques
5a6ee6a3e0 Small change 2023-07-23 18:28:37 +02:00
jacques
2dd9a07c55 Use new layout but still buggy 2023-07-23 18:28:05 +02:00
jacques
d736eece5f Update layout 2023-07-23 18:27:29 +02:00
jacques
b90e6d8e44 Update layout 2023-07-23 18:26:51 +02:00
jacques
be946d0327 Fix typo 2023-07-16 00:17:02 +02:00
jacques
98043556ef refactoring and add new custom layout for two button dialog 2023-07-16 00:13:43 +02:00
jacques
7d90b26c30 Add dimens for custom_dialog_two_button_layout 2023-07-16 00:13:04 +02:00
jacques
563c3fc796 Change custom_dialog_one_button_layout 2023-07-16 00:12:36 +02:00
jacques
3658fe165c add a second TextView in customlayout 2023-07-14 16:18:52 +02:00
jacques
3b84d41a44 Change askForComprehensive dialog to use customlayout 2023-07-14 12:29:52 +02:00
jacques
bffa1bc091 Change custom layout to constraint 2023-07-14 12:27:45 +02:00
jacques
21315727ed Delete unused file 2023-07-13 22:40:21 +02:00
jacques
334fc1d705 Change custom layout name 2023-07-13 22:33:23 +02:00
jacques
2b1dfa84cb Add custom layout 2023-07-13 22:30:10 +02:00
jacques
5ec704e890 Add vector images 2023-07-13 22:21:53 +02:00
jacques
7928aae782 Changes exclude; need other update 2023-07-13 22:18:21 +02:00
jacques
41db345e06 Add fontes 2023-07-13 22:17:12 +02:00
jacques
32ea92d628 Change askToAddToDB in order to custom layout. 2023-07-13 22:15:51 +02:00
jacques
102ad77932 Add a Style for custom Dialog 2023-07-13 22:12:09 +02:00
jacques
ae0969abb1 Add a string 2023-07-13 22:11:49 +02:00
jacques
b74a1e411d Upgrade Android Gradle Plugin from version 7.4.2 to 8.0.2 2023-06-30 21:39:12 +02:00
jacques
2da78dc31f Upgrade gradle to 7.5 2023-03-27 16:43:09 +02:00
jacques
13453ff7e4 Move askForComprehensive from DrugListActivity.java to WelcomeActivity.java 2023-01-10 12:09:21 +01:00
jacques
e9f5a373bb Move askForComprehensive from DrugListActivity.java to WelcomeActivity.java 2023-01-09 17:28:33 +01:00
jacques
f13860c000 Change Path for jks file 2023-01-09 17:24:51 +01:00
jacques
1a93cd3fd6 Add SCHEDULE_EXACT_ALARM permission 2023-01-09 17:24:04 +01:00
jacques
87fd45cfa1 Add debug code 2022-12-08 16:59:02 +01:00
jacques
9cf02aedda update gradle version to 7.4 2022-11-26 20:05:33 +01:00
jacques
61f93cb402 update gradle version to 7.3.1 2022-11-26 20:05:00 +01:00
jacques
d5b22890f0 Move package definition into AndroidManifest 2022-11-26 20:04:10 +01:00
jacques
188fe30abf Change com.google.android.material version to 1.7.0 2022-11-26 20:01:25 +01:00
jacques
0f75bff374 Change com.google.android.material verion to 1.7.0 2022-11-26 19:50:24 +01:00
jacques
84e7e565e1 Merge branch 'bugfix/button_in_dialog' into develop 2022-11-26 19:27:57 +01:00
jacques
8f8cc232ff Chnage title font arguments 2022-11-26 19:27:32 +01:00
jacques
1e44a786a6 Use the text ressource 2022-11-26 19:26:37 +01:00
jacques
dc2327f143 Merge branch 'feature/fix_entercip13' into develop 2022-10-05 10:20:25 +02:00
jacques
637e8e7e7e Create DialogMnuel entrie with contraints 2022-10-05 10:19:51 +02:00
jacques
e4a272b125 Androix.ConstraintLayout
Ugrade other dependencies
2022-10-05 10:18:51 +02:00
jacques
33fa352162 change layout of alert box 2022-08-18 20:41:06 +02:00
jacques
9bb5e62c48 As suggested by @Jean-BaptisteC, reformatting code with Android Studio 2022-08-03 19:02:25 +02:00
107 changed files with 2116 additions and 3234 deletions

6
.gitignore vendored
View file

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

View file

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

View file

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

View file

@ -1,121 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 31
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
<<<<<<< HEAD
implementation 'androidx.appcompat:appcompat:1.4.1'
=======
implementation 'androidx.appcompat:appcompat:1.4.0'
>>>>>>> 5fe29e5 (Change compileSskVersion)
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.7.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,121 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 31
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
<<<<<<< HEAD
implementation 'androidx.appcompat:appcompat:1.4.1'
=======
implementation 'androidx.appcompat:appcompat:1.4.0'
>>>>>>> 5fe29e5 (Change compileSskVersion)
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.7.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,121 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 31
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
<<<<<<< HEAD
implementation 'androidx.appcompat:appcompat:1.4.1'
=======
implementation 'androidx.appcompat:appcompat:1.4.0'
>>>>>>> 5fe29e5 (Change compileSskVersion)
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.7.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,121 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 31
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
<<<<<<< HEAD
implementation 'androidx.appcompat:appcompat:1.4.1'
=======
implementation 'androidx.appcompat:appcompat:1.4.0'
>>>>>>> 5fe29e5 (Change compileSskVersion)
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.7.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,117 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 30
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.6.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,117 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 30
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.6.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,117 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 30
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.6.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,117 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 30
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.6.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,117 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 31
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.7.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,117 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 31
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.7.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,117 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 31
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.7.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,117 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 31
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.7.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,117 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 31
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.6.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,117 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 31
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.6.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,117 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 31
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.6.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

@ -1,117 +0,0 @@
//noinspection GradleCompatible
apply plugin: 'com.android.application'
// Try reading secrets from file
def secretsPropertiesFile = rootProject.file("secrets.properties")
def secretProperties = new Properties()
if (secretsPropertiesFile.exists()) {
secretProperties.load(new FileInputStream(secretsPropertiesFile))
}
// Otherwise read from environment variables, this happens in CI
else {
secretProperties.setProperty("signing_keystore_password", "${System.getenv('signing_keystore_password')}")
secretProperties.setProperty("signing_key_password", "${System.getenv('signing_key_password')}")
secretProperties.setProperty("signing_key_alias", "${System.getenv('signing_key_alias')}")
}
android {
signingConfigs {
release {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_release_alias_key']
keyPassword secretProperties['signing_release_key_password']
}
prerelease {
storeFile rootProject.file("android-signing-keystore.jks")
storePassword secretProperties['signing_keystore_password']
keyAlias secretProperties['signing_pre-release_key_alias']
keyPassword secretProperties['signing_pre-release_key_password']
}
}
compileSdkVersion 31
defaultConfig {
applicationId "net.foucry.pilldroid"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode 100
versionName "v0.100-beta"
multiDexEnabled true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
applicationIdSuffix ".debug"
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.release
}
prerelease {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.prerelease
}
}
flavorDimensions "version"
productFlavors {
dev {
resValue "string", "app_name", "PillDroid dev"
dimension ="version"
}
product {
resValue "string", "app_name", "PillDroid"
dimension ="version"
}
preproduct {
resValue "string", "app_name", "PillDroid Pre-Release"
dimension ="version"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildToolsVersion '32.0.0'
allprojects {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}
}
}
repositories {
mavenCentral()
}
sourceSets {
main {
java {
exclude 'net/foucry/pilldroid/scanActivity.java'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
implementation 'androidx.core:core:1.6.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
}

View file

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

View file

@ -1,14 +0,0 @@
package net.foucry.pilldroid;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}

View file

@ -1,11 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.foucry.pilldroid"> xmlns:tools="http://schemas.android.com/tools"
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY"/>
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/> <uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<application <application
android:fullBackupContent="true" android:fullBackupContent="true"
@ -16,7 +22,8 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:allowBackup="true"> android:allowBackup="true"
tools:ignore="DiscouragedApi">
<activity <activity
android:name=".DrugListActivity" android:name=".DrugListActivity"
android:theme="@style/AppTheme.NoActionBar" android:theme="@style/AppTheme.NoActionBar"
@ -57,5 +64,8 @@
<action android:name="android.intent.action.BOOT_COMPLETED"/> <action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter> </intent-filter>
</receiver> </receiver>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
</application> </application>
</manifest> </manifest>

View file

@ -20,6 +20,7 @@
<body> <body>
<div style="text-align: center;"><img src="file:///android_asset/icon_pilldroid.png" width="64" alt="Icône de l'application Pilldroid"/></div> <div style="text-align: center;"><img src="file:///android_asset/icon_pilldroid.png" width="64" alt="Icône de l'application Pilldroid"/></div>
<div class="build"><p>[feb95329be7d05c6fd17d4ba4b72ca48c7bb294e]</p></div> <div class="build"><p>[feb95329be7d05c6fd17d4ba4b72ca48c7bb294e]</p></div>
<h5>Pilldroid &copy;&nbsp;2024 Jacques Foucry </h5> <h5>Pilldroid &copy;&nbsp;2024 Jacques Foucry </h5>
<p>Pilldroid est une gestion théorique de votre stock de médicaments.</p> <p>Pilldroid est une gestion théorique de votre stock de médicaments.</p>
<p>Pilldroid n'a aucune connaissance des interactions des médicaments entre eux.</p> <p>Pilldroid n'a aucune connaissance des interactions des médicaments entre eux.</p>

Binary file not shown.

View file

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

View file

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

View file

@ -1,6 +1,5 @@
package net.foucry.pilldroid; package net.foucry.pilldroid;
import android.app.Activity;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Bundle; import android.os.Bundle;
@ -11,8 +10,7 @@ import android.widget.ImageButton;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.journeyapps.barcodescanner.BarcodeCallback; import androidx.appcompat.app.AppCompatActivity;
import com.journeyapps.barcodescanner.BarcodeResult;
import com.journeyapps.barcodescanner.CaptureManager; import com.journeyapps.barcodescanner.CaptureManager;
import com.journeyapps.barcodescanner.DecoratedBarcodeView; import com.journeyapps.barcodescanner.DecoratedBarcodeView;
import com.journeyapps.barcodescanner.ViewfinderView; import com.journeyapps.barcodescanner.ViewfinderView;
@ -20,17 +18,15 @@ import com.journeyapps.barcodescanner.ViewfinderView;
/** /**
* Custom Scanner Activity extending from Activity to display a custom layout form scanner view. * Custom Scanner Activity extending from Activity to display a custom layout form scanner view.
*/ */
public class CustomScannerActivity extends Activity implements DecoratedBarcodeView.TorchListener { public class CustomScannerActivity extends AppCompatActivity implements DecoratedBarcodeView.TorchListener {
private static final String TAG = CustomScannerActivity.class.getName(); private static final String TAG = CustomScannerActivity.class.getName();
final Bundle captureIntentBundle = new Bundle();
private CaptureManager capture; private CaptureManager capture;
private DecoratedBarcodeView barcodeScannerView; private DecoratedBarcodeView barcodeScannerView;
private ImageButton switchFlashlightButton; private ImageButton switchFlashlightButton;
private ViewfinderView viewfinderView; private ViewfinderView viewfinderView;
final Bundle captureIntentBundle = new Bundle();
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -59,19 +55,16 @@ public class CustomScannerActivity extends Activity implements DecoratedBarcodeV
//changeMaskColor(null); //changeMaskColor(null);
changeLaserVisibility(true); changeLaserVisibility(true);
barcodeScannerView.decodeSingle(new BarcodeCallback() { barcodeScannerView.decodeSingle(result -> {
@Override Intent scanResult = new Intent();
public void barcodeResult(BarcodeResult result) { //Bundle scanResultBundle = new Bundle();
Intent scanResult = new Intent(); scanResult.putExtra("Barcode Content", result.getText());
//Bundle scanResultBundle = new Bundle(); scanResult.putExtra("Barcode Format name", result.getBarcodeFormat().name());
scanResult.putExtra("Barcode Content", result.getText()); scanResult.putExtra("returnCode", captureIntentBundle.getInt("returnCode"));
scanResult.putExtra("Barcode Format name", result.getBarcodeFormat().name()); scanResult.putExtra("resultCode", 1);
scanResult.putExtra("returnCode", captureIntentBundle.getInt("returnCode")); CustomScannerActivity.this.setResult(RESULT_OK, scanResult);
scanResult.putExtra("resultCode", 1); Log.d(TAG, "scanResult == " + scanResult);
CustomScannerActivity.this.setResult(RESULT_OK, scanResult); finish();
Log.d(TAG, "scanResult == " + scanResult);
finish();
}
}); });
} }
@ -93,6 +86,11 @@ public class CustomScannerActivity extends Activity implements DecoratedBarcodeV
capture.onDestroy(); capture.onDestroy();
} }
@Override
public void onBackPressed(){
onCancel(this.getCurrentFocus());
}
@Override @Override
protected void onSaveInstanceState(Bundle outState) { protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState); super.onSaveInstanceState(outState);
@ -147,7 +145,7 @@ public class CustomScannerActivity extends Activity implements DecoratedBarcodeV
public void onKeyboard(View view) { public void onKeyboard(View view) {
Log.d(TAG, "onkeyboard"); Log.d(TAG, "onkeyboard");
Intent resultIntent = new Intent(); Intent resultIntent = new Intent();
resultIntent.putExtra("returnCode",3); resultIntent.putExtra("returnCode", 3);
CustomScannerActivity.this.setResult(RESULT_OK, resultIntent); CustomScannerActivity.this.setResult(RESULT_OK, resultIntent);
finish(); finish();
} }

View file

@ -21,35 +21,29 @@ class DBDrugs extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 1; private static final int DATABASE_VERSION = 1;
private static final String dbName = "drugs.db"; private static final String dbName = "drugs.db";
private static final String TABLE_NAME = "drugs";
private static final String DRUG_CIS = "cis";
private static final String DRUG_CIP13 = "cip13";
private static final String DRUG_CIP7 = "cip7";
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 Context myContext;
private final SQLiteDatabase myDataBase = null; 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";
private static final String DRUG_CIP7 = "cip7";
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();
DBDrugs(Context context) { DBDrugs(Context context) {
super(context, dbName, null, DATABASE_VERSION); super(context, dbName, null, DATABASE_VERSION);
this.myContext = context; this.myContext = context;
} }
public boolean isDBFileExist(File database) public boolean isDBFileExist(File database) {
{ try {
try {
myContext.getDatabasePath(String.valueOf(database)); myContext.getDatabasePath(String.valueOf(database));
} } catch (final Exception e) {
catch (final Exception e){
return false; return false;
} }
return true; return true;
@ -166,26 +160,24 @@ class DBDrugs extends SQLiteOpenHelper {
String getCIP13FromCIP7(String cip7) { String getCIP13FromCIP7(String cip7) {
String cip13 = null; String cip13 = null;
try { try {
Cursor c = this.getReadableDatabase().rawQuery("SELECT cip13 FROM "+ TABLE_NAME + " where cip7 = "+cip7, null); Cursor c = this.getReadableDatabase().rawQuery("SELECT cip13 FROM " + TABLE_NAME + " where cip7 = " + cip7, null);
Log.d(TAG, "Cursor == " + DatabaseUtils.dumpCursorToString(c)); Log.d(TAG, "Cursor == " + DatabaseUtils.dumpCursorToString(c));
c.moveToFirst(); c.moveToFirst();
if(c.getCount()>0) if (c.getCount() > 0) {
{ cip13 = c.getString(0);
cip13 = c.getString(0);
}
c.close();
} catch(Exception e)
{
e.printStackTrace();
} }
return cip13; c.close();
} catch (Exception e) {
e.printStackTrace();
} }
return cip13;
}
Drug getDrugByCIP7(String cip7) { Drug getDrugByCIP7(String cip7) {
Log.d(TAG, "CIP7 - " + cip7); Log.d(TAG, "CIP7 - " + cip7);

View file

@ -10,7 +10,6 @@ import android.text.format.DateUtils;
import android.util.Log; import android.util.Log;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.List; import java.util.List;
/** /**
@ -18,31 +17,27 @@ import java.util.List;
*/ */
class DBHelper extends SQLiteOpenHelper { class DBHelper extends SQLiteOpenHelper {
private static final int DATABASE_VERSION = 1; private static final int DATABASE_VERSION = 1;
private static final String DATABASE_NAME = "prescription.db"; private static final String DATABASE_NAME = "prescription.db";
private static final String TABLE_DRUG = "drug"; private static final String TABLE_DRUG = "drug";
private static final String KEY_ID = "id"; private static final String KEY_ID = "id";
private static final String KEY_CIS = "cis"; private static final String KEY_CIS = "cis";
private static final String KEY_CIP13 = "cip13"; private static final String KEY_CIP13 = "cip13";
private static final String KEY_NAME = "name"; private static final String KEY_NAME = "name";
private static final String KEY_ADMIN = "administration_mode"; private static final String KEY_ADMIN = "administration_mode";
private static final String KEY_PRES = "presentation"; private static final String KEY_PRES = "presentation";
private static final String KEY_STOCK = "stock"; private static final String KEY_STOCK = "stock";
private static final String KEY_TAKE = "take"; private static final String KEY_TAKE = "take";
private static final String KEY_THRESHOLD_WARN = "warning"; private static final String KEY_THRESHOLD_WARN = "warning";
private static final String KEY_THRESHOLD_ALERT = "alert"; private static final String KEY_THRESHOLD_ALERT = "alert";
private static final String KEY_LAST_UPDATE = "last_update"; private static final String KEY_LAST_UPDATE = "last_update";
final List<Drug> drugs = new ArrayList<>();
private static final String TAG = DBHelper.class.getName(); private static final String TAG = DBHelper.class.getName();
private static final String[] COLUMNS = {KEY_ID, KEY_CIS, KEY_CIP13, KEY_NAME, KEY_ADMIN, KEY_PRES, KEY_STOCK, KEY_TAKE,
private static final String[] COLUMNS = {KEY_ID, KEY_CIS,KEY_CIP13, KEY_NAME, KEY_ADMIN, KEY_PRES, KEY_STOCK, KEY_TAKE,
KEY_THRESHOLD_WARN, KEY_THRESHOLD_ALERT, KEY_LAST_UPDATE}; KEY_THRESHOLD_WARN, KEY_THRESHOLD_ALERT, KEY_LAST_UPDATE};
final List<Drug> drugs = new ArrayList<>();
DBHelper(Context context) { DBHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION); super(context, DATABASE_NAME, null, DATABASE_VERSION);
@ -53,7 +48,7 @@ class DBHelper extends SQLiteOpenHelper {
String CREATE_DRUG_TABLE = "CREATE TABLE drug ( " + String CREATE_DRUG_TABLE = "CREATE TABLE drug ( " +
"id INTEGER PRIMARY KEY AUTOINCREMENT," + "id INTEGER PRIMARY KEY AUTOINCREMENT," +
"cis TEXT, " + "cis TEXT, " +
"cip13 TEXT, " + "cip13 TEXT, " +
"name TEXT, " + "name TEXT, " +
"administration_mode TEXT, " + "administration_mode TEXT, " +
"presentation TEXT, " + "presentation TEXT, " +
@ -88,6 +83,7 @@ class DBHelper extends SQLiteOpenHelper {
/** /**
* Split drug values into database record and record it to the DB * Split drug values into database record and record it to the DB
*
* @param drug the drug object to be saved * @param drug the drug object to be saved
*/ */
void addDrug(Drug drug) { void addDrug(Drug drug) {
@ -123,6 +119,7 @@ class DBHelper extends SQLiteOpenHelper {
/** /**
* return a drug from the DB with is id * return a drug from the DB with is id
*
* @param id of the drug we looking for (not used) * @param id of the drug we looking for (not used)
* @return return the found drug of null * @return return the found drug of null
*/ */
@ -134,7 +131,7 @@ class DBHelper extends SQLiteOpenHelper {
Cursor cursor = db.query(TABLE_DRUG, // Which table Cursor cursor = db.query(TABLE_DRUG, // Which table
COLUMNS, // column names COLUMNS, // column names
" id = ?", // selections " id = ?", // selections
new String[] { String.valueOf(id) }, // selections args new String[]{String.valueOf(id)}, // selections args
null, // group by null, // group by
null, // having null, // having
null, // order by null, // order by
@ -161,7 +158,7 @@ class DBHelper extends SQLiteOpenHelper {
drug.setDateLastUpdate(Long.parseLong(cursor.getString(10))); drug.setDateLastUpdate(Long.parseLong(cursor.getString(10)));
} }
// Log // Log
Log.d(TAG, "getDrug("+id+")" + drug); Log.d(TAG, "getDrug(" + id + ")" + drug);
assert cursor != null; assert cursor != null;
cursor.close(); cursor.close();
@ -172,7 +169,6 @@ class DBHelper extends SQLiteOpenHelper {
} }
/** /**
*
* @param cip13 drug id in French nomenclature * @param cip13 drug id in French nomenclature
* @return the drug object found in DB or null * @return the drug object found in DB or null
*/ */
@ -218,7 +214,6 @@ class DBHelper extends SQLiteOpenHelper {
} }
/** /**
*
* @return a Sorted and updated by dateEndOfStock List of All drugs presents in database * @return a Sorted and updated by dateEndOfStock List of All drugs presents in database
*/ */
@ -262,43 +257,36 @@ class DBHelper extends SQLiteOpenHelper {
db.close(); db.close();
Drug currentDrug; Drug currentDrug;
for (int position = 0 ; position < getCount() ; position++ ) { for (int position = 0; position < getCount(); position++) {
currentDrug = getItem(position); currentDrug = getItem(position);
if (!DateUtils.isToday(currentDrug.getDateLastUpdate())) if (!DateUtils.isToday(currentDrug.getDateLastUpdate())) {
{
currentDrug.newStock(); currentDrug.newStock();
updateDrug(currentDrug); updateDrug(currentDrug);
} }
} }
Log.d(TAG, "Before sort == " + drugs); Log.d(TAG, "Before sort == " + drugs);
drugs.sort(new Comparator<Drug>() { drugs.sort((lhs, rhs) -> {
@Override if (lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock()) != 0)
public int compare(Drug lhs, Drug rhs) { return lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock());
if (lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock()) != 0) else
return lhs.getDateEndOfStock().compareTo(rhs.getDateEndOfStock()); return (int) (lhs.getStock() - rhs.getStock());
else
return (int) (lhs.getStock() - rhs.getStock());
}
}); });
Log.d(TAG, "After sort " + drugs); Log.d(TAG, "After sort " + drugs);
// Move drug with prise = 0 at the end of the list // Move drug with prise = 0 at the end of the list
// todo: If some drug moved, must redo all the loop // todo: If some drug moved, must redo all the loop
int position = 0 ; int position = 0;
for ( int nbOps = 0; nbOps < getCount() ; nbOps ++ ) { for (int nbOps = 0; nbOps < getCount(); nbOps++) {
currentDrug = getItem(position); currentDrug = getItem(position);
double currentTake = currentDrug.getTake(); double currentTake = currentDrug.getTake();
if (currentTake == 0) if (currentTake == 0) {
{
drug = drugs.remove(position); drug = drugs.remove(position);
drugs.add(drug); drugs.add(drug);
} else } else {
{
position++; position++;
} }
} }
@ -306,7 +294,6 @@ class DBHelper extends SQLiteOpenHelper {
} }
/** /**
*
* @param drug object to be updated in DB * @param drug object to be updated in DB
*/ */
public void updateDrug(Drug drug) { public void updateDrug(Drug drug) {
@ -319,19 +306,19 @@ class DBHelper extends SQLiteOpenHelper {
// Create ContentValues to add column/value // Create ContentValues to add column/value
ContentValues values = new ContentValues(); ContentValues values = new ContentValues();
values.put(KEY_ID, drug.getId()); values.put(KEY_ID, drug.getId());
values.put(KEY_CIS, drug.getCis()); values.put(KEY_CIS, drug.getCis());
values.put(KEY_CIP13, drug.getCip13()); values.put(KEY_CIP13, drug.getCip13());
values.put(KEY_NAME, drug.getName()); values.put(KEY_NAME, drug.getName());
values.put(KEY_ADMIN, drug.getAdministration_mode()); values.put(KEY_ADMIN, drug.getAdministration_mode());
values.put(KEY_PRES, drug.getPresentation()); values.put(KEY_PRES, drug.getPresentation());
values.put(KEY_STOCK, drug.getStock()); values.put(KEY_STOCK, drug.getStock());
values.put(KEY_TAKE, drug.getTake()); values.put(KEY_TAKE, drug.getTake());
values.put(KEY_THRESHOLD_WARN, drug.getWarnThreshold()); values.put(KEY_THRESHOLD_WARN, drug.getWarnThreshold());
values.put(KEY_THRESHOLD_ALERT, drug.getAlertThreshold()); values.put(KEY_THRESHOLD_ALERT, drug.getAlertThreshold());
values.put(KEY_LAST_UPDATE, drug.getDateLastUpdate()); values.put(KEY_LAST_UPDATE, drug.getDateLastUpdate());
String[] selectionArgs = { String.valueOf(drug.getId()) }; String[] selectionArgs = {String.valueOf(drug.getId())};
db.update(TABLE_DRUG, // table db.update(TABLE_DRUG, // table
values, // column/value values, // column/value
@ -345,6 +332,7 @@ class DBHelper extends SQLiteOpenHelper {
/** /**
* Delete a drug object in database * Delete a drug object in database
*
* @param drug object to be delete in the DB * @param drug object to be delete in the DB
*/ */
public void deleteDrug(Drug drug) { public void deleteDrug(Drug drug) {
@ -353,18 +341,19 @@ class DBHelper extends SQLiteOpenHelper {
// Delete record // Delete record
db.delete(TABLE_DRUG, // table db.delete(TABLE_DRUG, // table
KEY_ID+ " = ?", // selections KEY_ID + " = ?", // selections
new String[] { String.valueOf(drug.getId()) } ); // selections args new String[]{String.valueOf(drug.getId())}); // selections args
// Close DB // Close DB
db.close(); db.close();
// log // log
Log.d(TAG, "delete drug "+ drug); Log.d(TAG, "delete drug " + drug);
} }
/** /**
* Get count of all drug present in database * Get count of all drug present in database
*
* @return number of drug in DB * @return number of drug in DB
*/ */
int getCount() { int getCount() {
@ -389,15 +378,13 @@ class DBHelper extends SQLiteOpenHelper {
boolean isDrugExist(String cip13) { boolean isDrugExist(String cip13) {
boolean value = false; boolean value = false;
try { try {
Cursor c = this.getReadableDatabase().rawQuery("SELECT * FROM "+ TABLE_DRUG + " where cip13 = "+cip13, null); Cursor c = this.getReadableDatabase().rawQuery("SELECT * FROM " + TABLE_DRUG + " where cip13 = " + cip13, null);
if(c.getCount()>0) if (c.getCount() > 0) {
{
value = true; value = true;
} }
c.close(); c.close();
} catch(Exception e) } catch (Exception e) {
{
e.printStackTrace(); e.printStackTrace();
} }
return value; return value;

View file

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

View file

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

View file

@ -13,7 +13,7 @@ public class DrugDetailContract extends ActivityResultContract<Intent, Integer>
* Create an intent that can be used for {@link Activity#startActivityForResult} * Create an intent that can be used for {@link Activity#startActivityForResult}
* *
* @param context Context * @param context Context
* @param input Drug * @param input Drug
*/ */
@NonNull @NonNull
@Override @Override
@ -26,8 +26,9 @@ public class DrugDetailContract extends ActivityResultContract<Intent, Integer>
/** /**
* Convert result obtained from to O * Convert result obtained from to O
*
* @param resultCode Integer * @param resultCode Integer
* @param intent Intent * @param intent Intent
* @return Integer * @return Integer
*/ */
@Override @Override

View file

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

View file

@ -4,13 +4,16 @@ import static net.foucry.pilldroid.UtilDate.date2String;
import static net.foucry.pilldroid.Utils.intRandomExclusive; import static net.foucry.pilldroid.Utils.intRandomExclusive;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Dialog;
import android.app.NotificationManager; import android.app.NotificationManager;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint; import android.graphics.Paint;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -23,22 +26,26 @@ import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.Window;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import androidx.activity.result.ActivityResultLauncher; import androidx.activity.result.ActivityResultLauncher;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.room.Room; import androidx.room.Room;
import com.google.android.material.appbar.MaterialToolbar;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
import com.google.android.material.textview.MaterialTextView;
import com.google.zxing.client.android.BuildConfig;
import com.google.zxing.client.android.Intents; import com.google.zxing.client.android.Intents;
import com.journeyapps.barcodescanner.ScanOptions; import com.journeyapps.barcodescanner.ScanOptions;
@ -53,8 +60,7 @@ import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Objects;
import com.google.zxing.client.android.BuildConfig;
/** /**
* An activity representing a list of Drugs is activity * An activity representing a list of Drugs is activity
@ -65,19 +71,15 @@ import com.google.zxing.client.android.BuildConfig;
* item details side-by-side using two vertical panes. * item details side-by-side using two vertical panes.
*/ */
public class DrugListActivity extends AppCompatActivity { public class DrugListActivity extends AppCompatActivity {
// Used for dev and debug private static final String TAG = DrugListActivity.class.getName();
final Boolean DEMO = false;
public final int CUSTOMIZED_REQUEST_CODE = 0x0000ffff; public final int CUSTOMIZED_REQUEST_CODE = 0x0000ffff;
public final String BARCODE_FORMAT_NAME = "Barcode Format name"; public final String BARCODE_FORMAT_NAME = "Barcode Format name";
public final String BARCODE_CONTENT = "Barcode Content"; public final String BARCODE_CONTENT = "Barcode Content";
// Used for dev and debug
private ActivityResultLauncher<ScanOptions> mBarcodeScannerLauncher; final Boolean DEMO = false;
private static final String TAG = DrugListActivity.class.getName();
public PrescriptionDatabase prescriptions; public PrescriptionDatabase prescriptions;
public MedicineDatabase medicines; public MedicineDatabase medicines;
private ActivityResultLauncher<ScanOptions> mBarcodeScannerLauncher;
private List<Prescription> prescriptionList; // used for prescriptions private List<Prescription> prescriptionList; // used for prescriptions
private RecyclerViewAdapter mAdapter; private RecyclerViewAdapter mAdapter;
@ -86,7 +88,7 @@ public class DrugListActivity extends AppCompatActivity {
public void onStart() { public void onStart() {
super.onStart(); super.onStart();
if(BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
String manufacturer = Build.MANUFACTURER; String manufacturer = Build.MANUFACTURER;
String model = Build.MODEL; String model = Build.MODEL;
int version = Build.VERSION.SDK_INT; int version = Build.VERSION.SDK_INT;
@ -108,13 +110,13 @@ public class DrugListActivity extends AppCompatActivity {
// Manually migrate old database to room // Manually migrate old database to room
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO(); PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
DBHelper dbHelper = new DBHelper(this); DBHelper dbHelper = new DBHelper(this);
if (dbHelper.getCount() !=0) { if (dbHelper.getCount() != 0) {
List<Drug> drugs=dbHelper.getAllDrugs(); List<Drug> drugs = dbHelper.getAllDrugs();
for (int count=0; count < dbHelper.getCount(); count++) { for (int count = 0; count < dbHelper.getCount(); count++) {
Drug drug = drugs.get(count); Drug drug = drugs.get(count);
Prescription prescription = new Prescription(); Prescription prescription = new Prescription();
if(prescriptionsDAO.getMedicByCIP13(drug.getCip13()) == null) { if (prescriptionsDAO.getMedicByCIP13(drug.getCip13()) == null) {
prescription.setName(drug.getName()); prescription.setName(drug.getName());
prescription.setCip13(drug.getCip13()); prescription.setCip13(drug.getCip13());
prescription.setCis(drug.getCis()); prescription.setCis(drug.getCis());
@ -127,8 +129,7 @@ public class DrugListActivity extends AppCompatActivity {
prescription.setLast_update(drug.getDateLastUpdate()); prescription.setLast_update(drug.getDateLastUpdate());
prescriptionsDAO.insert(prescription); prescriptionsDAO.insert(prescription);
} } else {
else {
Log.i(TAG, "Already in the database"); Log.i(TAG, "Already in the database");
} }
} }
@ -142,18 +143,10 @@ public class DrugListActivity extends AppCompatActivity {
} }
// start tutorial (only in non debug mode) // start tutorial (only in non debug mode)
// if(!net.foucry.pilldroid.BuildConfig.DEBUG) { // if(!net.foucry.pilldroid.BuildConfig.DEBUG) {
Log.i(TAG, "Launch tutorial"); Log.i(TAG, "Launch tutorial");
startActivity(new Intent(this, WelcomeActivity.class)); startActivity(new Intent(this, WelcomeActivity.class));
// } // }
PrefManager prefManager = new PrefManager(this);
if (!prefManager.isUnderstood()) {
askForComprehensive();
prefManager.setUnderstood(true);
}
} }
@Override @Override
@ -165,11 +158,12 @@ public class DrugListActivity extends AppCompatActivity {
super.onPause(); super.onPause();
Log.d(TAG, "onPause"); Log.d(TAG, "onPause");
if (!AlarmReceiver.isAlarmScheduled(this)){ if (!AlarmReceiver.isAlarmScheduled(this)) {
AlarmReceiver.scheduleAlarm(this); AlarmReceiver.scheduleAlarm(this);
} }
} }
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -184,41 +178,43 @@ public class DrugListActivity extends AppCompatActivity {
// Set view content // Set view content
setContentView(R.layout.drug_list_activity); setContentView(R.layout.drug_list_activity);
Toolbar toolbar = findViewById(R.id.toolbar); MaterialToolbar toolbar = findViewById(R.id.toolbar);
if (toolbar != null) { if (toolbar != null) {
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
toolbar.setTitle(getTitle()); toolbar.setTitle(getTitle());
} }
FloatingActionButton mFloatingActionButton = findViewById(R.id.fab);
mFloatingActionButton.setOnClickListener(v-> onButtonClick());
if (DEMO) { if (DEMO) {
PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO(); PrescriptionsDAO prescriptionsDAO = prescriptions.getPrescriptionsDAO();
if (prescriptionsDAO.getMedicCount() == 0) { if (prescriptionsDAO.getMedicCount() == 0) {
final int min_stock = 5; final int min_stock = 5;
final int max_stock = 50; final int max_stock = 50;
final int min_take = 0; final int min_take = 0;
final int max_take = 3; final int max_take = 3;
for (int i = 1; i < 9; i++) { for (int i = 1; i < 9; i++) {
Prescription prescription = new Prescription(); Prescription prescription = new Prescription();
prescription.setName("Medicament test " + i); prescription.setName("Medicament test " + i);
prescription.setCip13("340093000001" + i); prescription.setCip13("340093000001" + i);
prescription.setCis("6000001" + i); prescription.setCis("6000001" + i);
prescription.setAdministration_mode("oral"); prescription.setAdministration_mode("oral");
prescription.setPresentation("plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)"); prescription.setPresentation("plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)");
prescription.setStock((float) intRandomExclusive(min_stock, max_stock)); prescription.setStock((float) intRandomExclusive(min_stock, max_stock));
prescription.setTake((float) intRandomExclusive(min_take, max_take)); prescription.setTake((float) intRandomExclusive(min_take, max_take));
prescription.setWarning(14); prescription.setWarning(14);
prescription.setAlert(7); prescription.setAlert(7);
prescription.setLast_update(UtilDate.dateAtNoon(new Date()).getTime()); prescription.setLast_update(UtilDate.dateAtNoon(new Date()).getTime());
prescriptionsDAO.insert(prescription); prescriptionsDAO.insert(prescription);
} }
List<Prescription> prescriptions = prescriptionsDAO.getAllMedics(); List<Prescription> prescriptions = prescriptionsDAO.getAllMedics();
System.out.println(prescriptions); System.out.println(prescriptions);
Log.d(TAG, "prescriptions ==" + prescriptions); Log.d(TAG, "prescriptions ==" + prescriptions);
} }
} }
mBarcodeScannerLauncher = registerForActivityResult(new PilldroidScanContract(), mBarcodeScannerLauncher = registerForActivityResult(new PilldroidScanContract(),
@ -230,6 +226,7 @@ public class DrugListActivity extends AppCompatActivity {
Log.d(TAG, "Missing camera permission"); Log.d(TAG, "Missing camera permission");
Toast.makeText(this, R.string.missing_camera_permission, Toast.LENGTH_LONG).show(); Toast.makeText(this, R.string.missing_camera_permission, Toast.LENGTH_LONG).show();
} else { } else {
assert bundle != null;
Log.d(TAG, "bundle == " + bundle.getInt("returnCode")); Log.d(TAG, "bundle == " + bundle.getInt("returnCode"));
int returnCode = bundle.getInt("returnCode"); int returnCode = bundle.getInt("returnCode");
int resultCode = bundle.getInt("resultCode"); int resultCode = bundle.getInt("resultCode");
@ -253,13 +250,13 @@ public class DrugListActivity extends AppCompatActivity {
} }
String cip13; String cip13;
switch (bundle.getString(BARCODE_FORMAT_NAME)) { switch (Objects.requireNonNull(bundle.getString(BARCODE_FORMAT_NAME))) {
case "CODE_128": case "CODE_128":
case "EAN_13": //CODE_128 || EAN 13 case "EAN_13": //CODE_128 || EAN 13
cip13 = bundle.getString(BARCODE_CONTENT); cip13 = bundle.getString(BARCODE_CONTENT);
break; break;
case "DATA_MATRIX": case "DATA_MATRIX":
cip13 = bundle.getString(BARCODE_CONTENT).substring(4, 17); cip13 = Objects.requireNonNull(bundle.getString(BARCODE_CONTENT)).substring(4, 17);
break; break;
default: default:
scanNotOK(); scanNotOK();
@ -323,7 +320,7 @@ public class DrugListActivity extends AppCompatActivity {
} }
// Launch scan // Launch scan
public void onButtonClick(View v) { public void onButtonClick() {
Log.d(TAG, "add medication"); Log.d(TAG, "add medication");
ScanOptions options = new ScanOptions(); ScanOptions options = new ScanOptions();
options.setDesiredBarcodeFormats(ScanOptions.DATA_MATRIX, ScanOptions.CODE_128); options.setDesiredBarcodeFormats(ScanOptions.DATA_MATRIX, ScanOptions.CODE_128);
@ -332,11 +329,10 @@ public class DrugListActivity extends AppCompatActivity {
options.setBarcodeImageEnabled(true); options.setBarcodeImageEnabled(true);
options.setTimeout(60); options.setTimeout(60);
options.setCaptureActivity(CustomScannerActivity.class); options.setCaptureActivity(CustomScannerActivity.class);
options.setBeepEnabled(true);
options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.MIXED_SCAN); options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.MIXED_SCAN);
options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.INVERTED_SCAN); options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.INVERTED_SCAN);
Log.d(TAG, "scanOptions == " + options); Log.d(TAG, "scanOptions == " + options);
mBarcodeScannerLauncher.launch(options); mBarcodeScannerLauncher.launch(options);
} }
@ -344,42 +340,62 @@ public class DrugListActivity extends AppCompatActivity {
* show keyboardInput dialog * show keyboardInput dialog
*/ */
protected void showInputDialog() { protected void showInputDialog() {
// get prompts.xml view final Dialog dialog = new Dialog(this);
LayoutInflater layoutInflater = LayoutInflater.from(DrugListActivity.this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
View promptView = layoutInflater.inflate(R.layout.input_dialog, null); Objects.requireNonNull(dialog.getWindow()).setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(DrugListActivity.this);
alertDialogBuilder.setView(promptView);
final EditText editText = promptView.findViewById(R.id.edittext); dialog.setCancelable(true);
// setup a dialog window dialog.setCanceledOnTouchOutside(true);
dialog.setContentView(R.layout.input_dialog);
alertDialogBuilder.setCancelable(false) MaterialButton ok = dialog.findViewById(R.id.agreed);
.setPositiveButton("OK", (dialog, id) -> { MaterialButton cancel = dialog.findViewById(R.id.notagreed);
//String cip13 = editText.getText().toString(); ok.setEnabled(false);
String cip13 = "34009" + editText.getText().toString(); ok.setBackground(Objects.requireNonNull(ContextCompat.getDrawable(this, R.drawable.rounded_btn_disabled)));
MedicinesDAO medicineDAO = medicines.getMedicinesDAO(); MaterialTextView title = dialog.findViewById(R.id.title);
Medicine aMedicine = medicineDAO.getMedicineByCIP13(cip13); final EditText editText = dialog.findViewById(R.id.editcip13);
askToAddInDB(aMedicine); String cip13 = String.valueOf(editText.getText());
})
.setNegativeButton("Cancel",
(dialog, id) -> dialog.cancel());
// create an alert dialog // TODO change the color of ok button when the number of character is correct.
AlertDialog alert = alertDialogBuilder.create();
ok.setText(R.string.button_ok);
cancel.setText(R.string.button_cancel);
editText.addTextChangedListener(new TextWatcher() { editText.addTextChangedListener(new TextWatcher() {
@Override @Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) { } public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override @Override
public void onTextChanged(CharSequence s, int start, int before, int count) { } public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override @Override
public void afterTextChanged(Editable s) { public void afterTextChanged(Editable s) {
alert.getButton(alert.BUTTON_POSITIVE).setEnabled(s.length() == 8); //alert.getButton(alert.BUTTON_POSITIVE).setEnabled(s.length() == 8);
if (s.length() == 8) {
ok.setEnabled(true);
ok.setBackground(Objects.requireNonNull(ContextCompat.getDrawable(editText.getContext(), R.drawable.rounded_btn)));
}
else {
ok.setEnabled(false);
ok.setBackground(Objects.requireNonNull(ContextCompat.getDrawable(editText.getContext(), R.drawable.rounded_btn_disabled)));
}
} }
}); });
alert.show(); ok.setOnClickListener(v -> {
dialog.cancel();
Log.i("EditText Value",editText.getEditableText().toString());
MedicinesDAO medicinesDAO = medicines.getMedicinesDAO();
Medicine aMedicine = medicinesDAO.getMedicineByCIP13(cip13);
askToAddInDB(aMedicine);
});
cancel.setOnClickListener(v -> {
dialog.cancel();
Log.i(TAG, "dismiss dialog");
});
dialog.show();
} }
/** /**
@ -389,24 +405,40 @@ public class DrugListActivity extends AppCompatActivity {
* @param aMedicine Prescription- medication to be added * @param aMedicine Prescription- medication to be added
*/ */
private void askToAddInDB(Medicine aMedicine) { private void askToAddInDB(Medicine aMedicine) {
AlertDialog.Builder dlg = new AlertDialog.Builder(this); final Dialog dlg = new Dialog(this);
dlg.setTitle(getString(R.string.app_name)); dlg.requestWindowFeature(Window.FEATURE_NO_TITLE);
Objects.requireNonNull(dlg.getWindow()).setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dlg.setContentView(R.layout.custom_dialog_layout_one_button);
dlg.setCancelable(true);
MaterialTextView msg = dlg.findViewById(R.id.msg);
String msgString;
MaterialTextView cpl = dlg.findViewById(R.id.cpl);
ShapeableImageView icon = dlg.findViewById(R.id.image);
MaterialButton btn = dlg.findViewById(R.id.txtClose);
dlg.show();
if (aMedicine != null) { if (aMedicine != null) {
String msg = aMedicine.getName() + " " + getString(R.string.msgFound); msgString = aMedicine.getName() + " " + getString(R.string.msgFound);
msg.setText(msgString);
dlg.setMessage(msg); cpl.setText(getString(R.string.addInList));
dlg.setNegativeButton(getString(R.string.button_cancel), (dialog, which) -> { icon.setImageResource(R.drawable.tickmark);
// Nothing to do in case of cancel btn.setText(getString(R.string.Yes));
}); btn.setOnClickListener(v -> {
dlg.setPositiveButton(getString(R.string.button_ok), (dialog, which) -> { // TODO Auto-generated method stub
// Add Drug to DB then try to show it dlg.dismiss();
finish();
addDrugToList(Utils.medicine2prescription(aMedicine)); addDrugToList(Utils.medicine2prescription(aMedicine));
}); });
} else { } else {
dlg.setMessage(getString(R.string.msgNotFound)); msgString = getString(R.string.msgNotFound);
dlg.setPositiveButton("OK", (dialog, which) -> { msg.setText(msgString);
// nothing to do to just dismiss dialog cpl.setText("");
icon.setImageResource(R.drawable.tickcross);
btn.setText(getString(R.string.button_close));
btn.setOnClickListener(v -> {
// TODO Auto-generated method stub
dlg.dismiss();
finish();
}); });
} }
dlg.show(); dlg.show();
@ -416,7 +448,7 @@ public class DrugListActivity extends AppCompatActivity {
* Tell user that the barre code cannot be interpreted * Tell user that the barre code cannot be interpreted
*/ */
private void scanNotOK() { private void scanNotOK() {
AlertDialog.Builder dlg = new AlertDialog.Builder(this); MaterialAlertDialogBuilder dlg = new MaterialAlertDialogBuilder(this);
dlg.setTitle(getString(R.string.app_name)); dlg.setTitle(getString(R.string.app_name));
dlg.setMessage(R.string.notInterpreted); dlg.setMessage(R.string.notInterpreted);
@ -426,20 +458,6 @@ public class DrugListActivity extends AppCompatActivity {
dlg.show(); dlg.show();
} }
/**
* askForCompréhensive
*/
private void askForComprehensive() {
AlertDialog.Builder dlg = new AlertDialog.Builder(this);
dlg.setTitle(getString(R.string.app_name));
dlg.setMessage(R.string.understood);
dlg.setPositiveButton(R.string.Yes, (dialog, which) -> {
// Nothing to do just dismiss dialog
});
dlg.show();
}
/** /**
* Add New drug to the user database * Add New drug to the user database
@ -460,6 +478,7 @@ public class DrugListActivity extends AppCompatActivity {
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE); startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left); overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
} }
/** /**
* setupRecyclerView (list of drugs) * setupRecyclerView (list of drugs)
* *
@ -470,7 +489,7 @@ public class DrugListActivity extends AppCompatActivity {
mAdapter = new RecyclerViewAdapter(prescriptionList); mAdapter = new RecyclerViewAdapter(prescriptionList);
recyclerView.setAdapter(mAdapter); recyclerView.setAdapter(mAdapter);
new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, (ItemTouchHelper.RIGHT|ItemTouchHelper.LEFT)) { new ItemTouchHelper(new ItemTouchHelper.SimpleCallback(0, (ItemTouchHelper.RIGHT | ItemTouchHelper.LEFT)) {
@Override @Override
public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) { public boolean onMove(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, @NonNull RecyclerView.ViewHolder target) {
return false; return false;
@ -492,80 +511,88 @@ public class DrugListActivity extends AppCompatActivity {
} else { } else {
// Call DetailView // Call DetailView
Intent intent = new Intent(getApplicationContext(), DrugDetailActivity.class); Intent intent = new Intent(getApplicationContext(), DrugDetailActivity.class);
intent.putExtra("prescription", prescription); intent.putExtra("prescription", prescription);
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE); startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
} }
Snackbar.make(recyclerView, prescription.getName(), Snackbar.make(recyclerView, prescription.getName(),
Snackbar.LENGTH_LONG).setAction(R.string.Undo, new View.OnClickListener() { Snackbar.LENGTH_LONG).setAction(R.string.Undo, v -> {
@Override prescriptionList.add(position, prescription);
public void onClick(View v) { mAdapter.notifyItemInserted(position);
prescriptionList.add(position, prescription); }).setActionTextColor(getResources().getColor(R.color.bg_screen1))
mAdapter.notifyItemInserted(position); .show();
} }
}).show();
}
@Override @Override
public void onChildDraw(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) { public void onChildDraw(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE) { if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE) {
// Get RecyclerView item from the ViewHolder // Get RecyclerView item from the ViewHolder
View itemView = viewHolder.itemView; View itemView = viewHolder.itemView;
Paint p = new Paint(); Paint p = new Paint();
Drawable icon; Drawable icon;
icon = ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_trash_can_outline); icon = ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_trash_can_outline);
int xMarkMargin = (int) getApplicationContext().getResources().getDimension(R.dimen.fab_margin); int xMarkMargin = (int) getApplicationContext().getResources().getDimension(R.dimen.fab_margin);
assert icon != null;
int intrinsicWidth = icon.getIntrinsicWidth();
int intrinsicHeight = icon.getIntrinsicHeight();
int itemHeight = itemView.getBottom() - itemView.getTop();
if (dX > 0) {
p.setColor(getColor(R.color.bg_screen3));
icon = ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_edit_black_48dp);
// Draw Rect with varying right side, equal to displacement dX
c.drawRect((float) itemView.getLeft(), (float) itemView.getTop(), dX,
(float) itemView.getBottom(), p);
int xMarkLeft = itemView.getLeft() + xMarkMargin;
int xMarkRight = itemView.getLeft() + xMarkMargin + intrinsicWidth;
int xMarkTop = itemView.getTop() + (itemHeight - intrinsicHeight) / 2;
int xMarkBottom = xMarkTop + intrinsicHeight;// +xMarkTop;
assert icon != null; assert icon != null;
int intrinsicWidth = icon.getIntrinsicWidth(); icon.setBounds(xMarkLeft, xMarkTop, xMarkRight, xMarkBottom);
int intrinsicHeight = icon.getIntrinsicHeight();
int itemHeight = itemView.getBottom() - itemView.getTop();
if (dX > 0) { } else {
p.setColor(getColor(R.color.bg_screen3)); p.setColor(getColor(R.color.bg_screen4));
icon = ContextCompat.getDrawable(getApplicationContext(), R.drawable.ic_edit_black_48dp); // Draw Rect with varying left side, equal to the item's right side plus negative displacement dX
c.drawRect((float) itemView.getRight() + dX, (float) itemView.getTop(),
// Draw Rect with varying right side, equal to displacement dX (float) itemView.getRight(), (float) itemView.getBottom(), p);
c.drawRect((float) itemView.getLeft(), (float) itemView.getTop(), dX,
(float) itemView.getBottom(), p);
int xMarkLeft = itemView.getLeft() + xMarkMargin;
int xMarkRight = itemView.getLeft() + xMarkMargin + intrinsicWidth;
int xMarkTop = itemView.getTop() + (itemHeight - intrinsicHeight) / 2;
int xMarkBottom = xMarkTop + intrinsicHeight;// +xMarkTop;
assert icon != null;
icon.setBounds(xMarkLeft, xMarkTop, xMarkRight, xMarkBottom);
} else {
p.setColor(getColor(R.color.bg_screen4));
// Draw Rect with varying left side, equal to the item's right side plus negative displacement dX
c.drawRect((float) itemView.getRight() + dX, (float) itemView.getTop(),
(float) itemView.getRight(), (float) itemView.getBottom(), p);
int xMarkLeft = itemView.getRight() - xMarkMargin - intrinsicWidth; int xMarkLeft = itemView.getRight() - xMarkMargin - intrinsicWidth;
int xMarkRight = itemView.getRight() - xMarkMargin; int xMarkRight = itemView.getRight() - xMarkMargin;
int xMarkTop = itemView.getTop() + (itemHeight - intrinsicHeight) / 2; int xMarkTop = itemView.getTop() + (itemHeight - intrinsicHeight) / 2;
int xMarkBottom = xMarkTop + intrinsicHeight; int xMarkBottom = xMarkTop + intrinsicHeight;
icon.setBounds(xMarkLeft, xMarkTop, xMarkRight, xMarkBottom); icon.setBounds(xMarkLeft, xMarkTop, xMarkRight, xMarkBottom);
}
icon.draw(c);
super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
} }
icon.draw(c);
super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
} }
}
}).attachToRecyclerView(recyclerView); }).attachToRecyclerView(recyclerView);
} }
private String getAppName() {
PackageManager packageManager = getApplicationContext().getPackageManager();
ApplicationInfo applicationInfo = null;
try {
applicationInfo = packageManager.getApplicationInfo(this.getPackageName(), 0);
} catch (final PackageManager.NameNotFoundException ignored) {
}
return (String) ((applicationInfo != null) ? packageManager.getApplicationLabel(applicationInfo) : "???");
}
/** /**
* SimpleItemRecyclerViewAdapter * SimpleItemRecyclerViewAdapter
*/ */
public class RecyclerViewAdapter extends public class RecyclerViewAdapter extends
RecyclerView.Adapter<RecyclerViewAdapter.ViewHolder> { RecyclerView.Adapter<RecyclerViewAdapter.ViewHolder> {
private final List<Prescription> mValues; private final List<Prescription> mValues;
@ -620,17 +647,14 @@ public class DrugListActivity extends AppCompatActivity {
holder.mView.setBackgroundResource(R.drawable.gradient_bg); holder.mView.setBackgroundResource(R.drawable.gradient_bg);
holder.mIconView.setImageResource(R.drawable.ic_suspended_pill); holder.mIconView.setImageResource(R.drawable.ic_suspended_pill);
holder.mView.setOnClickListener(new View.OnClickListener() { holder.mView.setOnClickListener(v -> {
@Override Prescription aPrescription = mValues.get(position);
public void onClick(View v) { Context context = v.getContext();
Prescription aPrescription = mValues.get(position); Intent intent = new Intent(context, DrugDetailActivity.class);
Context context = v.getContext(); intent.putExtra("prescription", aPrescription);
Intent intent = new Intent(context, DrugDetailActivity.class); startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
intent.putExtra("prescription", aPrescription); overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
}
}); });
} else { } else {
int remainingStock = (int) Math.floor(mValues.get(position).getStock() / mValues.get(position).getTake()); int remainingStock = (int) Math.floor(mValues.get(position).getStock() / mValues.get(position).getTake());
@ -646,16 +670,13 @@ public class DrugListActivity extends AppCompatActivity {
holder.mIconView.setImageResource(R.drawable.ok_stock_vect); holder.mIconView.setImageResource(R.drawable.ok_stock_vect);
} }
holder.mView.setOnClickListener(new View.OnClickListener() { holder.mView.setOnClickListener(v -> {
@Override Prescription prescription = mValues.get(position);
public void onClick(View v) { Context context = v.getContext();
Prescription prescription = mValues.get(position); Intent intent = new Intent(context, DrugDetailActivity.class);
Context context = v.getContext(); intent.putExtra("prescription", prescription);
Intent intent = new Intent(context, DrugDetailActivity.class); startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
intent.putExtra("prescription", prescription); overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
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 { class ViewHolder extends RecyclerView.ViewHolder {
final View mView; final View mView;
final TextView mContentView; final MaterialTextView mContentView;
final TextView mEndOfStock; final MaterialTextView mEndOfStock;
final ImageView mIconView; final ShapeableImageView mIconView;
public Prescription mItem; public Prescription mItem;
ViewHolder(View view) { ViewHolder(View view) {
@ -687,14 +708,4 @@ public class DrugListActivity extends AppCompatActivity {
} }
} }
} }
private String getAppName() {
PackageManager packageManager = getApplicationContext().getPackageManager();
ApplicationInfo applicationInfo = null;
try {
applicationInfo = packageManager.getApplicationInfo(this.getPackageName(), 0);
} catch (final PackageManager.NameNotFoundException ignored) {
}
return (String) ((applicationInfo != null) ? packageManager.getApplicationLabel(applicationInfo) : "???");
}
} }

View file

@ -13,23 +13,24 @@ import com.journeyapps.barcodescanner.ScanIntentResult;
import com.journeyapps.barcodescanner.ScanOptions; import com.journeyapps.barcodescanner.ScanOptions;
public class PilldroidScanContract extends ActivityResultContract<ScanOptions, ScanIntentResult>{ public class PilldroidScanContract extends ActivityResultContract<ScanOptions, ScanIntentResult> {
private static final String TAG = PilldroidScanContract.class.getName(); private static final String TAG = PilldroidScanContract.class.getName();
@NonNull
@Override
public Intent createIntent(@NonNull Context context, ScanOptions input) {
Log.d(TAG, "create Intent");
Intent intent = new Intent(context, CustomScannerActivity.class); @NonNull
@Override
public Intent createIntent(@NonNull Context context, ScanOptions input) {
Log.d(TAG, "create Intent");
intent.setAction(Intents.Scan.ACTION); Intent intent = new Intent(context, CustomScannerActivity.class);
Log.d(TAG, "intent ==" + intent); intent.setAction(Intents.Scan.ACTION);
return(intent);
}
@Override Log.d(TAG, "intent ==" + intent);
public ScanIntentResult parseResult(int resultCode, @Nullable Intent intent) { return (intent);
return ScanIntentResult.parseActivityResult(resultCode, intent); }
}
@Override
public ScanIntentResult parseResult(int resultCode, @Nullable Intent intent) {
return ScanIntentResult.parseActivityResult(resultCode, intent);
}
} }

View file

@ -4,49 +4,51 @@ package net.foucry.pilldroid;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
/** /**
* Created by Lincoln on 05/05/16. * Created by Lincoln on 05/05/16.
*/ */
public class PrefManager { public class PrefManager {
final SharedPreferences pref; // Shared preferences file name
SharedPreferences.Editor editor; 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;
// shared pref mode public PrefManager(Context context) {
final int PRIVATE_MODE = 0; pref = context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
// 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";
public PrefManager(Context context) {
pref = context.getSharedPreferences(PREF_NAME, PRIVATE_MODE);
}
public void setFirstTimeLaunch(boolean isFirstTime) {
editor = pref.edit();
editor.putBoolean(IS_FIRST_TIME_LAUNCH, isFirstTime);
editor.apply();
}
public void setDatabaseVersion(int version) {
editor = pref.edit();
editor.putInt(DATABASE_VERSION, version);
editor.apply();
}
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); }
} }
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();
}
}

View file

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

View file

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

View file

@ -1,7 +1,9 @@
package net.foucry.pilldroid; package net.foucry.pilldroid;
import android.app.Dialog;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -11,126 +13,23 @@ import android.view.Window;
import android.view.WindowInsets; import android.view.WindowInsets;
import android.view.WindowInsetsController; import android.view.WindowInsetsController;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.viewpager.widget.PagerAdapter; import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager; import androidx.viewpager.widget.ViewPager;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.imageview.ShapeableImageView;
import com.google.android.material.textview.MaterialTextView;
public class WelcomeActivity extends AppCompatActivity { public class WelcomeActivity extends AppCompatActivity {
private ViewPager viewPager; private ViewPager viewPager;
private LinearLayout dotsLayout; private LinearLayout dotsLayout;
private int[] layouts; private int[] layouts;
private Button btnSkip, btnNext; private MaterialButton btnSkip, btnNext;
private PrefManager prefManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
boolean DEBUG = false;
// Checking for first time launch - before calling setContentView()
prefManager = new PrefManager(this);
if (DEBUG) {
prefManager.setFirstTimeLaunch(true);
}
if (!prefManager.isFirstTimeLaunch()) {
finish();
}
prefManager.setFirstTimeLaunch(false);
setContentView(R.layout.welcome_activity);
setFullScreen();
viewPager = findViewById(R.id.view_pager);
dotsLayout = findViewById(R.id.layoutDots);
btnSkip = findViewById(R.id.btn_skip);
btnNext = findViewById(R.id.btn_next);
// layouts of all welcome sliders
// add few more layouts if you want
layouts = new int[]{
R.layout.welcome1,
R.layout.welcome2,
R.layout.welcome3,
R.layout.welcome4,
R.layout.welcome5,
R.layout.welcome6,
R.layout.welcome7,
R.layout.welcome8,
R.layout.welcome9,
R.layout.welcome10,
R.layout.welcome11,
R.layout.welcome12};
// adding bottom dots
addBottomDots(0);
// making notification bar transparent
changeStatusBarColor();
MyViewPagerAdapter myViewPagerAdapter = new MyViewPagerAdapter();
viewPager.setAdapter(myViewPagerAdapter);
viewPager.addOnPageChangeListener(viewPagerPageChangeListener);
btnSkip.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
launchHomeScreen();
}
});
btnNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// checking for last page
// if last page home screen will be launched
int current = getItem();
if (current < layouts.length) {
// move to next screen
viewPager.setCurrentItem(current);
overridePendingTransition(R.anim.slide_from_left, R.anim.slide_to_right);
} else {
launchHomeScreen();
}
}
});
}
private void addBottomDots(int currentPage) {
TextView[] dots = new TextView[layouts.length];
dotsLayout.removeAllViews();
for (int i = 0; i < dots.length; i++) {
dots[i] = new TextView(this);
dots[i].setText("");
dots[i].setTextSize(65);
dots[i].setTextColor(ContextCompat.getColor(this, R.color.dot_dark));
dotsLayout.addView(dots[i]);
}
if (dots.length > 0)
dots[currentPage].setTextColor(ContextCompat.getColor(this, R.color.dot_light));
}
private int getItem() {
return viewPager.getCurrentItem() + 1;
}
void launchHomeScreen() {
prefManager.setFirstTimeLaunch(false);
startActivity(new Intent(WelcomeActivity.this, DrugListActivity.class));
finish();
}
// viewpager change listener // viewpager change listener
final ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() { final ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {
@ -160,6 +59,131 @@ public class WelcomeActivity extends AppCompatActivity {
} }
}; };
private PrefManager prefManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
boolean DEBUG = false;
// Checking for first time launch - before calling setContentView()
prefManager = new PrefManager(this);
if (DEBUG) {
prefManager.setFirstTimeLaunch(true);
}
if (!prefManager.isFirstTimeLaunch()) {
finish();
}
prefManager.setFirstTimeLaunch(false);
if (!prefManager.isUnderstood()) {
askForComprehensive();
prefManager.setUnderstood(true);
}
setContentView(R.layout.welcome_activity);
setFullScreen();
viewPager = findViewById(R.id.view_pager);
dotsLayout = findViewById(R.id.layoutDots);
btnSkip = findViewById(R.id.btn_skip);
btnNext = findViewById(R.id.btn_next);
// layouts of all welcome sliders
// add few more layouts if you want
layouts = new int[]{
R.layout.welcome1,
R.layout.welcome2,
R.layout.welcome3,
R.layout.welcome4,
R.layout.welcome5,
R.layout.welcome6,
R.layout.welcome7,
R.layout.welcome8,
R.layout.welcome9,
R.layout.welcome10,
R.layout.welcome11,
R.layout.welcome12};
// adding bottom dots
addBottomDots(0);
// making notification bar transparent
changeStatusBarColor();
MyViewPagerAdapter myViewPagerAdapter = new MyViewPagerAdapter();
viewPager.setAdapter(myViewPagerAdapter);
viewPager.addOnPageChangeListener(viewPagerPageChangeListener);
btnSkip.setOnClickListener(v -> launchHomeScreen());
btnNext.setOnClickListener(v -> {
// checking for last page
// if last page home screen will be launched
int current = getItem();
if (current < layouts.length) {
// move to next screen
viewPager.setCurrentItem(current);
overridePendingTransition(R.anim.slide_from_left, R.anim.slide_to_right);
} 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) {
MaterialTextView[] dots = new MaterialTextView[layouts.length];
dotsLayout.removeAllViews();
for (int i = 0; i < dots.length; i++) {
dots[i] = new MaterialTextView(this);
dots[i].setText("");
dots[i].setTextSize(65);
dots[i].setTextColor(ContextCompat.getColor(this, R.color.dot_dark));
dotsLayout.addView(dots[i]);
}
if (dots.length > 0)
dots[currentPage].setTextColor(ContextCompat.getColor(this, R.color.dot_light));
}
private int getItem() {
return viewPager.getCurrentItem() + 1;
}
void launchHomeScreen() {
prefManager.setFirstTimeLaunch(false);
startActivity(new Intent(WelcomeActivity.this, DrugListActivity.class));
finish();
}
/** /**
* Making notification bar transparent * Making notification bar transparent
@ -170,17 +194,16 @@ public class WelcomeActivity extends AppCompatActivity {
window.setStatusBarColor(Color.TRANSPARENT); window.setStatusBarColor(Color.TRANSPARENT);
} }
private void setFullScreen(){ @SuppressWarnings("deprecation")
private void setFullScreen() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
getWindow().setDecorFitsSystemWindows(false); getWindow().setDecorFitsSystemWindows(false);
WindowInsetsController controller = getWindow().getInsetsController(); WindowInsetsController controller = getWindow().getInsetsController();
if(controller != null) { if (controller != null) {
controller.hide(WindowInsets.Type.statusBars() | WindowInsets.Type.navigationBars()); controller.hide(WindowInsets.Type.statusBars() | WindowInsets.Type.navigationBars());
controller.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE); controller.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
} }
} } else {
else {
//noinspection
getWindow().getDecorView().setSystemUiVisibility( getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_FULLSCREEN View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
@ -222,7 +245,7 @@ public class WelcomeActivity extends AppCompatActivity {
@Override @Override
public void destroyItem(ViewGroup container, int position, @NonNull Object object) { public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
View view = (View) object; View view = (View) object;
container.removeView(view); container.removeView(view);
} }

View file

@ -12,23 +12,23 @@ import java.util.List;
@Dao @Dao
public interface PrescriptionsDAO { public interface PrescriptionsDAO {
@Insert @Insert
void insert(Prescription... prescriptions); void insert(Prescription... prescriptions);
@Update @Update
void update(Prescription... prescriptions); void update(Prescription... prescriptions);
@Delete @Delete
void delete(Prescription prescription); void delete(Prescription prescription);
@Query("SELECT * FROM prescriptions") @Query("SELECT * FROM prescriptions")
List<Prescription> getAllMedics(); List<Prescription> getAllMedics();
@Query("SELECT * FROM prescriptions WHERE cip13 = :cip13") @Query("SELECT * FROM prescriptions WHERE cip13 = :cip13")
Prescription getMedicByCIP13(String cip13); Prescription getMedicByCIP13(String cip13);
@Query("SELECT count(*) FROM prescriptions") @Query("SELECT count(*) FROM prescriptions")
int getMedicCount(); int getMedicCount();
} }

View file

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

View file

@ -13,38 +13,40 @@ import net.foucry.pilldroid.dao.PrescriptionsDAO;
import net.foucry.pilldroid.models.Prescription; import net.foucry.pilldroid.models.Prescription;
@Database( @Database(
version = 2, version = 2,
entities = {Prescription.class}, entities = {Prescription.class},
autoMigrations = { autoMigrations = {
@AutoMigration( @AutoMigration(
from = 1, from = 1,
to = 2, to = 2,
spec = PrescriptionDatabase.generic_typeMigration.class spec = PrescriptionDatabase.generic_typeMigration.class
) )
} }
) )
public abstract class PrescriptionDatabase extends RoomDatabase { public abstract class PrescriptionDatabase extends RoomDatabase {
private static PrescriptionDatabase INSTANCE; private static PrescriptionDatabase INSTANCE;
public abstract PrescriptionsDAO getPrescriptionsDAO();
@RenameColumn(tableName = "prescriptions", fromColumnName = "genetic_type", toColumnName = "generic_type")
static class generic_typeMigration implements AutoMigrationSpec { }
public static PrescriptionDatabase getInstanceDatabase(Context context) { public static PrescriptionDatabase getInstanceDatabase(Context context) {
if (INSTANCE == null) { if (INSTANCE == null) {
INSTANCE = INSTANCE =
Room Room
.databaseBuilder(context.getApplicationContext(), .databaseBuilder(context.getApplicationContext(),
PrescriptionDatabase.class, "prescriptions") PrescriptionDatabase.class, "prescriptions")
.allowMainThreadQueries() .allowMainThreadQueries()
.build(); .build();
} }
return INSTANCE; return INSTANCE;
} }
public static void destroyInstance() { public static void destroyInstance() {
INSTANCE = null; INSTANCE = null;
} }
public abstract PrescriptionsDAO getPrescriptionsDAO();
@RenameColumn(tableName = "prescriptions", fromColumnName = "genetic_type", toColumnName = "generic_type")
static class generic_typeMigration implements AutoMigrationSpec {
}
} }

View file

@ -7,14 +7,15 @@ import androidx.room.PrimaryKey;
@Entity(tableName = "drugs") @Entity(tableName = "drugs")
public class Medicine { public class Medicine {
@PrimaryKey @PrimaryKey
@NonNull private Integer _id; @NonNull
private String cis; private Integer _id;
private String cip13; private String cis;
private String cip7; private String cip13;
private String administration_mode; private String cip7;
private String name; private String administration_mode;
private String presentation; private String name;
private String label_group; private String presentation;
private String label_group;
private Integer generic_type; private Integer generic_type;
public Medicine(@NonNull String cis) { public Medicine(@NonNull String cis) {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

Binary file not shown.

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,46 +1,114 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:padding="10dp"
tools:ignore="MissingDefaultResource"> tools:ignore="MissingDefaultResource">
<TextView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/textView" android:id="@+id/cardView"
android:layout_width="wrap_content" android:layout_width="371dp"
android:layout_height="wrap_content" android:layout_height="209dp"
android:text="@string/enter_cip_13" android:layout_marginTop="16dp"
android:textAppearance="?android:attr/textAppearanceMedium" /> android:background="@drawable/background_dialog"
app:cardCornerRadius="25dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<EditText <com.google.android.material.button.MaterialButton
android:id="@+id/edittext" android:id="@+id/notagreed"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_marginStart="28dp"
android:layout_centerVertical="true" android:layout_marginBottom="16dp"
android:layout_marginEnd="16dp" android:background="@drawable/rounded_btn"
android:autofillHints="@string/enter_cip_13_here" android:gravity="center"
android:hint="@string/enter_cip_13_here" android:maxLines="1"
android:inputType="number" android:minWidth="100dp"
android:minHeight="48dp" android:paddingStart="25dp"
android:padding="10dp" android:paddingEnd="25dp"
tools:ignore="RelativeOverlap" /> 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" />
<TextView <Space
android:id="@+id/startcip13" android:id="@+id/space"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_marginBottom="1dp"
android:layout_centerVertical="true" app:layout_constraintEnd_toStartOf="@+id/agreed"
android:layout_marginStart="29dp" app:layout_constraintStart_toEndOf="@+id/notagreed" />
android:layout_marginTop="52dp"
android:layout_marginEnd="39dp" <com.google.android.material.button.MaterialButton
android:layout_marginBottom="16dp" android:id="@+id/agreed"
android:layout_toStartOf="@+id/edittext" android:layout_width="wrap_content"
android:ems="10" android:layout_height="wrap_content"
android:text="34009" android:layout_marginEnd="28dp"
android:textAlignment="viewEnd" android:background="@drawable/rounded_btn"
android:textSize="24dp" /> android:gravity="center"
</RelativeLayout> 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/editcip13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="28dp"
android:autofillHints="cip13"
android:ems="10"
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

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -9,7 +9,7 @@ buildscript {
google() google()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.2.1' classpath 'com.android.tools.build:gradle:8.0.2'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
@ -17,9 +17,6 @@ buildscript {
} }
ext { ext {
compileSdkVersion = '28' compileSdkVersion = '28'
buildToolsVersion = '28.0.1'
var = '3.4.2'
//buildToolsVersion1 = '29.0.3'
defaultMinSdkVersion = 26 defaultMinSdkVersion = 26
defaultTargetSdkVersion = 30 defaultTargetSdkVersion = 30
defaultVersionCode = 1 defaultVersionCode = 1
@ -35,9 +32,8 @@ allprojects {
} }
} }
task clean(type: Delete) { tasks.register('clean', Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }
dependencies { dependencies {}
}

View file

@ -0,0 +1,77 @@
# V0.350-beta
- Update drugs database in order to include new medicaments;
- Small fix in about.html file
# V0.302-beta - bugs fix and small interface changes
- Fix schedule and stock calculation bug which appears in v0.201-beta. Sorry for the inconvenient
and the time it took to fix it;
- Remove unused code and old comments;
- Change the input CIP13 dialog, you need the 7 last numbers;
- Change the input values look, remove the rounded corners.
Many other bugs are still present I guess, but I did not find them for now.
Once again, I'm sorry for the inconvenient. Please drop me a line:
Twitter: pillroid-app
Mastodon: @lovisix@social.zdx.fr
Mail: pilldroid@foucry.net
# v0.301-beta - bugs fix
- A major bug disallowed the new stock calculation when Pilldroid was called in background.
This bug is now fixed, but other bugs could appears.
Thanks for your help and patience. A small word always make me happy.
# v0.300-beta - New features
- The prescription list management have been revamp (the medics your taken);
- a swipe from right to left remove a medic from the list AND from the database;
- a swipe from left to right allow you to change the detail of the medic, exactly has taping
ont the right arrow.
Those change allow you to remove medics with a take to zero (0) for a to long time and you'll never
take again.
They allow me to go to the next step of Pilldroid advancement. Instead of displaying the medic named,
Pilldroid will display the molecule (doliprane, efferalgant, daflagant will be displyed has paracétamol).
I will sais more soon.
Thanks to make return of those new features, [Pilldroid](mailto:jacques+pilldroid@foucry.net)
or [Pilldroid](mailto:pilldroid@foucry.net).
# v0.201-beta - fix bug in `alarmReceiver`
The `alarmReceiver` was still using the old database that *should* be empty. I use `room` database
management now.
# v0.200-beta New semantic version number (VRelease.MajorMinorPatch)
**REMEMBER** Pilldroid is a French people user only.
I made a lot a tests but there must stay some bugs.
## What's new
A lot of things under the surface :
- Add an alert about non responsibility of the author in case of trouble;
- Using `Room` to manage databases;
- Migration of the old database to the new one, you should not see anything;
- Code cleaning.
## What should work.
- QR-code scan on a dark background. The library have an option for that.
**WARNING**, Pilldroid does not manage creams, liquids
(like insulin).
Thanks to use [github](https://github/jfoucry/pilldroid) for bugs
reports and new features.
> I made Pilldroid on my free time which is not expandable. Please
do not stress me it will be unproductive.
Pilldroid will available only from [f-droid](https://f-droid.org)
You can reach me and discuss on [Pilldroid](mailto:jacques+pilldroid@foucry.net).

View file

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

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