Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

<uses-feature
android:name="android.hardware.camera"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.appnotresponding.rumbo.models

data class ChatConversation(
val chatId: String = "",
val otherUserId: String = "",
val otherUserName: String = "",
val otherUserPhotoUrl: String? = null,
val otherUserActivity: String? = null,
val lastMessage: String = "",
val lastMessageTimestamp: Long = 0
)

data class GroupChat(
val placeId: String = "",
val placeName: String = "",
val lastMessage: String = "",
val lastMessageTimestamp: Long = 0,
val mutedBy: Map<String, Boolean> = emptyMap()
)
12 changes: 12 additions & 0 deletions app/src/main/java/com/appnotresponding/rumbo/models/chatMessage.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.appnotresponding.rumbo.models

data class ChatMessage(

Check warning

Code scanning / detekt

If a source file contains only a single non-private top-level class or object, the file name should reflect the case-sensitive name plus the .kt extension. Warning

The file name 'chatMessage' does not match the name of the single top-level declaration 'ChatMessage'.
val id: String = "",
val senderId: String = "",
val senderName: String = "",
val text: String = "",
val timestamp: Long = 0,
val type: String = "text",
val placeId: String? = null,
val mediaUrl: String? = null
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package com.appnotresponding.rumbo.models

import com.google.android.gms.maps.model.LatLng

data class PlaceState(
val availablePlaces: List<Place> = emptyList(),
val itinerary: List<Place> = emptyList(),
val selectedPlace: Place? = null
val selectedPlace: Place? = null,
val focusLocation: LatLng? = null
)
7 changes: 5 additions & 2 deletions app/src/main/java/com/appnotresponding/rumbo/models/user.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ data class User(
val latitude: Double = 0.0,
val longitude: Double = 0.0,
val altitude: Double = 0.0,
val profilePictureUrl: String? = null
val profilePictureUrl: String? = null,
val sharingLocation: Boolean = false,
val activity: String? = null
)

val sampleUser = User(
Expand All @@ -22,5 +24,6 @@ val sampleUser = User(
latitude = 0.0,
longitude = 0.0,
altitude = 0.0,
profilePictureUrl = "https://randomuser.me/api/portraits/men/1.jpg"
profilePictureUrl = "https://randomuser.me/api/portraits/men/1.jpg",
sharingLocation = false
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.appnotresponding.rumbo.navigation

import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalContext
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
Expand All @@ -10,20 +9,25 @@ import com.appnotresponding.rumbo.ui.screens.auth.LogInScreen
import com.appnotresponding.rumbo.ui.screens.auth.SignUpScreen
import com.appnotresponding.rumbo.ui.screens.chat.ChatListScreen
import com.appnotresponding.rumbo.ui.screens.chat.ChatThreadScreen
import com.appnotresponding.rumbo.ui.screens.friends.FriendsScreen
import com.appnotresponding.rumbo.ui.screens.itinerary.ItineraryScreen
import com.appnotresponding.rumbo.ui.screens.map.MapScreen
import com.appnotresponding.rumbo.ui.screens.onboarding.OnBoardingScreen
import com.appnotresponding.rumbo.ui.screens.plan.PlanScreen
import com.appnotresponding.rumbo.ui.screens.splash.SplashScreen
import com.appnotresponding.rumbo.ui.viewModel.ChatThreadViewModel
import com.appnotresponding.rumbo.ui.viewModel.ChatViewModel
import com.appnotresponding.rumbo.ui.viewModel.FriendsViewModel
import com.appnotresponding.rumbo.ui.viewModel.PlacesViewModel
import androidx.lifecycle.ViewModel
import com.appnotresponding.rumbo.ui.viewModel.UserLocationViewModel

import com.appnotresponding.rumbo.ui.viewModel.UserViewModel

val placesViewModel: PlacesViewModel = PlacesViewModel()
val chatViewModel: ChatViewModel = ChatViewModel()
val chatThreadViewModel: ChatThreadViewModel = ChatThreadViewModel()
val friendsViewModel: FriendsViewModel = FriendsViewModel()

enum class AppScreens{
enum class AppScreens {
Splash,
LogIn,
SignUp,
Expand All @@ -32,43 +36,46 @@ enum class AppScreens{
ChatThread,
Plan,
Itinerary,
OnBoarding
OnBoarding,
Friends
}

@Composable
fun Navigation(
locationViewModel: UserLocationViewModel = viewModel(),
userViewModel: UserViewModel = viewModel()
){
val context = LocalContext.current
) {
val navController = rememberNavController()
NavHost(navController=navController, startDestination = AppScreens.Splash.name){
composable (route = AppScreens.Splash.name){
NavHost(navController = navController, startDestination = AppScreens.Splash.name) {
composable(route = AppScreens.Splash.name) {
SplashScreen(navController)
}
composable(route = AppScreens.LogIn.name){
composable(route = AppScreens.LogIn.name) {
LogInScreen(navController)
}
composable (route = AppScreens.SignUp.name){
composable(route = AppScreens.SignUp.name) {
SignUpScreen(navController)
}
composable (route = AppScreens.Map.name) {
MapScreen(navController, placesViewModel, locationViewModel, userViewModel)
composable(route = AppScreens.Map.name) {
MapScreen(navController, placesViewModel, locationViewModel, userViewModel, friendsViewModel)
}
composable (route = AppScreens.Chat.name) {
ChatListScreen(navController, userViewModel)
composable(route = AppScreens.Chat.name) {
ChatListScreen(navController, userViewModel, chatViewModel, placesViewModel)
}
composable(route = AppScreens.ChatThread.name){
ChatThreadScreen(navController)
composable(route = AppScreens.ChatThread.name) {
ChatThreadScreen(navController, chatViewModel, chatThreadViewModel, userViewModel, locationViewModel, placesViewModel)
}
composable(route = AppScreens.Plan.name){
composable(route = AppScreens.Plan.name) {
PlanScreen(navController, placesViewModel, locationViewModel, userViewModel)
}
composable(route = AppScreens.Itinerary.name){
composable(route = AppScreens.Itinerary.name) {
ItineraryScreen(navController, placesViewModel, userViewModel)
}
composable(route = AppScreens.OnBoarding.name){
composable(route = AppScreens.OnBoarding.name) {
OnBoardingScreen(navController)
}
composable(route = AppScreens.Friends.name) {
FriendsScreen(navController, userViewModel, friendsViewModel, chatViewModel)
}
}
}
Loading
Loading