mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-09 17:13:46 +08:00
Backout 981069:cb671e39fd64 breaking master
fb-gh-sync-id: 052d4aab3722d44f5c4fbb0f4f50a2d71ba56927
This commit is contained in:
committed by
facebook-github-bot-5
parent
d23e622426
commit
c902ed2fe5
@@ -9,9 +9,6 @@
|
||||
|
||||
package com.facebook.react.uimanager;
|
||||
|
||||
import android.os.SystemClock;
|
||||
import android.support.v4.util.Pools;
|
||||
|
||||
import com.facebook.react.bridge.Arguments;
|
||||
import com.facebook.react.bridge.WritableMap;
|
||||
import com.facebook.react.uimanager.events.Event;
|
||||
@@ -22,30 +19,10 @@ import com.facebook.react.uimanager.events.RCTEventEmitter;
|
||||
*/
|
||||
/* package */ class OnLayoutEvent extends Event<OnLayoutEvent> {
|
||||
|
||||
private static final Pools.SynchronizedPool<OnLayoutEvent> EVENTS_POOL =
|
||||
new Pools.SynchronizedPool<>(20);
|
||||
private final int mX, mY, mWidth, mHeight;
|
||||
|
||||
private int mX, mY, mWidth, mHeight;
|
||||
|
||||
public static OnLayoutEvent obtain(int viewTag, int x, int y, int width, int height) {
|
||||
OnLayoutEvent event = EVENTS_POOL.acquire();
|
||||
if (event == null) {
|
||||
event = new OnLayoutEvent();
|
||||
}
|
||||
event.init(viewTag, x, y, width, height);
|
||||
return event;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDispose() {
|
||||
EVENTS_POOL.release(this);
|
||||
}
|
||||
|
||||
private OnLayoutEvent() {
|
||||
}
|
||||
|
||||
protected void init(int viewTag, int x, int y, int width, int height) {
|
||||
super.init(viewTag, SystemClock.uptimeMillis());
|
||||
protected OnLayoutEvent(int viewTag, int x, int y, int width, int height) {
|
||||
super(viewTag, 0);
|
||||
mX = x;
|
||||
mY = y;
|
||||
mWidth = width;
|
||||
|
||||
Reference in New Issue
Block a user