Skip to content

Commit

Permalink
Fix All warnings in "Usability:Typography", "Usability:Icons", and "U…
Browse files Browse the repository at this point in the history
…sability" categories (#5196)

<!-- READ ME FIRST: Please fill in the explanation section below and
check off every point from the Essential Checklist! -->
## Explanation
<!--
- Explain what your PR does. If this PR fixes an existing bug, please
include
- "Fixes #bugnum:" in the explanation so that GitHub can auto-close the
issue
  - when this PR is merged.
  -->
Fixes #5194 [part of #5182]

Fixes all warning in "Usability" category caused by

- **Borderless Buttons :** Fixed by introducing
`style="?android:attr/buttonBarButtonStyle"` to the borderless buttons
- **OK text capitalization :** Fixed by suppressing the lint warnings
for `ButtonCase` and `Typos`
- **Ellipsis/Hyphen unicode replacement :** Fixed by introducing unicode
representations (under review)
- **Image in density drawable folder :** Fixed by creating seperate
density images (under review)
- **Text size too small :** Fixed by upscaling text size to `12sp`
- **To incorporate Autofill :** Fixed by incorporating `autofillHints`
to the EditText

## ScreenShot

![Before After Usability Lint
Issues](https://github.com/oppia/oppia-android/assets/122200035/5a7037f5-ca22-482a-a0f3-8af2bfc8b75c)

## Essential Checklist
<!-- Please tick the relevant boxes by putting an "x" in them. -->
- [x] The PR title and explanation each start with "Fix #bugnum: " (If
this PR fixes part of an issue, prefix the title with "Fix part of
#bugnum: ...".)
- [x] Any changes to
[scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets)
files have their rationale included in the PR explanation.
- [x] The PR follows the [style
guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [x] The PR does not contain any unnecessary code changes from Android
Studio
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)).
- [x] The PR is made from a branch that's **not** called "develop" and
is up-to-date with "develop".
- [x] The PR is **assigned** to the appropriate reviewers
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).

---------

Co-authored-by: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Co-authored-by: Ben Henning <ben@oppia.org>
  • Loading branch information
3 people authored Jan 9, 2024
1 parent 6723268 commit 9ad24ef
Show file tree
Hide file tree
Showing 19 changed files with 34 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
android:fontFamily="sans-serif"
android:text="@{viewModel.storyPercentage != 100? @string/status_in_progress : @string/status_completed}"
android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="10sp"
android:textSize="12sp"
android:visibility="@{viewModel.storyPercentage != 0 ? View.VISIBLE : View.GONE}" />
</LinearLayout>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
android:id="@+id/open_dialog_0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/buttonBarButtonStyle"
android:text="@string/concept_card_one_button_text"
android:textAllCaps="false"/>

<Button
android:id="@+id/open_dialog_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="?android:attr/buttonBarButtonStyle"
android:text="@string/concept_card_two_button_text"
android:textAllCaps="false" />
</LinearLayout>
3 changes: 2 additions & 1 deletion app/src/main/res/layout/survey_free_form_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:textChangedListener="@{viewModel.answerTextWatcher}" />
app:textChangedListener="@{viewModel.answerTextWatcher}"
android:autofillHints="@string/survey_free_form_text_hint" />

<Button
android:id="@+id/submit_button"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/topic_lessons_story_summary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
android:fontFamily="sans-serif"
android:text="@{viewModel.storyPercentage != 100? @string/status_in_progress : @string/status_completed}"
android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="10sp"
android:textSize="12sp"
android:visibility="@{viewModel.storyPercentage != 0 ? View.VISIBLE : View.GONE}" />
</LinearLayout>

Expand Down
17 changes: 17 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/launcher_icon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,21 @@
</group>
</vector>
</foreground>
<monochrome>
<vector
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<group
android:scaleX="0.08046576"
android:scaleY="0.08046576"
android:translateX="10.548493"
android:translateY="10.146164">
<path
android:fillColor="#000000"
android:pathData="M792.1,291.7c-61.3,-69.7 -158.2,-107.3 -254.5,-107.3c-94.7,0 -174.3,28.8 -235.4,95.8c-58.8,64.5 -95.8,161.1 -95.8,258.9C206.4,738.3 351.9,904 537.6,904c94.4,0 185.3,-38.1 246.4,-105.3c59.2,-65 90,-157.5 90,-255.6C873.9,447.3 849,356.3 792.1,291.7zM709.5,722.8c-42.2,46.4 -105.1,72.8 -170.3,72.8c-2.7,0 -5.4,-0.1 -8.1,-0.2c2.7,-23.6 20.3,-78.7 26.8,-95.9c8.1,-21.6 29.6,-48 29.6,-48l22.7,-23.1c9.1,14.2 25,23.6 43.1,23.6c28.3,0 51.2,-22.9 51.2,-51.2s-22.9,-51.2 -51.2,-51.2s-51.2,22.9 -51.2,51.2c0,6.8 1.4,13.3 3.8,19.3l-26.2,26.6c0,0 -19.3,22.1 -29.6,48c-6.3,15.8 -21.8,64.7 -26,90.5c0.6,-46.2 7.4,-174.6 11.3,-215.3c4.1,-43.5 19.7,-70.9 22.9,-76.1c4.8,1.5 10,2.3 15.3,2.3c28.3,0 51.2,-22.9 51.2,-51.2s-22.9,-51.2 -51.2,-51.2s-51.2,22.9 -51.2,51.2c0,18.8 10.2,35.3 25.4,44.1c-2.9,5.1 -18.2,33.4 -22.4,77.3c-4.2,44.5 -11.2,195.5 -10.4,227.9c-0,0 -0,0 -0,0c-0.7,-9 -6.2,-79.4 -18.9,-122.3c-10.4,-35.2 -31.3,-68.4 -40.5,-82.1c13.7,-9.2 22.7,-24.8 22.7,-42.5c0,-28.3 -22.9,-51.2 -51.2,-51.2c-28.3,0 -51.2,22.9 -51.2,51.2s22.9,51.2 51.2,51.2c7.6,0 14.8,-1.7 21.3,-4.7c10.3,15.6 29.4,47.2 39.1,79.9c12.1,40.9 17.3,105.5 18.3,119.3c-112,-17.9 -195.5,-124 -195.5,-249.6c0,-67.6 25.6,-134.4 66.3,-179c42.3,-46.3 97.3,-66.3 162.7,-66.3c66.6,0 133.6,26 176,74.2c39.3,44.7 56.5,107.6 56.5,173.8C771.7,614 750.4,677.9 709.5,722.8z" />
</group>
</vector>
</monochrome>
</adaptive-icon>
6 changes: 3 additions & 3 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Sarah zoubida
* Seanlip
-->
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="nav_header_desc">أعلى قائمة التنقل</string>
<string name="menu_options">خيارات</string>
<string name="menu_my_downloads">التنزيلات</string>
Expand Down Expand Up @@ -167,7 +167,7 @@
<string name="fraction_error_larger_than_seven_digits">لا يجب أن يحتوي أي رقم في الكسر العشري على أكثر من 7 أرقام.</string>
<string name="number_error_starting_with_floating_point">من فضلك إبدأ إجابتك برقم (0 او 0.5 على سبيل المثال)</string>
<string name="number_error_invalid_format">من فضلك قم بإدخال رقم صالح.</string>
<string name="number_error_larger_than_fifteen_characters">يمكن أن تحتوي الإجابة على 15 رقمًا (0-9) على الأكثر أو الرموز (. أو -)</string>
<string name="number_error_larger_than_fifteen_characters" tools:ignore="TypographyDashes">(&#8211;يمكن أن تحتوي الإجابة على 15 رقمًا (0-9) على الأكثر أو الرموز (. أو</string>
<string name="ratio_error_invalid_chars" fuzzy="true">من فضلك قم بكتابة نسبة تتكون من أرقام مفصولة بنقطتين رأسيتين (1:2 أو 1:2:3 على سبيل المثال).</string>
<string name="ratio_error_invalid_format" fuzzy="true">من فضلك أدخل نسبة صحيحة (1:2 أو 1:2:3 على سبيل المثال)</string>
<string name="ratio_error_invalid_colons" fuzzy="true">إجابتك تحتوي على نقطتين رأسيتين (:) متتاليتين.</string>
Expand Down Expand Up @@ -411,7 +411,7 @@
<string name="great">عظيم</string>
<string name="lets_get_started">هيّا نبدأ.</string>
<string name="yes">نعم</string>
<string name="no">لا...</string>
<string name="no">&#8230;لا</string>
<string name="pick_a_different_topic">اختر موضوعًا\nآخرًا.</string>
<string name="are_you_interested">هل أنت مهتم بـ:\n%s</string>
<string name="new_hint_available">ملاحظة جديدة متاحة</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
<string name="great">Ótimo</string>
<string name="lets_get_started">Vamos começar.</string>
<string name="yes">Sim</string>
<string name="no">Não...</string>
<string name="no">Não&#8230;</string>
<string name="pick_a_different_topic">Escolha um\ntópico diferente.</string>
<string name="are_you_interested">Você está interessado em:\n%s?</string>
<string name="new_hint_available">Nova dica disponível</string>
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="nav_header_desc">Navigation header</string>
<string name="menu_options">Options</string>
<string name="menu_my_downloads">My Downloads</string>
Expand All @@ -16,13 +16,13 @@
<string name="audio_play_description">Play audio</string>
<string name="audio_pause_description">Pause audio</string>
<string name="audio_unavailable_in_selected_language">%s audio is unavailable.</string>
<string name="audio_language_select_dialog_okay_button">Ok</string>
<string name="audio_language_select_dialog_okay_button" tools:ignore="ButtonCase,Typos">Ok</string>
<string name="audio_language_select_dialog_cancel_button">Cancel</string>
<string name="audio_language_select_dialog_title">Audio Language</string>
<string name="audio_dialog_offline_title">Currently Offline</string>
<string name="audio_dialog_offline_message">Make sure Wi-Fi or cellular data is turned on, then try again.</string>
<string name="audio_dialog_offline_positive">Ok</string>
<string name="cellular_data_alert_dialog_okay_button">Ok</string>
<string name="audio_dialog_offline_positive" tools:ignore="ButtonCase,Typos">Ok</string>
<string name="cellular_data_alert_dialog_okay_button" tools:ignore="ButtonCase,Typos">Ok</string>
<string name="cellular_data_alert_dialog_cancel_button">Cancel</string>
<string name="cellular_data_alert_dialog_title">Currently on Cellular Data</string>
<string name="cellular_data_alert_dialog_description">Streaming audio may use a lot of cellular data.</string>
Expand Down Expand Up @@ -377,7 +377,7 @@
<string name="administrator_controls_account_actions_label">Account Actions</string>
<string name="administrator_controls_log_out">Log Out</string>
<string name="log_out_dialog_cancel_button">Cancel</string>
<string name="log_out_dialog_okay_button">Ok</string>
<string name="log_out_dialog_okay_button" tools:ignore="ButtonCase,Typos">Ok</string>
<string name="log_out_dialog_message">Are you sure you want to log out of your profile?</string>
<!-- AppVersionFragment -->
<string name="app_version_name">App Version %s</string>
Expand Down Expand Up @@ -490,11 +490,11 @@
<string name="beta_notice_dialog_title">Beta Notice</string>
<string name="beta_notice_dialog_message">Hello! Your app is now being updated to the Beta version. If you experience problems while using the app, or have questions, please contact us at android-feedback@oppia.org.</string>
<string name="beta_notice_dialog_do_not_show_again_text">Don\'t show this message again</string>
<string name="beta_notice_dialog_close_button_text">OK</string>
<string name="beta_notice_dialog_close_button_text" tools:ignore="ButtonCase,Typos">Ok</string>
<string name="general_availability_notice_dialog_title">General Availability Notice</string>
<string name="general_availability_notice_dialog_message">Hello! Your app is now being updated to the General Availability version. If you experience problems while using the app, or have questions, please contact us at android-feedback@oppia.org.</string>
<string name="general_availability_notice_dialog_do_not_show_again_text">Don\'t show this message again</string>
<string name="general_availability_notice_dialog_close_button_text">OK</string>
<string name="general_availability_notice_dialog_close_button_text" tools:ignore="ButtonCase,Typos">Ok</string>
<string name="ratio_content_description_separator" description="The separator that would be used to build the text that would be read out for ratio interaction.For e.g if the input is 1:2:3 the read out text would be 1 to 2 to 3">\u0020to\u0020</string>
<string name="ratio_default_hint_text" description="The default hint text for the ratio interaction if the placeholder text is not available.">Enter a ratio in the form x:y.</string>
<string name="text_input_default_hint_text">Tap here to enter text.</string>
Expand Down

0 comments on commit 9ad24ef

Please sign in to comment.