-
-
Save dbarks1024/d3402471c18628a3a2274fbbeeea1bca to your computer and use it in GitHub Desktop.
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
override fun onBindSlice(sliceUri: Uri): Slice? { | |
context ?: return null | |
return when (sliceUri.path) { | |
"/toggle" -> { | |
// Display toggle slice | |
val toggleAction = createToggleAction() | |
val focusTitleText: String | |
val focusSubtitleText: String | |
if (FocusManager.focusing) { | |
focusTitleText = context.getString(R.string.focus_title_text_enabled) | |
focusSubtitleText = context.getString(R.string.focus_subtitle_text_enabled) | |
} else { | |
focusTitleText = context.getString(R.string.focus_title_text_disabled) | |
focusSubtitleText = context.getString(R.string.focus_subtitle_text_disabled) | |
} | |
} | |
else -> { | |
... | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment