mirror of
https://github.com/jfoucry/Pilldroid.git
synced 2024-11-22 04:29:22 +01:00
Merge branch 'feature/Fix_zxing_calling' into develop
This commit is contained in:
commit
c0b0759466
36 changed files with 520 additions and 333 deletions
25
LICENSE
Normal file
25
LICENSE
Normal file
|
@ -0,0 +1,25 @@
|
|||
The BSD 3-Clause License The following is a BSD 3-Clause ("BSD New" or "BSD Simplified") license template. To generate your own license, change the values of OWNER, ORGANIZATION and YEAR from their original values as given here, and substitute your own.
|
||||
|
||||
Note: You may omit clause 3 and still be OSD-conformant. Despite its colloquial name "BSD New", this is not the newest version of the BSD license; it was followed by the even newer BSD-2-Clause version, sometimes known as the "Simplified BSD License". On January 9th, 2008 the OSI Board approved BSD-2-Clause, which is used by FreeBSD and others. It omits the final "no-endorsement" clause and is thus roughly equivalent to the MIT License.
|
||||
|
||||
Historical Background: The original license used on BSD Unix had four clauses. The advertising clause (the third of four clauses) required you to acknowledge use of U.C. Berkeley code in your advertising of any product using that code. It was officially rescinded by the Director of the Office of Technology Licensing of the University of California on July 22nd, 1999. He states that clause 3 is "hereby deleted in its entirety." The four clause license has not been approved by OSI. The license below does not contain the advertising clause.
|
||||
|
||||
This prelude is not part of the license.
|
||||
|
||||
OWNER = Regents of the University of California
|
||||
|
||||
ORGANIZATION = University of California, Berkeley
|
||||
|
||||
YEAR = 1998
|
||||
|
||||
In the original BSD license, both occurrences of the phrase "COPYRIGHT HOLDERS AND CONTRIBUTORS" in the disclaimer read "REGENTS AND CONTRIBUTORS".
|
||||
|
||||
Copyright (c) $2022 Jacques Foucry, All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
11
README.md
11
README.md
|
@ -3,10 +3,6 @@
|
|||
Pilldroid est une application de gestion de stock **théorique** de médicament à
|
||||
destinations des personnes résidant en France.
|
||||
|
||||
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
|
||||
alt="Get it on F-Droid"
|
||||
height="80">](https://f-droid.org/packages/net.foucry.pilldroid/)
|
||||
|
||||
## Ce que n'est pas Pilldroid
|
||||
|
||||
- Pilldroid n'est pas un pilulier. Pilldroid ne vous rappellera pas de prendre
|
||||
|
@ -31,7 +27,7 @@ lancer son cycle de réveil journalier ;
|
|||
scanner le code barre des boites de médicaments ;
|
||||
- Pilldroid a besoin de pouvoir vous envoyer des alarmes ;
|
||||
- Pilldroid a besoin de faire vibrer le téléphone pour les alarmes ;
|
||||
- Pilldroid utilise un accès Internet pour les remontée de crash *via* la bibliothèque [sentry.io](https://sentry.io).
|
||||
|
||||
|
||||
## L'application Pilldroid embarque-t-elle des bibliothèques tierce ?
|
||||
|
||||
|
@ -39,11 +35,6 @@ Oui. Pour la lecture de code barre, Pilldroid utilise le projet
|
|||
[zxing](https://github.com/journeyapps/zxing-android-embedded) lui-même libre et
|
||||
ouvert.
|
||||
|
||||
A terme Pilldroid utilisera la bibliothèque
|
||||
[sentry.io](https://sentry.io/for/android/) quand j'aurais compris comment cela
|
||||
fonctionne. Le but est d'avoir des remontées les crashs de l'application sans
|
||||
collecter de données à caractère personnel.
|
||||
Déjà embarquée mais non fonctionnelle, `sentry.io` à besoin de l'accès Internet.
|
||||
|
||||
## L'application Pilldroid contient-elle des pisteurs ?
|
||||
|
||||
|
|
|
@ -1,14 +1,6 @@
|
|||
//noinspection GradleCompatible
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
ext.versionMajor = 0
|
||||
ext.versionMinor = 65
|
||||
ext.versionPatch = new Date().format("yyyyMMdd")
|
||||
ext.versionClassifier = null
|
||||
ext.isSnapshot = false
|
||||
ext.minimumSdkVersion = defaultMinSdkVersion
|
||||
ext.git_version= ("git rev-parse --short HEAD".execute().text.trim())
|
||||
|
||||
// Try reading secrets from file
|
||||
def secretsPropertiesFile = rootProject.file("secrets.properties")
|
||||
def secretProperties = new Properties()
|
||||
|
@ -26,22 +18,26 @@ else {
|
|||
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 file("../android-signing-keystore.jks")
|
||||
storeFile rootProject.file("android-signing-keystore.jks")
|
||||
storePassword secretProperties['signing_keystore_password']
|
||||
keyAlias secretProperties['signing_key_alias']
|
||||
keyPassword secretProperties['signing_key_password']
|
||||
keyAlias secretProperties['signing_pre-release_key_alias']
|
||||
keyPassword secretProperties['signing_pre-release_key_password']
|
||||
}
|
||||
}
|
||||
compileSdkVersion 29
|
||||
compileSdkVersion 31
|
||||
|
||||
defaultConfig {
|
||||
applicationId "net.foucry.pilldroid"
|
||||
minSdkVersion defaultMinSdkVersion
|
||||
targetSdkVersion defaultTargetSdkVersion
|
||||
versionCode generateVersionCode() // 190010203
|
||||
versionName generateVersionName() // 1.2.3-SNAPSHOT
|
||||
versionCode 100
|
||||
versionName "v0.100-beta"
|
||||
multiDexEnabled true
|
||||
}
|
||||
|
||||
|
@ -55,6 +51,7 @@ android {
|
|||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
debuggable false
|
||||
signingConfig signingConfigs.release
|
||||
}
|
||||
prerelease {
|
||||
minifyEnabled false
|
||||
|
@ -81,15 +78,11 @@ android {
|
|||
}
|
||||
|
||||
compileOptions {
|
||||
coreLibraryDesugaringEnabled true
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
dexOptions {
|
||||
incremental false
|
||||
javaMaxHeapSize "4g"
|
||||
}
|
||||
buildToolsVersion '32.0.0'
|
||||
|
||||
allprojects {
|
||||
tasks.withType(JavaCompile) {
|
||||
|
@ -112,40 +105,13 @@ dependencies {
|
|||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||
implementation 'com.google.android.material:material:1.4.0'
|
||||
implementation 'com.google.android.material:material:1.5.0'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
|
||||
implementation 'com.journeyapps:zxing-android-embedded:4.3.0'
|
||||
implementation 'androidx.core:core:1.6.0'
|
||||
implementation 'androidx.core:core:1.7.0'
|
||||
|
||||
// debugImplementation 'com.amitshekhar.android:debug-db:1.0.6'
|
||||
|
||||
implementation 'io.sentry:sentry-android:5.4.0'
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||
}
|
||||
|
||||
private Integer generateVersionCode() {
|
||||
Integer versionCode = ext.minimumSdkVersion * 1000 + ext.versionMajor * 100 + ext.versionMinor
|
||||
print "versionCode = " + versionCode +"\n"
|
||||
return versionCode
|
||||
}
|
||||
|
||||
private String generateVersionName() {
|
||||
String versionName = "${ext.versionMajor}.${ext.versionMinor}.${ext.versionPatch}"
|
||||
if (ext.versionClassifier == null && ext.isSnapshot) {
|
||||
ext.versionClassifier = "SNAPSHOT"
|
||||
}
|
||||
|
||||
if (ext.versionClassifier != null) {
|
||||
versionName += "-" + ext.versionClassifier
|
||||
}
|
||||
|
||||
if (ext.git_version != null) {
|
||||
versionName += "-" + ext.git_version
|
||||
}
|
||||
|
||||
print "versionName = " + versionName
|
||||
return versionName
|
||||
}
|
|
@ -59,7 +59,5 @@
|
|||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<meta-data android:name="io.sentry.dsn" android:value="https://ba17f240b58144e398c862bb953256ef@o755123.ingest.sentry.io/5792286" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
|
@ -14,11 +14,11 @@
|
|||
}</style>
|
||||
</head>
|
||||
<body>
|
||||
<center><img src="file:///android_asset/ic_launcher-web.png" width="64"/></center>
|
||||
<center><img src="file:///android_asset/icon_pilldroid.png" width="64"/></center>
|
||||
<!--<div class="build">[[[about_string]]]</div>-->
|
||||
<h5>PillDroid © 2021 Jacques Foucry </h5>
|
||||
<p>PillDroid est une gestion théorique de votre stock de médicaments.</p>
|
||||
<p>PillDroid n'a aucune connaissance des interactions des médicaments entre eux.</p>
|
||||
<h5>Pilldroid © 2022 Jacques Foucry </h5>
|
||||
<p>Pilldroid est une gestion théorique de votre stock de médicaments.</p>
|
||||
<p>Pilldroid n'a aucune connaissance des interactions des médicaments entre eux.</p>
|
||||
<p class="red">EN CAS DE DOUTE, CONSULTEZ VOTRE MÉDECIN OU VOTRE PHARMACIEN.</p>
|
||||
<p>PillDroid ne vous rappelle pas de prendre vos médicaments.</p>
|
||||
<p class="red">LA RESPONSABILITÉ DE L'AUTEUR NE SAURAIT ÊTRE ENGAGÉE EN CAS DE SURDOSAGE OU D'OUBLI DE PRISE.</p>
|
||||
|
@ -28,9 +28,9 @@
|
|||
<hr width=45%/>
|
||||
<p>Les conseils et aides de <a href="https://mob-dev.fr">mob-dev.fr</a>.</p>
|
||||
<p>Le soutien actif et les conseils du Dr Kauffmann me permettent de faire
|
||||
évoluer PillDroid.</p>
|
||||
évoluer Pilldroid.</p>
|
||||
<p>Vous pouvez me contacter à l'adresse suivante : <a
|
||||
href="mailto:jacques+PillDroid@foucry.net?subject=À propos de
|
||||
href="mailto:pilldroidd@foucry.net?subject=À propos de
|
||||
PillDroid">jacques+pilldroid@foucry.net</a></p>.
|
||||
<p>Le site web de l'<a href="https://pilldroid.foucry.net">application</a>.
|
||||
</body>
|
||||
|
|
BIN
app/src/main/assets/icon_pilldroid.png
Normal file
BIN
app/src/main/assets/icon_pilldroid.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
|
@ -96,7 +96,6 @@ public class AlarmReceiver extends BroadcastReceiver {
|
|||
String description = context.getString(R.string.channel_description);
|
||||
int importance = NotificationManager.IMPORTANCE_DEFAULT;
|
||||
String CHANNEL_ID = "PillDroid";
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
|
||||
channel.setDescription(description);
|
||||
channel.enableLights(true);
|
||||
|
@ -117,7 +116,6 @@ public class AlarmReceiver extends BroadcastReceiver {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
public static void scheduleAlarm(Context context) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
Date today;
|
||||
|
|
23
app/src/main/java/net/foucry/pilldroid/BarcodeValues.java
Normal file
23
app/src/main/java/net/foucry/pilldroid/BarcodeValues.java
Normal file
|
@ -0,0 +1,23 @@
|
|||
package net.foucry.pilldroid;
|
||||
|
||||
public class BarcodeValues {
|
||||
private final String mFormat;
|
||||
private final String mContent;
|
||||
|
||||
public BarcodeValues(String format, String content) {
|
||||
mFormat = format;
|
||||
mContent = content;
|
||||
}
|
||||
|
||||
public String format() {
|
||||
return mFormat;
|
||||
}
|
||||
|
||||
public String content() {
|
||||
return mContent;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return mFormat == null && mContent == null;
|
||||
}
|
||||
}
|
|
@ -1,15 +1,19 @@
|
|||
package net.foucry.pilldroid;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.journeyapps.barcodescanner.BarcodeCallback;
|
||||
import com.journeyapps.barcodescanner.BarcodeResult;
|
||||
import com.journeyapps.barcodescanner.CaptureManager;
|
||||
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
|
||||
import com.journeyapps.barcodescanner.ViewfinderView;
|
||||
|
@ -19,39 +23,59 @@ import java.util.Random;
|
|||
/**
|
||||
* Custom Scanner Activity extending from Activity to display a custom layout form scanner view.
|
||||
*/
|
||||
public class CustomScannerActivity extends Activity implements
|
||||
DecoratedBarcodeView.TorchListener {
|
||||
public class CustomScannerActivity extends Activity implements DecoratedBarcodeView.TorchListener {
|
||||
|
||||
private static final String TAG = CustomScannerActivity.class.getName();
|
||||
|
||||
private CaptureManager capture;
|
||||
private DecoratedBarcodeView barcodeScannerView;
|
||||
private ImageButton switchFlashlightButton;
|
||||
private ViewfinderView viewfinderView;
|
||||
|
||||
final Bundle captureIntentBundle = new Bundle();
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_custom_scanner);
|
||||
|
||||
barcodeScannerView = findViewById(R.id.zxing_barcode_scanner);
|
||||
barcodeScannerView.setTorchListener(this);
|
||||
//barcodeScannerView.setTorchListener(this);
|
||||
|
||||
findViewById(R.id.keyboard_button).setOnClickListener(this::onKeyboard);
|
||||
findViewById(R.id.cancel_button).setOnClickListener(this::onCancel);
|
||||
findViewById(R.id.switch_flashlight).setOnClickListener(this::switchFlashlight);
|
||||
switchFlashlightButton = findViewById(R.id.switch_flashlight);
|
||||
|
||||
viewfinderView = findViewById(R.id.zxing_viewfinder_view);
|
||||
|
||||
barcodeScannerView = findViewById(R.id.zxing_barcode_scanner);
|
||||
|
||||
// if the device does not have flashlight in its camera,
|
||||
// then remove the switch flashlight button...
|
||||
if (!hasFlash()) {
|
||||
switchFlashlightButton.setVisibility(View.GONE);
|
||||
findViewById(R.id.switch_flashlight).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
capture = new CaptureManager(this, barcodeScannerView);
|
||||
capture.initializeFromIntent(getIntent(), savedInstanceState);
|
||||
capture.setShowMissingCameraPermissionDialog(false);
|
||||
capture.decode();
|
||||
|
||||
changeMaskColor(null);
|
||||
//changeMaskColor(null);
|
||||
changeLaserVisibility(true);
|
||||
barcodeScannerView.decodeSingle(new BarcodeCallback() {
|
||||
@Override
|
||||
public void barcodeResult(BarcodeResult result) {
|
||||
Intent scanResult = new Intent();
|
||||
//Bundle scanResultBundle = new Bundle();
|
||||
scanResult.putExtra("Barcode Content", result.getText());
|
||||
scanResult.putExtra("Barcode Format name", result.getBarcodeFormat().name());
|
||||
scanResult.putExtra("returnCode", captureIntentBundle.getInt("returnCode"));
|
||||
scanResult.putExtra("resultCode", 1);
|
||||
CustomScannerActivity.this.setResult(RESULT_OK, scanResult);
|
||||
Log.d(TAG, "scanResult == " + scanResult);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -85,6 +109,7 @@ public class CustomScannerActivity extends Activity implements
|
|||
|
||||
/**
|
||||
* Check if the device's camera has a Flashlight.
|
||||
*
|
||||
* @return true if there is Flashlight, otherwise false.
|
||||
*/
|
||||
private boolean hasFlash() {
|
||||
|
@ -93,10 +118,13 @@ public class CustomScannerActivity extends Activity implements
|
|||
}
|
||||
|
||||
public void switchFlashlight(View view) {
|
||||
Log.d(TAG, "Switch torch");
|
||||
if (switchFlashlightButton.isActivated()) {
|
||||
barcodeScannerView.setTorchOff();
|
||||
switchFlashlightButton.setActivated(false);
|
||||
} else {
|
||||
barcodeScannerView.setTorchOn();
|
||||
switchFlashlightButton.setActivated(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,13 +138,13 @@ public class CustomScannerActivity extends Activity implements
|
|||
viewfinderView.setLaserVisibility(visible);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTorchOn() {
|
||||
Log.d(TAG, "TorchON");
|
||||
switchFlashlightButton.setActivated(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTorchOff() {
|
||||
Log.d(TAG, "TorchOFF");
|
||||
switchFlashlightButton.setActivated(false);
|
||||
}
|
||||
|
||||
|
@ -125,14 +153,20 @@ public class CustomScannerActivity extends Activity implements
|
|||
capture.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||
}
|
||||
|
||||
|
||||
public void onKeyboard(View view) {
|
||||
setResult(3);
|
||||
Log.d(TAG, "onkeyboard");
|
||||
Intent resultIntent = new Intent();
|
||||
resultIntent.putExtra("returnCode",3);
|
||||
CustomScannerActivity.this.setResult(RESULT_OK, resultIntent);
|
||||
finish();
|
||||
}
|
||||
|
||||
public void onCancel(View view) {
|
||||
setResult(2);
|
||||
Log.d(TAG, "onCancel");
|
||||
Intent resultIntent = new Intent();
|
||||
resultIntent.putExtra("returnCode", 2);
|
||||
CustomScannerActivity.this.setResult(RESULT_OK, resultIntent);
|
||||
finish();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -48,7 +48,8 @@ class DBDrugs extends SQLiteOpenHelper {
|
|||
{
|
||||
try {
|
||||
myContext.getDatabasePath(String.valueOf(database));
|
||||
} catch (final Exception exception) {
|
||||
}
|
||||
catch (final Exception e){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -108,10 +109,9 @@ class DBDrugs extends SQLiteOpenHelper {
|
|||
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
if (myDataBase != null) {
|
||||
assert false;
|
||||
myDataBase.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Lookup in the DB for a record corresponding to cip13
|
||||
|
@ -154,7 +154,7 @@ class DBDrugs extends SQLiteOpenHelper {
|
|||
drug.setAlertThreshold(7);
|
||||
|
||||
// Log
|
||||
Log.d(TAG, "getDrug(" + cip13 + ")" + drug.toString());
|
||||
Log.d(TAG, "getDrug(" + cip13 + ")" + drug);
|
||||
|
||||
// Return drug
|
||||
|
||||
|
@ -222,7 +222,7 @@ class DBDrugs extends SQLiteOpenHelper {
|
|||
drug.setAlertThreshold(7);
|
||||
|
||||
// Log
|
||||
Log.d(TAG, "getDrug(" + cip7 + ")" + drug.toString());
|
||||
Log.d(TAG, "getDrug(" + cip7 + ")" + drug);
|
||||
|
||||
// Return drug
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ class DBHelper extends SQLiteOpenHelper {
|
|||
drug.setDateLastUpdate(Long.parseLong(cursor.getString(10)));
|
||||
}
|
||||
// Log
|
||||
Log.d(TAG, "getDrug("+id+")" + drug.toString());
|
||||
Log.d(TAG, "getDrug("+id+")" + drug);
|
||||
|
||||
assert cursor != null;
|
||||
cursor.close();
|
||||
|
@ -212,7 +212,7 @@ class DBHelper extends SQLiteOpenHelper {
|
|||
assert cursor != null;
|
||||
cursor.close();
|
||||
|
||||
Log.d(TAG, "getDrug(" + cip13 + ")" + drug.toString());
|
||||
Log.d(TAG, "getDrug(" + cip13 + ")" + drug);
|
||||
|
||||
return drug;
|
||||
}
|
||||
|
@ -274,10 +274,7 @@ class DBHelper extends SQLiteOpenHelper {
|
|||
|
||||
|
||||
|
||||
Log.d(TAG, "Before sort == " + drugs.toString());
|
||||
|
||||
/*drugs.sort(Comparator.comparing(Drug::getDateEndOfStock)
|
||||
.thenComparing(Drug::getStock));*/
|
||||
Log.d(TAG, "Before sort == " + drugs);
|
||||
|
||||
drugs.sort(new Comparator<Drug>() {
|
||||
@Override
|
||||
|
@ -288,7 +285,7 @@ class DBHelper extends SQLiteOpenHelper {
|
|||
return (int) (lhs.getStock() - rhs.getStock());
|
||||
}
|
||||
});
|
||||
Log.d(TAG, "After sort " + drugs.toString());
|
||||
Log.d(TAG, "After sort " + drugs);
|
||||
|
||||
// Move drug with prise = 0 at the end of the list
|
||||
// todo: If some drug moved, must redo all the loop
|
||||
|
@ -320,7 +317,7 @@ class DBHelper extends SQLiteOpenHelper {
|
|||
// Get reference to writable DB
|
||||
SQLiteDatabase db = this.getWritableDatabase();
|
||||
|
||||
// Create ContentValues to add columnm/value
|
||||
// Create ContentValues to add column/value
|
||||
ContentValues values = new ContentValues();
|
||||
values.put(KEY_ID, drug.getId());
|
||||
values.put(KEY_CIS, drug.getCis());
|
||||
|
@ -343,7 +340,7 @@ class DBHelper extends SQLiteOpenHelper {
|
|||
|
||||
// Close DB
|
||||
db.close();
|
||||
Log.d(TAG, "values == " + values.toString());
|
||||
Log.d(TAG, "values == " + values);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -165,7 +165,7 @@ public class Drug implements Serializable {
|
|||
}
|
||||
|
||||
void newStock() {
|
||||
Log.d(TAG, "current drug = " + this.toString());
|
||||
Log.d(TAG, "current drug = " + this);
|
||||
|
||||
Date lastUpdate = new Date(getDateLastUpdate());
|
||||
|
||||
|
|
|
@ -29,25 +29,25 @@ public class DrugDetailActivity extends AppCompatActivity {
|
|||
|
||||
Drug drug;
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
Bundle extras = getIntent().getExtras();
|
||||
Bundle bundle = getIntent().getExtras();
|
||||
|
||||
/* fetching the string passed with intent using ‘extras’*/
|
||||
|
||||
assert extras != null;
|
||||
drug = (Drug) extras.getSerializable("drug");
|
||||
assert bundle != null;
|
||||
drug = (Drug) bundle.getSerializable("drug");
|
||||
|
||||
assert drug != null;
|
||||
Log.d(TAG, "drug == " + drug.toString());
|
||||
Log.d(TAG, "drug == " + drug);
|
||||
|
||||
/* fetching the string passed with intent using ‘bundle’*/
|
||||
|
||||
setContentView(R.layout.activity_drug_detail);
|
||||
Toolbar toolbar = findViewById(detail_toolbar);
|
||||
|
||||
|
||||
if (toolbar != null) {
|
||||
setSupportActionBar(toolbar);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package net.foucry.pilldroid;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.activity.result.contract.ActivityResultContract;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
public class DrugDetailContract extends ActivityResultContract<Intent, Integer> {
|
||||
/**
|
||||
* Create an intent that can be used for {@link Activity#startActivityForResult}
|
||||
*
|
||||
* @param context Context
|
||||
* @param input Drug
|
||||
*/
|
||||
@NonNull
|
||||
@Override
|
||||
public Intent createIntent(@NonNull Context context, Intent input) {
|
||||
Intent intent = new Intent(context, DrugDetailActivity.class);
|
||||
|
||||
intent.putExtra("Drug", input.getExtras());
|
||||
return (intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert result obtained from to O
|
||||
* @param resultCode Integer
|
||||
* @param intent Intent
|
||||
* @return Integer
|
||||
*/
|
||||
@Override
|
||||
public Integer parseResult(int resultCode, @Nullable Intent intent) {
|
||||
|
||||
return resultCode;
|
||||
}
|
||||
}
|
|
@ -80,13 +80,13 @@ public class DrugDetailFragment extends Fragment {
|
|||
presentationView = detailView.findViewById(R.id.presentation_cell);
|
||||
TextView presentationLabel = presentationView.findViewById(R.id.label);
|
||||
TextView presentationValue = presentationView.findViewById(R.id.value);
|
||||
presentationLabel.setText(R.string.drug_presention_labal);
|
||||
presentationLabel.setText(R.string.drug_presentation_label);
|
||||
presentationValue.setText(drug.getPresentation());
|
||||
|
||||
adminModeView = detailView.findViewById(R.id.administration_cell);
|
||||
TextView adminModeLabel = adminModeView.findViewById(R.id.label);
|
||||
TextView adminModeValue = adminModeView.findViewById(R.id.value);
|
||||
adminModeLabel.setText(R.string.drug_administationMode_label);
|
||||
adminModeLabel.setText(R.string.drug_administrationMode_label);
|
||||
adminModeValue.setText(drug.getAdministration_mode());
|
||||
|
||||
stockView = detailView.findViewById(R.id.stock_cell);
|
||||
|
@ -108,17 +108,17 @@ public class DrugDetailFragment extends Fragment {
|
|||
warningView = detailView.findViewById(R.id.warning_cell);
|
||||
TextView warningLibelle = warningView.findViewById(R.id.label);
|
||||
TextView warningValue = warningView.findViewById(R.id.value);
|
||||
warningLibelle.setText(R.string.drug_warningTherehold_label);
|
||||
warningLibelle.setText(R.string.drug_warningThreshold_label);
|
||||
warningValue.setText(Integer.toString(drug.getWarnThreshold()));
|
||||
warningValue.setHint(R.string.drug_warningTherehold_label);
|
||||
warningValue.setHint(R.string.drug_warningThreshold_label);
|
||||
warningValue.setSelectAllOnFocus(true);
|
||||
|
||||
alertView = detailView.findViewById(R.id.alert_cell);
|
||||
TextView alertLibelle = alertView.findViewById(R.id.label);
|
||||
TextView alertValue = alertView.findViewById(R.id.value);
|
||||
alertLibelle.setText(R.string.drug_alertTherehold_label);
|
||||
alertLibelle.setText(R.string.drug_alertThreshold_label);
|
||||
alertValue.setText(Integer.toString(drug.getAlertThreshold()));
|
||||
alertValue.setHint(R.string.drug_alertTherehold_label);
|
||||
alertValue.setHint(R.string.drug_alertThreshold_label);
|
||||
alertValue.setSelectAllOnFocus(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
package net.foucry.pilldroid;
|
||||
|
||||
import static net.foucry.pilldroid.UtilDate.date2String;
|
||||
import static net.foucry.pilldroid.Utils.intRandomExclusive;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
@ -21,6 +24,7 @@ import android.widget.ImageView;
|
|||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.activity.result.ActivityResultLauncher;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
@ -28,17 +32,13 @@ import androidx.appcompat.widget.Toolbar;
|
|||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.zxing.client.android.Intents;
|
||||
import com.google.zxing.integration.android.IntentIntegrator;
|
||||
import com.google.zxing.integration.android.IntentResult;
|
||||
import com.journeyapps.barcodescanner.ScanOptions;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import static net.foucry.pilldroid.UtilDate.date2String;
|
||||
import static net.foucry.pilldroid.Utils.intRandomExclusive;
|
||||
|
||||
/**
|
||||
* An activity representing a list of Drugs is activity
|
||||
* has different presentations for handset and tablet-size devices. On
|
||||
|
@ -53,11 +53,16 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
* device.
|
||||
*/
|
||||
|
||||
// TODO: Change DEMO/DBDEMO form static to non-static. In order to create fake data at only at launchtime
|
||||
// TODO: Change DEMO/DBDEMO form static to non-static. In order to create fake data at only at launch time
|
||||
final Boolean DEMO = false;
|
||||
final Boolean DBDEMO = false;
|
||||
|
||||
public final int CUSTOMIZED_REQUEST_CODE = 0x0000ffff;
|
||||
public final String BARCODE_FORMAT_NAME = "Barcode Format name";
|
||||
public final String BARCODE_CONTENT = "Barcode Content";
|
||||
|
||||
private ActivityResultLauncher<ScanOptions> mBarcodeScannerLauncher;
|
||||
|
||||
|
||||
/**
|
||||
* Start tutorial
|
||||
|
@ -74,8 +79,8 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
nm.cancelAll();
|
||||
}
|
||||
|
||||
// tuto
|
||||
Log.i(TAG, "Launch tuto");
|
||||
// tutorial
|
||||
Log.i(TAG, "Launch tutorial");
|
||||
startActivity(new Intent(this, WelcomeActivity.class));
|
||||
}
|
||||
|
||||
|
@ -93,8 +98,7 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
|
||||
private SimpleItemRecyclerViewAdapter mAdapter;
|
||||
|
||||
public void constructDrugsList()
|
||||
{
|
||||
public void constructDrugsList() {
|
||||
dbHelper = new DBHelper(getApplicationContext());
|
||||
|
||||
if (!(drugs == null)) {
|
||||
|
@ -109,15 +113,14 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
setupRecyclerView((RecyclerView) mRecyclerView);
|
||||
}
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_drug_list);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
dbHelper = new DBHelper(this);
|
||||
}
|
||||
dbDrug = new DBDrugs(this);
|
||||
|
||||
Toolbar toolbar = findViewById(R.id.toolbar);
|
||||
|
@ -139,10 +142,10 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
// String presentation,double stock, double prise, int warn, int alert
|
||||
|
||||
// Limit for randoms generator
|
||||
final int min_stock=5;
|
||||
final int max_stock=50;
|
||||
final int min_prise=0;
|
||||
final int max_prise=3;
|
||||
final int min_stock = 5;
|
||||
final int max_stock = 50;
|
||||
final int min_prise = 0;
|
||||
final int max_prise = 3;
|
||||
|
||||
dbHelper.addDrug(new Drug("60000011", "3400930000011", "Médicament test 01", "orale",
|
||||
"plaquette(s) thermoformée(s) PVC PVDC aluminium de 10 comprimé(s)",
|
||||
|
@ -177,6 +180,68 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
}
|
||||
}
|
||||
|
||||
mBarcodeScannerLauncher = registerForActivityResult(new PilldroidScanContract(),
|
||||
result -> {
|
||||
if (result.getContents() == null) {
|
||||
Intent originalIntent = result.getOriginalIntent();
|
||||
Bundle bundle = originalIntent.getExtras();
|
||||
if (originalIntent.hasExtra(Intents.Scan.MISSING_CAMERA_PERMISSION)) {
|
||||
Log.d(TAG, "Missing camera permission");
|
||||
Toast.makeText(this, R.string.missing_camera_permission, Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
Log.d(TAG, "bundle == " + bundle.getInt("returnCode"));
|
||||
int returnCode = bundle.getInt("returnCode");
|
||||
int resultCode = bundle.getInt("resultCode");
|
||||
|
||||
if (resultCode != 1) {
|
||||
if (returnCode == 3) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
Toast.makeText(this, "Keyboard input",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
Log.d(TAG, "Keyboard Input");
|
||||
showInputDialog();
|
||||
} else if (returnCode == 2) {
|
||||
Toast.makeText(this, R.string.cancelled_scan, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} else {
|
||||
Log.d(TAG, "Scanned");
|
||||
if (BuildConfig.DEBUG) {
|
||||
Toast.makeText(this, "Scanned: " + bundle.getString(BARCODE_FORMAT_NAME),
|
||||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
String cip13;
|
||||
|
||||
// Handle successful scan
|
||||
|
||||
Log.d(TAG, "formatName = " + bundle.getString(BARCODE_FORMAT_NAME));
|
||||
|
||||
switch (bundle.getString(BARCODE_FORMAT_NAME)) {
|
||||
case "CODE_128":
|
||||
case "EAN_13": //CODE_128 || EAN 13
|
||||
cip13 = bundle.getString(BARCODE_CONTENT);
|
||||
break;
|
||||
case "CODE_39":
|
||||
cip13 = dbDrug.getCIP13FromCIP7(bundle.getString(BARCODE_CONTENT));
|
||||
break;
|
||||
case "DATA_MATRIX":
|
||||
cip13 = bundle.getString(BARCODE_CONTENT).substring(4, 17);
|
||||
break;
|
||||
default:
|
||||
scanNotOK();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get Drug from database
|
||||
final Drug scannedDrug = dbDrug.getDrugByCIP13(cip13);
|
||||
|
||||
// add Drug to prescription database
|
||||
askToAddInDB(scannedDrug);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
constructDrugsList();
|
||||
}
|
||||
|
||||
|
@ -202,9 +267,27 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
/*if (requestCode != CUSTOMIZED_REQUEST_CODE && requestCode != IntentIntegrator.REQUEST_CODE) {
|
||||
// This is important, otherwise the result will not be passed to the fragment
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
return;
|
||||
}*/
|
||||
if (requestCode == CUSTOMIZED_REQUEST_CODE) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
Toast.makeText(this, "REQUEST_CODE = " + requestCode +
|
||||
"RESULT_CODE = " + resultCode, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
Log.d(TAG, "REQUEST_CODE = " + requestCode + " RESULT_CODE = " + resultCode);
|
||||
constructDrugsList();
|
||||
}
|
||||
}
|
||||
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
Log.d(TAG, "onPause really!");
|
||||
Log.d(TAG, "onPause");
|
||||
AlarmReceiver.scheduleAlarm(this);
|
||||
}
|
||||
|
||||
|
@ -212,89 +295,24 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
super.onResume();
|
||||
}
|
||||
|
||||
/** scanNow
|
||||
*
|
||||
* @param view
|
||||
* call ZXing Library to scan a new QR/EAN code
|
||||
*/
|
||||
public void scanNow(View view) {
|
||||
new IntentIntegrator(this).setOrientationLocked(false).setCaptureActivity(CustomScannerActivity.class).initiateScan();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode != CUSTOMIZED_REQUEST_CODE && requestCode != IntentIntegrator.REQUEST_CODE) {
|
||||
// This is important, otherwise the result will not be passed to the fragment
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
return;
|
||||
}
|
||||
if (requestCode == CUSTOMIZED_REQUEST_CODE) {
|
||||
if (BuildConfig.DEBUG) { Toast.makeText(this, "REQUEST_CODE = " + requestCode +
|
||||
"RESULT_CODE = " + resultCode, Toast.LENGTH_LONG).show(); }
|
||||
Log.d(TAG, "REQUEST_CODE = " + requestCode + " RESULT_CODE = " + resultCode);
|
||||
constructDrugsList();
|
||||
} else {
|
||||
IntentResult result = IntentIntegrator.parseActivityResult(resultCode, data);
|
||||
// Launch scan
|
||||
public void onButtonClick() {
|
||||
Log.d(TAG, "add medication");
|
||||
ScanOptions options = new ScanOptions();
|
||||
options.setDesiredBarcodeFormats(ScanOptions.DATA_MATRIX, ScanOptions.CODE_39,
|
||||
ScanOptions.CODE_128);
|
||||
options.setCameraId(0); // Use a specific camera of the device
|
||||
options.setBeepEnabled(true);
|
||||
options.setBarcodeImageEnabled(true);
|
||||
//options.setTimeout(3600);
|
||||
options.setCaptureActivity(CustomScannerActivity.class);
|
||||
options.setBeepEnabled(true);
|
||||
options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.MIXED_SCAN);
|
||||
options.addExtra(Intents.Scan.SCAN_TYPE, Intents.Scan.INVERTED_SCAN);
|
||||
|
||||
if (BuildConfig.DEBUG) { Toast.makeText(this, "REQUEST_CODE = " + requestCode,
|
||||
Toast.LENGTH_LONG).show(); }
|
||||
|
||||
Log.d(TAG, "REQUEST_CODE = " + requestCode + "resultCode = " + resultCode);
|
||||
if (result.getContents() == null) {
|
||||
Intent originalIntent = result.getOriginalIntent();
|
||||
if (originalIntent == null) {
|
||||
if (resultCode == 3) {
|
||||
if(BuildConfig.DEBUG) { Toast.makeText(this, "Keyboard input",
|
||||
Toast.LENGTH_SHORT).show(); }
|
||||
Log.d(TAG, "Keyboard Input");
|
||||
showInputDialog();
|
||||
} else {
|
||||
Log.d(TAG, "Cancelled scan");
|
||||
Log.d(TAG, "REQUEST_CODE = " + requestCode + " RESULT_CODE = " + resultCode);
|
||||
}
|
||||
if(BuildConfig.DEBUG) { Toast.makeText(this, "Cancelled",
|
||||
Toast.LENGTH_LONG).show(); }
|
||||
} else if (originalIntent.hasExtra(Intents.Scan.MISSING_CAMERA_PERMISSION)) {
|
||||
Log.d(TAG, "Cancelled scan due to missing camera permission");
|
||||
Log.d(TAG, "REQUEST_CODE = " + requestCode + " RESULT_CODE = " + resultCode);
|
||||
Toast.makeText(this, "Cancelled due to missing camera permission", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} else {
|
||||
Log.d(TAG, "Scanned");
|
||||
Log.d(TAG, "REQUEST_CODE = " + requestCode + " RESULT_CODE = " + resultCode);
|
||||
Log.d(TAG, "result.getContents = " + result.getContents());
|
||||
Log.d(TAG, "format = " + result.getFormatName());
|
||||
|
||||
if (BuildConfig.DEBUG) { Toast.makeText(this, "Scanned: " +
|
||||
result.getContents(), Toast.LENGTH_LONG).show(); }
|
||||
|
||||
String cip13;
|
||||
|
||||
// Handle successful scan
|
||||
|
||||
Log.d(TAG, "formatName = " + result.getFormatName());
|
||||
|
||||
switch (result.getFormatName()) {
|
||||
case "CODE_128":
|
||||
case "EAN_13": //CODE_128 || EAN 13
|
||||
cip13 = result.getContents();
|
||||
break;
|
||||
case "CODE_39":
|
||||
cip13 = dbDrug.getCIP13FromCIP7(result.getContents());
|
||||
break;
|
||||
case "DATA_MATRIX":
|
||||
cip13 = result.getContents().substring(4, 17);
|
||||
break;
|
||||
default:
|
||||
scanNotOK();
|
||||
return;
|
||||
}
|
||||
|
||||
// Get Drug from database
|
||||
final Drug scannedDrug = dbDrug.getDrugByCIP13(cip13);
|
||||
askToAddInDB(scannedDrug);
|
||||
}
|
||||
}
|
||||
Log.d(TAG, "scanOptions == " + options);
|
||||
mBarcodeScannerLauncher.launch(options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -346,6 +364,7 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
/**
|
||||
* Ask if the drug found in the database should be include in the
|
||||
* user database
|
||||
*
|
||||
* @param aDrug Drug- drug to be added
|
||||
*/
|
||||
private void askToAddInDB(Drug aDrug) {
|
||||
|
@ -375,8 +394,7 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
/**
|
||||
* Tell user that the barre code cannot be interpreted
|
||||
*/
|
||||
private void scanNotOK()
|
||||
{
|
||||
private void scanNotOK() {
|
||||
AlertDialog.Builder dlg = new AlertDialog.Builder(this);
|
||||
dlg.setTitle(getString(R.string.app_name));
|
||||
|
||||
|
@ -389,10 +407,12 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
|
||||
/**
|
||||
* Add New drug to the user database
|
||||
*
|
||||
* @param aDrug Drug - drug to be added
|
||||
*/
|
||||
private void addDrugToList(Drug aDrug)
|
||||
{
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void addDrugToList(Drug aDrug) {
|
||||
aDrug.setDateEndOfStock();
|
||||
mAdapter.addItem(aDrug);
|
||||
|
||||
|
@ -400,11 +420,24 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
Context context = this;
|
||||
Intent intent = new Intent(context, DrugDetailActivity.class);
|
||||
intent.putExtra("drug", aDrug);
|
||||
|
||||
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
|
||||
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
|
||||
}
|
||||
|
||||
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) : "???");
|
||||
}
|
||||
|
||||
/**
|
||||
* setupRecyclerView (list of drugs
|
||||
* setupRecyclerView (list of drugs)
|
||||
*
|
||||
* @param recyclerView RecyclerView
|
||||
*/
|
||||
private void setupRecyclerView(@NonNull RecyclerView recyclerView) {
|
||||
|
@ -413,21 +446,13 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
recyclerView.setAdapter(mAdapter);
|
||||
}
|
||||
|
||||
private String getAppName() {
|
||||
PackageManager packageManager = getApplicationContext().getPackageManager();
|
||||
ApplicationInfo applicationInfo = null;
|
||||
try {
|
||||
applicationInfo = packageManager.getApplicationInfo(this.getPackageName(), 0);
|
||||
} catch (final PackageManager.NameNotFoundException ignored) {}
|
||||
return (String)((applicationInfo != null) ? packageManager.getApplicationLabel(applicationInfo) : "???");
|
||||
}
|
||||
|
||||
/**
|
||||
* SimpleItemRecyclerViewAdapter
|
||||
*/
|
||||
public class SimpleItemRecyclerViewAdapter extends RecyclerView.Adapter<SimpleItemRecyclerViewAdapter.ViewHolder> {
|
||||
|
||||
private final List<Drug> mValues;
|
||||
|
||||
SimpleItemRecyclerViewAdapter(List<Drug> items) {
|
||||
mValues = items;
|
||||
}
|
||||
|
@ -452,6 +477,7 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public void onBindViewHolder(final ViewHolder holder, int dummy) {
|
||||
final int position = holder.getBindingAdapterPosition();
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("EEEE d MMMM yyyy", Locale.getDefault());
|
||||
|
@ -473,6 +499,19 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
if (mValues.get(position).getTake() == 0) {
|
||||
holder.mView.setBackgroundResource(R.drawable.gradient_bg);
|
||||
holder.mIconView.setImageResource(R.drawable.ic_suspended_pill);
|
||||
|
||||
holder.mView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Drug drug = mValues.get(position);
|
||||
Context context = v.getContext();
|
||||
Intent intent = new Intent(context, DrugDetailActivity.class);
|
||||
intent.putExtra("drug", drug);
|
||||
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
|
||||
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
int remainingStock = (int) Math.floor(mValues.get(position).getStock() / mValues.get(position).getTake());
|
||||
if (remainingStock <= mValues.get(position).getAlertThreshold()) {
|
||||
|
@ -486,21 +525,23 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
holder.mView.setBackgroundResource(R.drawable.gradient_bg_ok);
|
||||
holder.mIconView.setImageResource(R.drawable.ok_stock_vect);
|
||||
}
|
||||
}
|
||||
|
||||
holder.mView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Drug drugCourant = mValues.get(position);
|
||||
Drug drug = mValues.get(position);
|
||||
Context context = v.getContext();
|
||||
Intent intent = new Intent(context, DrugDetailActivity.class);
|
||||
intent.putExtra("drug", drugCourant);
|
||||
intent.putExtra("drug", drug);
|
||||
startActivityForResult(intent, CUSTOMIZED_REQUEST_CODE);
|
||||
overridePendingTransition(R.anim.slide_from_right, R.anim.slide_to_left);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mValues.size();
|
||||
|
@ -511,8 +552,7 @@ public class DrugListActivity extends AppCompatActivity {
|
|||
final TextView mContentView;
|
||||
final TextView mEndOfStock;
|
||||
final ImageView mIconView;
|
||||
|
||||
Drug mItem;
|
||||
public Drug mItem;
|
||||
|
||||
ViewHolder(View view) {
|
||||
super(view);
|
||||
|
|
|
@ -13,7 +13,6 @@ import androidx.core.app.NotificationManagerCompat;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* Created by jacques on 17/09/16.
|
||||
*/
|
||||
|
@ -89,7 +88,7 @@ public class PillDroidJobService extends JobService {
|
|||
Log.d(TAG, "schedule notification");
|
||||
createNotificationChannel();
|
||||
Intent intent = new Intent(this, DrugListActivity.class);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,0);
|
||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent,PendingIntent.FLAG_MUTABLE);
|
||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(this, "PillDroid")
|
||||
.setSmallIcon(R.drawable.ic_pill_alarm)
|
||||
.setContentTitle(getString(R.string.app_name))
|
||||
|
@ -114,7 +113,6 @@ public class PillDroidJobService extends JobService {
|
|||
int importance = NotificationManager.IMPORTANCE_DEFAULT;
|
||||
String CHANNEL_ID = "PillDroid";
|
||||
NotificationChannel channel;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
channel = new NotificationChannel(CHANNEL_ID, name, importance);
|
||||
|
||||
channel.setDescription(description);
|
||||
|
@ -132,5 +130,4 @@ public class PillDroidJobService extends JobService {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package net.foucry.pilldroid;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.activity.result.contract.ActivityResultContract;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.google.zxing.client.android.Intents;
|
||||
import com.journeyapps.barcodescanner.ScanIntentResult;
|
||||
import com.journeyapps.barcodescanner.ScanOptions;
|
||||
|
||||
|
||||
public class PilldroidScanContract extends ActivityResultContract<ScanOptions, ScanIntentResult>{
|
||||
private static final String TAG = PilldroidScanContract.class.getName();
|
||||
@NonNull
|
||||
@Override
|
||||
public Intent createIntent(@NonNull Context context, ScanOptions input) {
|
||||
Log.d(TAG, "create Intent");
|
||||
|
||||
Intent intent = new Intent(context, CustomScannerActivity.class);
|
||||
|
||||
intent.setAction(Intents.Scan.ACTION);
|
||||
|
||||
Log.d(TAG, "intent ==" + intent);
|
||||
return(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScanIntentResult parseResult(int resultCode, @Nullable Intent intent) {
|
||||
return ScanIntentResult.parseActivityResult(resultCode, intent);
|
||||
}
|
||||
}
|
|
@ -8,11 +8,11 @@ import android.content.SharedPreferences;
|
|||
* Created by Lincoln on 05/05/16.
|
||||
*/
|
||||
public class PrefManager {
|
||||
SharedPreferences pref;
|
||||
final SharedPreferences pref;
|
||||
SharedPreferences.Editor editor;
|
||||
|
||||
// shared pref mode
|
||||
int PRIVATE_MODE = 0;
|
||||
final int PRIVATE_MODE = 0;
|
||||
|
||||
// Shared preferences file name
|
||||
private static final String PREF_NAME = "Pildroid-Prefs";
|
||||
|
|
|
@ -6,7 +6,6 @@ import android.graphics.drawable.Drawable;
|
|||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,7 +5,6 @@ import android.util.Log;
|
|||
import java.text.DateFormat;
|
||||
import java.text.ParsePosition;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
package net.foucry.pilldroid;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Random;
|
||||
|
||||
public class Utils {
|
||||
private static final String TAG = UtilDate.class.getName();
|
||||
private static final String TAG = Utils.class.getName();
|
||||
|
||||
public static final int SELECT_BARCODE_REQUEST = 2;
|
||||
public static final int BARCODE_SCAN = 3;
|
||||
|
||||
public static void CopyStream(InputStream is, OutputStream os)
|
||||
{
|
||||
|
@ -20,8 +29,10 @@ public class Utils {
|
|||
break;
|
||||
os.write(bytes, 0, count);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
catch(Exception ignored){}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -34,5 +45,4 @@ public class Utils {
|
|||
Random r = new Random();
|
||||
return r.nextInt(max - min) +max;
|
||||
}
|
||||
|
||||
}
|
|
@ -2,16 +2,20 @@ package net.foucry.pilldroid;
|
|||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowInsets;
|
||||
import android.view.WindowInsetsController;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.viewpager.widget.PagerAdapter;
|
||||
|
@ -41,11 +45,10 @@ public class WelcomeActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
prefManager.setFirstTimeLaunch(false);
|
||||
// Making notification bar transparent
|
||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
|
||||
|
||||
setContentView(R.layout.activity_welcome);
|
||||
|
||||
setFullScreen();
|
||||
|
||||
viewPager = findViewById(R.id.view_pager);
|
||||
dotsLayout = findViewById(R.id.layoutDots);
|
||||
btnSkip = findViewById(R.id.btn_skip);
|
||||
|
@ -90,7 +93,7 @@ public class WelcomeActivity extends AppCompatActivity {
|
|||
public void onClick(View v) {
|
||||
// checking for last page
|
||||
// if last page home screen will be launched
|
||||
int current = getItem(+1);
|
||||
int current = getItem();
|
||||
if (current < layouts.length) {
|
||||
// move to next screen
|
||||
viewPager.setCurrentItem(current);
|
||||
|
@ -118,8 +121,8 @@ public class WelcomeActivity extends AppCompatActivity {
|
|||
dots[currentPage].setTextColor(ContextCompat.getColor(this, R.color.dot_light));
|
||||
}
|
||||
|
||||
private int getItem(int i) {
|
||||
return viewPager.getCurrentItem() + i;
|
||||
private int getItem() {
|
||||
return viewPager.getCurrentItem() + 1;
|
||||
}
|
||||
|
||||
void launchHomeScreen() {
|
||||
|
@ -129,7 +132,7 @@ public class WelcomeActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
// viewpager change listener
|
||||
ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {
|
||||
final ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
|
@ -167,6 +170,28 @@ public class WelcomeActivity extends AppCompatActivity {
|
|||
window.setStatusBarColor(Color.TRANSPARENT);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void setFullScreen(){
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
getWindow().setDecorFitsSystemWindows(false);
|
||||
WindowInsetsController controller = getWindow().getInsetsController();
|
||||
if(controller != null) {
|
||||
controller.hide(WindowInsets.Type.statusBars() | WindowInsets.Type.navigationBars());
|
||||
controller.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
|
||||
}
|
||||
}
|
||||
else {
|
||||
//noinspection
|
||||
getWindow().getDecorView().setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
| View.SYSTEM_UI_FLAG_IMMERSIVE
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* View pager adapter
|
||||
*/
|
||||
|
@ -175,8 +200,9 @@ public class WelcomeActivity extends AppCompatActivity {
|
|||
public MyViewPagerAdapter() {
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Object instantiateItem(ViewGroup container, int position) {
|
||||
public Object instantiateItem(@NonNull ViewGroup container, int position) {
|
||||
LayoutInflater layoutInflater = getLayoutInflater();
|
||||
|
||||
View view = layoutInflater.inflate(layouts[position], container, false);
|
||||
|
@ -191,13 +217,13 @@ public class WelcomeActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isViewFromObject(View view, Object obj) {
|
||||
public boolean isViewFromObject(@NonNull View view, @NonNull Object obj) {
|
||||
return view == obj;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void destroyItem(ViewGroup container, int position, Object object) {
|
||||
public void destroyItem(ViewGroup container, int position, @NonNull Object object) {
|
||||
View view = (View) object;
|
||||
container.removeView(view);
|
||||
}
|
||||
|
|
|
@ -17,8 +17,7 @@
|
|||
|
||||
-->
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/drug_list"
|
||||
android:name="net.foucry.pilldroid.MedicamentListFragment"
|
||||
android:layout_width="@dimen/item_width"
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context="example.zxing.CustomScannerActivity">
|
||||
tools:context="net.foucry.pilldroid.CustomScannerActivity">
|
||||
|
||||
<com.journeyapps.barcodescanner.DecoratedBarcodeView
|
||||
android:id="@+id/zxing_barcode_scanner"
|
||||
|
@ -22,7 +22,7 @@
|
|||
android:layout_marginEnd="@dimen/fab_margin"
|
||||
android:layout_marginBottom="@dimen/fab_margin"
|
||||
android:backgroundTint="@android:color/transparent"
|
||||
android:contentDescription="@string/flashlighButton"
|
||||
android:contentDescription="@string/flashlightButton"
|
||||
android:onClick="switchFlashlight"
|
||||
android:src="@drawable/ic_baseline_highlight_24" />
|
||||
</com.journeyapps.barcodescanner.DecoratedBarcodeView>
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
android:backgroundTint="@android:color/transparent"
|
||||
android:baselineAlignBottom="false"
|
||||
android:clickable="false"
|
||||
android:onClick="scanNow"
|
||||
android:onClick="onButtonClick"
|
||||
android:src="@drawable/ic_add_circle_black_24dp"
|
||||
app:backgroundTint="@android:color/darker_gray"
|
||||
app:fabCustomSize="60dp"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
app:zxing_result_view="@color/zxing_custom_result_view"
|
||||
app:zxing_viewfinder_laser="@color/zxing_custom_viewfinder_laser"
|
||||
app:zxing_viewfinder_laser_visibility="true"
|
||||
app:zxing_viewfinder_mask="@color/zxing_custom_viewfinder_mask" />
|
||||
app:zxing_viewfinder_mask="@color/grey"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/zxing_status_view"
|
||||
|
@ -33,7 +33,7 @@
|
|||
android:textSize="32sp"
|
||||
android:textAlignment="center"
|
||||
android:text="@string/zxing_msg_default_status"
|
||||
android:textColor="@color/design_default_color_primary_dark"
|
||||
android:textColor="@color/white"
|
||||
tools:ignore="PrivateResource" />
|
||||
|
||||
<ImageButton
|
||||
|
@ -60,6 +60,7 @@
|
|||
android:backgroundTint="@android:color/transparent"
|
||||
android:contentDescription="@string/button_keyboard"
|
||||
android:onClick="onKeyboard"
|
||||
android:src="@drawable/ic_keyboard_black_24dp" />
|
||||
android:src="@drawable/ic_keyboard_black_24dp"
|
||||
tools:ignore="PrivateResource" />
|
||||
|
||||
</merge>
|
|
@ -10,7 +10,7 @@
|
|||
<ImageView
|
||||
android:layout_width="@dimen/img_width_height"
|
||||
android:layout_height="@dimen/img_width_height"
|
||||
android:contentDescription="@string/barre_code_icone"
|
||||
android:contentDescription="@string/barcode_icon"
|
||||
android:src="@drawable/ic_barcode" />
|
||||
|
||||
<TextView
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<ImageView
|
||||
android:layout_width="@dimen/screen_shot_height"
|
||||
android:layout_height="@dimen/screen_shot_height"
|
||||
android:contentDescription="@string/tunables"
|
||||
android:contentDescription="@string/tunable"
|
||||
android:src="@drawable/tunable" />
|
||||
|
||||
<TextView
|
||||
|
|
0
app/src/main/res/mipmap-anydpi
Normal file
0
app/src/main/res/mipmap-anydpi
Normal file
|
@ -3,22 +3,22 @@
|
|||
<string name="title_drug_detail">Détail Médicament</string>
|
||||
<string name="button_cancel">Annuler</string>
|
||||
<string name="button_ok">OK</string>
|
||||
<string name="drug_presention_labal">Présentation</string>
|
||||
<string name="drug_presentation_label">Présentation</string>
|
||||
<string name="drug_name_label">Nom</string>
|
||||
<string name="drug_administationMode_label">Mode d\'adminitration</string>
|
||||
<string name="drug_administrationMode_label">Mode d\'adminitration</string>
|
||||
<string name="msgNotFound">Médicament introuvable dans la base de données</string>
|
||||
<string name="about">À propos</string>
|
||||
<string name="help">Aide</string>
|
||||
<string name="drug_take_label">Prise</string>
|
||||
<string name="drug_alertTherehold_label">Seuil critique</string>
|
||||
<string name="drug_warningTherehold_label">Seuil d\'alerte</string>
|
||||
<string name="drug_alertThreshold_label">Seuil critique</string>
|
||||
<string name="drug_warningThreshold_label">Seuil d\'alerte</string>
|
||||
<string name="msgFound">Médicament trouvé dans la base de données</string>
|
||||
<string name="drug_current_stock_label">Stock courant</string>
|
||||
<string name="notification_text">Vous devez passer à la pharmacie</string>
|
||||
<string name="button_keyboard">Utilisez le clavier</string>
|
||||
<string name="detail_view">Vue de détail</string>
|
||||
<string name="save_button">Enrefistrez</string>
|
||||
<string name="flashlighButton">Allumez/Éteignez le Flash</string>
|
||||
<string name="flashlightButton">Allumez/Éteignez le Flash</string>
|
||||
<string name="enter_cip_13_here">Enter cip 13 here..</string>
|
||||
<string name="enter_cip_13">Enter CIP 13</string>
|
||||
|
||||
|
@ -42,12 +42,12 @@
|
|||
<string name="the_plus_icon">L\'icône Plus</string>
|
||||
<string name="slide4_desc">Pour trouver le CIP13</string>
|
||||
<string name="happy_face">Visage souriant</string>
|
||||
<string name="barre_code_icone">Icône de code barre</string>
|
||||
<string name="barcode_icon">Icône de code barre</string>
|
||||
<string name="qr_code_icon">icône de QR-Code</string>
|
||||
<string name="neutral_face">Visage neutre</string>
|
||||
<string name="unhappy_face">Visage grincheux</string>
|
||||
<string name="drug_info">Capture d\'écran sur la partie information du médicament</string>
|
||||
<string name="tunables">Réglages</string>
|
||||
<string name="tunable">Réglages</string>
|
||||
<string name="slide10_desc">Mettre la prise à zéro suspend le traitement et les calculs de stock</string>
|
||||
<string name="suspended_treatment_icon">Icône de traitemernt suspendu</string>
|
||||
<string name="slide11_desc">Pour enregistrer les changements, utilisez l\'icône de sauvegarde</string>
|
||||
|
@ -64,4 +64,6 @@
|
|||
<string name="label">Libellé</string>
|
||||
<string name="drug_list">Attributs d\'un médicament</string>
|
||||
<string name="notInterpreted">Le code barre ne peut pas être interprété</string>
|
||||
<string name="cancelled_scan">Scan annulé</string>
|
||||
<string name="missing_camera_permission">Permission appareil photo manquante</string>
|
||||
</resources>
|
|
@ -3,6 +3,7 @@
|
|||
<color name="colorPrimary">#3F51B5</color>
|
||||
<color name="colorPrimaryDark">#303F9F</color>
|
||||
<color name="colorAccent">#FF4081</color>
|
||||
<color name="white">#FFFFFF</color>
|
||||
|
||||
<!-- slide bg -->
|
||||
<color name="bg_screen1">#4f91ff</color>
|
||||
|
|
|
@ -8,16 +8,16 @@
|
|||
<string name="help">Help</string>
|
||||
<string name="notification_text">You have to go to the pharmacy</string>
|
||||
<string name="drug_name_label">Name</string>
|
||||
<string name="drug_presention_labal">Presentation</string>
|
||||
<string name="drug_administationMode_label">Administration mode</string>
|
||||
<string name="drug_presentation_label">Presentation</string>
|
||||
<string name="drug_administrationMode_label">Administration mode</string>
|
||||
<string name="drug_current_stock_label">Current stock</string>
|
||||
<string name="drug_take_label">Take</string>
|
||||
<string name="drug_warningTherehold_label">Alert therehold</string>
|
||||
<string name="drug_alertTherehold_label">Critical therehold</string>
|
||||
<string name="drug_warningThreshold_label">Alert threshold</string>
|
||||
<string name="drug_alertThreshold_label">Critical threshold</string>
|
||||
<string name="button_keyboard">"Use the keyboard"</string>
|
||||
<string name="detail_view">Detail view</string>
|
||||
<string name="save_button">Save</string>
|
||||
<string name="flashlighButton">Toggle Flash</string>
|
||||
<string name="flashlightButton">Toggle Flash</string>
|
||||
<string name="enter_cip_13_here">Enter cip 13 here..</string>
|
||||
<string name="enter_cip_13">Enter CIP 13</string>
|
||||
<string name="channel_description" translatable="false">PillDroid_NotificationChannel</string>
|
||||
|
@ -25,7 +25,7 @@
|
|||
|
||||
<!-- slides strings -->
|
||||
<string name="slide1_Pilldroid">Welcome on Pilldroid</string>
|
||||
<string name="slide1_desc">The theorical Pill Stock Manager</string>
|
||||
<string name="slide1_desc">The theoretical Pill Stock Manager</string>
|
||||
<string name="slide2_Pilldroid">To add a med, tap on the "Plus" button</string>
|
||||
<string name="slide2_desc">You\'ll add a drug to the database</string>
|
||||
<string name="slide3_Pilldroid">You can scan classic barcode</string>
|
||||
|
@ -43,12 +43,12 @@
|
|||
<string name="the_plus_icon">The plus icon</string>
|
||||
<string name="slide4_desc">In order to find the CIP13</string>
|
||||
<string name="happy_face">Happy face</string>
|
||||
<string name="barre_code_icone">Barre code icon</string>
|
||||
<string name="barcode_icon">Barre code icon</string>
|
||||
<string name="qr_code_icon">qr-code icon</string>
|
||||
<string name="neutral_face">neutral face</string>
|
||||
<string name="unhappy_face">unhappy face</string>
|
||||
<string name="drug_info">Drug info screenshot</string>
|
||||
<string name="tunables">Tunables</string>
|
||||
<string name="tunable">Tunable</string>
|
||||
<string name="slide10_desc">Take to 0 to suspend treatment</string>
|
||||
<string name="suspended_treatment_icon">Treatment suspended icon</string>
|
||||
<string name="slide11_desc">To save changes</string>
|
||||
|
@ -65,5 +65,7 @@
|
|||
<string name="Value">Value</string>
|
||||
<string name="label">Label</string>
|
||||
<string name="drug_list">Drug\'s attributes</string>
|
||||
<string name="notInterpreted">Barre code cannot be intrepreted</string>
|
||||
<string name="notInterpreted">Barre code cannot be interpreted</string>
|
||||
<string name="cancelled_scan">Scan canceled</string>
|
||||
<string name="missing_camera_permission">Missing camera permission</string>
|
||||
</resources>
|
||||
|
|
|
@ -9,7 +9,7 @@ buildscript {
|
|||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.0.4'
|
||||
classpath 'com.android.tools.build:gradle:7.1.2'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
@ -20,10 +20,11 @@ ext {
|
|||
buildToolsVersion = '28.0.1'
|
||||
var = '3.4.2'
|
||||
//buildToolsVersion1 = '29.0.3'
|
||||
defaultMinSdkVersion = 24
|
||||
defaultMinSdkVersion = 26
|
||||
defaultTargetSdkVersion = 30
|
||||
defaultVersionCode = 1
|
||||
defaultVersionCode1 = defaultVersionCode
|
||||
defaultVersionName = 'beta-0.+$versioncode'
|
||||
}
|
||||
|
||||
allprojects {
|
||||
|
|
|
@ -23,4 +23,4 @@ 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 [Pildroid](mailto://jacques+pilldroid@foucry.net).
|
||||
You can reach me and discuss on [Pilldroid](mailto://jacques+pilldroid@foucry.net).
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
<<<<<<< HEAD
|
||||
<strong>Pilldroid</strong> is a theorical medics manager. It for French people
|
||||
only.
|
||||
|
||||
<strong>Why for french people only?</strong>
|
||||
<p>Pilldroid use a medics databases that come from French governement website, with
|
||||
<strong>Pilldroid</strong> is a theoretical medics manager. It for French people
|
||||
only.
|
||||
|
||||
medics which are refund by french health care national insurance (Sécurité
|
||||
Sociale).</p>
|
||||
|
||||
|
|
Loading…
Reference in a new issue