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,9 +2,11 @@ package com.example.app_10p5;
2 2
3 import android.os.Bundle; 3 import android.os.Bundle;
4 import android.app.Fragment; 4 import android.app.Fragment;
  5 +import android.text.InputFilter;
5 import android.view.LayoutInflater; 6 import android.view.LayoutInflater;
6 import android.view.View; 7 import android.view.View;
7 import android.view.ViewGroup; 8 import android.view.ViewGroup;
  9 +import android.widget.EditText;
8 10
9 /** 11 /**
10 * Created by Jean-loup Beaussart on 24/04/2016. 12 * Created by Jean-loup Beaussart on 24/04/2016.
@@ -14,6 +16,9 @@ public class TabFragment2 extends Fragment { @@ -14,6 +16,9 @@ public class TabFragment2 extends Fragment {
14 16
15 @Override 17 @Override
16 public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 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,10 +14,10 @@
14 android:layout_width="wrap_content" 14 android:layout_width="wrap_content"
15 android:layout_height="wrap_content" 15 android:layout_height="wrap_content"
16 android:inputType="numberDecimal" 16 android:inputType="numberDecimal"
  17 + android:digits="0123456789,."
17 android:ems="10" 18 android:ems="10"
18 android:id="@+id/rechargement_champ_montant" 19 android:id="@+id/rechargement_champ_montant"
19 android:layout_gravity="center_horizontal" 20 android:layout_gravity="center_horizontal"
20 - android:layout_marginTop="80dp"  
21 android:editable="true" 21 android:editable="true"
22 android:elegantTextHeight="true" 22 android:elegantTextHeight="true"
23 android:enabled="true" 23 android:enabled="true"
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 android:layout_height="wrap_content" 37 android:layout_height="wrap_content"
38 android:text="@string/validate" 38 android:text="@string/validate"
39 android:id="@+id/rechargement_bouton" 39 android:id="@+id/rechargement_bouton"
40 - android:layout_marginTop="80dp" 40 + android:layout_marginTop="40dp"
41 android:layout_gravity="center_horizontal" 41 android:layout_gravity="center_horizontal"
42 android:minWidth="150dp" 42 android:minWidth="150dp"
43 android:minHeight="50dp" 43 android:minHeight="50dp"