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

Commit 86e5a77

Browse files
committed
Audit and cleanup TODOs and lints; update dep versions
- BottomNavigationDrawerFragment changed to use motion.xml duration for sandwich toggle duration. - Organized all imports - Resolved/removed all TODOs - Lint checks resolved where possible Change-Id: I1155cdb31704c11c09c5c006451f104a4fc6d9de
1 parent ac21ad7 commit 86e5a77

35 files changed

+63
-367
lines changed

app/build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ dependencies {
5252
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
5353

5454
// AndroidX
55-
implementation 'androidx.appcompat:appcompat:1.1.0-beta01'
56-
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'
55+
implementation 'androidx.appcompat:appcompat:1.1.0'
56+
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
5757
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
58-
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha06'
59-
implementation 'androidx.core:core-ktx:1.0.2'
60-
implementation 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.2.0-alpha03'
58+
implementation 'androidx.recyclerview:recyclerview:1.1.0-beta05'
59+
implementation 'androidx.core:core-ktx:1.1.0'
60+
implementation 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.2.0-beta01'
6161
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
6262
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
6363

@@ -71,5 +71,4 @@ dependencies {
7171
testImplementation 'junit:junit:4.12'
7272
androidTestImplementation 'androidx.test:runner:1.2.0'
7373
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
74-
7574
}

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
34
package="com.materialstudies.reply">
45

56
<application
@@ -8,7 +9,8 @@
89
android:label="@string/app_name"
910
android:roundIcon="@mipmap/ic_launcher_round"
1011
android:supportsRtl="true"
11-
android:theme="@style/Theme.Reply.DayNight">
12+
android:theme="@style/Theme.Reply.DayNight"
13+
tools:ignore="AllowBackup">
1214
<activity android:name=".ui.MainActivity">
1315
<intent-filter>
1416
<action android:name="android.intent.action.MAIN" />

app/src/main/java/com/materialstudies/reply/data/AccountStore.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ object AccountStore {
156156
fun getAllUserAccounts() = allUserAccounts
157157

158158
/**
159-
* Whether or not the given [accountId] is an account owned by the current user.
159+
* Whether or not the given [Account.id] uid is an account owned by the current user.
160160
*/
161161
fun isUserAccount(uid: Long): Boolean = allUserAccounts.any { it.uid == uid }
162162

app/src/main/java/com/materialstudies/reply/data/Email.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ data class Email(
3131
var isImportant: Boolean = false,
3232
var isStarred: Boolean = false
3333
) {
34-
//TODO(hunterstich) Update to use real Dates.
3534
val senderPreview: String = "${sender.fullName} - 4 hrs ago"
3635
val hasBody: Boolean = body.isNotBlank()
3736
val hasAttachments: Boolean = attachments.isNotEmpty()

app/src/main/java/com/materialstudies/reply/data/EmailStore.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ object EmailStore {
9797
I've been doing a bit of research and have come across a few paces in Northern Brazil that I think we should check out. One, the north has some of the most predictable wind on the planet. I'd love to get out on the ocean and kitesurf for a couple of days if we're going to be anywhere near or around Taiba. I hear it's beautiful there and if you're up for it, I'd love to go. Other than that, I haven't spent too much time looking into places along our road trip route. I'm assuming we can find places to stay and things to do as we drive and find places we think look interesting. But... I know you're more of a planner, so if you have ideas or places in mind, lets jot some ideas down!
9898
9999
Maybe we can jump on the phone later today if you have a second.
100-
101-
I've been doing a bit of research and have come across a few paces in Northern Brazil that I think we should check out. One, the north has some of the most predictable wind on the planet. I'd love to get out on the ocean and kitesurf for a couple of days if we're going to be anywhere near or around Taiba. I hear it's beautiful there and if you're up for it, I'd love to go. Other than that, I haven't spent too much time looking into places along our road trip route. I'm assuming we can find places to stay and things to do as we drive and find places we think look interesting. But... I know you're more of a planner, so if you have ideas or places in mind, lets jot some ideas down!
102100
""".trimIndent(),
103101
isStarred = true
104102
),
@@ -195,6 +193,5 @@ object EmailStore {
195193
"Mortgage",
196194
"Grocery coupons"
197195
)
198-
199196
}
200197

app/src/main/java/com/materialstudies/reply/ui/common/EmailAttachmentAdapter.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,4 @@ abstract class EmailAttachmentAdapter : RecyclerView.Adapter<EmailAttachmentView
5757
* of [EmailAttachment].
5858
*/
5959
abstract fun getLayoutIdForPosition(position: Int): Int
60-
6160
}

app/src/main/java/com/materialstudies/reply/ui/email/EmailAttachmentGridAdapter.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class EmailAttachmentGridAdapter(
4141
val list = mutableListOf<Int>()
4242

4343
var rowSpansOccupied = 0
44-
(0..count).forEach {
44+
repeat(count) {
4545
val size = Random.nextInt(1, spans + 1 - rowSpansOccupied)
4646
rowSpansOccupied += size
4747
if (rowSpansOccupied >= 3) rowSpansOccupied = 0
@@ -59,5 +59,4 @@ class EmailAttachmentGridAdapter(
5959

6060
override fun getLayoutIdForPosition(position: Int): Int =
6161
R.layout.email_attachment_grid_item_layout
62-
6362
}

app/src/main/java/com/materialstudies/reply/ui/home/EmailSwipeActionDrawable.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ import androidx.annotation.ColorInt
2929
import androidx.appcompat.content.res.AppCompatResources
3030
import androidx.interpolator.view.animation.FastOutSlowInInterpolator
3131
import com.materialstudies.reply.R
32-
import com.materialstudies.reply.util.themeColor
3332
import com.materialstudies.reply.util.lerp
3433
import com.materialstudies.reply.util.lerpArgb
34+
import com.materialstudies.reply.util.themeColor
3535
import kotlin.math.abs
3636
import kotlin.math.hypot
37+
import kotlin.math.sin
3738

3839
/**
3940
* A [Drawable] which handles drawing the background behind an email item preview and responds to
@@ -85,7 +86,7 @@ class EmailSwipeActionDrawable(context: Context) : Drawable() {
8586
update()
8687
}
8788

88-
fun update() {
89+
private fun update() {
8990
circle.set(
9091
bounds.left.toFloat(),
9192
bounds.top.toFloat(),
@@ -141,8 +142,7 @@ class EmailSwipeActionDrawable(context: Context) : Drawable() {
141142
)
142143
// Take the sin of our ranged progress * our maxScaleAddition as what we should
143144
// increase the icon's scale by.
144-
val additive = (Math.sin(range.toDouble()) * iconMaxScaleAddition)
145-
.coerceIn(0.0, 1.0)
145+
val additive = (sin(range.toDouble()) * iconMaxScaleAddition).coerceIn(0.0, 1.0)
146146
val scaleFactor = 1 + additive
147147
icon.setBounds(
148148
(cx - (iconIntrinsicWidth / 2F) * scaleFactor).toInt(),
@@ -169,5 +169,4 @@ class EmailSwipeActionDrawable(context: Context) : Drawable() {
169169
override fun setColorFilter(filter: ColorFilter?) {
170170
circlePaint.colorFilter = filter
171171
}
172-
173172
}

app/src/main/java/com/materialstudies/reply/ui/home/EmailViewHolder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ import com.materialstudies.reply.R
2222
import com.materialstudies.reply.data.Email
2323
import com.materialstudies.reply.databinding.EmailItemLayoutBinding
2424
import com.materialstudies.reply.ui.common.EmailAttachmentAdapter
25-
import com.materialstudies.reply.util.themeStyle
2625
import com.materialstudies.reply.util.setTextAppearanceCompat
26+
import com.materialstudies.reply.util.themeStyle
2727
import kotlin.math.abs
2828

2929
class EmailViewHolder(

app/src/main/java/com/materialstudies/reply/ui/home/HomeFragment.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,4 @@ class HomeFragment : Fragment(), EmailAdapter.EmailAdapterListener {
9191
override fun onEmailArchived(email: Email) {
9292
EmailStore.delete(email.id)
9393
}
94-
9594
}

0 commit comments

Comments
 (0)