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
APText( | |
modifier = Modifier | |
.testTag("txt_title") | |
.padding(top = 6.dp, bottom = 4.dp), | |
apStyle = textStyle, text = text, textColor = textColor | |
) |
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
class AccountDetailsPage constructor(private val composeTestRule: ComposeContentTestRule) { | |
val personalDetails: PersonalDetails | |
get() = | |
with(composeTestRule) { | |
PersonalDetails( | |
preferredName = TitleValue( | |
title = onNestedChild(UiAssert.stringRes(R.string.glam_preferred_name), "txt_title"), | |
value = onNestedChild(UiAssert.stringRes(R.string.glam_preferred_name), "txt_subtitle") | |
), | |
lastName = TitleValue( |
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
@Config(application = PostApp::class, instrumentedPackages = ["androidx.loader.content"]) | |
class AccountDetailsActivityTest : | |
RobolectricTestBase<AccountDetailsActivity>(AccountDetailsActivity::class) { | |
@get:Rule | |
val composeTestRule = createComposeRule() | |
private lateinit var page: AccountDetailsPage | |
@Before |
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
val defaultTextColor: Color | |
@Composable | |
@ReadOnlyComposable | |
get() = if (isSystemInDarkTheme()) AP_White else AP_Ink | |
val defaultSecondaryTextColor: Color | |
@Composable | |
@ReadOnlyComposable | |
get() = if (isSystemInDarkTheme()) AP_Smoke else AP_Iron |
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
@OptIn(ExperimentalAnimationGraphicsApi::class) | |
@Composable | |
fun APTextField( | |
modifier: Modifier = Modifier, | |
value: String? = null, | |
onValueChange: (String) -> Unit, | |
onEndIconClicked: () -> Unit = { }, | |
label: String? = null, | |
mode: APTextFieldType = APTextFieldType.Normal | |
) { |
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
sealed class DebugScreen(val route: String, val title: Int, val topLevelDestination: Boolean = false) { | |
object Environment : DebugScreen(DebugNavigationItem.Environment.route, R.string.environment_screen_title, true) | |
} | |
Scaffold( | |
scaffoldState = scaffoldState, | |
topBar = { DebugTopBar(navController, version) }, | |
bottomBar = { DebugBottomNavigationBar(navController) } | |
) { paddingValues -> | |
DebugNavHost(navController = navController, paddingValues, showSnackBar) |
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
WearAppTheme { | |
Scaffold( | |
timeText = { | |
if (displayTime(currentScreen, scalingLazyListState)) { | |
TimeText() | |
} | |
}, | |
vignette = { | |
Vignette(vignettePosition = VignettePosition.TopAndBottom) | |
}, |
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
composable( | |
// Route information | |
route = WearScreen.DETAILS.name + "/{trackNumber}", | |
arguments = listOf(navArgument("trackNumber") { type = NavType.StringType }) | |
) { backStackEntry -> | |
val trackNumber = backStackEntry.arguments?.getString("trackNumber") ?: "" | |
// Retrieve View model | |
val trackDetailsViewModel = viewModel<TrackDetailsViewModel>() |
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
fun Route.postGreeting() { | |
val greetingService by inject<GreetingService>() | |
post("/greeting") { | |
val greetingRequest = call.receive<GreetingRequest>() | |
call.respond(greetingService.greeting(greetingRequest)) | |
} | |
} |
NewerOlder