Skip to content

Commit

Permalink
Add explanation to counter sample (#1963)
Browse files Browse the repository at this point in the history
  • Loading branch information
kul3r4 authored Jan 12, 2024
1 parent 430a59e commit da1a87e
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .idea/assetWizardSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/inspectionProfiles/ktlint.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

package com.google.android.horologist.datalayer.sample.screens.counter

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
Expand Down Expand Up @@ -73,9 +75,18 @@ fun CounterScreen(
}

is CounterScreenUiState.Loaded -> {
Text(text = "Counter: " + state.counter)
Button(onClick = onPlusClick) {
Icon(imageVector = Icons.Default.Add, contentDescription = "Plus 1")
Column(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
) {
Text(text = stringResource(R.string.app_helper_counter_increase_explanation))
Row(verticalAlignment = Alignment.CenterVertically) {
Text(text = "Counter: " + state.counter)
Button(onClick = onPlusClick) {
Icon(imageVector = Icons.Default.Add, contentDescription = "Plus 1")
}
}
}
}

Expand Down
1 change: 1 addition & 0 deletions datalayer/sample/phone/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<!-- Counter screen -->
<string name="app_helper_counter_label">Counter: %1$s</string>
<string name="app_helper_counter_increase_btn_content_description">Increase counter</string>
<string name="app_helper_counter_increase_explanation">Open the datalayer sample on your watch to observe how the counter number is incremented</string>

<!-- Start Remote Sample Activity screen -->
<string name="app_helper_start_remote_activity_message">This is a sample activity to demonstrate it being launched remotely from the watch.</string>
Expand Down

0 comments on commit da1a87e

Please sign in to comment.