-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Updated accessibility service not running screens to comply with goo…
…gle play policies -hotfixes and minor improvements
- Loading branch information
Showing
15 changed files
with
141 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94 changes: 94 additions & 0 deletions
94
core-ui/src/main/java/ly/com/tahaben/core_ui/components/AccessibilityNotRunningContent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package ly.com.tahaben.core_ui.components | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.* | ||
import androidx.compose.foundation.rememberScrollState | ||
import androidx.compose.foundation.verticalScroll | ||
import androidx.compose.material.Button | ||
import androidx.compose.material.MaterialTheme | ||
import androidx.compose.material.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.text.AnnotatedString | ||
import androidx.compose.ui.text.style.TextAlign | ||
import ly.com.tahaben.core.R | ||
import ly.com.tahaben.core_ui.Black | ||
import ly.com.tahaben.core_ui.LocalSpacing | ||
|
||
@Composable | ||
fun AccessibilityNotRunningContent( | ||
modifier: Modifier, | ||
message: String, | ||
subMessage: String, | ||
permissionReasons: AnnotatedString? = null, | ||
onGrantClick: () -> Unit, | ||
onBack: () -> Unit, | ||
onHowClick: () -> Unit | ||
) { | ||
val spacing = LocalSpacing.current | ||
val accessibilityServiceNotRunningScrollState = rememberScrollState() | ||
Column( | ||
modifier = modifier | ||
.padding(horizontal = spacing.spaceMedium) | ||
.verticalScroll(accessibilityServiceNotRunningScrollState), | ||
horizontalAlignment = Alignment.CenterHorizontally, | ||
verticalArrangement = Arrangement.Center | ||
) { | ||
Text( | ||
text = message, | ||
style = MaterialTheme.typography.h3, | ||
color = Black, | ||
textAlign = TextAlign.Center | ||
) | ||
Spacer(modifier = Modifier.height(spacing.spaceMedium)) | ||
Text( | ||
text = subMessage, | ||
style = MaterialTheme.typography.h4, | ||
color = Black, | ||
textAlign = TextAlign.Center | ||
) | ||
Spacer(modifier = Modifier.height(spacing.spaceMedium)) | ||
if (permissionReasons != null) { | ||
Text( | ||
text = permissionReasons, | ||
style = MaterialTheme.typography.h4, | ||
color = Black, | ||
textAlign = TextAlign.Center | ||
) | ||
Spacer(modifier = Modifier.height(spacing.spaceMedium)) | ||
} | ||
Text( | ||
text = stringResource(R.string.if_you_choose_agree_msg), | ||
style = MaterialTheme.typography.h4, | ||
color = Black, | ||
textAlign = TextAlign.Center | ||
) | ||
Spacer(modifier = Modifier.height(spacing.spaceMedium)) | ||
Row { | ||
Button(onClick = onGrantClick) { | ||
Text( | ||
text = stringResource(R.string.agree), | ||
style = MaterialTheme.typography.button, | ||
color = Black | ||
) | ||
} | ||
Spacer(modifier = Modifier.width(spacing.spaceSmall)) | ||
Button(onClick = onBack) { | ||
Text( | ||
text = stringResource(R.string.cancel), | ||
style = MaterialTheme.typography.button, | ||
color = Black | ||
) | ||
} | ||
} | ||
Spacer(modifier = Modifier.height(spacing.spaceMedium)) | ||
Text( | ||
modifier = Modifier.clickable(onClick = onHowClick), | ||
text = stringResource(R.string.how), | ||
style = MaterialTheme.typography.button, | ||
color = Black | ||
) | ||
} | ||
} |
Binary file modified
BIN
+266 KB
(170%)
core/src/main/res/drawable/accessibility_permission_howto.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters