Skip to content

Commit c8f68a2

Browse files
committed
#53 New article can be added to database (small changes)
1 parent 81523e2 commit c8f68a2

File tree

2 files changed

+6
-13
lines changed

2 files changed

+6
-13
lines changed

app/src/main/java/ekylibre/zero/reception/ArticleNewActivity.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@
1717
import ekylibre.database.ZeroContract;
1818
import ekylibre.zero.R;
1919

20-
/**
21-
* Created by NUMAG 1-NB on 19/12/2017.
22-
*/
2320

2421
public class ArticleNewActivity extends AppCompatActivity implements View.OnClickListener {
2522

26-
String[] natureList = {"fertilizer", "seed", "chemical"};
23+
String[] natureList = {"Fertilizer", "Seed", "Chemical"};
2724
String[] unityList = {"kg", "L", "t"};
2825

2926
@Override
@@ -59,8 +56,6 @@ public void add_article(Context context) {
5956
mNewValues.put(ZeroContract.Articles.NATURE, SpinnerArticleNature.getSelectedItem().toString());
6057
mNewValues.put(ZeroContract.Articles.UNITY, SpinnerArticleUnity.getSelectedItem().toString());
6158
contentResolver.insert(ZeroContract.Articles.CONTENT_URI, mNewValues);
62-
63-
6459
}
6560

6661
@Override

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

+5-7
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515
android:hint="Article name"
1616
/>
1717

18-
<Button
19-
android:id="@+id/buttonSaveArticleId"
20-
android:layout_width="wrap_content"
21-
android:layout_height="wrap_content"
22-
android:text="Save"/>
23-
2418
<Spinner
2519
android:id="@+id/spinnerNatureArticleId"
2620
android:layout_width="fill_parent"
@@ -41,6 +35,10 @@
4135
android:textAppearance="?android:attr/textAppearanceLarge"
4236
/>
4337

44-
38+
<Button
39+
android:id="@+id/buttonSaveArticleId"
40+
android:layout_width="wrap_content"
41+
android:layout_height="wrap_content"
42+
android:text="Save"/>
4543

4644
</LinearLayout>

0 commit comments

Comments
 (0)