Skip to content

Commit

Permalink
Fix duplicate photos in user search, update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
b-lam committed Sep 7, 2020
1 parent 80e41f7 commit e61ad16
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 13 deletions.
16 changes: 16 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 16 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

// Support libraries
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta8'
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.fragment:fragment:1.2.5'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.paging:paging-runtime-ktx:2.1.2'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.work:work-runtime-ktx:2.4.0-rc01'
implementation 'androidx.work:work-runtime-ktx:2.4.0'

// Lifecycle
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
Expand All @@ -87,7 +87,7 @@ dependencies {
kapt 'androidx.room:room-compiler:2.2.5'

// Material components
implementation 'com.google.android.material:material:1.3.0-alpha01'
implementation 'com.google.android.material:material:1.3.0-alpha02'

// Billing
implementation 'com.android.billingclient:billing:3.0.0'
Expand Down Expand Up @@ -122,12 +122,16 @@ dependencies {
implementation 'org.koin:koin-androidx-viewmodel:2.1.5'

// Firebase
implementation 'com.google.firebase:firebase-analytics-ktx:17.4.4'
implementation 'com.google.firebase:firebase-crashlytics:17.1.1'
implementation 'com.google.firebase:firebase-inappmessaging-ktx:19.1.0'
implementation 'com.google.firebase:firebase-firestore-ktx:21.5.0'
implementation 'com.google.firebase:firebase-analytics-ktx:17.5.0'
implementation 'com.google.firebase:firebase-crashlytics:17.2.1'
implementation 'com.google.firebase:firebase-inappmessaging-ktx:19.1.1'
implementation 'com.google.firebase:firebase-firestore-ktx:21.6.0'
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'

// Play Core
implementation 'com.google.android.play:core:1.8.0'
implementation 'com.google.android.play:core-ktx:1.8.1'

// Lottie
implementation 'com.airbnb.android:lottie:3.4.0'

Expand All @@ -144,13 +148,13 @@ dependencies {
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'

// Muzei
implementation 'com.google.android.apps.muzei:muzei-api:3.4.0-alpha02'
implementation 'com.google.android.apps.muzei:muzei-api:3.4.0'

// LeakCanary
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.2'

// Unit tests
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.view.View
import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import com.b_lam.resplash.GlideApp
import com.b_lam.resplash.R
import com.b_lam.resplash.data.user.model.User
import com.b_lam.resplash.util.loadPhotoUrl
Expand Down Expand Up @@ -34,9 +35,11 @@ class UserViewHolder(parent: View) : RecyclerView.ViewHolder(parent) {
photos.getOrNull(index)?.let { photo ->
imageView.loadPhotoUrl(
photo.urls.small,
ContextCompat.getColor(context, R.color.grey_300)
ContextCompat.getColor(context, R.color.grey_400)
)
imageView.setOnClickListener { callback.onPhotoClick(photo) }
} ?: run {
GlideApp.with(context).clear(imageView)
}
}
}
Expand Down

0 comments on commit e61ad16

Please sign in to comment.