File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
mobile/src/main/java/com/windscribe/mobile/ui/serverlist Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package com.windscribe.mobile.ui.serverlist
2
2
3
3
import android.annotation.SuppressLint
4
4
import androidx.compose.foundation.Image
5
+ import androidx.compose.foundation.clickable
5
6
import androidx.compose.foundation.layout.Box
6
7
import androidx.compose.foundation.layout.Row
7
8
import androidx.compose.foundation.layout.Spacer
@@ -49,7 +50,6 @@ fun ServerListNavigation(
49
50
homeViewmodel : HomeViewmodel ,
50
51
onTabSelected : (Int ) -> Unit
51
52
) {
52
- val isHapticEnabled by homeViewmodel.hapticFeedbackEnabled.collectAsState()
53
53
val selectedType by viewModel.selectedServerListType.collectAsState()
54
54
val serverTabs = listOf (
55
55
ServerTabIcon (
@@ -147,7 +147,7 @@ fun ServerListNavigation(
147
147
Image (
148
148
painter = painterResource(if (isSelected) tab.filledIcon else tab.unfilledIcon),
149
149
contentDescription = null ,
150
- modifier = Modifier .Companion .hapticClickable() {
150
+ modifier = Modifier .Companion .clickable {
151
151
onTabSelected(index)
152
152
},
153
153
colorFilter = ColorFilter .tint(
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ fun ServerListScreen(
51
51
val hapticFeedback by homeViewmodel.hapticFeedbackEnabled.collectAsState()
52
52
val haptic = LocalHapticFeedback .current
53
53
LaunchedEffect (selectedType) {
54
+ if (hapticFeedback) {
55
+ haptic.performHapticFeedback(HapticFeedbackType .GestureEnd )
56
+ }
54
57
pagerState.animateScrollToPage(selectedType.toPageIndex())
55
58
}
56
59
LaunchedEffect (pagerState.targetPage) {
@@ -70,9 +73,6 @@ fun ServerListScreen(
70
73
state = pagerState,
71
74
modifier = Modifier .fillMaxSize(),
72
75
) { pageIndex ->
73
- if (hapticFeedback) {
74
- haptic.performHapticFeedback(HapticFeedbackType .GestureEnd )
75
- }
76
76
Box (
77
77
modifier = Modifier .fillMaxSize(),
78
78
contentAlignment = Alignment .TopStart
You can’t perform that action at this time.
0 commit comments