Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Sliding pane layout implementadb shell am compat enable FGS_BOOT_COMPLETED_RESTRICTIONS your-package-nameation #108

Open
wants to merge 72 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
bc747df
update androidx.core to 1.6.0
DavidHewWing Sep 24, 2021
ae0200b
[Reply] Updating themes to M3
DavidHewWing Sep 27, 2021
870a4a8
[Reply] rename themes to M3.
DavidHewWing Sep 28, 2021
5188bb8
Merge pull request #76 from material-components/update-material-3-theme
DavidHewWing Sep 29, 2021
803c2f3
[Reply] Added dynamic colors and styled bars
DavidHewWing Sep 29, 2021
165bf66
[Reply] fix style indentation
DavidHewWing Sep 30, 2021
1575711
[Reply] Navbar Compatibility Fix
DavidHewWing Sep 30, 2021
fbee983
Merge pull request #78 from material-components/reply-dyanmic-colors
DavidHewWing Sep 30, 2021
780f462
[Reply] Changed color theme, update icons
DavidHewWing Sep 30, 2021
1d59b5b
[Reply] Fixed Nits / Comments
DavidHewWing Oct 4, 2021
b04edee
[Reply] Fixed nits / redundant theming
DavidHewWing Oct 5, 2021
4d855d2
Merge pull request #80 from material-components/update-color-theme
DavidHewWing Oct 5, 2021
bfc5fd1
[Reply] Updated RecyclerView Card Styles
DavidHewWing Oct 6, 2021
a88d5fd
[Reply] Fix: Styling issues
DavidHewWing Oct 8, 2021
f309ae4
[Reply] Elevated Style and no shadows
DavidHewWing Oct 8, 2021
039e8d8
[Reply] Fixed nits
DavidHewWing Oct 8, 2021
3b497b3
Merge pull request #81 from material-components/update-card-view
DavidHewWing Oct 8, 2021
586c7b1
fix merge conflicts
DavidHewWing Oct 8, 2021
df61148
[Reply] New Email Detail Screen
DavidHewWing Oct 12, 2021
0244d11
[Reply] Clean up the PR
DavidHewWing Oct 12, 2021
a9ffa4a
[Reply] Fixes
DavidHewWing Oct 13, 2021
4eff061
[Reply] Update some styles, removed undeed imports
DavidHewWing Oct 13, 2021
c6e05c2
[Reply] Last minute ID change
DavidHewWing Oct 13, 2021
c499430
[Reply] Update to M3 Typography
DavidHewWing Oct 13, 2021
7908302
[Reply] Used a MaterialToolBar
DavidHewWing Oct 14, 2021
9970413
[Reply] Removed fillViewPort
DavidHewWing Oct 14, 2021
40fc1f8
[Reply] Updated to Coordinator Layout
DavidHewWing Oct 18, 2021
291de0a
[Reply] Bottom padding to email cardview
DavidHewWing Oct 18, 2021
35abaec
[Reply] Adding padding to the appbarlayout
DavidHewWing Oct 18, 2021
98b5236
[Reply] Added botton nav view
DavidHewWing Oct 19, 2021
b6d1949
[Reply] Formatting and Margin updates
DavidHewWing Oct 19, 2021
85fe918
Merge pull request #82 from material-components/update-email-card-view
DavidHewWing Oct 20, 2021
4424bfb
Merge branch 'reply-material-3' into update-new-typography
DavidHewWing Oct 20, 2021
0e328da
[Reply] fix merge and add back typography
DavidHewWing Oct 20, 2021
8e52339
Added removed theme
DavidHewWing Oct 20, 2021
ebb6f19
[Reply] Changed reference typography
DavidHewWing Oct 20, 2021
a416861
[Reply] Fixed attribute naming
DavidHewWing Oct 21, 2021
dfb7213
[Reply] Organizing theme references
DavidHewWing Oct 21, 2021
8d8a4d8
Merge pull request #83 from material-components/update-new-typography
DavidHewWing Oct 21, 2021
6992148
[Reply] Merge from reply-material-3
DavidHewWing Oct 21, 2021
ec82a6f
[Reply] Removed BottomAppBar usages, address comments
DavidHewWing Oct 25, 2021
ae7dbae
[Reply] Updated color scheme and elevations
DavidHewWing Oct 25, 2021
13bb89d
[Reply] Fix some nits
DavidHewWing Oct 25, 2021
a547f16
[Reply] Fix line length
DavidHewWing Oct 26, 2021
24a70f1
[Reply] Brace fix
DavidHewWing Oct 26, 2021
f8e7d67
Merge pull request #84 from material-components/add-bottom-nav
DavidHewWing Oct 26, 2021
2441d97
[Reply] Merging changes
DavidHewWing Oct 26, 2021
390740b
[Reply] Temporary commit, added toggling star
DavidHewWing Oct 27, 2021
4ebf377
[Reply] Fix star image button surface colors
dsn5ft Oct 27, 2021
c7083b3
[Reply] Icon Button fix and xml clean up
DavidHewWing Oct 28, 2021
13062fd
[Reply] Fixed star button logic, and clean up
DavidHewWing Oct 30, 2021
febf483
[Reply] Binding Adapter Issues
DavidHewWing Nov 1, 2021
6c30edc
[Reply] Databinding Surface Colors
DavidHewWing Nov 1, 2021
0564675
[Reply] Fixed nits
DavidHewWing Nov 2, 2021
bcf2dd4
[Reply] Rename the Binding Adapters
DavidHewWing Nov 2, 2021
a65fa39
[Reply] Naming issues in BindingAdapter
DavidHewWing Nov 2, 2021
4b45ffb
Merge pull request #85 from material-components/reply-elevation-color
DavidHewWing Nov 2, 2021
fba5074
[Reply] Layout changes for the search bar
DavidHewWing Nov 4, 2021
56c1e90
[Reply] Searchbar transitions and ripple
DavidHewWing Nov 4, 2021
03e7b09
[Reply] Address comments
DavidHewWing Nov 4, 2021
d1d3afd
[Reply] Fix nits
DavidHewWing Nov 5, 2021
62fe444
Merge pull request #87 from material-components/add-search-bar
DavidHewWing Nov 5, 2021
0a96180
[Reply] Adaptive Navigation Views
DavidHewWing Nov 16, 2021
4d7eb20
[Reply] Replace with Kotlin Flows and new Architecture
DavidHewWing Nov 23, 2021
4a4ef33
[Reply] Activity View changes for XLarge Screens
DavidHewWing Nov 23, 2021
b19189a
[Reply] Address comments for Navigation Views
DavidHewWing Nov 24, 2021
aee2b6f
[Reply] Sliding Pane Layout first commit
DavidHewWing Nov 25, 2021
994070b
[Reply] Moving pane resizing logic to another branch
DavidHewWing Nov 29, 2021
cb329c4
[Reply] Added comments
DavidHewWing Nov 30, 2021
d879e6c
Merge pull request #89 from material-components/adaptive-activity-views
DavidHewWing Dec 1, 2021
f69fa3d
Merge branch 'reply-material-3' into sliding-pane-layout-implementation
DavidHewWing Dec 1, 2021
00125cd
[Reply] Utilize SLP APIs
DavidHewWing Dec 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Reply/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ apply plugin: 'kotlin-kapt'
apply plugin: "androidx.navigation.safeargs.kotlin"

android {
compileSdkVersion 30
compileSdkVersion 31
defaultConfig {
applicationId "com.materialstudies.reply"
minSdkVersion 23
targetSdkVersion 30
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -53,16 +53,18 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1'
implementation 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.2.0'
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
implementation "androidx.slidingpanelayout:slidingpanelayout:1.2.0-beta01"

// Glide
implementation "com.github.bumptech.glide:glide:4.11.0"

// Material Components
implementation 'com.google.android.material:material:1.2.1'
implementation 'com.google.android.material:material:1.5.0-alpha04'

// Testing
testImplementation 'junit:junit:4.13.1'
Expand Down
5 changes: 4 additions & 1 deletion Reply/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
android:supportsRtl="true"
android:theme="@style/Theme.Reply.DayNight"
tools:ignore="AllowBackup">
<activity android:name=".ui.MainActivity">
<activity
android:name=".ui.MainActivity"
android:exported="true"
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|uiMode">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Binary file added Reply/app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 18 additions & 4 deletions Reply/app/src/main/java/com/materialstudies/reply/data/Email.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.materialstudies.reply.data

import androidx.databinding.BaseObservable
import androidx.recyclerview.widget.DiffUtil
import com.materialstudies.reply.ui.home.Mailbox

Expand All @@ -31,16 +32,29 @@ data class Email(
val attachments: List<EmailAttachment> = emptyList(),
var isImportant: Boolean = false,
var isStarred: Boolean = false,
var mailbox: Mailbox = Mailbox.INBOX
) {
val senderPreview: String = "${sender.fullName} - 4 hrs ago"
var mailbox: Mailbox = Mailbox.INBOX,
var timeSent: String = ""
) : BaseObservable() {
val hasBody: Boolean = body.isNotBlank()
val hasAttachments: Boolean = attachments.isNotEmpty()
val recipientsPreview: String = recipients
.map { it.firstName }
.fold("") { name, acc -> "$acc, $name" }
.foldIndexed("") { i, acc, name ->
val separator = when (i) {
0 -> ""
recipients.size - 1 -> " & "
else -> ", "
}
"$acc$separator$name"
}
val nonUserAccountRecipients = recipients
.filterNot { AccountStore.isUserAccount(it.uid) }

fun toggleStar() {
EmailStore.update(id) { isStarred = !isStarred }
notifyChange()
}

}

object EmailDiffCallback : DiffUtil.ItemCallback<Email>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,33 @@ import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import com.materialstudies.reply.R
import com.materialstudies.reply.ui.home.Mailbox
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow

/**
* A static data store of [Email]s.
*/
object EmailStore {

private const val DEFAULT_EMAIL_ID = 0L

private val _selectedEmailId = MutableStateFlow(DEFAULT_EMAIL_ID)
val selectedEmailId: StateFlow<Long> = _selectedEmailId.asStateFlow()

fun setSelectedEmailId(emailId: Long) {
_selectedEmailId.value = emailId
}

private val allEmails = mutableListOf(
Email(
0L,
AccountStore.getContactAccountById(9L),
listOf(AccountStore.getDefaultUserAccount()),
listOf(
AccountStore.getDefaultUserAccount(),
AccountStore.getContactAccountById(1),
AccountStore.getContactAccountById(3)
),
"Package shipped!",
"""
Cucumber Mask Facial has shipped.
Expand All @@ -40,7 +56,8 @@ object EmailStore {

As always, thank you for shopping with us and we hope you love our specially formulated Cucumber Mask!
""".trimIndent(),
isStarred = true
isStarred = true,
timeSent = "10 min ago",
),
Email(
1L,
Expand All @@ -55,7 +72,8 @@ object EmailStore {
Talk to you soon,

Ali
""".trimIndent()
""".trimIndent(),
timeSent = "2 hours ago"
),
Email(
2L,
Expand All @@ -69,7 +87,8 @@ object EmailStore {
EmailAttachment(R.drawable.paris_3, "City street in Paris"),
EmailAttachment(R.drawable.paris_4, "Street with bike in Paris")
),
true
true,
timeSent = "20 min ago"
),
Email(
3L,
Expand All @@ -83,7 +102,8 @@ object EmailStore {

Anyway, it turns out she is on the organizing committee for the high school reunion this fall. I don't know if you were planning on going or not, but she could definitely use our help in trying to track down lots of missing alums. If you can make it, we're doing a little phone-tree party at her place next Saturday, hoping that if we can find one person, thee more will...
""".trimIndent(),
mailbox = Mailbox.SENT
mailbox = Mailbox.SENT,
timeSent = "10 min ago"
),
Email(
4L,
Expand All @@ -101,14 +121,16 @@ object EmailStore {

Maybe we can jump on the phone later today if you have a second.
""".trimIndent(),
isStarred = true
isStarred = true,
timeSent = "10 min ago"
),
Email(
5L,
AccountStore.getContactAccountById(13L),
listOf(AccountStore.getDefaultUserAccount()),
"Update to Your Itinerary",
""
"",
timeSent = "10 min ago"
),
Email(
6L,
Expand All @@ -117,14 +139,16 @@ object EmailStore {
"Recipe to try",
"Raspberry Pie: We should make this pie recipe tonight! The filling is " +
"very quick to put together.",
mailbox = Mailbox.SENT
mailbox = Mailbox.SENT,
timeSent = "10 min ago"
),
Email(
7L,
AccountStore.getContactAccountById(9L),
listOf(AccountStore.getDefaultUserAccount()),
"Delivered",
"Your shoes should be waiting for you at home!"
"Your shoes should be waiting for you at home!",
timeSent = "10 min ago"
),
Email(
8L,
Expand All @@ -136,7 +160,8 @@ object EmailStore {

Your alpha testers will be automatically notified. If you'd rather send them a link directly, go to your Google Play Console and follow the instructions for obtaining an open alpha testing link.
""".trimIndent(),
mailbox = Mailbox.TRASH
mailbox = Mailbox.TRASH,
timeSent = "10 min ago"
),
Email(
9L,
Expand All @@ -148,7 +173,8 @@ object EmailStore {

Wanted to email and see what you thought of
""".trimIndent(),
mailbox = Mailbox.DRAFTS
mailbox = Mailbox.DRAFTS,
timeSent = "10 min ago"
),
Email(
10L,
Expand All @@ -160,7 +186,8 @@ object EmailStore {

Whether you're an experienced hiker or just looking to get outside for the afternoon, there's a segment that suits you.
""".trimIndent(),
mailbox = Mailbox.TRASH
mailbox = Mailbox.TRASH,
timeSent = "10 min ago"
),
Email(
10L,
Expand All @@ -170,7 +197,8 @@ object EmailStore {
"""
You've been selected as a winner in our latest raffle! To claim your prize, click on the link.
""".trimIndent(),
mailbox = Mailbox.SPAM
mailbox = Mailbox.SPAM,
timeSent = "10 min ago"
)
)

Expand Down
Loading