Skip to content

Commit

Permalink
Fix #5136: Modifies all caps buttons to sentence case (#5157)
Browse files Browse the repository at this point in the history
<!-- 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 #5136

This PR changes all caps buttons to sentence case. All buttons mentioned
in this
[comment](#5136 (comment))
are changed either by directly changing its `android:textAllCaps` to
`false` in the layout files or by changing its style in the `styles.xml`
file.

## 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)).

## For UI-specific PRs only
<!-- Delete these section if this PR does not include UI-related
changes. -->
If your PR includes UI-related changes, then:
- Add screenshots for portrait/landscape for both a tablet & phone of
the before & after UI changes
- For the screenshots above, include both English and pseudo-localized
(RTL) screenshots (see [RTL
guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines))
- Add a video showing the full UX flow with a screen reader enabled (see
[accessibility
guide](https://github.com/oppia/oppia-android/wiki/Accessibility-A11y-Guide))
- Add a screenshot demonstrating that you ran affected Espresso tests
locally & that they're passing

## Screenshots

### _layout_

|Screen / Dialog|Button ID|Screenshots|
|--|--|--|
|`activity_input_interaction_view_test.xml`|`submit_button`|
|`add_profile_activity.xml`|`add_profile_activity_create_button`|
|`admin_auth_activity.xml`|`admin_auth_submit_button`|
|`admin_pin_activity.xml`|`submit_button`|
|`concept_card_fragment_test_activity.xml`|`open_dialog_0`
`open_dialog_1`|
|`exploration_test_activity.xml`|`play_exploration_button`|

|`hint_summary.xml`|`reveal_hint_button`|![image](https://github.com/oppia/oppia-android/assets/84731134/fa55e84f-df00-47fc-9064-6ba57dc91337)|

|`math_expression_parser_fragment.xml`|`parse_math_expression_button`|![image](https://github.com/oppia/oppia-android/assets/84731134/97678f0a-294f-40e9-a057-cd59843a07c9)|

|`onboarding_slide_final.xml`|`get_started_button`|![image](https://github.com/oppia/oppia-android/assets/84731134/44dab2e5-af61-42b6-a9be-977f0c3487a3)|

|`profile_list_control_buttons.xml`|`learner_analytics_share_ids_and_events_button`
`learner_analytics_upload_logs_now_button`|

|`profile_rename_fragment.xml`|`profile_rename_save_button`|![image](https://github.com/oppia/oppia-android/assets/84731134/6834670a-6225-45a1-a845-f41bc464a711)|
|`profile_reset_pin_fragment.xml`|`profile_reset_save_button`|
|`replay_button_item.xml`|`replay_button`|

|`return_to_lesson_button_item.xml`|`return_to_lesson_button`|![image](https://github.com/oppia/oppia-android/assets/84731134/fa55e84f-df00-47fc-9064-6ba57dc91337)|
|`return_to_topic_button_item.xml`|`return_to_topic_button`|
|`solution_summary.xml`|`show_solution_button`|
|`state_fragment_test_activity.xml`|`play_test_exploration_button`|

|`submit_button_item.xml`|`submit_answer_button`|![image](https://github.com/oppia/oppia-android/assets/84731134/eed9fb84-b4d8-4d65-a665-813c641debc5)|
|`topic_practice_footer_view.xml`|`topic_practice_start_button`|
|`walkthrough_welcome_fragment.xml`|`walkthrough_welcome_next_button`|

### _layout-land_
|Screen / Dialog|Button ID|Screenshots|
|--|--|--|

|`onboarding_slide_final.xml`|`get_started_button`|![image](https://github.com/oppia/oppia-android/assets/84731134/ce6df192-62ee-481b-83ea-49a56a4dfbe3)|
|`walkthrough_welcome_fragment.xml`|`walkthrough_welcome_next_button`|

### _layout-sw600dp-land_
|Screen / Dialog|Button ID|
|--|--|
|`onboarding_slide_final.xml`|`get_started_button`|

### _layout-sw600dp-port_
|Screen / Dialog|Button ID|
|--|--|
|`onboarding_slide_final.xml`|`get_started_button`|

<img
src="https://github.com/oppia/oppia-android/assets/84731134/23e8ebbb-386d-4dfa-bf4a-6e8354734245"
width="300"/>
<img
src="https://github.com/oppia/oppia-android/assets/84731134/e1358ff6-9e5e-4ae6-a9bc-44490f48d022"
width="300"/>
<img
src="https://github.com/oppia/oppia-android/assets/84731134/10c06098-0e4a-47a5-b7c3-988fc97073f2"
width="300"/>
<img
src="https://github.com/oppia/oppia-android/assets/84731134/08d9c601-8c46-430c-ba17-f7dbcd131d4a"
width="300"/>

---------

Co-authored-by: Adhiambo Peres <[email protected]>
  • Loading branch information
theMr17 and adhiamboperes authored Sep 30, 2023
1 parent 41f74fc commit 9bbf94a
Show file tree
Hide file tree
Showing 23 changed files with 32 additions and 23 deletions.
1 change: 1 addition & 0 deletions app/src/main/res/layout-land/onboarding_slide_final.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
android:text="@string/get_started"
android:textColor="@color/component_color_shared_secondary_4_text_color"
android:textSize="14sp"
android:textAllCaps="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/slide_image_view"
app:layout_constraintTop_toBottomOf="@id/slide_description_text_view" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout-land/resume_lesson_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
android:minWidth="144dp"
android:minHeight="@dimen/clickable_item_min_height"
android:text="@string/start_over_lesson_button"
android:textAllCaps="true"
android:textAllCaps="false"
android:textColor="@color/component_color_shared_secondary_button_background_trim_color"
android:textSize="14sp"
app:backgroundTint="@null"
Expand All @@ -100,7 +100,7 @@
android:minWidth="144dp"
android:minHeight="@dimen/clickable_item_min_height"
android:text="@string/resume_lesson_button"
android:textAllCaps="true"
android:textAllCaps="false"
android:textColor="@color/component_color_shared_secondary_4_text_color"
android:textSize="14sp"
app:backgroundTint="@null"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
android:text="@string/get_started"
android:textColor="@color/component_color_shared_secondary_4_text_color"
android:textSize="14sp"
android:textAllCaps="false"
app:layout_constraintEnd_toEndOf="@+id/slide_title_text_view"
app:layout_constraintStart_toStartOf="@+id/slide_title_text_view"
app:layout_constraintTop_toBottomOf="@id/slide_description_text_view" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
android:minWidth="144dp"
android:minHeight="@dimen/clickable_item_min_height"
android:text="@string/start_over_lesson_button"
android:textAllCaps="true"
android:textAllCaps="false"
android:textColor="@color/component_color_shared_secondary_button_background_trim_color"
android:textSize="14sp"
app:backgroundTint="@null"
Expand All @@ -130,7 +130,7 @@
android:minWidth="144dp"
android:minHeight="@dimen/clickable_item_min_height"
android:text="@string/resume_lesson_button"
android:textAllCaps="true"
android:textAllCaps="false"
android:textColor="@color/component_color_shared_secondary_4_text_color"
android:textSize="14sp"
app:backgroundTint="@null"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
android:text="@string/get_started"
android:textColor="@color/component_color_shared_secondary_4_text_color"
android:textSize="20sp"
android:textAllCaps="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/slide_description_text_view" />
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/add_profile_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@
android:enabled="@{viewModel.isButtonActive()}"
android:gravity="center"
android:text="@string/add_profile_create_btn"
android:textAllCaps="true"
android:textColor="@{viewModel.isButtonActive() ? @color/component_color_shared_secondary_4_text_color : @color/component_color_shared_button_inactive_text_color }"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/add_profile_activity_pin_constraint_layout" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
android:id="@+id/open_dialog_0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Concept Card 1" />
android:text="Concept Card 1"
android:textAllCaps="false"/>

<Button
android:id="@+id/open_dialog_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Concept Card 2" />
android:text="Concept Card 2"
android:textAllCaps="false" />
</LinearLayout>
3 changes: 2 additions & 1 deletion app/src/main/res/layout/exploration_test_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
android:id="@+id/play_exploration_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Play exploration" />
android:text="Play exploration"
android:textAllCaps="false"/>

<FrameLayout
android:id="@+id/exploration_test_fragment_placeholder"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/hint_summary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
android:text="@string/reveal_hint"
android:textColor="@color/component_color_hints_and_solution_summary_button_text_color"
android:textSize="14sp"
android:textAllCaps="false"
android:visibility="@{viewModel.isHintRevealed? View.GONE : View.VISIBLE}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
android:enabled="true"
android:onClick="@{(v) -> viewModel.onParseButtonClicked()}"
android:text="@string/math_expression_parse_button_label"
android:textAllCaps="true"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/onboarding_slide_final.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
android:text="@string/get_started"
android:textColor="@color/component_color_shared_secondary_4_text_color"
android:textSize="14sp"
android:textAllCaps="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/slide_description_text_view" />
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/profile_rename_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
android:clickable="@{viewModel.inputName.length > 0}"
android:enabled="@{viewModel.inputName.length > 0}"
android:text="@string/profile_rename_save"
android:textAllCaps="true"
android:textColor="@{viewModel.inputName.length > 0 ? @color/component_color_shared_secondary_4_text_color : @color/component_color_shared_button_inactive_text_color }"
android:textSize="14sp"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/profile_reset_pin_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
android:clickable="@{viewModel.isButtonActive()}"
android:enabled="@{viewModel.isButtonActive()}"
android:text="@string/profile_rename_save"
android:textAllCaps="true"
android:textColor="@{viewModel.isButtonActive() ? @color/component_color_shared_secondary_4_text_color : @color/component_color_shared_button_inactive_text_color }"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/profile_reset_input_confirm_pin" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/resume_lesson_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
android:minWidth="144dp"
android:minHeight="@dimen/clickable_item_min_height"
android:text="@string/start_over_lesson_button"
android:textAllCaps="true"
android:textAllCaps="false"
android:textColor="@color/component_color_shared_secondary_button_background_trim_color"
android:textSize="14sp"
app:backgroundTint="@null"
Expand All @@ -114,7 +114,7 @@
android:minWidth="144dp"
android:minHeight="@dimen/clickable_item_min_height"
android:text="@string/resume_lesson_button"
android:textAllCaps="true"
android:textAllCaps="false"
android:textColor="@color/component_color_shared_secondary_4_text_color"
android:textSize="14sp"
app:backgroundTint="@null"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/solution_summary.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
android:text="@string/show_solution"
android:textColor="@color/component_color_hints_and_solution_summary_button_text_color"
android:textSize="14sp"
android:textAllCaps="false"
android:visibility="@{viewModel.isSolutionRevealed()? View.GONE : View.VISIBLE}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/state_fragment_test_activity.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Play exploration"
android:textAllCaps="false"
android:visibility="@{viewModel.hasExplorationStarted ? View.GONE : View.VISIBLE}" />
</FrameLayout>
</layout>
1 change: 1 addition & 0 deletions app/src/main/res/values-v21/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@
<item name="android:textColorPrimary">@color/component_color_shared_primary_dark_text_color</item>
<item name="android:buttonBarNegativeButtonStyle">@style/textAllCaps</item>
<item name="android:buttonBarPositiveButtonStyle">@style/textAllCaps</item>
<item name="android:textAllCaps">false</item>
</style>
</resources>
8 changes: 4 additions & 4 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,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">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">Ok</string>
<string name="cellular_data_alert_dialog_okay_button">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 @@ -376,7 +376,7 @@
<!-- ProfileRenameActivity -->
<string name="profile_rename_activity_title">Rename Profile</string>
<string name="profile_rename_label">New Name</string>
<string name="profile_rename_save">save</string>
<string name="profile_rename_save">Save</string>
<!-- ProfileResetPinActivity -->
<string name="profile_reset_pin_activity_title">Reset PIN</string>
<string name="profile_reset_pin_main">Enter a new PIN for the user to enter when accessing their profile.</string>
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<item name="android:background">@drawable/state_button_primary_background</item>
<item name="android:fontFamily">sans-serif-medium</item>
<item name="android:minHeight">@dimen/clickable_item_min_height</item>
<item name="android:textAllCaps">true</item>
<item name="android:textAllCaps">false</item>
<item name="android:textColor">@color/component_color_shared_secondary_4_text_color</item>
<item name="android:textSize">14sp</item>
</style>
Expand Down Expand Up @@ -125,7 +125,7 @@
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:padding">8dp</item>
<item name="android:textAllCaps">true</item>
<item name="android:textAllCaps">false</item>
<item name="android:background">@android:color/transparent</item>
<item name="android:textColor">#56000000</item>
<item name="android:textSize">14sp</item>
Expand Down Expand Up @@ -418,7 +418,7 @@
<item name="android:minWidth">144dp</item>
<item name="android:drawablePadding">4dp</item>
<item name="drawableTint">@color/component_color_shared_secondary_button_background_trim_color</item>
<item name="android:textAllCaps">true</item>
<item name="android:textAllCaps">false</item>
<item name="android:textColor">@color/component_color_shared_secondary_button_background_trim_color</item>
<item name="android:textSize">14sp</item>
</style>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<item name="textColorAlertDialogListItem">@color/component_color_shared_primary_dark_text_color</item>
<item name="colorControlNormal">@color/component_color_shared_dialogs_radio_button_unchecked_color</item>
<item name="colorControlActivated">@color/component_color_shared_dialogs_radio_button_checked_color</item>
<item name="android:textAllCaps">false</item>
</style>

<style name="OppiaSwitchCompatTheme" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">
Expand All @@ -50,6 +51,7 @@
<item name="colorAccent">@color/component_color_shared_dialogs_primary_color</item>
<item name="colorBackgroundFloating">@color/component_color_shared_item_background_solid_color</item>
<item name="android:textColorPrimary">@color/component_color_shared_primary_dark_text_color</item>
<item name="android:textAllCaps">false</item>
</style>

<style name="DeprecationAlertDialogTheme" parent="OppiaAlertDialogTheme">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ class AudioFragmentTest {
.perform(click())

testCoroutineDispatchers.runCurrent()
onView(withText("OK")).inRoot(isDialog()).perform(click())
onView(withText("Ok")).inRoot(isDialog()).perform(click())

testCoroutineDispatchers.runCurrent()
onView(withId(R.id.play_pause_audio_icon))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,7 @@ class ExplorationActivityTest {
onView(withId(R.id.cellular_data_dialog_checkbox))
.inRoot(isDialog())
.perform(click())
onView(withText(context.getString(R.string.audio_language_select_dialog_okay_button)))
onView(withText(context.getString(R.string.cellular_data_alert_dialog_okay_button)))
.inRoot(isDialog())
.perform(click())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ class StateFragmentLocalTest {
showRevealSolutionDialog()
clickCancelInRevealSolutionDialog(scenario)

onView(withText("SHOW SOLUTION"))
onView(withText("Show solution"))
.inRoot(isDialog())
.check(matches(isDisplayed()))
}
Expand Down

0 comments on commit 9bbf94a

Please sign in to comment.