Merged
Conversation
This commit adds a new composable function, `EventFolderCard`, to display event folders. The card features: - An aspect ratio of 1.5. - The event name displayed at the top, with a maximum of two lines and ellipsis for overflow. - A "more options" (three dots) icon aligned to the right of the event name. - A folder icon that fills the remaining vertical space within the card. A preview (`ComponentPreview`) is also included, showcasing a `LazyVerticalGrid` of `EventFolderCard` instances for demonstration.
This commit adds a new `CreateNewEventCard` composable for creating events and a corresponding `NewEventItem` data class. The `CreateNewEventCard` includes: - Input fields for event name and description. - Basic validation to ensure the event name is not empty. - An `onSubmit` callback that provides a `NewEventItem` instance. - A close icon. The `NewEventItem` data class holds the `eventName` and `eventDescription` strings. The preview for existing components has been updated to showcase the new `CreateNewEventCard`.
This commit introduces two new vector drawable icons: - `ic_folder_24.xml`: A standard folder icon. - `ic_image_24.xml`: An icon representing an image, styled as a framed picture with a landscape.
This commit adds the necessary permissions to `AndroidManifest.xml` for accessing media files on Android 13 (API level 33) and higher, in preparation for targeting SDK 34. Specifically, the following permissions are added: - `READ_MEDIA_IMAGES` - `READ_MEDIA_VIDEO` - `READ_MEDIA_VISUAL_USER_SELECTED` (for Android 14+ to handle partial media access reselection) The existing `READ_EXTERNAL_STORAGE` permission is now restricted to `android:maxSdkVersion="32"` for devices running Android 12L or lower.
This commit updates the `BottomNavigation` and `EventFolderCard` composables. `BottomNavigation`: - Now accepts `selectedRoute`, `navigateToHome`, and `navigateToProfile` parameters to manage selection state and navigation. - NavigationBarItems' `selected` state is dynamically set based on `selectedRoute`. - `onClick` actions for Home and Profile items now trigger the respective navigation functions. - The last NavigationBarItem, previously representing a second "Search", now also reflects the `Search` route's selection state. `EventFolderCard`: - An empty `onClick` lambda has been added to the `Card` composable. - The `Image` used to display the folder icon has been replaced with an `Icon` composable. - The folder icon's tint is now set to `MaterialTheme.colorScheme.primary`.
This commit introduces the initial structure for the `HomeScreen`. It features a `Scaffold` containing a `LazyVerticalGrid` to display a list of event folders. Each event is represented by an `EventFolderCard`. The `LazyVerticalGrid` is configured with a fixed number of two columns and spacing between items. A preview function `PreviewHomeScreen` is also included for design-time visualization.
This commit removes the `Scaffold` composable from the `HomeScreen`. The `HomeScreen` now directly uses a `Box` as its root composable. The floating action button (FAB) previously defined within the `Scaffold` has been commented out and is no longer part of the screen's layout.
This commit adds a new `Home` object to the `Routes.kt` file. This object represents the home screen destination within the application's navigation graph and is marked as `@Serializable`.
This commit integrates the `BottomNavigation` component with the `NavController` to handle navigation between screens. It also introduces a Floating Action Button (FAB) that is conditionally displayed on the `HomeScreen`. Key changes: - `MainActivity` now manages a `NavController` instance. - The `currentBackStackEntryAsState` is used to determine the current route. - `BottomNavigation` now receives the `selectedRoute` and navigation callbacks (`navigateToHome`, `navigateToProfile`) to interact with the `NavController`. - The `Home` route is now the initial destination if an access token exists. - A `FloatingActionButton` with an "Add" icon is added to the `Scaffold` and is only visible when the current route is `Home`. - `MainScreen` now accepts the `NavController` as a parameter. - The `HomeScreen` composable has been added to the `NavHost`.
This commit introduces the `DriveManager` class, responsible for interacting with the Google Drive API, specifically for creating folders. Key functionalities include: - **Token Management**: It initializes and manages an access token retrieved from `DataStorePref`. A `Mutex` is used to ensure thread-safe access to the token. The token is fetched asynchronously in a dedicated `CoroutineScope`. - **Folder Creation**: The `createFolder(folderName: String)` method creates a new folder in Google Drive with the specified name and returns its ID. - **Drive Service Initialization**: The private `getDriveService()` method configures and returns a `Drive` service instance using the managed access token, `NetHttpTransport`, and `GsonFactory`. - **Coroutine Scope Management**: A `CoroutineScope` with `Dispatchers.IO` and a `SupervisorJob` is used for background operations. A `cancelDriveManagerCoroutine()` method is provided to cancel this scope.
This commit removes the `FileUploader` class and its associated file upload logic from the `core` module. The `FileUploader` class was responsible for handling file uploads to Google Drive, including obtaining an access token, creating a `Drive` service instance, finding a destination folder, and uploading files using either a file path or a content `Uri`. This functionality is no longer present in the codebase.
This commit introduces a Hilt provider for the `DriveManager` class in the `core` module. A new `@Singleton` provider function, `providesDriveManager`, replaces the previous `providesFileUploader` function. This new function is responsible for creating and providing a single instance of `DriveManager`, injecting the required `Context` and `DataStorePref`.
This commit introduces the functionality to create folders in Google Drive. - The `ProfileViewmodel` now includes a `createFolder` method that utilizes the `DriveManager` to create a new folder with the specified name. - The `uploadFile` methods in `ProfileViewmodel` and their usage in `ProfileScreen` have been commented out, indicating a shift in focus towards folder management or a temporary removal of the upload feature. - `DriveManager` is now injected into `ProfileViewmodel` instead of `FileUploader`.
This commit updates the `MainActivity` to display the "PicCollab" title in the top app bar with an `ExtraBold` font weight.
This commit refactors the `CreateNewEventCard` composable to improve its functionality and user experience. - The card is now presented within a `Dialog`, allowing it to be displayed as a modal. - An `onCancel` lambda parameter is added, enabling the dialog to be dismissed. - An `IconButton` with a "Close" icon is added to the dialog for cancellation. - The input fields are changed from `TextField` to `OutlinedTextField`. - A "Cancel" `OutlinedButton` is added to clear input fields and trigger the `onCancel` lambda. - The "Submit" button is now labeled "Create". - The `onSubmit` logic is extracted into a `validateAndSubmit` function for better organization and reusability when submitting via the "Done" keyboard action or the "Create" button. - The title "Create New Event" now uses `MaterialTheme.typography.titleLarge`. - Spacing around elements has been adjusted for better visual layout. - The preview for `CreateNewEventCard` has been updated to include the new `onCancel` parameter.
This commit refactors the `MainActivity` by extracting the logic for displaying the `FloatingActionButton` based on the current route into a new composable function, `FloatingActionButtonByRoutes`. Additionally, the `TopAppBar`'s color customization has been commented out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.