Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Volley with Glide in Activity Log #8077

Merged
merged 1 commit into from
Jul 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ import android.view.ViewGroup
import android.widget.TextView
import kotlinx.android.synthetic.main.activity_log_item_detail.*
import org.wordpress.android.R
import org.wordpress.android.R.id.activityJetpackActorIcon
import org.wordpress.android.WordPress
import org.wordpress.android.fluxc.model.SiteModel
import org.wordpress.android.ui.posts.BasicFragmentDialog
import org.wordpress.android.util.image.ImageManager
import org.wordpress.android.util.image.ImageType.AVATAR
import org.wordpress.android.viewmodel.activitylog.ACTIVITY_LOG_ID_KEY
import org.wordpress.android.viewmodel.activitylog.ACTIVITY_LOG_REWIND_ID_KEY
import org.wordpress.android.viewmodel.activitylog.ActivityLogDetailViewModel
import org.wordpress.android.widgets.WPNetworkImageView
import javax.inject.Inject

class ActivityLogDetailFragment : Fragment() {
@Inject lateinit var viewModelFactory: ViewModelProvider.Factory
@Inject lateinit var imageManager: ImageManager

private lateinit var viewModel: ActivityLogDetailViewModel

companion object {
Expand Down Expand Up @@ -103,7 +105,7 @@ class ActivityLogDetailFragment : Fragment() {
private fun setActorIcon(actorIcon: String?, showJetpackIcon: Boolean?) {
when {
actorIcon != null && actorIcon != "" -> {
activityActorIcon.setImageUrl(actorIcon, WPNetworkImageView.ImageType.AVATAR)
imageManager.loadIntoCircle(activityActorIcon, AVATAR, actorIcon)
activityActorIcon.visibility = View.VISIBLE
activityJetpackActorIcon.visibility = View.GONE
}
Expand All @@ -112,7 +114,7 @@ class ActivityLogDetailFragment : Fragment() {
activityActorIcon.visibility = View.GONE
}
else -> {
activityActorIcon.resetImage()
imageManager.cancelRequestAndClearImageView(activityActorIcon)
activityActorIcon.visibility = View.GONE
activityJetpackActorIcon.visibility = View.GONE
}
Expand Down
3 changes: 2 additions & 1 deletion WordPress/src/main/res/layout/activity_log_item_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
android:layout_height="wrap_content"
android:orientation="horizontal">

<org.wordpress.android.widgets.WPNetworkImageView
<ImageView
android:id="@+id/activityActorIcon"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginEnd="12dp"
android:layout_marginRight="12dp"
app:srcCompat="@drawable/ic_placeholder_blavatar_grey_lighten_20_40dp"
android:contentDescription="@null"
tools:src="@drawable/badge"/>

<ImageView
Expand Down