diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2580491..79a7284 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -43,6 +43,11 @@ + + \ No newline at end of file diff --git a/app/src/main/assets/about.html b/app/src/main/assets/about.html new file mode 100644 index 0000000..a15b457 --- /dev/null +++ b/app/src/main/assets/about.html @@ -0,0 +1,32 @@ + + + + + + +
+ +
PilStock © 2016 Jacques Foucry
+

PilStock est une gestion théorique de votre stock de médicaments.

+

PilStock n'a aucune connaissance des interactions des médicaments entre eux.

+

EN CAS DE DOUTE, CONSULTEZ VOTRE MÉDECIN OU VOTRE PHARMACIEN.

+

PilStock ne vous rappelle pas de prendre vos médicaments.

+

LA RESPONSABILITÉ DE L'AUTEUR NE SAURAIT ÊTRE ENGAGÉE EN CAS DE SURDOSAGE OU D'OUBLI DE PRISE.

+
+

PilStock n'aurait pas pu voir le jour sans les conseils avisés de Frank, Benoit, Dominique & Aurélien.

+

Stéphane en grand chamboulateur d'interface en fait quelque chose d'utilisable

+
+

Le soutien actif et les conseils du Dr Kauffmann me permettent de faire évoluer PilStock

+

Vous pouvez me contacter à l'adresse suivante : pilstock@pilstock-app.com

+ + diff --git a/app/src/main/java/net/foucry/pilldroid/About.java b/app/src/main/java/net/foucry/pilldroid/About.java new file mode 100644 index 0000000..ced9973 --- /dev/null +++ b/app/src/main/java/net/foucry/pilldroid/About.java @@ -0,0 +1,52 @@ +package net.foucry.pilldroid; + +import android.graphics.Color; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.text.Html; +import android.webkit.WebView; + +/** + * Created by jacques on 12/06/16. + */ +public class About extends AppCompatActivity{ + + private WebView aboutView; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.about); + + String htmlString = null; + + aboutView = (WebView) findViewById(R.id.aboutHtml); + + aboutView.loadUrl("file:///android_asset/about.html"); + aboutView.clearCache(true); + aboutView.clearHistory(); + aboutView.getSettings().setJavaScriptEnabled(true); + aboutView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); + aboutView.setBackgroundColor(Color.WHITE); + + + } + + private class ImageGetter implements Html.ImageGetter { + + public Drawable getDrawable(String source) { + int id; + if (source.equals("ic_launcher.png")) { + id = R.mipmap.ic_launcher; + } else { + return null; + } + + Drawable d = getResources().getDrawable(id); +// Drawable d = ResourcesCompat.getDrawable(getResources(),id, null); + d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight()); + return d; + } + } +} diff --git a/app/src/main/java/net/foucry/pilldroid/DBMedoc.java b/app/src/main/java/net/foucry/pilldroid/DBMedoc.java index e15488f..a446765 100644 --- a/app/src/main/java/net/foucry/pilldroid/DBMedoc.java +++ b/app/src/main/java/net/foucry/pilldroid/DBMedoc.java @@ -47,14 +47,13 @@ public class DBMedoc extends SQLiteOpenHelper{ } public void createDatabase() throws IOException { - Log.e(MedicamentListActivity.Constants.TAG, "createDatabase called"); boolean dbExist = checkDatabase(); if (dbExist) { - // Nothing to do, DB already exist + Log.v("DB Exists", "db exists"); } else { - this.getDatabaseName(); + this.getReadableDatabase(); try { copyDatabase(); } catch (IOException e) { diff --git a/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java b/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java index 0ee95fc..3da720e 100644 --- a/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java +++ b/app/src/main/java/net/foucry/pilldroid/MedicamentListActivity.java @@ -11,6 +11,9 @@ import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; @@ -147,6 +150,25 @@ public class MedicamentListActivity extends AppCompatActivity { } } + + public boolean onCreateOptionsMenu(Menu menu) { + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.about, menu); + return true; + } + + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.about: + startActivity(new Intent(this, About.class)); + return true; + case R.id.help: + //startActivity(new Intent(this, Help.class)); + return true; + } + return super.onOptionsItemSelected(item); + } + public void scanNow(View view) { Intent intent = new Intent("com.google.zxing.client.android.SCAN"); //intent.putExtra("SCAN_MODE", "CODE_128"); diff --git a/app/src/main/res/layout/about.xml b/app/src/main/res/layout/about.xml new file mode 100644 index 0000000..1dd71d4 --- /dev/null +++ b/app/src/main/res/layout/about.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/about.xml b/app/src/main/res/menu/about.xml new file mode 100644 index 0000000..f25403c --- /dev/null +++ b/app/src/main/res/menu/about.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cb93174..d0c5ac7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -126,4 +126,6 @@ Google Book Search Requesting connection to network\u2026 Médicament introuvable dans la base de données + À propos + Aide