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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ google-services.json

# Android Profiling
*.hprof

.gradle-sandbox/
5 changes: 4 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<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-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_CONTACTS" />

<uses-feature
android:name="android.hardware.camera"
Expand Down Expand Up @@ -46,4 +49,4 @@
android:value="${MAPS_API_KEY}" />

</application>
</manifest>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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 isOtherUserOnline: Boolean = false,
val lastMessage: String = "",
val lastMessageTimestamp: Long = 0,
val unreadCount: Int = 0
)

data class GroupChat(
val placeId: String = "",
val placeName: String = "",
val lastMessage: String = "",
val lastMessageTimestamp: Long = 0,
val unreadCount: Int = 0,
val mutedBy: Map<String, Boolean> = emptyMap()
)
13 changes: 13 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,13 @@
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,
val seenBy: Map<String, Boolean> = emptyMap()
)
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
)
11 changes: 8 additions & 3 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,11 @@ 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 isOnline: Boolean = false,
val lastSeenAt: Long = 0
)

val sampleUser = User(
Expand All @@ -22,5 +26,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)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
Expand All @@ -33,6 +34,7 @@ import androidx.compose.ui.unit.sp
import coil3.compose.AsyncImage
import coil3.request.ImageRequest
import coil3.request.allowHardware
import com.appnotresponding.rumbo.R
import com.appnotresponding.rumbo.models.User
import com.appnotresponding.rumbo.models.sampleUser
import com.appnotresponding.rumbo.ui.theme.RumboTheme
Expand Down Expand Up @@ -95,7 +97,7 @@ fun UserProfileBubble(
if (!user.profilePictureUrl.isNullOrEmpty() && imageLoadFailed) {
Icon(
modifier = Modifier.size(bubbleSize * 0.5f),
imageVector = Icons.Rounded.Person,
painter = painterResource(R.drawable.ic_user),
contentDescription = null,
tint = MaterialTheme.colorScheme.onSurfaceVariant
)
Expand Down
Loading
Loading