diff --git a/app/build.gradle b/app/build.gradle index aa4b7ee..e971d73 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -19,13 +19,13 @@ android { productFlavors { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_6 + sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } /*dexOptions { incremental false }*/ - buildToolsVersion = '29.0.2' + buildToolsVersion = buildToolsVersion1 } repositories { @@ -37,7 +37,7 @@ repositories { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.13' implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support:recyclerview-v7:27.1.1' implementation 'com.android.support:design:27.1.1' diff --git a/app/src/main/java/net/foucry/pilldroid/DBHelper.java b/app/src/main/java/net/foucry/pilldroid/DBHelper.java index ca450e7..a8a93fc 100644 --- a/app/src/main/java/net/foucry/pilldroid/DBHelper.java +++ b/app/src/main/java/net/foucry/pilldroid/DBHelper.java @@ -20,7 +20,7 @@ class DBHelper extends SQLiteOpenHelper { private static final int DATABASE_VERSION = 1; private static String DATABASE_NAME = "ordonnance.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_CIS = "cis"; private static final String KEY_CIP13 = "cip13"; diff --git a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailActivity.java b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailActivity.java index 773be84..3e047d1 100644 --- a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailActivity.java +++ b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailActivity.java @@ -36,6 +36,7 @@ public class MedicamentDetailActivity extends AppCompatActivity { Snackbar.make(view, "Will be use to save changes in a drug", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); setResult(1); + finish(); } }); diff --git a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java index 4508626..26d31ed 100644 --- a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java +++ b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java @@ -5,6 +5,7 @@ import android.content.Context; import android.support.design.widget.CollapsingToolbarLayout; import android.os.Bundle; import android.support.v4.app.Fragment; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -24,6 +25,7 @@ public class MedicamentDetailFragment extends Fragment { * represents. */ public static final String ARG_ITEM_ID = "medicament"; + private static final String TAG = MedicamentListActivity.class.getName(); /** * The dummy content this fragment is presenting. @@ -56,8 +58,7 @@ public class MedicamentDetailFragment extends Fragment { } @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View detailView = inflater.inflate(R.layout.medicament_detail, container, false); View nameView; View adminModeView; @@ -120,12 +121,7 @@ public class MedicamentDetailFragment extends Fragment { { Context context = getContext(); Toast.makeText(context, "***PROUT***", Toast.LENGTH_SHORT).show(); - - super.onStop(); - } - - private void grabNewMedicamentValues() - { + View currentView = getView(); View nameView; View adminModeView; View presentationView; @@ -134,8 +130,14 @@ public class MedicamentDetailFragment extends Fragment { View warningView; View alertView; - nameView detailView.findViewById(R.id.name_cell); - medicament.setNom(nameView.getText()); + stockView = currentView.findViewById(R.id.alert_cell); + TextView stockTextView = stockView.findViewById(R.id.valeur); + String stockValue = stockTextView.getText().toString(); + Log.d(TAG, "StockValue == "+ stockValue); + Log.d(TAG, "medicamentID "+ medicament.getId()); + + Toast.makeText(context,"stock value "+ stockValue, Toast.LENGTH_SHORT).show(); + super.onStop(); } } diff --git a/build.gradle b/build.gradle index 4fdbf45..47e20d3 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.1' + classpath 'com.android.tools.build:gradle:3.6.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -19,6 +19,7 @@ ext { compileSdkVersion = '27' buildToolsVersion = '27.0.1' var = '3.4.2' + buildToolsVersion1 = '29.0.3' } allprojects { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index cd89f37..8c344a9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Thu Jul 11 18:46:50 CEST 2019 +#Sun Apr 12 14:00:20 UTC 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip