Skip to content

Commit

Permalink
[#243] Add content description on images of sliders with icons
Browse files Browse the repository at this point in the history
  • Loading branch information
paulinea committed Sep 5, 2022
1 parent 8b059ce commit 2f12cd3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.stringResource
import com.orange.ods.compose.component.control.OdsSlider
import com.orange.ods.compose.component.control.OdsSliderLockups
import com.orange.ods.demo.R
Expand Down Expand Up @@ -46,8 +47,10 @@ fun ComponentSlidersContent() {
value = discreteWithIconsSliderPosition,
steps = 10,
onValueChange = { discreteWithIconsSliderPosition = it },
leftIconRes = R.drawable.ic_heart,
rightIconRes = R.drawable.ic_heart,
leftIconRes = R.drawable.ic_volume_status_1,
leftIconContentDescription = stringResource(id = R.string.component_slider_low_volume),
rightIconRes = R.drawable.ic_volume_status_4,
rightIconContentDescription = stringResource(id = R.string.component_slider_high_volume)
)

var continuousSliderPosition by remember { mutableStateOf(0f) }
Expand All @@ -64,8 +67,10 @@ fun ComponentSlidersContent() {
OdsSlider(
value = continuousSliderWithIconsPosition,
onValueChange = { continuousSliderWithIconsPosition = it },
leftIconRes = R.drawable.ic_heart,
rightIconRes = R.drawable.ic_heart,
leftIconRes = R.drawable.ic_volume_status_1,
leftIconContentDescription = stringResource(id = R.string.component_slider_low_volume),
rightIconRes = R.drawable.ic_volume_status_4,
rightIconContentDescription = stringResource(id = R.string.component_slider_high_volume)
)

var discreteLockupsSliderPosition by remember { mutableStateOf(0f) }
Expand Down
4 changes: 4 additions & 0 deletions demo/src/main/res/drawable/ic_volume_status_1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<vector android:height="24dp" android:viewportHeight="1000"
android:viewportWidth="1000" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:fillType="evenOdd" android:pathData="M325,675H100a50,50 0,0 1,-50 -50V375a50,50 0,0 1,50 -50H325L550,125V875Z"/>
</vector>
4 changes: 4 additions & 0 deletions demo/src/main/res/drawable/ic_volume_status_4.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<vector android:height="24dp" android:viewportHeight="1000"
android:viewportWidth="1000" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:fillType="evenOdd" android:pathData="M834,801.6l-56.4,-49.4a374.6,374.6 0,0 0,0 -504.4L834,198.4A450,450 0,0 1,834 801.6ZM739.9,719.3 L683.4,669.9a249.6,249.6 0,0 0,0 -339.7l56.5,-49.4A325,325 0,0 1,739.9 719.3ZM645.8,636.9 L589.3,587.5a125,125 0,0 0,0 -175l56.5,-49.4A200,200 0,0 1,645.8 636.9ZM100,675a50,50 0,0 1,-50 -50L50,375a50,50 0,0 1,50 -50L325,325L550,125L550,875L325,675L100,675Z"/>
</vector>
3 changes: 3 additions & 0 deletions demo/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@
<string name="component_slider_continuous_with_icons">Continuous with icons</string>
<string name="component_slider_discrete_lockups">Discrete lockups</string>
<string name="component_slider_continuous_lockups">Continuous lockups</string>
<string name="component_slider_low_volume">Low volume</string>
<string name="component_slider_high_volume">High volume</string>


<!-- Component Progress & activities -->
<string name="component_progress">Progress &amp; activities</string>
Expand Down

0 comments on commit 2f12cd3

Please sign in to comment.