-
Notifications
You must be signed in to change notification settings - Fork 289
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
New architecture support #550
Changes from all commits
60a048a
acda193
9c36e0a
ade08ac
a77dc81
c12786f
2c7f3c7
ddb6c6a
eb5cfad
8c212ee
c7528cd
44302e9
25abbb7
e5d3bde
03815c9
c740e67
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
@file:Suppress("DEPRECATION") // We want to use RCTEventEmitter for interop purposes | ||
package com.shopify.reactnative.flash_list | ||
|
||
import com.facebook.react.bridge.Arguments | ||
import com.facebook.react.bridge.WritableMap | ||
import com.facebook.react.uimanager.events.Event | ||
import com.facebook.react.uimanager.events.RCTEventEmitter | ||
|
||
class BlankAreaEvent( | ||
surfaceId: Int, | ||
viewTag: Int, | ||
private val offsetStart: Double, | ||
private val offsetEnd: Double | ||
): Event<BlankAreaEvent>(surfaceId, viewTag) { | ||
override fun getEventName() = EVENT_NAME | ||
|
||
override fun getEventData(): WritableMap = Arguments.createMap().apply { | ||
putDouble("offsetStart", offsetStart) | ||
putDouble("offsetEnd", offsetEnd) | ||
} | ||
|
||
override fun dispatch(rctEventEmitter: RCTEventEmitter) { | ||
rctEventEmitter.receiveEvent(viewTag, eventName, eventData) | ||
} | ||
|
||
companion object { | ||
const val EVENT_NAME: String = "onBlankAreaEvent" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is the generator always creating code for paper as well? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's not. I copied those files without modifying them. Do you think those comments should be removed? |
||
* | ||
* Do not edit this file as changes may cause incorrect behavior and will be lost | ||
* once the code is regenerated. | ||
* | ||
* @generated by codegen project: GeneratePropsJavaDelegate.js | ||
*/ | ||
|
||
package com.facebook.react.viewmanagers; | ||
|
||
import android.view.View; | ||
import androidx.annotation.Nullable; | ||
import com.facebook.react.uimanager.BaseViewManagerDelegate; | ||
import com.facebook.react.uimanager.BaseViewManagerInterface; | ||
|
||
public class AutoLayoutViewManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & AutoLayoutViewManagerInterface<T>> extends BaseViewManagerDelegate<T, U> { | ||
public AutoLayoutViewManagerDelegate(U viewManager) { | ||
super(viewManager); | ||
} | ||
@Override | ||
public void setProperty(T view, String propName, @Nullable Object value) { | ||
switch (propName) { | ||
case "horizontal": | ||
mViewManager.setHorizontal(view, value == null ? false : (boolean) value); | ||
break; | ||
case "scrollOffset": | ||
mViewManager.setScrollOffset(view, value == null ? 0f : ((Double) value).doubleValue()); | ||
break; | ||
case "windowSize": | ||
mViewManager.setWindowSize(view, value == null ? 0f : ((Double) value).doubleValue()); | ||
break; | ||
case "renderAheadOffset": | ||
mViewManager.setRenderAheadOffset(view, value == null ? 0f : ((Double) value).doubleValue()); | ||
break; | ||
case "enableInstrumentation": | ||
mViewManager.setEnableInstrumentation(view, value == null ? false : (boolean) value); | ||
break; | ||
case "disableAutoLayout": | ||
mViewManager.setDisableAutoLayout(view, value == null ? false : (boolean) value); | ||
break; | ||
default: | ||
super.setProperty(view, propName, value); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). | ||
* | ||
* Do not edit this file as changes may cause incorrect behavior and will be lost | ||
* once the code is regenerated. | ||
* | ||
* @generated by codegen project: GeneratePropsJavaInterface.js | ||
*/ | ||
|
||
package com.facebook.react.viewmanagers; | ||
|
||
import android.view.View; | ||
|
||
public interface AutoLayoutViewManagerInterface<T extends View> { | ||
void setHorizontal(T view, boolean value); | ||
void setScrollOffset(T view, double value); | ||
void setWindowSize(T view, double value); | ||
void setRenderAheadOffset(T view, double value); | ||
void setEnableInstrumentation(T view, boolean value); | ||
void setDisableAutoLayout(T view, boolean value); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). | ||
* | ||
* Do not edit this file as changes may cause incorrect behavior and will be lost | ||
* once the code is regenerated. | ||
* | ||
* @generated by codegen project: GeneratePropsJavaDelegate.js | ||
*/ | ||
|
||
package com.facebook.react.viewmanagers; | ||
|
||
import android.view.View; | ||
import androidx.annotation.Nullable; | ||
import com.facebook.react.uimanager.BaseViewManagerDelegate; | ||
import com.facebook.react.uimanager.BaseViewManagerInterface; | ||
|
||
public class CellContainerManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & CellContainerManagerInterface<T>> extends BaseViewManagerDelegate<T, U> { | ||
public CellContainerManagerDelegate(U viewManager) { | ||
super(viewManager); | ||
} | ||
@Override | ||
public void setProperty(T view, String propName, @Nullable Object value) { | ||
switch (propName) { | ||
case "index": | ||
mViewManager.setIndex(view, value == null ? 0 : ((Double) value).intValue()); | ||
break; | ||
default: | ||
super.setProperty(view, propName, value); | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen). | ||
* | ||
* Do not edit this file as changes may cause incorrect behavior and will be lost | ||
* once the code is regenerated. | ||
* | ||
* @generated by codegen project: GeneratePropsJavaInterface.js | ||
*/ | ||
|
||
package com.facebook.react.viewmanagers; | ||
|
||
import android.view.View; | ||
|
||
public interface CellContainerManagerInterface<T extends View> { | ||
void setIndex(T view, int value); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need here both
onBlankAreaEvent
andtopOnBlankAreaEvent
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I don't remember 😅. It's been a while since I've written this, but it doesn't seem to be causing any issues when I removed
topOnBlankAreaEvent
.