Add string ans field to improve accessiblity

This commit is contained in:
jacques 2021-04-04 20:18:16 +02:00
parent 374c0abd41
commit c8548fdd0b
8 changed files with 34 additions and 27 deletions

View file

@ -94,24 +94,32 @@ public class MedicamentDetailFragment extends Fragment {
TextView stockValue = stockView.findViewById(R.id.valeur);
stockLibelle.setText(R.string.med_current_stock_label);
stockValue.setText(Double.toString(medicament.getStock()));
stockValue.setHint(R.string.med_current_stock_label);
stockValue.setSelectAllOnFocus(true);
priseView = detailView.findViewById(R.id.prise_cell);
TextView priseLibelle = priseView.findViewById(R.id.libelle);
TextView priseValue = (priseView.findViewById(R.id.valeur));
priseLibelle.setText(R.string.med_take_label);
priseValue.setText(Double.toString(medicament.getPrise()));
priseValue.setHint(R.string.med_take_label);
priseValue.setSelectAllOnFocus(true);
warningView = detailView.findViewById(R.id.warning_cell);
TextView warningLibelle = warningView.findViewById(R.id.libelle);
TextView warningValue = warningView.findViewById(R.id.valeur);
warningLibelle.setText(R.string.med_warningTherehold_label);
warningValue.setText(Integer.toString(medicament.getWarnThreshold()));
warningValue.setHint(R.string.med_warningTherehold_label);
warningValue.setSelectAllOnFocus(true);
alertView = detailView.findViewById(R.id.alert_cell);
TextView alertLibelle = alertView.findViewById(R.id.libelle);
TextView alertValue = alertView.findViewById(R.id.valeur);
alertLibelle.setText(R.string.med_criticalTherehold_label);
alertLibelle.setText(R.string.med_alertTherehold_label);
alertValue.setText(Integer.toString(medicament.getAlertThreshold()));
alertValue.setHint(R.string.med_alertTherehold_label);
alertValue.setSelectAllOnFocus(true);
}
return detailView;

View file

@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".MainActivity">
tools:context=".MedicamentListActivity">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
@ -49,9 +49,6 @@
android:src="@drawable/ic_add_circle_black_24dp"
app:backgroundTint="@android:color/darker_gray"
app:fabCustomSize="60dp"
app:maxImageSize="60dp" />
app:maxImageSize="60dp"
android:contentDescription="@string/add_button" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -9,5 +9,6 @@
android:backgroundTint="@android:color/transparent"
app:fabCustomSize="60dp"
app:maxImageSize="60dp"
android:src="@drawable/ic_add_circle_black_24dp" />
android:src="@drawable/ic_add_circle_black_24dp"
android:contentDescription="@string/add_button" />

View file

@ -11,14 +11,14 @@
android:paddingStart="10sp"
android:paddingEnd="10sp"
android:paddingTop="5dp"
android:text="Valeur"
android:text="@string/Value"
android:textColor="#040404"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Label"
android:text="@string/label"
android:layout_below="@+id/valeur"
android:layout_alignParentStart="true"
android:textStyle="italic"

View file

@ -36,10 +36,9 @@
<include
android:id="@+id/prise_cell"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/value_input"
android:layout_marginTop="30sp" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<include
android:id="@+id/warning_cell"
@ -53,8 +52,6 @@
layout="@layout/value_input"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5sp" />
android:layout_gravity="center_horizontal" />
</LinearLayout>

View file

@ -15,7 +15,7 @@
android:layout_height="50sp"
android:layout_marginStart="5dp"
android:src="@drawable/ok_stock_vect"
android:contentDescription="Icone de stock"
android:contentDescription="@string/icone_de_stock"
android:layout_centerVertical="true"
android:layout_alignParentStart="true" />
@ -23,14 +23,14 @@
android:id="@+id/valeur"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Nom Médicament"
android:text="@string/nom_m_dicament"
android:textColor="#040404"
android:typeface="sans"
android:textSize="16sp"
android:textStyle="bold"
android:layout_alignTop="@+id/list_image"
android:layout_toEndOf="@+id/list_image"
android:layout_marginLeft="5dp" />
android:layout_marginStart="5dp" />
<TextView
android:id="@+id/cip13"
@ -38,7 +38,7 @@
android:layout_height="wrap_content"
android:textColor="#343434"
android:textSize="14sp"
android:text="cip13 goes here"
android:text="@string/cip13_goes_here"
android:layout_below="@+id/valeur"
android:layout_toEndOf="@+id/list_image"
android:layout_marginStart="5dp" />
@ -47,8 +47,8 @@
android:id="@+id/endOfStock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right"
android:text="lundi 1 janvier 2001"
android:gravity="end"
android:text="@string/Date"
android:textSize="14sp"
android:textColor="#212121"
android:textStyle="bold"
@ -66,9 +66,9 @@
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginRight="10sp"
android:layout_marginEnd="10sp"
android:contentDescription="@string/detail_view"
android:src="@drawable/ic_navigate_next_black_24dp" />

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
@ -28,7 +29,6 @@
android:layout_height="50dp"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:autofillHints=""
android:background="@drawable/rounded_corner"
android:ems="10"
android:gravity="end|fill_vertical"
@ -36,7 +36,10 @@
android:labelFor="@id/valeur"
android:paddingEnd="25dp"
android:paddingStart="5dp"
android:text="0"
android:textAlignment="gravity" />
android:hint="@string/zero"
android:textColorHint="@color/grey"
android:textAlignment="gravity"
android:importantForAutofill="no"
tools:ignore="LabelFor" />
</RelativeLayout>

View file

@ -18,4 +18,5 @@
<color name="tutorial_buttonTextColor">#000000</color>
<color name="led">#31f623</color>
<color name="grey">#777</color>
</resources>