Skip to content

Commit

Permalink
Added SimpleImagePerfNotifier that delegates image perf events to a s…
Browse files Browse the repository at this point in the history
…ingle image perf data listener

Reviewed By: javache

Differential Revision: D51202696

fbshipit-source-id: a9e8325aed6bfaab2edfa59b401af38dd36fdd7f
  • Loading branch information
oprisnik authored and facebook-github-bot committed Nov 10, 2023
1 parent e1d46e7 commit ac7d9c4
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.fresco.ui.common

class SimpleImagePerfNotifier(private val imagePerfDataListener: ImagePerfDataListener) :
ImagePerfNotifier {

override fun notifyListenersOfVisibilityStateUpdate(
state: ImagePerfState,
visibilityState: VisibilityState
) {
imagePerfDataListener.onImageVisibilityUpdated(state.snapshot(), visibilityState)
}

override fun notifyStatusUpdated(state: ImagePerfState, imageLoadStatus: ImageLoadStatus) {
imagePerfDataListener.onImageLoadStatusUpdated(state.snapshot(), imageLoadStatus)
}
}

0 comments on commit ac7d9c4

Please sign in to comment.