Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #5612 Talk back is not reading Arabic language in Preferred Audio Language #5613

Merged
merged 43 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d819e70
Merge pull request #1 from oppia/develop
subhajitxyz Jul 23, 2024
c6f54ea
Merge branch 'oppia:develop' into develop
subhajitxyz Jul 27, 2024
d44015b
Merge remote-tracking branch 'upstream/develop' into develop
subhajitxyz Aug 17, 2024
d604bc2
Merge pull request #2 from oppia/develop
subhajitxyz Aug 26, 2024
cc0ddef
Merge pull request #3 from oppia/develop
subhajitxyz Aug 26, 2024
52c6bb1
Merge pull request #4 from oppia/develop
subhajitxyz Aug 29, 2024
773c810
Merge remote-tracking branch 'upstream/develop' into develop
subhajitxyz Sep 5, 2024
56af5ae
Merge pull request #5 from oppia/develop
subhajitxyz Sep 16, 2024
3883f70
Merge pull request #6 from oppia/develop
subhajitxyz Sep 27, 2024
10c8e6e
Fix #5404: Migrate away from onBackPressed for remaining activities (…
dattasneha Oct 3, 2024
5e140e9
Fix #5404: Migrate away from onBackPressed for RevisionCardActivity (…
dattasneha Oct 9, 2024
b4ad7a3
Merge branch 'oppia:develop' into develop
subhajitxyz Oct 11, 2024
238645d
Merge pull request #8 from oppia/develop
subhajitxyz Oct 12, 2024
5a546b9
Merge pull request #9 from oppia/develop
subhajitxyz Nov 3, 2024
b1ca8e1
Merge pull request #10 from oppia/develop
subhajitxyz Nov 19, 2024
ad7e380
Merge pull request #11 from oppia/develop
subhajitxyz Dec 11, 2024
b938a4c
Fix #5508: Skipping redundant code coverage and APK/AAB report commen…
Rd4dev Dec 12, 2024
fc2f932
Fix part of #4865: Use profileId in classroom activity and presenter …
tobioyelekan Dec 16, 2024
35f937b
Merge branch 'oppia:develop' into develop
subhajitxyz Dec 17, 2024
21b0986
Merge branch 'oppia:develop' into develop
subhajitxyz Dec 18, 2024
d891a5a
Merge branch 'oppia:develop' into develop
subhajitxyz Dec 21, 2024
3e6404d
add content desc and test for arabicDisplayName
subhajitxyz Dec 21, 2024
9312dcf
added kdoc for fun languageContentDescription
subhajitxyz Dec 21, 2024
b1d0ca1
add string in string.xml and change test name
subhajitxyz Dec 23, 2024
7c12668
Merge branch 'oppia:develop' into develop
subhajitxyz Dec 23, 2024
6df6480
Merge branch 'develop' of https://github.com/subhajitxyz/oppia-androi…
subhajitxyz Dec 23, 2024
040c157
Merge branch 'oppia:develop' into develop
subhajitxyz Dec 26, 2024
c5db6ea
Merge branch 'oppia:develop' into develop
subhajitxyz Dec 27, 2024
2fcc3b5
Merge branch 'oppia:develop' into develop
subhajitxyz Jan 2, 2025
0e19cdd
Use appLangugeResourceHandler
subhajitxyz Jan 3, 2025
e28fc3b
Correct klint
subhajitxyz Jan 3, 2025
e0c38c6
Remove resourcehandler
subhajitxyz Jan 3, 2025
b9622be
Correct klint
subhajitxyz Jan 3, 2025
d21a662
Correct string.xml
subhajitxyz Jan 3, 2025
896ab3a
Merge branch 'oppia:develop' into develop
subhajitxyz Jan 11, 2025
c960789
Merge branch 'oppia:develop' into develop
subhajitxyz Jan 14, 2025
88cfc59
Merge branch 'oppia:develop' into develop
subhajitxyz Jan 18, 2025
bb21cd4
Add AppLanguageResourcehandler
subhajitxyz Jan 20, 2025
03358f2
Merge branch 'develop' of https://github.com/subhajitxyz/oppia-androi…
subhajitxyz Jan 20, 2025
1646f9f
add string in ar, pt-rBR,sw
subhajitxyz Jan 20, 2025
7d148bc
add string in pcm-rNG
subhajitxyz Jan 20, 2025
3e7dfb4
add path rVIEW_MODELS_WITH_RESOURCE_IMPORTS in build.bazel
subhajitxyz Jan 20, 2025
b4572ad
Merge branch 'develop' into fix-talkbackread-arabic
adhiamboperes Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,14 @@ class AudioLanguageItemViewModel(
val isLanguageSelected: LiveData<Boolean> by lazy {
Transformations.map(currentSelectedLanguage) { it == language }
}
/**
* Returns the content description for the current language. This is used for accessibility
* purposes to provide a readable description of the language in the UI.
*/
fun languageContentDescription(): String {
return when (language) {
AudioLanguage.ARABIC_LANGUAGE -> "Arabic"
adhiamboperes marked this conversation as resolved.
Show resolved Hide resolved
adhiamboperes marked this conversation as resolved.
Show resolved Hide resolved
else -> languageDisplayName
}
}
}
1 change: 1 addition & 0 deletions app/src/main/res/layout/audio_language_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:fontFamily="sans-serif"
android:contentDescription="@{viewModel.languageContentDescription()}"
android:text="@{viewModel.languageDisplayName}"
android:textColor="@color/component_color_shared_primary_text_color"
android:textSize="16sp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import androidx.test.espresso.matcher.RootMatchers.withDecorView
import androidx.test.espresso.matcher.ViewMatchers.Visibility
import androidx.test.espresso.matcher.ViewMatchers.isChecked
import androidx.test.espresso.matcher.ViewMatchers.isRoot
import androidx.test.espresso.matcher.ViewMatchers.withContentDescription
import androidx.test.espresso.matcher.ViewMatchers.withEffectiveVisibility
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
Expand Down Expand Up @@ -499,6 +500,30 @@ class AudioLanguageFragmentTest {
}
}

@Test
fun testOpenFragment_withEnglish_verifyContentDescriptionOfArabicLanguage() {
adhiamboperes marked this conversation as resolved.
Show resolved Hide resolved
initializeTestApplicationComponent(enableOnboardingFlowV2 = false)
launchActivityWithLanguage(ENGLISH_AUDIO_LANGUAGE).use {
verifyEnglishIsSelected()

onView(
atPositionOnView(
R.id.audio_language_recycler_view,
3,
R.id.language_text_view
)
).check(matches(withText(R.string.arabic_localized_language_name)))

onView(
atPositionOnView(
R.id.audio_language_recycler_view,
3,
R.id.language_text_view
)
).check(matches(withContentDescription("Arabic")))
}
}

private fun launchActivityWithLanguage(
audioLanguage: AudioLanguage
): ActivityScenario<AppLanguageActivity> {
Expand Down
Loading