Skip to content

Commit

Permalink
Add some accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kenumir committed Nov 4, 2019
1 parent 8ad3c95 commit bd9ff98
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 22 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/com/wt/pinger/activity/PingActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ protected void onCreate(Bundle savedInstanceState) {
finish();
}
});
toolbar.setNavigationContentDescription(R.string.label_back);
fabAction.setOnClickListener(view -> {
getPingManager().startStopPingWorker(PingActivity.this, mAddressItem);
});
Expand Down
11 changes: 4 additions & 7 deletions app/src/main/java/com/wt/pinger/fragment/ConsoleFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,10 @@ public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which)

adapter = new SimpleCursorAdapter(getActivity(), R.layout.item_cmd, null, new String[]{"data"}, new int[]{R.id.cmd_item}, 0);
list.setAdapter(adapter);
cmdBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
list.setSelectionAfterHeaderView();
cmdBtn.setImageResource(R.drawable.ic_clear_black_24dp);
CmdService.executeCmd(getActivity(), edit.getText().toString());
}
cmdBtn.setOnClickListener(view -> {
list.setSelectionAfterHeaderView();
cmdBtn.setImageResource(R.drawable.ic_clear_black_24dp);
CmdService.executeCmd(getActivity(), edit.getText().toString());
});
edit.setText("");
TextKeyListener.clear(edit.getText());
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_ping.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
android:paddingTop="12dp"
android:layout_marginTop="46dp"
android:clipToPadding="false"
android:contentDescription="@string/label_entry_list"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
Expand Down
27 changes: 16 additions & 11 deletions app/src/main/res/layout/dialog_address_form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/editText1Lay"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:contentDescription="@string/label_entry_url">

<EditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -20,16 +21,17 @@
android:hint="@string/label_entry_url"
android:nextFocusRight="@+id/editText0">
<requestFocus />
</EditText>
</com.google.android.material.textfield.TextInputEditText>

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/editText0Lay"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:contentDescription="@string/label_entry_display_name">

<EditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editText0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -44,9 +46,10 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/editText2Lay"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:contentDescription="@string/label_entry_packet">

<EditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -64,9 +67,10 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/editText3Lay"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:contentDescription="@string/label_entry_count">

<EditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editText3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -84,9 +88,10 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/editText4Lay"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:contentDescription="@string/label_interval_time">

<EditText
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editText4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/layout/fragment_address.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingBottom="88dp"/>
android:paddingBottom="88dp"
android:contentDescription="@string/label_entry_list"/>

<com.google.android.material.floatingactionbutton.FloatingActionButton
style="@style/Fab"
Expand All @@ -22,6 +23,7 @@
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:contentDescription="@string/label_add_address"
app:srcCompat="@drawable/ic_add_white_24dp"/>

<LinearLayout
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/layout/fragment_console.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground"
android:contentDescription="@string/label_list_of_commands"
tools:ignore="ContentDescription"/>

<ImageView
Expand All @@ -41,6 +42,7 @@
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground"
android:contentDescription="@string/label_add_command"
tools:ignore="ContentDescription"/>

<EditText
Expand Down Expand Up @@ -72,6 +74,7 @@
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground"
android:contentDescription="@string/label_execute_stop_command"
tools:ignore="ContentDescription"/>

</LinearLayout>
Expand Down
11 changes: 9 additions & 2 deletions app/src/main/res/layout/fragment_more.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"/>
android:layout_alignParentEnd="true"
android:clickable="false"
android:focusable="false"
android:importantForAccessibility="no"/>

</com.wt.pinger.proto.CheckableRelativeLayout>

Expand All @@ -92,6 +95,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:background="?attr/selectableItemBackground"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingStart="@dimen/activity_horizontal_margin"
Expand Down Expand Up @@ -147,7 +151,10 @@
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:checked="true"/>
android:checked="true"
android:clickable="false"
android:focusable="false"
android:importantForAccessibility="no"/>

</com.wt.pinger.proto.CheckableRelativeLayout>

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/fragment_replaio.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
android:layout_width="match_parent"
android:layout_height="400dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp" />
android:layout_marginBottom="16dp"
android:contentDescription="@string/menu_replaio"/>

</LinearLayout>

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/item_address.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
android:focusable="true"
android:background="?attr/selectableItemBackground"
android:scaleType="centerInside"
android:contentDescription="@string/label_edit"
tools:ignore="ContentDescription"/>

</LinearLayout>
6 changes: 6 additions & 0 deletions app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<string name="label_delete">Usuń</string>
<string name="label_stop">Stop</string>
<string name="label_start">Start</string>
<string name="label_edit">Edytuj</string>
<string name="label_back">Powrót</string>

<string name="menu_address_list">Adresy</string>
<string name="menu_cmd">Konsola</string>
Expand Down Expand Up @@ -40,12 +42,16 @@
<string name="label_list_of_commands">Lista komend</string>

<string name="label_entry">Wpis</string>
<string name="label_entry_list">Lista wpisów</string>
<string name="label_entry_name">Nazwa wpisu</string>
<string name="label_entry_url">Adres URL</string>
<string name="label_entry_display_name">Nazwa wyświetlana (nie wymagane)</string>
<string name="label_entry_packet">Rozmiar pakietu (domyślnie puste)</string>
<string name="label_entry_count">Ilość pakietów (domyślnie niskończona)</string>
<string name="label_interval_time">Interwał pakietów (sekundy)</string>
<string name="label_add_command">Dodaj komendę</string>
<string name="label_execute_stop_command">Uruchom/Zatrzymaj komendę</string>
<string name="label_add_address">Dodaj adres</string>

<string name="toast_no_default_browser">Brak przeglądarki do wyświetlenia info</string>
<string name="toast_enter_url">Wpisz adres URL</string>
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<string name="label_delete">Delete</string>
<string name="label_stop">Stop</string>
<string name="label_start">Start</string>
<string name="label_edit">Edit</string>
<string name="label_back">Back</string>

<string name="menu_address_list">Address</string>
<string name="menu_cmd">Console</string>
Expand Down Expand Up @@ -40,12 +42,16 @@
<string name="label_list_of_commands">List of commands</string>

<string name="label_entry">Entry</string>
<string name="label_entry_list">Entry list</string>
<string name="label_entry_name">Entry name</string>
<string name="label_entry_url">Entry URL</string>
<string name="label_entry_display_name">Display name (not required)</string>
<string name="label_entry_packet">Packet size (empty for default)</string>
<string name="label_entry_count">Ping count (default unlimited)</string>
<string name="label_interval_time">Ping interval (seconds)</string>
<string name="label_add_command">Add command</string>
<string name="label_execute_stop_command">Execute/Stop command</string>
<string name="label_add_address">Add address</string>

<string name="toast_no_default_browser">No browser to show info</string>
<string name="toast_enter_url">Enter URL</string>
Expand Down

0 comments on commit bd9ff98

Please sign in to comment.