├── .gitignore ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── xtremedevx │ │ └── gmail │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── xtremedevx │ │ │ └── gmail │ │ │ ├── MainActivity.kt │ │ │ ├── navigation │ │ │ ├── bottomNavigation │ │ │ │ ├── BottomBar.kt │ │ │ │ ├── BottomBarScreens.kt │ │ │ │ ├── BottomNavGraph.kt │ │ │ │ └── NavigationItem.kt │ │ │ └── drawer │ │ │ │ ├── DrawerItem.kt │ │ │ │ ├── MenuItem.kt │ │ │ │ └── NavigationDrawer.kt │ │ │ ├── screen │ │ │ ├── MailFloatingActionButton.kt │ │ │ ├── MailItem.kt │ │ │ ├── MailScreen.kt │ │ │ ├── MainScreen.kt │ │ │ ├── MeetPagerScreen.kt │ │ │ ├── MeetScreen.kt │ │ │ └── UserDialogScreen.kt │ │ │ ├── ui │ │ │ └── theme │ │ │ │ ├── Color.kt │ │ │ │ ├── Shape.kt │ │ │ │ ├── Theme.kt │ │ │ │ └── Type.kt │ │ │ ├── user │ │ │ └── data │ │ │ │ └── MailItem.kt │ │ │ └── utils │ │ │ └── MeetScreenPages.kt │ └── res │ │ ├── drawable-v24 │ │ ├── amazon_logo.png │ │ ├── dropbox_logo.png │ │ ├── facebook_logo.png │ │ ├── google.png │ │ ├── google_logo.png │ │ ├── ic_launcher_foreground.xml │ │ ├── netflix_logo.jpg │ │ ├── profile.jpg │ │ ├── protonmail_logo.jpg │ │ ├── safety_first.jpg │ │ ├── share_link.jpg │ │ ├── signal_logo.png │ │ ├── swiggy_logo.jpg │ │ └── twitter_logo.jpg │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ │ └── xml │ │ ├── backup_rules.xml │ │ └── data_extraction_rules.xml │ └── test │ └── java │ └── com │ └── xtremedevx │ └── gmail │ └── ExampleUnitTest.kt ├── assets ├── gmail_clone.mp4 └── images │ ├── dialog.jpg │ ├── drawer.jpg │ ├── mail.jpg │ └── meet.jpg ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | 17 | # Gradle files 18 | .gradle/ 19 | build/ 20 | 21 | # Local configuration file (sdk path, etc) 22 | local.properties 23 | 24 | # Log/OS Files 25 | *.log 26 | 27 | # Android Studio generated files and folders 28 | captures/ 29 | .externalNativeBuild/ 30 | .cxx/ 31 | *.apk 32 | output.json 33 | 34 | # IntelliJ 35 | *.iml 36 | .idea/ 37 | misc.xml 38 | deploymentTargetDropDown.xml 39 | render.experimental.xml 40 | 41 | # Keystore files 42 | *.jks 43 | *.keystore 44 | 45 | # Google Services (e.g. APIs or Firebase) 46 | google-services.json 47 | 48 | # Android Profiling 49 | *.hprof -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Harsh Silori 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Gmail Compose 3 |

4 | 5 | This is a clone of Google's Gmail App main UI using *Android's new UI Development Toolkit*: [**Jetpack Compose.**](https://developer.android.com/jetpack/compose) 6 | 7 | The goal of this project is to practice UI building with both Jetpack Compose & Material Design. 8 | 9 | ## 📷 Screenshots 📷 10 | 11 | Mail | Meet | Dialog | Drawer | 12 | :------:|:---------------------:|:-----------------------------:|:-------------:| 13 | ![](./assets/images/mail.jpg) | ![](./assets/images/meet.jpg) | ![](./assets/images/dialog.jpg) | ![](./assets/images/drawer.jpg) 14 | 15 | 16 | ## 📹 Live Demo 📹 17 | https://user-images.githubusercontent.com/99537110/200489245-dd9824ea-0fdb-43a0-ae36-9e1c90abb7f3.mp4 18 | ## 🪶 Author(s) 🪶 19 | 20 | **Silori**, [*@AndroidRegiment*](https://github.com/AndroidRegiment). 21 | 22 | App Programmer & UI Desginer. 23 | 24 | **Jon Areas**, [*@jxareas*](https://github.com/jxareas). 25 | 26 | Editor & Collaborator. 27 | 28 | 29 | ## License 30 | ``` 31 | MIT License 32 | 33 | Copyright (c) 2022 Harsh Silori 34 | 35 | Permission is hereby granted, free of charge, to any person obtaining a copy 36 | of this software and associated documentation files (the "Software"), to deal 37 | in the Software without restriction, including without limitation the rights 38 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 39 | copies of the Software, and to permit persons to whom the Software is 40 | furnished to do so, subject to the following conditions: 41 | 42 | The above copyright notice and this permission notice shall be included in all 43 | copies or substantial portions of the Software. 44 | 45 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 46 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 47 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 48 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 49 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 50 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 51 | SOFTWARE. 52 | ``` 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | id 'org.jetbrains.kotlin.android' 4 | } 5 | 6 | android { 7 | compileSdk 32 8 | 9 | defaultConfig { 10 | applicationId "com.xtremedevx.gmail" 11 | minSdk 23 12 | targetSdk 32 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | vectorDrawables { 18 | useSupportLibrary true 19 | } 20 | } 21 | 22 | buildTypes { 23 | release { 24 | minifyEnabled false 25 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 26 | } 27 | } 28 | compileOptions { 29 | sourceCompatibility JavaVersion.VERSION_1_8 30 | targetCompatibility JavaVersion.VERSION_1_8 31 | } 32 | kotlinOptions { 33 | jvmTarget = '1.8' 34 | freeCompilerArgs = ['-Xjvm-default=enable'] 35 | 36 | } 37 | buildFeatures { 38 | compose true 39 | } 40 | composeOptions { 41 | kotlinCompilerExtensionVersion compose_version 42 | } 43 | packagingOptions { 44 | resources { 45 | excludes += '/META-INF/{AL2.0,LGPL2.1}' 46 | } 47 | } 48 | } 49 | 50 | dependencies { 51 | 52 | implementation 'androidx.core:core-ktx:1.7.0' 53 | implementation "androidx.compose.ui:ui:$compose_version" 54 | implementation "androidx.compose.material:material:$compose_version" 55 | implementation "androidx.compose.ui:ui-tooling-preview:$compose_version" 56 | implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1' 57 | implementation 'androidx.activity:activity-compose:1.3.1' 58 | testImplementation 'junit:junit:4.13.2' 59 | androidTestImplementation 'androidx.test.ext:junit:1.1.3' 60 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' 61 | androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version" 62 | debugImplementation "androidx.compose.ui:ui-tooling:$compose_version" 63 | debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version" 64 | 65 | // Navigation 66 | implementation "androidx.navigation:navigation-compose:$nav_version" 67 | 68 | // Icons 69 | implementation "androidx.compose.material:material-icons-extended:$compose_version" 70 | 71 | //ViewPager 72 | implementation "com.google.accompanist:accompanist-pager:$accompanist_version" 73 | implementation "com.google.accompanist:accompanist-pager-indicators:$accompanist_version" 74 | 75 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/androidTest/java/com/xtremedevx/gmail/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.xtremedevx.gmail", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 16 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail 2 | 3 | import android.os.Bundle 4 | import androidx.activity.ComponentActivity 5 | import androidx.activity.compose.setContent 6 | import androidx.navigation.compose.rememberNavController 7 | import com.xtremedevx.gmail.screen.MainScreen 8 | import com.xtremedevx.gmail.ui.theme.GmailTheme 9 | 10 | class MainActivity : ComponentActivity() { 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | setContent { 14 | GmailTheme { 15 | val navController = rememberNavController() 16 | MainScreen( 17 | navController = navController 18 | ) 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/navigation/bottomNavigation/BottomBar.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.navigation.bottomNavigation 2 | 3 | import androidx.compose.foundation.layout.* 4 | import androidx.compose.material.Icon 5 | import androidx.compose.material.Text 6 | import androidx.compose.runtime.Composable 7 | import androidx.compose.runtime.getValue 8 | import androidx.compose.ui.Alignment 9 | import androidx.compose.ui.Modifier 10 | import androidx.compose.ui.unit.dp 11 | import androidx.navigation.NavController 12 | import androidx.navigation.NavDestination 13 | import androidx.navigation.NavDestination.Companion.hierarchy 14 | import androidx.navigation.NavGraph.Companion.findStartDestination 15 | import androidx.navigation.compose.currentBackStackEntryAsState 16 | 17 | @Composable 18 | fun BottomBar( 19 | navController: NavController 20 | ) { 21 | val screens = listOf( 22 | BottomBarScreens.MailScreen, 23 | BottomBarScreens.MeetScreen, 24 | ) 25 | val navBackStackEntry by navController.currentBackStackEntryAsState() 26 | val currentDestination = navBackStackEntry?.destination 27 | 28 | Row( 29 | modifier = Modifier 30 | .height(56.dp) 31 | .fillMaxWidth(), 32 | horizontalArrangement = Arrangement.SpaceEvenly, 33 | verticalAlignment = Alignment.CenterVertically, 34 | 35 | ) { 36 | screens.forEach { screen -> 37 | AddItem( 38 | 39 | screen = screen, 40 | navController = navController, 41 | currentDestination = currentDestination, 42 | ) 43 | } 44 | } 45 | } 46 | 47 | @Composable 48 | fun RowScope.AddItem( 49 | screen: BottomBarScreens, 50 | navController: NavController, 51 | currentDestination: NavDestination? 52 | ) { 53 | val selected = currentDestination?.hierarchy?.any { 54 | it.route == screen.route 55 | } == true 56 | 57 | NavigationItem( 58 | label = { 59 | Text(text = screen.title) 60 | }, 61 | selected = selected, 62 | icon = { 63 | Icon( 64 | imageVector = if (selected) screen.filledIcon else screen.outlinedIcon, 65 | contentDescription = null 66 | ) 67 | }, 68 | onClickEvent = { 69 | navController.navigate(screen.route) { 70 | popUpTo(navController.graph.findStartDestination().id) 71 | launchSingleTop = true 72 | } 73 | }, 74 | ) 75 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/navigation/bottomNavigation/BottomBarScreens.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.navigation.bottomNavigation 2 | 3 | import androidx.compose.material.icons.Icons 4 | import androidx.compose.material.icons.filled.Mail 5 | import androidx.compose.material.icons.filled.Videocam 6 | import androidx.compose.material.icons.outlined.Mail 7 | import androidx.compose.material.icons.outlined.Videocam 8 | import androidx.compose.ui.graphics.vector.ImageVector 9 | 10 | 11 | sealed class BottomBarScreens( 12 | val route: String, 13 | val title: String, 14 | val outlinedIcon: ImageVector, 15 | val filledIcon: ImageVector, 16 | ) { 17 | object MailScreen : BottomBarScreens( 18 | route = "mail", 19 | title = "Mail", 20 | outlinedIcon = Icons.Outlined.Mail, 21 | filledIcon = Icons.Filled.Mail 22 | ) 23 | 24 | object MeetScreen : BottomBarScreens( 25 | route = "meet", 26 | title = "Meet", 27 | outlinedIcon = Icons.Outlined.Videocam, 28 | filledIcon = Icons.Filled.Videocam, 29 | ) 30 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/navigation/bottomNavigation/BottomNavGraph.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.navigation.bottomNavigation 2 | 3 | import androidx.compose.runtime.Composable 4 | import androidx.navigation.NavHostController 5 | import androidx.navigation.compose.NavHost 6 | import androidx.navigation.compose.composable 7 | import com.xtremedevx.gmail.screen.MailScreen 8 | import com.xtremedevx.gmail.screen.MeetScreen 9 | 10 | @Composable 11 | fun BottomNavGraph( 12 | navController: NavHostController, 13 | onNavigationIconClick: () -> Unit, 14 | onShowUserDialog: () -> Unit, 15 | 16 | ) { 17 | NavHost( 18 | navController = navController, 19 | startDestination = BottomBarScreens.MailScreen.route, 20 | ) { 21 | composable( 22 | BottomBarScreens.MailScreen.route 23 | ) { 24 | MailScreen( 25 | onNavigationIconClick = onNavigationIconClick, 26 | onShowUserDialog = onShowUserDialog 27 | ) 28 | } 29 | 30 | composable( 31 | BottomBarScreens.MeetScreen.route 32 | ) 33 | { 34 | MeetScreen( 35 | onNavigationIconClick = onNavigationIconClick, 36 | onShowUserDialog = onShowUserDialog 37 | ) 38 | 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/navigation/bottomNavigation/NavigationItem.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.navigation.bottomNavigation 2 | 3 | import androidx.compose.animation.AnimatedVisibility 4 | import androidx.compose.animation.animateColorAsState 5 | import androidx.compose.foundation.layout.* 6 | import androidx.compose.foundation.selection.selectable 7 | import androidx.compose.foundation.shape.CircleShape 8 | import androidx.compose.material.Surface 9 | import androidx.compose.runtime.Composable 10 | import androidx.compose.runtime.getValue 11 | import androidx.compose.ui.Alignment 12 | import androidx.compose.ui.Modifier 13 | import androidx.compose.ui.graphics.Color 14 | import androidx.compose.ui.unit.dp 15 | import com.xtremedevx.gmail.ui.theme.SkyBlue 16 | 17 | @Composable 18 | fun RowScope.NavigationItem( 19 | label: @Composable () -> Unit, 20 | icon: @Composable () -> Unit, 21 | selected: Boolean, 22 | onClickEvent: () -> Unit, 23 | ) { 24 | val backgroundColor by animateColorAsState(targetValue = if (selected) SkyBlue else Color.White) 25 | 26 | Box( 27 | modifier = Modifier.weight(1f), 28 | contentAlignment = Alignment.Center, 29 | ) { 30 | Surface( 31 | modifier = Modifier.wrapContentWidth(), 32 | shape = CircleShape, 33 | color = backgroundColor, 34 | ) { 35 | Row( 36 | modifier = Modifier 37 | .selectable( 38 | selected = selected, onClick = onClickEvent 39 | ) 40 | .padding(horizontal = 16.dp, vertical = 4.dp), 41 | verticalAlignment = Alignment.CenterVertically 42 | 43 | ) { 44 | icon() 45 | AnimatedVisibility(visible = selected) { 46 | label() 47 | } 48 | } 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/navigation/drawer/DrawerItem.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.navigation.drawer 2 | 3 | import androidx.compose.foundation.layout.* 4 | import androidx.compose.material.Icon 5 | import androidx.compose.material.Text 6 | import androidx.compose.runtime.Composable 7 | import androidx.compose.ui.Alignment 8 | import androidx.compose.ui.Modifier 9 | import androidx.compose.ui.text.TextStyle 10 | import androidx.compose.ui.unit.dp 11 | import androidx.compose.ui.unit.sp 12 | 13 | @Composable 14 | fun DrawerItem( 15 | item: MenuItem, 16 | itemTextStyle: TextStyle = TextStyle(fontSize = 18.sp), 17 | ) { 18 | Row( 19 | modifier = Modifier 20 | .fillMaxWidth() 21 | .padding(16.dp), 22 | verticalAlignment = Alignment.CenterVertically, 23 | ) { 24 | Icon(imageVector = item.icon, contentDescription = null) 25 | Spacer(modifier = Modifier.width(16.dp)) 26 | Text(text = item.title, style = itemTextStyle) 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/navigation/drawer/MenuItem.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.navigation.drawer 2 | 3 | import androidx.compose.material.icons.Icons 4 | import androidx.compose.material.icons.outlined.* 5 | import androidx.compose.ui.graphics.vector.ImageVector 6 | 7 | data class MenuItem( 8 | val id: String, 9 | val title: String, 10 | val icon: ImageVector, 11 | ) 12 | 13 | val navScreenItemList = listOf( 14 | MenuItem( 15 | id = "primary", 16 | title = "Primary", 17 | icon = Icons.Outlined.Inbox, 18 | ), 19 | MenuItem( 20 | id = "promotion", 21 | title = "Promotion", 22 | icon = Icons.Outlined.Sell, 23 | ), 24 | MenuItem( 25 | id = "social", 26 | title = "Social", 27 | icon = Icons.Outlined.Group, 28 | ), 29 | 30 | ) 31 | 32 | val googleAppsItemList = listOf( 33 | MenuItem( 34 | id = "calendar", 35 | title = "Calendar", 36 | icon = Icons.Outlined.CalendarToday, 37 | ), 38 | MenuItem( 39 | id = "contacts", 40 | title = "Contacts", 41 | icon = Icons.Outlined.AccountCircle, 42 | ), 43 | 44 | ) 45 | 46 | 47 | val allLabelsItemList = listOf( 48 | MenuItem( 49 | id = "starred", 50 | title = "Starred", 51 | icon = Icons.Outlined.Star, 52 | ), 53 | MenuItem( 54 | id = "snoozed", 55 | title = "Snoozed", 56 | icon = Icons.Outlined.Schedule, 57 | ), 58 | MenuItem( 59 | id = "important", 60 | title = "Important", 61 | icon = Icons.Outlined.LabelImportant, 62 | ), 63 | MenuItem( 64 | id = "sent", 65 | title = "Sent", 66 | icon = Icons.Outlined.Send, 67 | ), 68 | MenuItem( 69 | id = "scheduled", 70 | title = "Scheduled", 71 | icon = Icons.Outlined.ScheduleSend, 72 | ), 73 | MenuItem( 74 | id = "outbox", 75 | title = "Outbox", 76 | icon = Icons.Outlined.Outbox, 77 | ), 78 | MenuItem( 79 | id = "draft", 80 | title = "Draft", 81 | icon = Icons.Outlined.Drafts, 82 | ), 83 | MenuItem( 84 | id = "allMails", 85 | title = "All mail", 86 | icon = Icons.Outlined.MarkAsUnread, 87 | ), 88 | MenuItem( 89 | id = "spam", 90 | title = "Spam", 91 | icon = Icons.Outlined.Report, 92 | ), 93 | MenuItem( 94 | id = "bin", 95 | title = "Bin", 96 | icon = Icons.Outlined.Delete, 97 | ), 98 | 99 | ) 100 | 101 | 102 | val extraItemList = listOf( 103 | MenuItem( 104 | id = "settings", 105 | title = "Settings", 106 | icon = Icons.Outlined.Settings, 107 | ), 108 | MenuItem( 109 | id = "helpAndFeedBack", 110 | title = "Help and feedback", 111 | icon = Icons.Outlined.Help, 112 | ), 113 | 114 | ) 115 | 116 | -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/navigation/drawer/NavigationDrawer.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.navigation.drawer 2 | 3 | import androidx.compose.foundation.layout.* 4 | import androidx.compose.foundation.lazy.LazyColumn 5 | import androidx.compose.foundation.lazy.items 6 | import androidx.compose.material.Divider 7 | import androidx.compose.material.Text 8 | import androidx.compose.runtime.Composable 9 | import androidx.compose.ui.Modifier 10 | import androidx.compose.ui.graphics.Color 11 | import androidx.compose.ui.unit.dp 12 | 13 | 14 | @Composable 15 | fun DrawerMenuHeader() { 16 | Box( 17 | modifier = Modifier 18 | .fillMaxWidth() 19 | .height(70.dp) 20 | .padding(16.dp) 21 | ) { 22 | Text(text = "Gmail", color = Color.Red) 23 | } 24 | } 25 | 26 | @Composable 27 | fun DrawerBody() { 28 | LazyColumn( 29 | modifier = Modifier.fillMaxWidth(), 30 | ) { 31 | item { 32 | DrawerMenuHeader() 33 | } 34 | 35 | 36 | item { 37 | Divider( 38 | modifier = Modifier 39 | .fillMaxWidth() 40 | .height(1.dp), color = Color.LightGray 41 | ) 42 | } 43 | 44 | items(navScreenItemList) { item -> 45 | DrawerItem(item = item) 46 | } 47 | item { 48 | Text(text = "All labels", modifier = Modifier.padding(horizontal = 16.dp)) 49 | } 50 | items(allLabelsItemList) { item -> 51 | DrawerItem(item = item) 52 | } 53 | item { 54 | Text(text = "Google apps", modifier = Modifier.padding(horizontal = 16.dp)) 55 | } 56 | items(googleAppsItemList) { item -> 57 | DrawerItem(item = item) 58 | } 59 | item { 60 | Divider( 61 | modifier = Modifier 62 | .fillMaxWidth() 63 | .height(1.dp), color = Color.LightGray 64 | ) 65 | } 66 | items(extraItemList) { item -> 67 | DrawerItem(item = item) 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/screen/MailFloatingActionButton.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.screen 2 | 3 | import androidx.compose.animation.AnimatedVisibility 4 | import androidx.compose.foundation.layout.Row 5 | import androidx.compose.foundation.layout.padding 6 | import androidx.compose.material.FloatingActionButton 7 | import androidx.compose.material.Icon 8 | import androidx.compose.material.Text 9 | import androidx.compose.material.icons.Icons 10 | import androidx.compose.material.icons.outlined.Edit 11 | import androidx.compose.runtime.Composable 12 | import androidx.compose.ui.Modifier 13 | import androidx.compose.ui.res.stringResource 14 | import androidx.compose.ui.unit.dp 15 | import com.xtremedevx.gmail.R 16 | 17 | @Composable 18 | fun MailFloatingActionButton( 19 | extended: () -> Boolean, 20 | onClick: () -> Unit, 21 | modifier: Modifier = Modifier 22 | ) { 23 | FloatingActionButton( 24 | onClick = { onClick() }, 25 | modifier = modifier 26 | ) { 27 | Row( 28 | modifier = Modifier.padding(16.dp) 29 | ) { 30 | 31 | Icon(imageVector = Icons.Outlined.Edit, contentDescription = null) 32 | 33 | AnimatedVisibility(visible = extended()) { 34 | Text( 35 | text = stringResource(id = R.string.compose), modifier = Modifier 36 | .padding(start = 8.dp, top = 3.dp) 37 | ) 38 | 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/screen/MailItem.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.screen 2 | 3 | import androidx.compose.foundation.Image 4 | import androidx.compose.foundation.layout.* 5 | import androidx.compose.foundation.shape.CircleShape 6 | import androidx.compose.material.Icon 7 | import androidx.compose.material.Text 8 | import androidx.compose.material.icons.Icons 9 | import androidx.compose.material.icons.outlined.Grade 10 | import androidx.compose.runtime.Composable 11 | import androidx.compose.ui.Alignment 12 | import androidx.compose.ui.Modifier 13 | import androidx.compose.ui.draw.clip 14 | import androidx.compose.ui.res.painterResource 15 | import androidx.compose.ui.text.font.FontWeight 16 | import androidx.compose.ui.unit.dp 17 | import com.xtremedevx.gmail.user.data.MailItem 18 | 19 | 20 | @Composable 21 | fun ShowMailItem( 22 | mailItem: MailItem, 23 | ) { 24 | Row(modifier = Modifier.fillMaxWidth()) { 25 | Box(modifier = Modifier.size(70.dp), contentAlignment = Alignment.Center) { 26 | Image( 27 | painter = painterResource(id = mailItem.profileId), 28 | modifier = Modifier 29 | .size(50.dp) 30 | .clip(CircleShape), contentDescription = null 31 | ) 32 | } 33 | Column(modifier = Modifier.fillMaxWidth()) { 34 | Row(modifier = Modifier.fillMaxWidth()) { 35 | Text( 36 | text = mailItem.senderName, 37 | fontWeight = FontWeight.Bold, 38 | modifier = Modifier.weight(1f) 39 | ) 40 | Text(text = mailItem.mailDate) 41 | Spacer(modifier = Modifier.width(5.dp)) 42 | } 43 | Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.Bottom) { 44 | Column(modifier = Modifier.weight(1f)) { 45 | Text(text = mailItem.mailSubject, modifier = Modifier.fillMaxWidth()) 46 | Text(text = mailItem.mailContent, modifier = Modifier.fillMaxWidth()) 47 | } 48 | 49 | Icon(imageVector = Icons.Outlined.Grade, contentDescription = null) 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/screen/MailScreen.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.screen 2 | 3 | import androidx.compose.foundation.layout.* 4 | import androidx.compose.foundation.lazy.LazyColumn 5 | import androidx.compose.foundation.lazy.items 6 | import androidx.compose.foundation.lazy.rememberLazyListState 7 | import androidx.compose.foundation.shape.RoundedCornerShape 8 | import androidx.compose.material.* 9 | import androidx.compose.material.icons.Icons 10 | import androidx.compose.material.icons.filled.Menu 11 | import androidx.compose.material.icons.filled.Person 12 | import androidx.compose.runtime.* 13 | import androidx.compose.ui.Alignment 14 | import androidx.compose.ui.Modifier 15 | import androidx.compose.ui.geometry.Offset 16 | import androidx.compose.ui.graphics.Color 17 | import androidx.compose.ui.input.nestedscroll.NestedScrollConnection 18 | import androidx.compose.ui.input.nestedscroll.NestedScrollSource 19 | import androidx.compose.ui.input.nestedscroll.nestedScroll 20 | import androidx.compose.ui.platform.LocalDensity 21 | import androidx.compose.ui.unit.IntOffset 22 | import androidx.compose.ui.unit.dp 23 | import com.xtremedevx.gmail.ui.theme.LightBlue 24 | import com.xtremedevx.gmail.user.data.mailsList 25 | import kotlin.math.roundToInt 26 | 27 | 28 | @Composable 29 | fun MailScreen( 30 | onNavigationIconClick: () -> Unit, 31 | onShowUserDialog: () -> Unit, 32 | ) { 33 | val toolbarHeightInDp = 58.dp 34 | val toolbarHeightInPx = with(LocalDensity.current) { 35 | toolbarHeightInDp.roundToPx().toFloat() 36 | } 37 | var toolbarHeightOffset by remember { 38 | mutableStateOf(0f) 39 | } 40 | val lazyListState = rememberLazyListState() 41 | val extendState by remember { derivedStateOf { lazyListState.firstVisibleItemIndex < 2 } } 42 | 43 | val nestedScrollConnection = remember { 44 | object : NestedScrollConnection { 45 | override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset { 46 | val yOffset = available.y 47 | val newOffset = toolbarHeightOffset + yOffset 48 | toolbarHeightOffset = 49 | newOffset.coerceIn(minimumValue = -toolbarHeightInPx, maximumValue = 0f) 50 | return Offset.Zero 51 | } 52 | } 53 | } 54 | 55 | 56 | Box( 57 | modifier = Modifier 58 | .fillMaxSize() 59 | ) { 60 | LazyColumn( 61 | state = lazyListState, 62 | modifier = Modifier 63 | .fillMaxSize() 64 | .nestedScroll(nestedScrollConnection), 65 | contentPadding = PaddingValues(top = toolbarHeightInDp), 66 | verticalArrangement = Arrangement.spacedBy(16.dp) 67 | 68 | ) { 69 | 70 | items(mailsList) { item -> 71 | ShowMailItem(mailItem = item) 72 | } 73 | } 74 | 75 | TopAppBar( 76 | elevation = 0.dp, 77 | backgroundColor = Color.White, 78 | contentColor = Color.Black, 79 | 80 | modifier = Modifier 81 | .height(toolbarHeightInDp) 82 | .fillMaxWidth() 83 | .offset { IntOffset(x = 0, y = toolbarHeightOffset.roundToInt()) } 84 | 85 | ) { 86 | Spacer(modifier = Modifier.width(8.dp)) 87 | TextField( 88 | 89 | value = "", 90 | onValueChange = {}, 91 | modifier = Modifier 92 | .weight(1f) 93 | .padding(4.dp), 94 | placeholder = { Text(text = "Search in mail") }, 95 | 96 | leadingIcon = { 97 | IconButton(onClick = { onNavigationIconClick() }) { 98 | Icon(imageVector = Icons.Default.Menu, contentDescription = null) 99 | } 100 | }, 101 | trailingIcon = { 102 | 103 | IconButton(onClick = { onShowUserDialog() }) { 104 | Icon( 105 | imageVector = Icons.Filled.Person, 106 | contentDescription = null, 107 | ) 108 | } 109 | 110 | }, 111 | colors = TextFieldDefaults.textFieldColors( 112 | backgroundColor = LightBlue, 113 | textColor = Color.Black, 114 | cursorColor = Color.Black, 115 | focusedIndicatorColor = Color.Transparent, 116 | unfocusedIndicatorColor = Color.Transparent, 117 | disabledIndicatorColor = Color.Transparent 118 | ), 119 | 120 | shape = RoundedCornerShape(percent = 50) 121 | ) 122 | 123 | } 124 | MailFloatingActionButton( 125 | extended = { extendState }, 126 | onClick = {}, 127 | modifier = Modifier 128 | .align( 129 | Alignment.BottomEnd 130 | ) 131 | .offset(x = (-10).dp, y = (-10).dp) 132 | ) 133 | 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/screen/MainScreen.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.screen 2 | 3 | import androidx.compose.foundation.layout.Box 4 | import androidx.compose.foundation.layout.padding 5 | import androidx.compose.material.Scaffold 6 | import androidx.compose.material.rememberScaffoldState 7 | import androidx.compose.runtime.* 8 | import androidx.compose.ui.Modifier 9 | import androidx.navigation.NavHostController 10 | import com.xtremedevx.gmail.navigation.bottomNavigation.BottomBar 11 | import com.xtremedevx.gmail.navigation.bottomNavigation.BottomNavGraph 12 | import com.xtremedevx.gmail.navigation.drawer.DrawerBody 13 | import kotlinx.coroutines.launch 14 | 15 | 16 | @Composable 17 | fun MainScreen(navController: NavHostController) { 18 | val scaffoldState = rememberScaffoldState() 19 | val scope = rememberCoroutineScope() 20 | var isDialogOpen by remember { 21 | mutableStateOf(false) 22 | } 23 | Scaffold( 24 | scaffoldState = scaffoldState, 25 | drawerContent = { 26 | DrawerBody() 27 | }, bottomBar = { 28 | BottomBar(navController = navController) 29 | }) { paddingValues -> 30 | Box(modifier = Modifier.padding(paddingValues = paddingValues)) { 31 | BottomNavGraph(navController = navController, 32 | onNavigationIconClick = { 33 | scope.launch { 34 | scaffoldState.drawerState.open() 35 | } 36 | }, 37 | onShowUserDialog = { isDialogOpen = true } 38 | ) 39 | 40 | if (isDialogOpen) { 41 | ShowUserDialog(onCloseUserDialog = { isDialogOpen = false }) 42 | } 43 | 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/screen/MeetPagerScreen.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.screen 2 | 3 | import androidx.compose.foundation.Image 4 | import androidx.compose.foundation.layout.* 5 | import androidx.compose.foundation.shape.CircleShape 6 | import androidx.compose.material.Text 7 | import androidx.compose.runtime.Composable 8 | import androidx.compose.ui.Alignment 9 | import androidx.compose.ui.Modifier 10 | import androidx.compose.ui.draw.clip 11 | import androidx.compose.ui.layout.ContentScale 12 | import androidx.compose.ui.res.painterResource 13 | import androidx.compose.ui.text.font.FontWeight 14 | import androidx.compose.ui.text.style.TextAlign 15 | import androidx.compose.ui.unit.dp 16 | import androidx.compose.ui.unit.sp 17 | import com.google.accompanist.pager.ExperimentalPagerApi 18 | import com.google.accompanist.pager.HorizontalPager 19 | import com.google.accompanist.pager.HorizontalPagerIndicator 20 | import com.google.accompanist.pager.rememberPagerState 21 | import com.xtremedevx.gmail.ui.theme.DarkBlue 22 | import com.xtremedevx.gmail.utils.MeetScreenPages 23 | 24 | 25 | @OptIn(ExperimentalPagerApi::class) 26 | @Composable 27 | fun MeetPagerScreen() { 28 | val pages = listOf( 29 | MeetScreenPages.First, 30 | MeetScreenPages.Second, 31 | ) 32 | val pagerState = rememberPagerState() 33 | 34 | Column(modifier = Modifier.fillMaxSize()) { 35 | HorizontalPager( 36 | modifier = Modifier.weight(10f), 37 | count = 2, 38 | state = pagerState, 39 | verticalAlignment = Alignment.Top 40 | ) { position -> 41 | PagerScreen(meetScreenPage = pages[position]) 42 | } 43 | HorizontalPagerIndicator( 44 | modifier = Modifier 45 | .align(Alignment.CenterHorizontally) 46 | .weight(1f), 47 | pagerState = pagerState, 48 | activeColor = DarkBlue, 49 | ) 50 | 51 | } 52 | } 53 | 54 | 55 | @Composable 56 | fun PagerScreen(meetScreenPage: MeetScreenPages) { 57 | Column( 58 | modifier = Modifier.fillMaxSize(), 59 | horizontalAlignment = Alignment.CenterHorizontally, 60 | verticalArrangement = Arrangement.Center 61 | ) { 62 | Image( 63 | modifier = Modifier 64 | .size(150.dp) 65 | .clip(CircleShape), 66 | painter = painterResource(id = meetScreenPage.image), contentDescription = null, 67 | contentScale = ContentScale.Crop 68 | ) 69 | Spacer(modifier = Modifier.height(8.dp)) 70 | Text( 71 | text = meetScreenPage.title, 72 | fontWeight = FontWeight.Bold, 73 | fontSize = 18.sp, 74 | modifier = Modifier.fillMaxWidth(.6f), 75 | textAlign = TextAlign.Center, 76 | ) 77 | 78 | Spacer(modifier = Modifier.height(8.dp)) 79 | Text( 80 | text = meetScreenPage.description, 81 | fontSize = 16.sp, 82 | modifier = Modifier.fillMaxWidth(.6f), 83 | textAlign = TextAlign.Center, 84 | ) 85 | 86 | } 87 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/screen/MeetScreen.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.screen 2 | 3 | import androidx.compose.foundation.Image 4 | import androidx.compose.foundation.clickable 5 | import androidx.compose.foundation.layout.* 6 | import androidx.compose.foundation.shape.CircleShape 7 | import androidx.compose.foundation.shape.RoundedCornerShape 8 | import androidx.compose.material.* 9 | import androidx.compose.material.icons.Icons 10 | import androidx.compose.material.icons.filled.Menu 11 | import androidx.compose.runtime.Composable 12 | import androidx.compose.ui.Alignment 13 | import androidx.compose.ui.Modifier 14 | import androidx.compose.ui.draw.clip 15 | import androidx.compose.ui.graphics.Color 16 | import androidx.compose.ui.layout.ContentScale 17 | import androidx.compose.ui.res.painterResource 18 | import androidx.compose.ui.text.style.TextAlign 19 | import androidx.compose.ui.unit.dp 20 | import androidx.compose.ui.unit.sp 21 | import com.xtremedevx.gmail.R 22 | import com.xtremedevx.gmail.ui.theme.DarkBlue 23 | 24 | @Composable 25 | fun MeetScreen( 26 | onNavigationIconClick: () -> Unit, 27 | onShowUserDialog: () -> Unit, 28 | ) { 29 | Scaffold(modifier = Modifier.fillMaxSize(), 30 | 31 | topBar = { 32 | 33 | CenterAlignTopAppbar( 34 | onShowUserDialog = onShowUserDialog, 35 | onNavigationIconClick = onNavigationIconClick 36 | ) 37 | } 38 | ) { paddingValues -> 39 | Surface( 40 | modifier = Modifier 41 | .padding(paddingValues) 42 | .fillMaxSize(), 43 | ) { 44 | Column( 45 | modifier = Modifier.padding(horizontal = 8.dp) 46 | ) { 47 | Spacer(modifier = Modifier.height(16.dp)) 48 | Button( 49 | onClick = { /*TODO*/ }, 50 | shape = RoundedCornerShape(percent = 50), 51 | modifier = Modifier.fillMaxWidth(), 52 | colors = ButtonDefaults.buttonColors( 53 | backgroundColor = DarkBlue, 54 | contentColor = Color.White, 55 | ) 56 | ) { 57 | Text(text = "New meeting") 58 | } 59 | OutlinedButton( 60 | onClick = { /*TODO*/ }, 61 | shape = RoundedCornerShape(percent = 50), 62 | modifier = Modifier.fillMaxWidth(), 63 | colors = ButtonDefaults.outlinedButtonColors( 64 | backgroundColor = Color.White, 65 | contentColor = DarkBlue, 66 | ) 67 | ) { 68 | Text(text = "Meet new people") 69 | } 70 | MeetPagerScreen() 71 | 72 | } 73 | } 74 | } 75 | } 76 | 77 | @Composable 78 | fun CenterAlignTopAppbar( 79 | onShowUserDialog: () -> Unit, 80 | onNavigationIconClick: () -> Unit, 81 | ) { 82 | Row( 83 | modifier = Modifier 84 | .fillMaxWidth() 85 | .padding(horizontal = 8.dp), 86 | 87 | verticalAlignment = Alignment.CenterVertically, 88 | ) { 89 | IconButton(onClick = { onNavigationIconClick() }, modifier = Modifier.size(42.dp)) { 90 | Icon(imageVector = Icons.Default.Menu, contentDescription = null) 91 | } 92 | 93 | Text( 94 | modifier = Modifier.weight(1f), 95 | text = "Meet", 96 | textAlign = TextAlign.Center, 97 | fontSize = 20.sp, 98 | ) 99 | Image( 100 | painter = painterResource(id = R.drawable.profile), 101 | contentDescription = null, 102 | modifier = Modifier 103 | .size(42.dp) 104 | .clickable { onShowUserDialog() } 105 | .clip(CircleShape), 106 | contentScale = ContentScale.Crop 107 | ) 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/screen/UserDialogScreen.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.screen 2 | 3 | import androidx.compose.foundation.Image 4 | import androidx.compose.foundation.background 5 | import androidx.compose.foundation.clickable 6 | import androidx.compose.foundation.layout.* 7 | import androidx.compose.foundation.shape.CircleShape 8 | import androidx.compose.foundation.shape.RoundedCornerShape 9 | import androidx.compose.material.* 10 | import androidx.compose.material.icons.Icons 11 | import androidx.compose.material.icons.filled.Close 12 | import androidx.compose.material.icons.outlined.Cloud 13 | import androidx.compose.material.icons.outlined.ManageAccounts 14 | import androidx.compose.material.icons.outlined.PersonAdd 15 | import androidx.compose.runtime.Composable 16 | import androidx.compose.ui.Alignment 17 | import androidx.compose.ui.Modifier 18 | import androidx.compose.ui.draw.clip 19 | import androidx.compose.ui.graphics.Color 20 | import androidx.compose.ui.layout.ContentScale 21 | import androidx.compose.ui.res.painterResource 22 | import androidx.compose.ui.text.TextStyle 23 | import androidx.compose.ui.text.font.FontWeight 24 | import androidx.compose.ui.unit.dp 25 | import androidx.compose.ui.unit.sp 26 | import androidx.compose.ui.window.Dialog 27 | import com.xtremedevx.gmail.R 28 | import com.xtremedevx.gmail.navigation.drawer.DrawerItem 29 | import com.xtremedevx.gmail.navigation.drawer.MenuItem 30 | 31 | @Composable 32 | fun ShowUserDialog( 33 | modifier: Modifier = Modifier, 34 | onCloseUserDialog: () -> Unit, 35 | ) { 36 | Dialog(onDismissRequest = { onCloseUserDialog() }) { 37 | Surface( 38 | modifier = Modifier 39 | .fillMaxWidth() 40 | .clip(RoundedCornerShape(size = 8.dp)) 41 | .background(Color.White) 42 | .padding(8.dp), 43 | 44 | ) { 45 | Column( 46 | modifier = modifier 47 | .fillMaxWidth() 48 | ) { 49 | // Top Header 50 | Row( 51 | modifier = modifier.fillMaxWidth(), 52 | verticalAlignment = Alignment.CenterVertically, 53 | horizontalArrangement = Arrangement.SpaceBetween 54 | ) { 55 | IconButton(onClick = { onCloseUserDialog() }) { 56 | Icon(imageVector = Icons.Default.Close, contentDescription = null) 57 | } 58 | Image( 59 | modifier = Modifier.height(35.dp), 60 | painter = painterResource(id = R.drawable.google), 61 | contentDescription = null, 62 | alignment = Alignment.Center 63 | ) 64 | 65 | Spacer(modifier = Modifier.width(48.dp)) 66 | } 67 | Spacer(modifier = Modifier.height(8.dp)) 68 | 69 | //User Detail 70 | Row(modifier = modifier) { 71 | Image( 72 | painter = painterResource(id = R.drawable.profile), 73 | contentDescription = null, 74 | modifier = Modifier 75 | .size(50.dp) 76 | .clip(CircleShape), 77 | contentScale = ContentScale.Crop 78 | ) 79 | Spacer(modifier = Modifier.width(8.dp)) 80 | Column(modifier = modifier) { 81 | Text(text = "XtremeDevX", fontSize = 18.sp) 82 | Text(text = "XtremeDevX.........", fontSize = 12.sp) 83 | Spacer(modifier = Modifier.height(16.dp)) 84 | OutlinedButton( 85 | onClick = { /*TODO*/ }, 86 | shape = RoundedCornerShape(percent = 50), 87 | colors = ButtonDefaults.outlinedButtonColors( 88 | backgroundColor = Color.White, 89 | contentColor = Color.Black, 90 | ) 91 | ) { 92 | Text( 93 | text = "Google Account", fontSize = 16.sp 94 | ) 95 | } 96 | Spacer(modifier = Modifier.height(16.dp)) 97 | } 98 | } 99 | 100 | Divider( 101 | modifier = Modifier 102 | .height(1.dp) 103 | .fillMaxWidth() 104 | ) 105 | 106 | DrawerItem( 107 | item = MenuItem( 108 | id = "storage", 109 | title = "Storage used : 0% fo 15 GB", 110 | icon = Icons.Outlined.Cloud 111 | ), 112 | itemTextStyle = TextStyle(fontSize = 12.sp) 113 | ) 114 | 115 | Divider( 116 | modifier = Modifier 117 | .height(1.dp) 118 | .fillMaxWidth() 119 | ) 120 | DrawerItem( 121 | item = MenuItem( 122 | id = "addAccount", 123 | title = "Add another account", 124 | icon = Icons.Outlined.PersonAdd 125 | ), 126 | itemTextStyle = TextStyle(fontSize = 16.sp) 127 | ) 128 | DrawerItem( 129 | item = MenuItem( 130 | id = "manageAccounts", 131 | title = "Manage accounts on this device", 132 | icon = Icons.Outlined.ManageAccounts 133 | ), 134 | itemTextStyle = TextStyle(fontSize = 16.sp) 135 | ) 136 | Divider( 137 | modifier = Modifier 138 | .height(1.dp) 139 | .fillMaxWidth() 140 | ) 141 | //Privacy Policy 142 | Spacer(modifier = Modifier.height(8.dp)) 143 | Row( 144 | modifier = Modifier.fillMaxWidth(), 145 | verticalAlignment = Alignment.CenterVertically, 146 | horizontalArrangement = Arrangement.Center 147 | ) { 148 | Text( 149 | modifier = Modifier 150 | .clickable { } 151 | .padding(8.dp), 152 | text = "Privacy Policy", 153 | fontSize = 12.sp, 154 | color = Color.Gray, 155 | 156 | ) 157 | Text(text = ".", fontSize = 22.sp, fontWeight = FontWeight.Bold) 158 | Text( 159 | modifier = Modifier 160 | .clickable { } 161 | .padding(8.dp), 162 | text = "Terms of service", 163 | fontSize = 12.sp, 164 | color = Color.Gray, 165 | ) 166 | 167 | } 168 | } 169 | } 170 | } 171 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/ui/theme/Color.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.ui.theme 2 | 3 | import androidx.compose.ui.graphics.Color 4 | 5 | 6 | val Teal200 = Color(0xFF03DAC5) 7 | val LightBlue = Color(0xFFF0F8FF) 8 | val SkyBlue = Color(0xFF89CFF0) 9 | val DarkBlue = Color(0xFF2A52BE) -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/ui/theme/Shape.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.ui.theme 2 | 3 | import androidx.compose.foundation.shape.RoundedCornerShape 4 | import androidx.compose.material.Shapes 5 | import androidx.compose.ui.unit.dp 6 | 7 | val Shapes = Shapes( 8 | small = RoundedCornerShape(4.dp), 9 | medium = RoundedCornerShape(4.dp), 10 | large = RoundedCornerShape(0.dp) 11 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/ui/theme/Theme.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.ui.theme 2 | 3 | import android.annotation.SuppressLint 4 | import androidx.compose.foundation.isSystemInDarkTheme 5 | import androidx.compose.material.MaterialTheme 6 | import androidx.compose.material.darkColors 7 | import androidx.compose.material.lightColors 8 | import androidx.compose.runtime.Composable 9 | import androidx.compose.ui.graphics.Color 10 | 11 | private val DarkColorPalette = darkColors( 12 | primary = Color.White, 13 | primaryVariant = LightBlue, 14 | secondary = SkyBlue, 15 | 16 | // Other default colors to override 17 | background = Color.White, 18 | surface = Color.White, 19 | onPrimary = Color.Black, 20 | onSecondary = Color.Black, 21 | onBackground = Color.Black, 22 | onSurface = Color.Black, 23 | ) 24 | 25 | @SuppressLint("ConflictingOnColor") 26 | private val LightColorPalette = lightColors( 27 | primary = Color.White, 28 | primaryVariant = LightBlue, 29 | secondary = SkyBlue, 30 | 31 | // Other default colors to override 32 | background = Color.White, 33 | surface = Color.White, 34 | onPrimary = Color.Black, 35 | onSecondary = Color.Black, 36 | onBackground = Color.Black, 37 | onSurface = Color.Black, 38 | 39 | ) 40 | 41 | @Composable 42 | fun GmailTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) { 43 | val colors = if (darkTheme) { 44 | DarkColorPalette 45 | } else { 46 | LightColorPalette 47 | } 48 | 49 | MaterialTheme( 50 | colors = colors, 51 | typography = Typography, 52 | shapes = Shapes, 53 | content = content 54 | ) 55 | } -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/ui/theme/Type.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.ui.theme 2 | 3 | import androidx.compose.material.Typography 4 | import androidx.compose.ui.text.TextStyle 5 | import androidx.compose.ui.text.font.FontFamily 6 | import androidx.compose.ui.text.font.FontWeight 7 | import androidx.compose.ui.unit.sp 8 | 9 | // Set of Material typography styles to start with 10 | val Typography = Typography( 11 | body1 = TextStyle( 12 | fontFamily = FontFamily.Default, 13 | fontWeight = FontWeight.Normal, 14 | fontSize = 16.sp 15 | ) 16 | /* Other default text styles to override 17 | button = TextStyle( 18 | fontFamily = FontFamily.Default, 19 | fontWeight = FontWeight.W500, 20 | fontSize = 14.sp 21 | ), 22 | caption = TextStyle( 23 | fontFamily = FontFamily.Default, 24 | fontWeight = FontWeight.Normal, 25 | fontSize = 12.sp 26 | ) 27 | */ 28 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/user/data/MailItem.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.user.data 2 | 3 | import com.xtremedevx.gmail.R 4 | 5 | data class MailItem( 6 | val profileId: Int, 7 | val senderName: String, 8 | val mailSubject: String, 9 | val mailContent: String, 10 | val mailDate: String, 11 | 12 | ) 13 | 14 | val mailsList = listOf( 15 | MailItem( 16 | profileId = R.drawable.google_logo, 17 | senderName = "Google", 18 | mailSubject = "Job offer", 19 | mailContent = "jr. android dev role for ......", 20 | mailDate = "24 Aug", 21 | ), 22 | MailItem( 23 | profileId = R.drawable.facebook_logo, 24 | senderName = "Facebook", 25 | mailSubject = "Android dev role", 26 | mailContent = "Your resume has been accepted...", 27 | mailDate = "21 feb", 28 | ), 29 | MailItem( 30 | profileId = R.drawable.amazon_logo, 31 | senderName = "Amazon", 32 | mailSubject = "Interview round", 33 | mailContent = "Call for your first interview round.........", 34 | mailDate = "21 feb", 35 | ), 36 | MailItem( 37 | profileId = R.drawable.netflix_logo, 38 | senderName = "Netflix", 39 | mailSubject = "Second interview round", 40 | mailContent = "Congrats for clearing 1st interview round ...", 41 | mailDate = "21 feb", 42 | ), 43 | MailItem( 44 | profileId = R.drawable.dropbox_logo, 45 | senderName = "Dropbox", 46 | mailSubject = "Offer letter", 47 | mailContent = "Congratulating for clearing all three interview.....", 48 | mailDate = "24 aug", 49 | ), 50 | MailItem( 51 | profileId = R.drawable.twitter_logo, 52 | senderName = "Twitter", 53 | mailSubject = "jr. android dev role", 54 | mailContent = "We received your resume for jr. android....", 55 | mailDate = "21 feb", 56 | ), 57 | MailItem( 58 | profileId = R.drawable.signal_logo, 59 | senderName = "Signal", 60 | mailSubject = "Second Interview Round", 61 | mailContent = "Congrats for clearing 1st interview round ...", 62 | mailDate = "21 feb", 63 | ), 64 | 65 | MailItem( 66 | profileId = R.drawable.protonmail_logo, 67 | senderName = "Proton Mail", 68 | mailSubject = "Final Interview round", 69 | mailContent = "Congrats for clearing two interview round ...", 70 | mailDate = "21 feb", 71 | ), 72 | MailItem( 73 | profileId = R.drawable.dropbox_logo, 74 | senderName = "Dropbox", 75 | mailSubject = "3rd Interview", 76 | mailContent = "Thanks for showing interest in Dropbox....", 77 | mailDate = "20feb ", 78 | ), 79 | MailItem( 80 | profileId = R.drawable.protonmail_logo, 81 | senderName = "Proton Mail", 82 | mailSubject = "Application Received", 83 | mailContent = "Thanks for showing interest in Proton Mail", 84 | mailDate = "15 feb", 85 | ), 86 | MailItem( 87 | profileId = R.drawable.signal_logo, 88 | senderName = "Signal", 89 | mailSubject = "Application Received", 90 | mailContent = "Thanks for showing interest in Signal", 91 | mailDate = "15 feb", 92 | ), 93 | MailItem( 94 | profileId = R.drawable.protonmail_logo, 95 | senderName = "Netflix", 96 | mailSubject = "Application Received", 97 | mailContent = "Thanks for showing interest in Netflix", 98 | mailDate = "15 feb", 99 | ), 100 | MailItem( 101 | profileId = R.drawable.swiggy_logo, 102 | senderName = "Swiggy", 103 | mailSubject = "Interview round", 104 | mailContent = "Your resume has been accepted...", 105 | mailDate = "21 feb", 106 | ), 107 | 108 | ) -------------------------------------------------------------------------------- /app/src/main/java/com/xtremedevx/gmail/utils/MeetScreenPages.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail.utils 2 | 3 | import androidx.annotation.DrawableRes 4 | import com.xtremedevx.gmail.R 5 | 6 | sealed class MeetScreenPages( 7 | @DrawableRes 8 | val image: Int, 9 | val title: String, 10 | val description: String 11 | ) { 12 | object First : MeetScreenPages( 13 | image = R.drawable.share_link, 14 | title = "Get a link that you can share", 15 | description = "Tap New meeting to get a link that you can send to people that you want to meet" 16 | ) 17 | 18 | object Second : MeetScreenPages( 19 | image = R.drawable.safety_first, 20 | title = "Your meeting is safe", 21 | description = "No one can join a meeting unless invited or admitted by the host" 22 | ) 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/amazon_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/drawable-v24/amazon_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/dropbox_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/drawable-v24/dropbox_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/facebook_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/drawable-v24/facebook_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/drawable-v24/google.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/google_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/drawable-v24/google_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/netflix_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/drawable-v24/netflix_logo.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/profile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/drawable-v24/profile.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/protonmail_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/drawable-v24/protonmail_logo.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/safety_first.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/drawable-v24/safety_first.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/share_link.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/drawable-v24/share_link.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/signal_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/drawable-v24/signal_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/swiggy_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/drawable-v24/swiggy_logo.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/twitter_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/drawable-v24/twitter_logo.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Gmail 3 | Compose 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/xml/backup_rules.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/xml/data_extraction_rules.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | 19 | -------------------------------------------------------------------------------- /app/src/test/java/com/xtremedevx/gmail/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.xtremedevx.gmail 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /assets/gmail_clone.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/assets/gmail_clone.mp4 -------------------------------------------------------------------------------- /assets/images/dialog.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/assets/images/dialog.jpg -------------------------------------------------------------------------------- /assets/images/drawer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/assets/images/drawer.jpg -------------------------------------------------------------------------------- /assets/images/mail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/assets/images/mail.jpg -------------------------------------------------------------------------------- /assets/images/meet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/assets/images/meet.jpg -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | compose_version = '1.2.0' 4 | nav_version = '2.5.1' 5 | accompanist_version = '0.25.0' 6 | 7 | } 8 | }// Top-level build file where you can add configuration options common to all sub-projects/modules. 9 | plugins { 10 | id 'com.android.application' version '7.2.1' apply false 11 | id 'com.android.library' version '7.2.1' apply false 12 | id 'org.jetbrains.kotlin.android' version '1.7.0' apply false 13 | } 14 | 15 | task clean(type: Delete) { 16 | delete rootProject.buildDir 17 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Kotlin code style for this project: "official" or "obsolete": 19 | kotlin.code.style=official 20 | # Enables namespacing of each library's R class so that its R class includes only the 21 | # resources declared in the library itself and none from the library's dependencies, 22 | # thereby reducing the size of the R class for that library 23 | android.nonTransitiveRClass=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/silori-dev/Gmail-Compose/754f5c80b5eec728cdf5ca1816e86bf4e1a1ffad/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Aug 17 15:12:57 IST 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | google() 5 | mavenCentral() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | } 15 | rootProject.name = "Gmail" 16 | include ':app' 17 | --------------------------------------------------------------------------------