├── .gitignore ├── .idea ├── assetWizardSettings.xml ├── codeStyles │ └── Project.xml ├── gradle.xml ├── misc.xml ├── runConfigurations.xml └── vcs.xml ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── app │ │ └── rigs │ │ └── emaily │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── app │ │ │ └── rigs │ │ │ └── emaily │ │ │ ├── Email.kt │ │ │ ├── EmailRecyclerViewAdapter.kt │ │ │ └── MainActivity.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── bg_button_borderless_outline_dark_theme.xml │ │ ├── bg_button_borderless_outline_light_theme.xml │ │ ├── ic_launcher_background.xml │ │ └── ic_quill_white_24dp.xml │ │ ├── font │ │ └── nunito.ttf │ │ ├── layout │ │ ├── activity_main.xml │ │ └── list_item_email.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── scene_drag.xml │ └── test │ └── java │ └── app │ └── rigs │ └── emaily │ └── ExampleUnitTest.kt ├── 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/build_file_checksums.ser 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | .DS_Store 9 | /build 10 | /captures 11 | .externalNativeBuild 12 | -------------------------------------------------------------------------------- /.idea/assetWizardSettings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 31 | 32 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 29 | 30 | 31 | 32 | 33 | 34 | 36 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | compileSdkVersion 28 9 | defaultConfig { 10 | applicationId "app.rigs.emaily" 11 | minSdkVersion 21 12 | targetSdkVersion 28 13 | versionCode 1 14 | versionName "1.0" 15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | } 24 | 25 | dependencies { 26 | implementation fileTree(dir: 'libs', include: ['*.jar']) 27 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 28 | implementation 'androidx.appcompat:appcompat:1.0.0-rc01' 29 | implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2' 30 | testImplementation 'junit:junit:4.12' 31 | androidTestImplementation 'androidx.test:runner:1.1.0-alpha4' 32 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4' 33 | implementation 'androidx.cardview:cardview:1.0.0-rc01' 34 | implementation 'com.google.android.material:material:1.0.0-rc01' 35 | implementation 'com.github.bumptech.glide:glide:4.7.1' 36 | annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1' 37 | } 38 | -------------------------------------------------------------------------------- /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 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/app/rigs/emaily/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package app.rigs.emaily 2 | 3 | import androidx.test.InstrumentationRegistry 4 | import androidx.test.runner.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.getTargetContext() 22 | assertEquals("app.rigs.emaily", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/app/rigs/emaily/Email.kt: -------------------------------------------------------------------------------- 1 | package app.rigs.emaily 2 | 3 | data class Email(val from: String, val subject: String, val content:String, val time:String, val profilePicUrl: String) -------------------------------------------------------------------------------- /app/src/main/java/app/rigs/emaily/EmailRecyclerViewAdapter.kt: -------------------------------------------------------------------------------- 1 | package app.rigs.emaily 2 | 3 | import android.view.LayoutInflater 4 | import android.view.View 5 | import android.view.ViewGroup 6 | import androidx.recyclerview.widget.DiffUtil 7 | import androidx.recyclerview.widget.ListAdapter 8 | import androidx.recyclerview.widget.RecyclerView 9 | import com.bumptech.glide.Glide 10 | import com.bumptech.glide.request.RequestOptions 11 | import kotlinx.android.synthetic.main.list_item_email.view.* 12 | 13 | class EmailRecyclerViewAdapter(): ListAdapter(DIFFER) { 14 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): EmailViewHolder { 15 | val view = LayoutInflater.from(parent.context).inflate(R.layout.list_item_email, parent, false) 16 | return EmailViewHolder(view) 17 | } 18 | 19 | override fun onBindViewHolder(holder: EmailViewHolder, position: Int) { 20 | val email = getItem(position) 21 | holder.bind(email) 22 | } 23 | companion object { 24 | val DIFFER = object : DiffUtil.ItemCallback() { 25 | override fun areItemsTheSame(oldItem: Email, newItem: Email): Boolean { 26 | return oldItem == newItem 27 | } 28 | 29 | override fun areContentsTheSame(oldItem: Email, newItem: Email): Boolean { 30 | return oldItem == newItem 31 | } 32 | } 33 | } 34 | } 35 | 36 | class EmailViewHolder(val view: View) : RecyclerView.ViewHolder(view) { 37 | fun bind(email: Email){ 38 | view.textViewEmailFromName.text = email.from 39 | view.textViewEmailTime.text = email.time 40 | view.textViewEmailTextExtract.text = email.content 41 | view.textViewEmailSubject.text = email.subject 42 | Glide.with(view) 43 | .setDefaultRequestOptions(RequestOptions() 44 | .circleCrop()) 45 | .load(email.profilePicUrl) 46 | .into(view.imageViewEmailProfilePic) 47 | } 48 | } -------------------------------------------------------------------------------- /app/src/main/java/app/rigs/emaily/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package app.rigs.emaily 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import com.bumptech.glide.Glide 6 | import com.bumptech.glide.request.RequestOptions 7 | import kotlinx.android.synthetic.main.activity_main.* 8 | 9 | class MainActivity : AppCompatActivity() { 10 | 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | setContentView(R.layout.activity_main) 14 | 15 | val adapter = EmailRecyclerViewAdapter() 16 | recyclerViewEmails.adapter = adapter 17 | val fakeEmails = listOf( 18 | Email("Rebecca Franks", "Hello Rebecca", "I would like to invite you to Disneyland...", "10.40AM", "https://source.unsplash.com/100x100/?lego"), 19 | Email("Bob Free", "DisneyLand 2019", "Have you seen disney land", "11:23AM", "https://source.unsplash.com/100x100/?profile+picture"), 20 | Email("Becky Hunde", "Lunch today?", "Let's meet at 12:00 for Taco's 🌮?", "11:23AM", "https://source.unsplash.com/100x100/?architecture"), 21 | Email("Brain Game", "Brain Game 🔥", "Try this app, it really is awesome! 🎉", "11:40AM", "https://source.unsplash.com/100x100/?flowers"), 22 | Email("Bob Free", "DisneyLand 2019", "Have you seen disney land", "11:23AM", "https://source.unsplash.com/100x100/?people")) 23 | adapter.submitList(fakeEmails) 24 | 25 | Glide.with(imageViewProfilePic) 26 | .setDefaultRequestOptions(RequestOptions() 27 | .circleCrop()) 28 | .load("https://source.unsplash.com/100x100/?candy") 29 | .into(imageViewProfilePic) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_button_borderless_outline_dark_theme.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_button_borderless_outline_light_theme.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 11 | 16 | 21 | 26 | 31 | 36 | 41 | 46 | 51 | 56 | 61 | 66 | 71 | 76 | 81 | 86 | 91 | 96 | 101 | 106 | 111 | 116 | 121 | 126 | 131 | 136 | 141 | 146 | 151 | 156 | 161 | 166 | 171 | 172 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_quill_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/font/nunito.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riggaroo/email-app-layouts-android/1c756add87e1da8f385ae93d531e5277bd60a14b/app/src/main/res/font/nunito.ttf -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 20 | 21 | 36 | 37 | 46 | 47 | 62 | 63 | 75 | 76 | 89 | 90 |