Commit 2f69be20172bf5f2db0cc37b25363da0ccfda24b

Authored by JLo'w
1 parent fde33444

Filtre sur le champ montant de rechargement + ','

PremiereActivite/app/src/main/java/com/example/app_10p5/TabFragment2.java
... ... @@ -2,9 +2,11 @@ package com.example.app_10p5;
2 2  
3 3 import android.os.Bundle;
4 4 import android.app.Fragment;
  5 +import android.text.InputFilter;
5 6 import android.view.LayoutInflater;
6 7 import android.view.View;
7 8 import android.view.ViewGroup;
  9 +import android.widget.EditText;
8 10  
9 11 /**
10 12 * Created by Jean-loup Beaussart on 24/04/2016.
... ... @@ -14,6 +16,9 @@ public class TabFragment2 extends Fragment {
14 16  
15 17 @Override
16 18 public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
17   - return inflater.inflate(R.layout.tab_fragment_2, container, false);
  19 + View v = inflater.inflate(R.layout.tab_fragment_2, container, false);
  20 + EditText et = (EditText) v.findViewById(R.id.rechargement_champ_montant);
  21 + et.setFilters(new InputFilter[]{new DecimalDigitsInputFilter(3, 2)});
  22 + return v;
18 23 }
19 24 }
... ...
PremiereActivite/app/src/main/res/layout/layout_rechargement.xml
... ... @@ -14,10 +14,10 @@
14 14 android:layout_width="wrap_content"
15 15 android:layout_height="wrap_content"
16 16 android:inputType="numberDecimal"
  17 + android:digits="0123456789,."
17 18 android:ems="10"
18 19 android:id="@+id/rechargement_champ_montant"
19 20 android:layout_gravity="center_horizontal"
20   - android:layout_marginTop="80dp"
21 21 android:editable="true"
22 22 android:elegantTextHeight="true"
23 23 android:enabled="true"
... ... @@ -37,7 +37,7 @@
37 37 android:layout_height="wrap_content"
38 38 android:text="@string/validate"
39 39 android:id="@+id/rechargement_bouton"
40   - android:layout_marginTop="80dp"
  40 + android:layout_marginTop="40dp"
41 41 android:layout_gravity="center_horizontal"
42 42 android:minWidth="150dp"
43 43 android:minHeight="50dp"
... ...