File tree Expand file tree Collapse file tree 12 files changed +57
-34
lines changed
app/src/main/kotlin/io/getstream/whatsappclone
calls/src/main/kotlin/io/getstream/whatsappclone/calls
chats/src/main/kotlin/io/getstream/whatsappclone/chats Expand file tree Collapse file tree 12 files changed +57
-34
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ package io.getstream.whatsappclone.navigation
1919import androidx.compose.foundation.layout.padding
2020import androidx.compose.material3.Scaffold
2121import androidx.compose.ui.Modifier
22- import androidx.hilt.navigation.compose.hiltViewModel
2322import androidx.navigation.NavGraphBuilder
2423import androidx.navigation.compose.composable
2524import io.getstream.whatsappclone.calls.info.WhatsAppCallHistoryInfo
@@ -28,8 +27,7 @@ import io.getstream.whatsappclone.model.WhatsAppUser
2827import io.getstream.whatsappclone.ui.WhatsAppTabPager
2928import io.getstream.whatsappclone.ui.WhatsAppTopBar
3029
31- fun NavGraphBuilder.whatsAppHomeNavigation (
32- ) {
30+ fun NavGraphBuilder.whatsAppHomeNavigation () {
3331 composable(route = WhatsAppScreens .Home .name) {
3432 Scaffold (topBar = { WhatsAppTopBar () }) { padding ->
3533 WhatsAppTabPager (
@@ -44,9 +42,9 @@ fun NavGraphBuilder.whatsAppHomeNavigation(
4442 ) {
4543 val channelId = it.arguments?.getString(" channelId" ) ? : return @composable
4644 WhatsAppMessages (
47- channelId = channelId,
45+ channelId = channelId
4846
49- )
47+ )
5048 }
5149
5250 composable(
@@ -57,7 +55,7 @@ fun NavGraphBuilder.whatsAppHomeNavigation(
5755 ? : return @composable
5856
5957 WhatsAppCallHistoryInfo (
60- whatsAppUser = whatsAppUser,
61- )
58+ whatsAppUser = whatsAppUser
59+ )
6260 }
6361}
Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ import io.getstream.whatsappclone.designsystem.component.WhatsAppCloneBackground
3838import io.getstream.whatsappclone.designsystem.icon.WhatsAppIcons
3939import io.getstream.whatsappclone.designsystem.theme.WHITE200
4040import io.getstream.whatsappclone.designsystem.theme.getTabPrimaryColor
41- import io.getstream.whatsappclone.navigation.AppComposeNavigator
4241import io.getstream.whatsappclone.navigation.TOP_LEVEL_DESTINATIONS
4342import io.getstream.whatsappclone.navigation.WhatsAppPage
4443import io.getstream.whatsappclone.navigation.WhatsAppPagerContent
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ fun WhatsAppCalls(
4242@Composable
4343private fun WhatsAppCallsScreen (
4444 whatsAppUsersUiState : WhatsAppUserUiState ,
45- onHistoryItemClick : (WhatsAppUser ) -> Unit ,
45+ onHistoryItemClick : (WhatsAppUser ) -> Unit
4646) {
4747 when (whatsAppUsersUiState) {
4848 WhatsAppUserUiState .Loading -> WhatsAppLoadingColumn ()
Original file line number Diff line number Diff line change @@ -26,11 +26,11 @@ import io.getstream.whatsappclone.navigation.AppComposeNavigator
2626import io.getstream.whatsappclone.navigation.WhatsAppScreens
2727import io.getstream.whatsappclone.uistate.WhatsAppUserExtensive
2828import io.getstream.whatsappclone.uistate.WhatsAppUserUiState
29+ import javax.inject.Inject
2930import kotlinx.coroutines.flow.StateFlow
3031import kotlinx.coroutines.flow.flatMapLatest
3132import kotlinx.coroutines.flow.flowOf
3233import kotlinx.coroutines.flow.stateIn
33- import javax.inject.Inject
3434
3535@HiltViewModel
3636class WhatsAppCallsViewModel @Inject constructor(
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ import androidx.compose.runtime.Composable
2323import androidx.compose.ui.Modifier
2424import androidx.hilt.navigation.compose.hiltViewModel
2525import io.getstream.whatsappclone.model.WhatsAppUser
26- import io.getstream.whatsappclone.navigation.AppComposeNavigator
2726
2827@Composable
2928fun WhatsAppCallHistoryInfo (
Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ import androidx.compose.ui.Modifier
2828import androidx.compose.ui.draw.clip
2929import androidx.compose.ui.unit.dp
3030import androidx.constraintlayout.compose.ConstraintLayout
31- import androidx.hilt.navigation.compose.hiltViewModel
3231import com.skydoves.landscapist.glide.GlideImage
3332import io.getstream.whatsappclone.designsystem.R
3433import io.getstream.whatsappclone.designsystem.icon.WhatsAppIcons
@@ -41,7 +40,7 @@ import java.util.Date
4140@Composable
4241fun WhatsAppCallHistoryInfoBody (
4342 modifier : Modifier ,
44- whatsAppUser : WhatsAppUser ,
43+ whatsAppUser : WhatsAppUser
4544
4645) {
4746 ConstraintLayout (modifier = modifier.padding(12 .dp)) {
Original file line number Diff line number Diff line change @@ -32,8 +32,6 @@ import androidx.compose.ui.unit.dp
3232import io.getstream.whatsappclone.calls.R
3333import io.getstream.whatsappclone.designsystem.icon.WhatsAppIcons
3434import io.getstream.whatsappclone.designsystem.theme.WhatsAppCloneComposeTheme
35- import io.getstream.whatsappclone.navigation.AppComposeNavigator
36- import io.getstream.whatsappclone.navigation.WhatsAppCloneComposeNavigator
3735
3836@Composable
3937fun WhatsAppCallHistoryTopBar (
@@ -44,10 +42,10 @@ fun WhatsAppCallHistoryTopBar(
4442 navigationIcon = {
4543 Icon (
4644 modifier = Modifier
47- .size(26 .dp)
48- .clickable {
49- onBackClick()
50- },
45+ .size(26 .dp)
46+ .clickable {
47+ onBackClick()
48+ },
5149 imageVector = WhatsAppIcons .ArrowBack ,
5250 tint = MaterialTheme .colorScheme.tertiary,
5351 contentDescription = null
@@ -93,7 +91,8 @@ private fun WhatsAppCallHistoryTopBarPreview() {
9391@Composable
9492private fun WhatsAppCallHistoryTopBarDarkPreview () {
9593 WhatsAppCloneComposeTheme (darkTheme = true ) {
96- WhatsAppCallHistoryTopBar (onBackClick = {}
94+ WhatsAppCallHistoryTopBar (
95+ onBackClick = {}
9796 )
9897 }
9998}
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023 Stream.IO, Inc. All Rights Reserved.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
117package io.getstream.whatsappclone.calls.info
218
319import androidx.lifecycle.ViewModel
@@ -10,7 +26,6 @@ class WhatsAppCallHistoryViewModel @Inject constructor(
1026 private val composeNavigator : AppComposeNavigator
1127) : ViewModel() {
1228
13-
1429 fun navigateUp () {
1530 composeNavigator.navigateUp()
1631 }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2023 Stream.IO, Inc. All Rights Reserved.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
117package io.getstream.whatsappclone.chats.channels
218
319import androidx.lifecycle.ViewModel
@@ -8,13 +24,10 @@ import javax.inject.Inject
824
925@HiltViewModel
1026class WhatsChannelsViewModel @Inject constructor(
11- private val composeNavigator : AppComposeNavigator ,
27+ private val composeNavigator : AppComposeNavigator
1228) : ViewModel() {
1329
14-
1530 fun navigateToMessages (channelId : String ) {
1631 composeNavigator.navigate(WhatsAppScreens .Messages .createRoute(channelId))
1732 }
18-
19-
2033}
Original file line number Diff line number Diff line change @@ -46,8 +46,6 @@ fun WhatsAppMessageTopBar(
4646 messageUiState : WhatsAppMessageUiState ,
4747 onBackClick : () -> Unit
4848) {
49-
50-
5149 SmallTopAppBar (
5250 modifier = Modifier .fillMaxWidth(),
5351 navigationIcon = {
You can’t perform that action at this time.
0 commit comments