-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enable new arch & make newer libs compile under 0.72 * Setup codegen * Update podspec * Setup ios code * Fix AutoLayout subviews and footer * Implement `onBlankAreaEvent` on iOS * Update comments * Implement Android * Mound children under AutoLayoutView * Update changelog * Improve event handling * Remove context extension * Disable new arch by default * Update `podfile.lock` * update podfile --------- Co-authored-by: Talha Naqvi <naqvitalha@gmail.com>
- Loading branch information
1 parent
43c7eec
commit 029fd40
Showing
30 changed files
with
957 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
android/src/main/kotlin/com/shopify/reactnative/flash_list/BlankAreaEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
android/src/paper/java/com/facebook/react/viewmanagers/AutoLayoutViewManagerDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). | ||
* | ||
* 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); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
android/src/paper/java/com/facebook/react/viewmanagers/AutoLayoutViewManagerInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
31 changes: 31 additions & 0 deletions
31
android/src/paper/java/com/facebook/react/viewmanagers/CellContainerManagerDelegate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
android/src/paper/java/com/facebook/react/viewmanagers/CellContainerManagerInterface.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
Oops, something went wrong.