Skip to content

Commit fb91d9b

Browse files
committed
#53 handling of not null fields : every fields needs to be complete to save new article in db
1 parent 1d79194 commit fb91d9b

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

app/src/main/java/ekylibre/zero/home/MainActivity.java

-7
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,6 @@ public boolean onNavigationItemSelected(MenuItem item)
276276
startActivity(intent);
277277
break;
278278
}
279-
//currently linking to IssueActivity
280-
case R.id.nav_reception :
281-
{
282-
Intent intent = new Intent(this, IssueActivity.class);
283-
startActivity(intent);
284-
break;
285-
}
286279
case R.id.nav_counting :
287280
{
288281
Intent intent = new Intent(this, PlantCountingActivity.class);

app/src/main/res/layout/article_new.xml

+2-4
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
android:layout_width="wrap_content"
1313
android:layout_height="wrap_content"
1414
android:inputType="text"
15-
android:hint="Article name"
15+
android:hint="@string/article_name"
1616
/>
1717

1818
<Spinner
1919
android:id="@+id/spinnerNatureArticleId"
2020
android:layout_width="fill_parent"
2121
android:layout_height="wrap_content"
22-
android:text="Select nature"
2322
android:padding="5dp"
2423
android:layout_marginTop="10dp"
2524
android:textAppearance="?android:attr/textAppearanceLarge"
@@ -29,7 +28,6 @@
2928
android:id="@+id/spinnerUnityArticleId"
3029
android:layout_width="fill_parent"
3130
android:layout_height="wrap_content"
32-
android:text="Select nature"
3331
android:padding="5dp"
3432
android:layout_marginTop="10dp"
3533
android:textAppearance="?android:attr/textAppearanceLarge"
@@ -39,6 +37,6 @@
3937
android:id="@+id/buttonSaveArticleId"
4038
android:layout_width="wrap_content"
4139
android:layout_height="wrap_content"
42-
android:text="Save"/>
40+
android:text="@string/save"/>
4341

4442
</LinearLayout>

app/src/main/res/values-fr/strings.xml

+8
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,12 @@
125125
<string name="pref_syncContact">Synchronisation des contacts Ekylibre</string>
126126
<string name="pref_syncContact_summary">Autoriser l\'application à synchroniser vos
127127
contacts Ekylibre</string>
128+
129+
<string name="article_cannot_save">Merci de compléter tous les champs</string>
130+
<string name="article_saved">Nouvel article sauvegardé</string>
131+
<string name="fertilizer">Fertilisant</string>
132+
<string name="seed">Semence</string>
133+
<string name="chemical">Produit phytosanitaire</string>
134+
<string name="spinner_selection_nature">Sélectionner le type d\'article</string>
135+
<string name="spinner_selection_unity">Sélectionner l\'unité</string>
128136
</resources>

app/src/main/res/values/strings.xml

+8
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,12 @@
125125
<string name="intervention">Intervention</string>
126126
<string name="pref_syncContact">Synchronize Ekylibre\'s contacts</string>
127127
<string name="pref_syncContact_summary">Allow application to automatically synchronize your contacts from Ekylibre</string>
128+
<string name="article_cannot_save">Please complete all the fields</string>
129+
<string name="article_saved">Article saved</string>
130+
<string name="fertilizer">Fertilizer</string>
131+
<string name="seed">Seed</string>
132+
<string name="chemical">Chemical</string>
133+
<string name="spinner_selection_nature">Please select a nature</string>
134+
<string name="spinner_selection_unity">Please select a unity</string>
135+
128136
</resources>

0 commit comments

Comments
 (0)