Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Golden Tiles samples #450

Merged
merged 20 commits into from
Jul 12, 2022
Prev Previous commit
Next Next commit
Spotless checks
  • Loading branch information
Ataul Munim committed Jul 10, 2022
commit bbc18424a678282fa6e35169d47da228c30b805a
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.wear.tiles.components

import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.wear.tiles.golden

import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.wear.tiles.golden

import android.content.Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.wear.tiles.golden

import androidx.compose.ui.graphics.Color
Expand All @@ -10,4 +25,4 @@ object GoldenTilesColors {
val White = Color.White.toArgb()
val White10Pc = Color(1f, 1f, 1f, 0.1f).toArgb()
val Yellow = android.graphics.Color.parseColor("#FDE293")
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.wear.tiles.golden

import android.content.Context
Expand Down Expand Up @@ -70,27 +85,27 @@ object Workout {
chipText: String,
lastWorkoutSummary: String
) = PrimaryLayout.Builder(deviceParameters)
.setPrimaryLabelTextContent(
Text.Builder(context, title)
.setTypography(Typography.TYPOGRAPHY_CAPTION1)
.setColor(ColorBuilders.argb(GoldenTilesColors.Yellow))
.build()
)
.setContent(
TitleChip.Builder(context, chipText, clickable, deviceParameters)
.setChipColors(
ChipColors(
/*backgroundColor=*/ ColorBuilders.argb(GoldenTilesColors.Yellow),
/*contentColor=*/ ColorBuilders.argb(GoldenTilesColors.Black)
)
.setPrimaryLabelTextContent(
Text.Builder(context, title)
.setTypography(Typography.TYPOGRAPHY_CAPTION1)
.setColor(ColorBuilders.argb(GoldenTilesColors.Yellow))
.build()
)
.setContent(
TitleChip.Builder(context, chipText, clickable, deviceParameters)
.setChipColors(
ChipColors(
/*backgroundColor=*/ ColorBuilders.argb(GoldenTilesColors.Yellow),
/*contentColor=*/ ColorBuilders.argb(GoldenTilesColors.Black)
)
.build()
)
.setSecondaryLabelTextContent(
Text.Builder(context, lastWorkoutSummary)
.setTypography(Typography.TYPOGRAPHY_CAPTION1)
.setColor(ColorBuilders.argb(GoldenTilesColors.White))
.build()
)
.build()
)
.build()
)
.setSecondaryLabelTextContent(
Text.Builder(context, lastWorkoutSummary)
.setTypography(Typography.TYPOGRAPHY_CAPTION1)
.setColor(ColorBuilders.argb(GoldenTilesColors.White))
.build()
)
.build()
}