Commit f75bf17 1 parent 2a08f37 commit f75bf17 Copy full SHA for f75bf17
File tree 7 files changed +24
-9
lines changed
app/src/main/java/com/example/util/simpletimetracker/navigation
wear/src/main/java/com/example/util/simpletimetracker/presentation/components
7 files changed +24
-9
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ import android.content.Intent
6
6
import androidx.activity.ComponentActivity
7
7
import androidx.navigation.NavController
8
8
import androidx.navigation.findNavController
9
- import com.example.util.simpletimetracker.feature_widget.universal.activity.view.WidgetUniversalActivity
10
9
import com.example.util.simpletimetracker.navigation.params.action.ActionParams
11
10
import com.example.util.simpletimetracker.navigation.params.notification.NotificationParams
12
11
import com.example.util.simpletimetracker.navigation.params.screen.ScreenParams
Original file line number Diff line number Diff line change @@ -43,15 +43,19 @@ fun ActivityChip(
43
43
onClick : () -> Unit = {},
44
44
) {
45
45
val isRunning = state.startedAt != null
46
- val height = if (isRunning) 56 else 44
46
+ val height = if (isRunning) {
47
+ ACTIVITY_RUNNING_VIEW_HEIGHT
48
+ } else {
49
+ ACTIVITY_VIEW_HEIGHT
50
+ }
47
51
Chip (
48
52
modifier = Modifier
49
53
.height(height.dp)
50
54
.fillMaxWidth(),
51
55
icon = {
52
56
ActivityIcon (
53
57
modifier = Modifier .height(20 .dp),
54
- activityIcon = state.icon
58
+ activityIcon = state.icon,
55
59
)
56
60
},
57
61
label = {
Original file line number Diff line number Diff line change @@ -9,8 +9,6 @@ import android.util.TypedValue
9
9
import android.view.Gravity
10
10
import androidx.appcompat.widget.AppCompatTextView
11
11
import androidx.compose.foundation.layout.aspectRatio
12
- import androidx.compose.foundation.layout.fillMaxHeight
13
- import androidx.compose.foundation.layout.height
14
12
import androidx.compose.foundation.layout.width
15
13
import androidx.compose.runtime.Composable
16
14
import androidx.compose.ui.Modifier
Original file line number Diff line number Diff line change
1
+ package com.example.util.simpletimetracker.presentation.components
2
+
3
+ internal const val ACTIVITY_VIEW_HEIGHT = 44
4
+ internal const val ACTIVITY_RUNNING_VIEW_HEIGHT = 56
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ fun RefreshButton(
42
42
},
43
43
modifier = Modifier
44
44
.rotate(targetRotation)
45
- .size(44 .dp),
45
+ .size(ACTIVITY_VIEW_HEIGHT .dp),
46
46
)
47
47
}
48
48
Original file line number Diff line number Diff line change 6
6
package com.example.util.simpletimetracker.presentation.components
7
7
8
8
import androidx.compose.foundation.layout.fillMaxWidth
9
+ import androidx.compose.foundation.layout.height
9
10
import androidx.compose.runtime.Composable
10
11
import androidx.compose.ui.Modifier
11
12
import androidx.compose.ui.graphics.Color
12
13
import androidx.compose.ui.text.style.TextOverflow
13
14
import androidx.compose.ui.tooling.preview.Preview
15
+ import androidx.compose.ui.unit.dp
14
16
import androidx.wear.compose.material.Checkbox
15
17
import androidx.wear.compose.material.CheckboxDefaults
16
18
import androidx.wear.compose.material.Chip
@@ -57,7 +59,9 @@ private fun SingleSelectTagChip(
57
59
onClick : (WearTag ) -> Unit ,
58
60
) {
59
61
Chip (
60
- modifier = Modifier .fillMaxWidth(),
62
+ modifier = Modifier
63
+ .height(ACTIVITY_VIEW_HEIGHT .dp)
64
+ .fillMaxWidth(),
61
65
onClick = {
62
66
onClick(tag)
63
67
},
@@ -81,7 +85,9 @@ private fun MultiSelectTagChip(
81
85
checked : Boolean ,
82
86
) {
83
87
SplitToggleChip (
84
- modifier = Modifier .fillMaxWidth(),
88
+ modifier = Modifier
89
+ .height(ACTIVITY_VIEW_HEIGHT .dp)
90
+ .fillMaxWidth(),
85
91
checked = checked,
86
92
onCheckedChange = {
87
93
onClick(tag)
Original file line number Diff line number Diff line change 6
6
package com.example.util.simpletimetracker.presentation.components
7
7
8
8
import androidx.compose.foundation.layout.fillMaxWidth
9
+ import androidx.compose.foundation.layout.height
9
10
import androidx.compose.runtime.Composable
10
11
import androidx.compose.ui.Modifier
11
12
import androidx.compose.ui.graphics.Color
12
13
import androidx.compose.ui.text.style.TextAlign
13
14
import androidx.compose.ui.text.style.TextOverflow
14
15
import androidx.compose.ui.tooling.preview.Preview
16
+ import androidx.compose.ui.unit.dp
15
17
import androidx.wear.compose.material.Chip
16
18
import androidx.wear.compose.material.ChipDefaults
17
19
import androidx.wear.compose.material.Text
@@ -26,6 +28,9 @@ fun TagSelectionButton(
26
28
onClick : () -> Unit = {},
27
29
) {
28
30
Chip (
31
+ modifier = Modifier
32
+ .height(ACTIVITY_VIEW_HEIGHT .dp)
33
+ .fillMaxWidth(),
29
34
onClick = onClick,
30
35
label = {
31
36
Text (
@@ -39,7 +44,6 @@ fun TagSelectionButton(
39
44
colors = ChipDefaults .chipColors(
40
45
backgroundColor = color,
41
46
),
42
- modifier = Modifier .fillMaxWidth(),
43
47
)
44
48
}
45
49
You can’t perform that action at this time.
0 commit comments