Skip to content

Commit

Permalink
feat: update accessibility strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ohassine committed Nov 21, 2024
1 parent 06671ef commit 2880062
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ import com.wire.android.ui.common.dimensions
import com.wire.android.ui.common.preview.MultipleThemePreviews
import com.wire.android.ui.theme.WireTheme
import com.wire.android.ui.userprofile.teammigration.common.ConfirmMigrationLeaveDialog
import com.wire.android.ui.userprofile.teammigration.step1.TEAM_MIGRATION_TEAM_PLAN_STEP
import com.wire.android.ui.userprofile.teammigration.step2.TEAM_MIGRATION_TEAM_NAME_STEP
import com.wire.android.ui.userprofile.teammigration.step3.TEAM_MIGRATION_CONFIRMATION_STEP
import com.wire.android.ui.userprofile.teammigration.step4.TEAM_MIGRATION_DONE_STEP

@OptIn(ExperimentalMaterialNavigationApi::class, ExperimentalAnimationApi::class)
@WireDestination(style = PopUpNavigationAnimation::class)
Expand Down Expand Up @@ -93,6 +97,14 @@ fun TeamMigrationScreen(
.fillMaxSize()
.background(color = colorsScheme().surface)
) {
val closeIconContentDescription = when(teamMigrationViewModel.teamMigrationState.currentStep) {
TEAM_MIGRATION_TEAM_PLAN_STEP -> stringResource(R.string.personal_to_team_migration_close_team_account_content_description)
TEAM_MIGRATION_TEAM_NAME_STEP -> stringResource(R.string.personal_to_team_migration_close_team_name_content_description)
TEAM_MIGRATION_CONFIRMATION_STEP -> stringResource(R.string.personal_to_team_migration_close_confirmation_content_description)
TEAM_MIGRATION_DONE_STEP -> stringResource(R.string.personal_to_team_migration_close_team_created_content_description)
else -> stringResource(R.string.personal_to_team_migration_close_icon_content_description)
}

IconButton(
modifier = Modifier.align(alignment = Alignment.End),
onClick = {
Expand All @@ -107,7 +119,7 @@ fun TeamMigrationScreen(
) {
Icon(
painter = painterResource(id = R.drawable.ic_close),
contentDescription = stringResource(R.string.personal_to_team_migration_close_icon_content_description)
contentDescription = closeIconContentDescription
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ import androidx.compose.foundation.text.input.TextFieldState

data class TeamMigrationState(
val teamNameTextState: TextFieldState = TextFieldState(),
val shouldShowMigrationLeaveDialog: Boolean = false
val shouldShowMigrationLeaveDialog: Boolean = false,
val currentStep: Int = 0
)
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ class TeamMigrationViewModel @Inject constructor(
)
}

fun setCurrentStep(step: Int) {
teamMigrationState = teamMigrationState.copy(currentStep = step)
}

fun sendPersonalTeamCreationFlowCanceledEvent(
modalLeaveClicked: Boolean? = null,
modalContinueClicked: Boolean? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ import com.wire.android.ui.common.dimensions
import com.wire.android.ui.destinations.TeamMigrationTeamNameStepScreenDestination
import com.wire.android.ui.theme.WireTheme
import com.wire.android.ui.theme.wireTypography
import com.wire.android.ui.userprofile.teammigration.common.BottomLineButtons
import com.wire.android.ui.userprofile.teammigration.PersonalToTeamMigrationNavGraph
import com.wire.android.ui.userprofile.teammigration.TeamMigrationViewModel
import com.wire.android.ui.userprofile.teammigration.common.BottomLineButtons
import com.wire.android.util.CustomTabsHelper
import com.wire.android.util.ui.PreviewMultipleThemes

const val TEAM_MIGRATION_TEAM_PLAN_STEP = 1

@PersonalToTeamMigrationNavGraph(start = true)
@WireDestination(
style = SlideNavigationAnimation::class
Expand All @@ -76,7 +78,8 @@ fun TeamMigrationTeamPlanStepScreen(
)

LaunchedEffect(Unit) {
teamMigrationViewModel.sendPersonalTeamCreationFlowStartedEvent(1)
teamMigrationViewModel.sendPersonalTeamCreationFlowStartedEvent(TEAM_MIGRATION_TEAM_PLAN_STEP)
teamMigrationViewModel.setCurrentStep(TEAM_MIGRATION_TEAM_PLAN_STEP)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ import com.wire.android.ui.common.textfield.WireTextField
import com.wire.android.ui.destinations.TeamMigrationConfirmationStepScreenDestination
import com.wire.android.ui.theme.WireTheme
import com.wire.android.ui.theme.wireTypography
import com.wire.android.ui.userprofile.teammigration.common.BottomLineButtons
import com.wire.android.ui.userprofile.teammigration.PersonalToTeamMigrationNavGraph
import com.wire.android.ui.userprofile.teammigration.TeamMigrationViewModel
import com.wire.android.ui.userprofile.teammigration.common.BottomLineButtons
import com.wire.android.util.ui.PreviewMultipleThemes

const val TEAM_MIGRATION_TEAM_NAME_STEP = 2

@PersonalToTeamMigrationNavGraph
@WireDestination(
style = SlideNavigationAnimation::class
Expand All @@ -68,7 +70,8 @@ fun TeamMigrationTeamNameStepScreen(
teamNameTextFieldState = teamMigrationViewModel.teamMigrationState.teamNameTextState
)
LaunchedEffect(Unit) {
teamMigrationViewModel.sendPersonalTeamCreationFlowStartedEvent(2)
teamMigrationViewModel.sendPersonalTeamCreationFlowStartedEvent(TEAM_MIGRATION_TEAM_NAME_STEP)
teamMigrationViewModel.setCurrentStep(TEAM_MIGRATION_TEAM_NAME_STEP)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ import com.wire.android.ui.userprofile.teammigration.common.BulletList
import com.wire.android.util.CustomTabsHelper
import com.wire.android.util.ui.PreviewMultipleThemes

const val TEAM_MIGRATION_CONFIRMATION_STEP = 3

@PersonalToTeamMigrationNavGraph
@WireDestination(
style = SlideNavigationAnimation::class
Expand All @@ -77,7 +79,8 @@ fun TeamMigrationConfirmationStepScreen(
}
)
LaunchedEffect(Unit) {
teamMigrationViewModel.sendPersonalTeamCreationFlowStartedEvent(3)
teamMigrationViewModel.sendPersonalTeamCreationFlowStartedEvent(TEAM_MIGRATION_CONFIRMATION_STEP)
teamMigrationViewModel.setCurrentStep(TEAM_MIGRATION_CONFIRMATION_STEP)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
Expand All @@ -45,12 +46,14 @@ import com.wire.android.ui.common.spacers.VerticalSpace.x32
import com.wire.android.ui.destinations.HomeScreenDestination
import com.wire.android.ui.theme.WireTheme
import com.wire.android.ui.theme.wireTypography
import com.wire.android.ui.userprofile.teammigration.common.BulletList
import com.wire.android.ui.userprofile.teammigration.PersonalToTeamMigrationNavGraph
import com.wire.android.ui.userprofile.teammigration.TeamMigrationViewModel
import com.wire.android.ui.userprofile.teammigration.common.BulletList
import com.wire.android.util.CustomTabsHelper
import com.wire.android.util.ui.PreviewMultipleThemes

const val TEAM_MIGRATION_DONE_STEP = 4

@PersonalToTeamMigrationNavGraph
@WireDestination(
style = SlideNavigationAnimation::class
Expand Down Expand Up @@ -84,6 +87,10 @@ fun TeamMigrationDoneStepScreen(
teamName = teamMigrationViewModel.teamMigrationState.teamNameTextState.text.toString()
)

LaunchedEffect(Unit) {
teamMigrationViewModel.setCurrentStep(TEAM_MIGRATION_DONE_STEP)
}

BackHandler { }
}

Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1579,6 +1579,10 @@ In group conversations, the group admin can overwrite this setting.</string>
<string name="personal_to_team_migration_back_button_team_name_content_description">Go back to team account overview</string>
<string name="personal_to_team_migration_back_button_confirmation_content_description">Go back to team name view</string>
<string name="personal_to_team_migration_close_icon_content_description">Close team migration flow</string>
<string name="personal_to_team_migration_close_team_account_content_description">Close team account overview</string>
<string name="personal_to_team_migration_close_team_name_content_description">Close team name view</string>
<string name="personal_to_team_migration_close_confirmation_content_description">Close confirmation view</string>
<string name="personal_to_team_migration_close_team_created_content_description">Close team created view</string>

<string name="personal_to_team_migration_team_plan_step">Team Account</string>
<string name="personal_to_team_migration_team_plan_description">Transform your personal account into a team account to get more out of your collaboration.</string>
Expand Down

0 comments on commit 2880062

Please sign in to comment.