Skip to content

Commit

Permalink
Merge pull request #4387 from owncloud/feature/accesibility_non_text_…
Browse files Browse the repository at this point in the history
…content

[a11y] 11.1.1.1a Non-text content (control elements)
  • Loading branch information
JuancaG05 authored May 2, 2024
2 parents 893d1a1 + 54cf94f commit 999d383
Show file tree
Hide file tree
Showing 18 changed files with 84 additions and 17 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ ownCloud admins and users.
* Enhancement - Make dialog more Android-alike: [#4303](https://github.com/owncloud/android/issues/4303)
* Enhancement - Password generator for public links in oCIS: [#4308](https://github.com/owncloud/android/issues/4308)
* Enhancement - Improvements in remove dialog alert: [#4342](https://github.com/owncloud/android/issues/4342)
* Enhancement - Content description in UI elements to improve accessibility: [#4360](https://github.com/owncloud/android/issues/4360)
* Enhancement - Added contentDescription attribute in the previewed image: [#4360](https://github.com/owncloud/android/issues/4360)

## Details
Expand Down Expand Up @@ -216,6 +217,16 @@ ownCloud admins and users.
https://github.com/owncloud/android/issues/4342
https://github.com/owncloud/android/pull/4348

* Enhancement - Content description in UI elements to improve accessibility: [#4360](https://github.com/owncloud/android/issues/4360)

A description of the meaning or action associated with some UI elements has been
included as alternative text to make the application more accessible. Views
improved: toolbar, file list, spaces list, share, drawer menu, manage accounts
and image preview.

https://github.com/owncloud/android/issues/4360
https://github.com/owncloud/android/pull/4387

* Enhancement - Added contentDescription attribute in the previewed image: [#4360](https://github.com/owncloud/android/issues/4360)

A contentDescription attribute has been added to previewed image to make the
Expand Down
7 changes: 7 additions & 0 deletions changelog/unreleased/4387
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Content description in UI elements to improve accessibility

A description of the meaning or action associated with some UI elements has been included as alternative text to make the application more accessible.
Views improved: toolbar, file list, spaces list, share, drawer menu, manage accounts and image preview.

https://github.com/owncloud/android/issues/4360
https://github.com/owncloud/android/pull/4387
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ class AvatarUtils : KoinComponent {
displayRadius = displayRadius
)
withContext(Dispatchers.Main) {
// Not just accessibility support, used to know what account is bound to each imageView
imageView.contentDescription = account.name
if (drawable != null) {
imageView.setImageDrawable(drawable)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* @author Fernando Sanz Velasco
* @author Juan Carlos Garrote Gascón
* @author Manuel Plazas Palacio
* @author Aitor Ballesteros Pavón
*
* Copyright (C) 2023 ownCloud GmbH.
* Copyright (C) 2024 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -215,6 +216,7 @@ class FileListAdapter(
it.fileListSize.text = DisplayUtils.bytesToHumanReadable(file.length, context)
it.fileListLastMod.text = DisplayUtils.getRelativeTimestamp(context, file.modificationTimestamp)
it.threeDotMenu.isVisible = getCheckedItems().isEmpty()
it.threeDotMenu.contentDescription = context.getString(R.string.content_description_file_operations, file.fileName)
if (fileListOption.isAvailableOffline() || (fileListOption.isSharedByLink() && fileWithSyncInfo.space == null)) {
it.spacePathLine.path.apply {
text = file.getParentRemotePath()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @author Juan Carlos Garrote Gascón
* @author Manuel Plazas Palacio
* @author Jorge Aguado Recio
* @author Aitor Ballesteros Pavón
*
* Copyright (C) 2024 ownCloud GmbH.
*
Expand Down Expand Up @@ -56,6 +57,7 @@ import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import coil.load
import com.getbase.floatingactionbutton.AddFloatingActionButton
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.snackbar.Snackbar
Expand Down Expand Up @@ -273,6 +275,9 @@ class MainFileListFragment : Fragment(),
setViewTypeSelector(SortOptionsView.AdditionalView.CREATE_FOLDER)

showOrHideFab(requireArguments().getParcelable(ARG_FILE_LIST_OPTION)!!, requireArguments().getParcelable(ARG_INITIAL_FOLDER_TO_DISPLAY)!!)

binding.fabMain.findViewById<AddFloatingActionButton>(com.getbase.floatingactionbutton.R.id.fab_expand_menu_button).contentDescription =
getString(R.string.content_description_add_new_content)
}

private fun setViewTypeSelector(additionalView: SortOptionsView.AdditionalView) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ class ReleaseNotesViewModel(
subtitle = R.string.release_notes_4_3_0_subtitle_video_streaming_spaces,
type = ReleaseNoteType.BUGFIX
),
ReleaseNote(
title = R.string.release_notes_4_3_0_title_accessibility_improvements,
subtitle = R.string.release_notes_4_3_0_subtitle_accessibility_improvements,
type = ReleaseNoteType.ENHANCEMENT
),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
* @author Juan Carlos González Cabrero
* @author David González Verdugo
* @author Christian Schabesberger
* Copyright (C) 2020 ownCloud GmbH.
* @author Aitor Ballesteros Pavón
*
* Copyright (C) 2024 ownCloud GmbH.
*
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -65,7 +67,7 @@ class ShareActivity : FileActivity(), ShareFragmentListener {

// Set back button
supportActionBar?.setDisplayHomeAsUpEnabled(true)

supportActionBar?.setHomeActionContentDescription(R.string.common_back)
supportFragmentManager.transaction {
if (savedInstanceState == null && file != null && account != null) {
// Add Share fragment on first creation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
*
* @author Andy Scherzinger
* @author Christian Schabesberger
* @author Aitor Ballesteros Pavón
*
* Copyright (C) 2024 ownCloud GmbH.
* Copyright (C) 2020 ownCloud GmbH.
*
*
* This program is free software: you can redistribute it and/or modify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
* @author David A. Velasco
* @author David González Verdugo
* @author Christian Schabesberger
* Copyright (C) 2020 ownCloud GmbH.
* @author Aitor Ballesteros Pavón
*
* Copyright (C) 2024 ownCloud GmbH.
*
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -85,6 +87,7 @@ class PreviewImageActivity : FileActivity(),
// ActionBar
supportActionBar?.run {
setDisplayHomeAsUpEnabled(true)
setHomeActionContentDescription(R.string.common_back)
setHomeButtonEnabled(true)
}
showActionBar(false)
Expand Down
1 change: 1 addition & 0 deletions owncloudApp/src/main/res/layout-land/nav_drawer_footer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
android:layout_height="24dp"
android:visibility="gone"
android:src="@drawable/drawer_logo"
android:contentDescription="@string/content_description_logo"
app:layout_constraintBottom_toTopOf="@id/account_quota_bar"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
Expand Down
2 changes: 2 additions & 0 deletions owncloudApp/src/main/res/layout/account_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
android:paddingEnd="@dimen/standard_half_padding"
android:paddingBottom="@dimen/standard_padding"
android:src="@drawable/ic_clean_account"
android:contentDescription="@string/content_description_clean_account_storage"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/removeButton"
app:layout_constraintTop_toTopOf="parent"
Expand All @@ -114,6 +115,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:contentDescription="@string/content_description_remove_account"
app:tint="@color/black" />

</androidx.constraintlayout.widget.ConstraintLayout>
1 change: 1 addition & 0 deletions owncloudApp/src/main/res/layout/nav_drawer_footer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
android:layout_marginTop="@dimen/standard_half_margin"
android:visibility="gone"
android:src="@drawable/drawer_logo"
android:contentDescription="@string/content_description_logo"
app:layout_constraintBottom_toTopOf="@id/account_quota_bar"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/drawer_logo"
Expand Down
4 changes: 4 additions & 0 deletions owncloudApp/src/main/res/layout/owncloud_toolbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
android:layout_marginHorizontal="@dimen/standard_half_margin"
android:padding="@dimen/standard_half_padding"
android:src="@drawable/ic_drawer_icon"
android:contentDescription="@string/content_description_menu"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand Down Expand Up @@ -61,6 +62,7 @@
android:paddingHorizontal="@dimen/standard_half_padding"
android:textColor="@color/white"
android:textSize="@dimen/toolbar_title_text_size"
android:contentDescription="@string/content_description_search"
app:drawableEndCompat="@drawable/ic_search"
app:drawableTint="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
Expand All @@ -77,6 +79,7 @@
android:padding="@dimen/standard_half_padding"
android:src="@drawable/ic_account_circle"
android:tint="@color/primary"
android:contentDescription="@string/content_description_manage_accounts"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
Expand All @@ -89,5 +92,6 @@
android:background="?attr/colorPrimary"
android:theme="@style/ownCloud.Appbar"
android:visibility="gone"
app:navigationContentDescription="@string/common_back"
app:popupTheme="?attr/actionBarPopupTheme" />
</com.google.android.material.appbar.AppBarLayout>
9 changes: 6 additions & 3 deletions owncloudApp/src/main/res/layout/share_file_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
android:padding="@dimen/standard_half_padding"
android:src="@drawable/copy_link"
android:scaleType="centerCrop"
android:background="@color/transparent"/>
android:background="@color/transparent"
android:contentDescription="@string/content_description_get_private_link" />

</RelativeLayout>

Expand Down Expand Up @@ -111,7 +112,8 @@
android:layout_height="48dp"
android:layout_alignParentEnd="true"
android:background="@color/transparent"
android:src="@drawable/ic_add" />
android:src="@drawable/ic_add"
android:contentDescription="@string/content_description_add_share" />

</RelativeLayout>

Expand Down Expand Up @@ -164,7 +166,8 @@
android:layout_height="48dp"
android:layout_alignParentEnd="true"
android:background="@color/transparent"
android:src="@drawable/ic_add" />
android:src="@drawable/ic_add"
android:contentDescription="@string/content_description_add_public_link" />

</RelativeLayout>

Expand Down
9 changes: 6 additions & 3 deletions owncloudApp/src/main/res/layout/share_public_link_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
android:padding="14dp"
android:src="@drawable/copy_link"
android:scaleType="centerCrop"
android:background="@color/transparent"/>
android:background="@color/transparent"
android:contentDescription="@string/content_description_get_public_link" />

<ImageButton
android:id="@+id/deletePublicLinkButton"
Expand All @@ -59,7 +60,8 @@
android:padding="14dp"
android:src="@drawable/ic_action_delete_grey"
android:scaleType="centerCrop"
android:background="@color/transparent"/>
android:background="@color/transparent"
android:contentDescription="@string/content_description_delete_public_link" />

<ImageButton
android:id="@+id/editPublicLinkButton"
Expand All @@ -68,7 +70,8 @@
android:layout_gravity="center_vertical"
android:padding="14dp"
android:src="@drawable/ic_lead_pencil_grey"
android:background="@color/transparent"/>
android:background="@color/transparent"
android:contentDescription="@string/content_description_get_edit_public_link" />

</LinearLayout>

Expand Down
6 changes: 4 additions & 2 deletions owncloudApp/src/main/res/layout/share_user_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,17 @@
android:src="@drawable/ic_action_delete_grey"
android:padding="14dp"
android:scaleType="centerCrop"
android:background="@color/transparent" />
android:background="@color/transparent"
android:contentDescription="@string/content_description_delete_share" />

<ImageButton
android:layout_width="48dp"
android:layout_height="48dp"
android:id="@+id/editShareButton"
android:src="@drawable/ic_lead_pencil_grey"
android:padding="14dp"
android:background="@color/transparent"/>
android:background="@color/transparent"
android:contentDescription="@string/content_description_edit_share" />

</LinearLayout>

Expand Down
1 change: 1 addition & 0 deletions owncloudApp/src/main/res/layout/sort_options_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
android:padding="@dimen/standard_half_padding"
android:src="@drawable/ic_baseline_view_list"
android:tint="@color/white"
android:contentDescription="@string/content_description_type_view"
app:layout_constraintBottom_toBottomOf="@id/sort_type_selector"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/sort_type_selector"
Expand Down
19 changes: 19 additions & 0 deletions owncloudApp/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,8 @@
<string name="release_notes_4_3_0_subtitle_search_functionality_in_spaces_list">Search functionality has been added in spaces list when you are trying to filter them</string>
<string name="release_notes_4_3_0_title_video_streaming_spaces">Video streaming in spaces</string>
<string name="release_notes_4_3_0_subtitle_video_streaming_spaces">Video files located in spaces can now be played in streaming correctly</string>
<string name="release_notes_4_3_0_title_accessibility_improvements">Improvements in accessibility</string>
<string name="release_notes_4_3_0_subtitle_accessibility_improvements">Some improvements to make the application more accessible</string>

<!-- Open in web -->
<string name="ic_action_open_in_web">Open in web</string>
Expand Down Expand Up @@ -810,6 +812,23 @@
<string name="clean_data_account_title">Remove local storage</string>
<string name="clean_data_account_button_yes">Clean data</string>

<string name="content_description_menu">Menu</string>
<string name="content_description_manage_accounts">Manage accounts</string>
<string name="content_description_search">Search</string>
<string name="content_description_type_view">Type of view</string>
<string name="content_description_image_previewed">Image previewed</string>
<string name="content_description_add_public_link">Add public link</string>
<string name="content_description_get_private_link">Get private link</string>
<string name="content_description_get_public_link">Get public link</string>
<string name="content_description_delete_public_link">Delete public link</string>
<string name="content_description_get_edit_public_link">Edit public link</string>
<string name="content_description_remove_account">Remove account</string>
<string name="content_description_add_new_content">Add new content</string>
<string name="content_description_clean_account_storage">Clean account storage</string>
<string name="content_description_logo">Logo</string>
<string name="content_description_add_share">Add share</string>
<string name="content_description_edit_share">Edit share</string>
<string name="content_description_delete_share">Delete share</string>
<string name="content_description_file_operations">%1$s operations</string>

</resources>

0 comments on commit 999d383

Please sign in to comment.