r19 - in trunk: res/layout res/values res/values-fr src/fr/ifremer/wlo src/fr/ifremer/wlo/models
Author: kmorin Date: 2014-01-23 10:26:45 +0100 (Thu, 23 Jan 2014) New Revision: 19 Url: http://forge.codelutin.com/projects/wlo/repository/revisions/19 Log: fixes #4182 Formulaire de cr?\195?\169ation d'une esp?\195?\168ce scientifiq refs #3082 Formulaire de cr?\195?\169ation d'une esp?\195?\168ce commerciale Modified: trunk/res/layout/scientific_species_form.xml trunk/res/values-fr/strings.xml trunk/res/values/strings.xml trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java trunk/src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java Modified: trunk/res/layout/scientific_species_form.xml =================================================================== --- trunk/res/layout/scientific_species_form.xml 2014-01-23 08:53:04 UTC (rev 18) +++ trunk/res/layout/scientific_species_form.xml 2014-01-23 09:26:45 UTC (rev 19) @@ -26,8 +26,8 @@ android:singleLine="true" android:hint="@string/undefined"/> - <CheckBox android:id="@+id/commercial_species_form_species_mix" - android:text="@string/commercial_species_form_species_mix" + <CheckBox android:id="@+id/scientific_species_form_takingActivation" + android:text="@string/scientific_species_form_taking_activation" android:layout_width="match_parent" android:layout_height="wrap_content"/> Modified: trunk/res/values/strings.xml =================================================================== --- trunk/res/values/strings.xml 2014-01-23 08:53:04 UTC (rev 18) +++ trunk/res/values/strings.xml 2014-01-23 09:26:45 UTC (rev 19) @@ -131,6 +131,8 @@ <string name="commercial_species_form_name">Name</string> <string name="commercial_species_form_measurement_method">Measurement method</string> <string name="commercial_species_form_species_mix">Species mix</string> + <string name="commercial_species_form_state">State</string> + <string name="commercial_species_form_presentation">Presentation</string> <string name="commercial_species_title">Commercial species</string> <string name="commercial_species_subtitle">Metier %s</string> <string name="add_commercial_species">Create a new commercial species</string> @@ -138,13 +140,12 @@ <!-- Scientific species --> <string name="scientific_species_form_name">Name</string> + <string name="scientific_species_form_taking_activation">Calcified samples taking</string> <string name="scientific_species_title">Scientific species</string> <string name="scientific_species_subtitle">Commercial species %s</string> <string name="new_scientific_species_title">New scientific species</string> <string name="exit_form_confirmation">Do you want to save the form before leaving?</string> - <string name="commercial_species_form_state">État</string> - <string name="commercial_species_form_presentation">Peésentation</string> <!--File chooser--> <string name="file_chooser_location">Location</string> Modified: trunk/res/values-fr/strings.xml =================================================================== --- trunk/res/values-fr/strings.xml 2014-01-23 08:53:04 UTC (rev 18) +++ trunk/res/values-fr/strings.xml 2014-01-23 09:26:45 UTC (rev 19) @@ -135,6 +135,7 @@ <!-- Scientific species --> <string name="scientific_species_form_name">Nom</string> + <string name="scientific_species_form_taking_activation">Prélèvement de pièces calcifiées</string> <string name="scientific_species_title">Espèces scientifiques</string> <string name="scientific_species_subtitle">Espèce commerciale %s</string> <string name="new_scientific_species_title">Nouvelle espèce scientifique</string> Modified: trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java =================================================================== --- trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java 2014-01-23 08:53:04 UTC (rev 18) +++ trunk/src/fr/ifremer/wlo/CommercialSpeciesFormActivity.java 2014-01-23 09:26:45 UTC (rev 19) @@ -4,6 +4,7 @@ import android.util.Log; import android.widget.ArrayAdapter; import android.widget.CheckBox; +import android.widget.CompoundButton; import android.widget.Spinner; import com.google.common.collect.Lists; import fr.ifremer.wlo.models.CommercialSpeciesModel; @@ -24,8 +25,6 @@ private static final String TAG = "CommercialSpeciesFormActivity"; - protected CheckBox speciesMixEditor; - @Override protected Integer getContentView() { return R.layout.commercial_species_form; @@ -53,8 +52,6 @@ // editors - speciesMixEditor = (CheckBox) findViewById(R.id.commercial_species_form_species_mix); - // init editors List<CommercialSpecies> commercialSpecies = Lists.newArrayList(DataCache.getAllCommercialSpecies(this)); initAutoCompleteTextView(R.id.commercial_species_form_fao_code, CommercialSpeciesModel.COLUMN_FAO_CODE, commercialSpecies); @@ -68,8 +65,15 @@ List<Presentation> presentations = Lists.newArrayList(DataCache.getAllPresentations(this)); initAutoCompleteTextView(R.id.commercial_species_form_presentation, CommercialSpeciesModel.COLUMN_PRESENTATION, presentations); - // measurement method - speciesMixEditor.setSelected(model.isSpeciesMix()); + CheckBox speciesMixEditor = (CheckBox) findViewById(R.id.commercial_species_form_species_mix); + speciesMixEditor.setChecked(model.isSpeciesMix()); + speciesMixEditor.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean b) { + Log.d(TAG, "b : " + b + ", checked : " + compoundButton.isChecked()); + model.setSpeciesMix(b); + } + }); } Modified: trunk/src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java =================================================================== --- trunk/src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java 2014-01-23 08:53:04 UTC (rev 18) +++ trunk/src/fr/ifremer/wlo/ScientificSpeciesFormActivity.java 2014-01-23 09:26:45 UTC (rev 19) @@ -4,6 +4,8 @@ import android.os.Bundle; import android.util.Log; import android.view.View; +import android.widget.CheckBox; +import android.widget.CompoundButton; import com.google.common.collect.Lists; import fr.ifremer.wlo.measurement.MeasurementActivity; import fr.ifremer.wlo.models.ScientificSpeciesModel; @@ -48,12 +50,18 @@ // editors -// speciesMixEditor = (CheckBox) findViewById(R.id.commercial_species_form_species_mix); - // init editors List<ScientificSpecies> scientificSpecies = Lists.newArrayList(DataCache.getAllScientificSpecies(this)); initAutoCompleteTextView(R.id.scientific_species_form_name, ScientificSpeciesModel.COLUMN_NAME, scientificSpecies); + CheckBox takingActivationEditor = (CheckBox) findViewById(R.id.scientific_species_form_takingActivation); + takingActivationEditor.setChecked(model.isTakingActivation()); + takingActivationEditor.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton compoundButton, boolean b) { + model.setTakingActivation(b); + } + }); } @Override Modified: trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java =================================================================== --- trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java 2014-01-23 08:53:04 UTC (rev 18) +++ trunk/src/fr/ifremer/wlo/models/CommercialSpeciesModel.java 2014-01-23 09:26:45 UTC (rev 19) @@ -3,6 +3,7 @@ import android.content.ContentValues; import android.content.Context; import android.database.Cursor; +import android.util.Log; import fr.ifremer.wlo.models.referentials.CommercialSpecies; import fr.ifremer.wlo.models.referentials.Mensuration; import fr.ifremer.wlo.models.referentials.Presentation; @@ -54,7 +55,7 @@ state = DataCache.getStateById(context, stateId); String presentationId = cursor.getString(4); presentation = DataCache.getPresentationById(context, presentationId); - speciesMix = cursor.getShort(4) > 0; + speciesMix = cursor.getShort(5) > 0; } public CommercialSpecies getFaoCode() { Modified: trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java =================================================================== --- trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java 2014-01-23 08:53:04 UTC (rev 18) +++ trunk/src/fr/ifremer/wlo/models/ScientificSpeciesModel.java 2014-01-23 09:26:45 UTC (rev 19) @@ -3,6 +3,7 @@ import android.content.ContentValues; import android.content.Context; import android.database.Cursor; +import android.util.Log; import fr.ifremer.wlo.models.referentials.ScientificSpecies; import fr.ifremer.wlo.storage.DataCache; import fr.ifremer.wlo.utils.UIUtils;
participants (1)
-
kmorin@users.forge.codelutin.com