-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathFastImageErrorEvent.java
More file actions
34 lines (28 loc) · 898 Bytes
/
Copy pathFastImageErrorEvent.java
File metadata and controls
34 lines (28 loc) · 898 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 androidx.annotation.Nullable;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.uimanager.events.Event;
public class FastImageErrorEvent extends Event<FastImageErrorEvent> {
@Nullable
private final ReadableMap mSource;
public FastImageErrorEvent(int surfaceId, int viewTag, @Nullable ReadableMap source) {
super(surfaceId, viewTag);
mSource = source;
}
@NonNull
@Override
public String getEventName() {
return "onFastImageError";
}
@Override
protected WritableMap getEventData() {
WritableMap eventData = Arguments.createMap();
if (mSource != null) {
eventData.putString("message", "Invalid source prop:" + mSource);
}
return eventData;
}
}