-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathFastImageProgressEvent.java
More file actions
34 lines (26 loc) · 895 Bytes
/
Copy pathFastImageProgressEvent.java
File metadata and controls
34 lines (26 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.dylanvann.fastimage.events;
import androidx.annotation.NonNull;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.uimanager.events.Event;
public class FastImageProgressEvent extends Event<FastImageProgressEvent> {
private final int mBytesRead;
private final int mExpectedLength;
public FastImageProgressEvent(int surfaceId, int viewTag, int bytesRead, int expectedLength) {
super(surfaceId, viewTag);
this.mBytesRead = bytesRead;
this.mExpectedLength = expectedLength;
}
@NonNull
@Override
public String getEventName() {
return "onFastImageProgress";
}
@Override
protected WritableMap getEventData() {
WritableMap eventData = Arguments.createMap();
eventData.putInt("loaded", mBytesRead);
eventData.putInt("total", mExpectedLength);
return eventData;
}
}