-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #790 from grahammendick/pager-fabric
- Loading branch information
Showing
12 changed files
with
124 additions
and
4 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
24 changes: 24 additions & 0 deletions
24
NavigationReactNative/src/TabBarPagerItemNativeComponent.js
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,24 @@ | ||
// @flow strict-local | ||
|
||
import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTypes'; | ||
import type {HostComponent} from 'react-native'; | ||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent'; | ||
|
||
type NativeProps = $ReadOnly<{| | ||
...ViewProps, | ||
title: string, | ||
fontFamily: string, | ||
fontWeight: string, | ||
fontStyle: string, | ||
fontSize?: WithDefault<Float, -1>, | ||
testID: string, | ||
badge: string, | ||
badgeColor: ColorValue, | ||
image: ImageSource, | ||
systemItem: string, | ||
onPress: BubblingEventHandler<null> | ||
|}>; | ||
|
||
export default (codegenNativeComponent<NativeProps>( | ||
'NVTabBarPagerItem', | ||
): HostComponent<NativeProps>); |
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
16 changes: 16 additions & 0 deletions
16
...ctNative/src/android/src/main/java/com/navigation/reactnative/TabBarPagerItemManager.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 @@ | ||
package com.navigation.reactnative; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
public class TabBarPagerItemManager extends TabBarItemManager { | ||
@NonNull | ||
@Override | ||
public String getName() { | ||
return "NVTabBarPagerItem"; | ||
} | ||
|
||
@Override | ||
public boolean needsCustomLayoutForChildren() { | ||
return true; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...tive/src/android/src/main/java/com/navigation/reactnative/TabBarPagerItemViewManager.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,18 @@ | ||
package com.navigation.reactnative; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import com.facebook.react.viewmanagers.NVTabBarPagerItemManagerInterface; | ||
|
||
public class TabBarPagerItemViewManager extends TabBarItemViewManager implements NVTabBarPagerItemManagerInterface<TabBarItemView> { | ||
@NonNull | ||
@Override | ||
public String getName() { | ||
return "NVTabBarPagerItem"; | ||
} | ||
|
||
@Override | ||
public boolean needsCustomLayoutForChildren() { | ||
return true; | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
NavigationReactNative/src/ios/NVTabBarPagerItemComponentView.h
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,13 @@ | ||
#ifdef RCT_NEW_ARCH_ENABLED | ||
#import <UIKit/UIKit.h> | ||
#import <React/RCTViewComponentView.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface NVTabBarPagerItemComponentView : RCTViewComponentView | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END | ||
|
||
#endif |
39 changes: 39 additions & 0 deletions
39
NavigationReactNative/src/ios/NVTabBarPagerItemComponentView.mm
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,39 @@ | ||
#ifdef RCT_NEW_ARCH_ENABLED | ||
#import "NVTabBarPagerItemComponentView.h" | ||
|
||
#import <react/renderer/components/navigationreactnative/ComponentDescriptors.h> | ||
#import <react/renderer/components/navigationreactnative/EventEmitters.h> | ||
#import <react/renderer/components/navigationreactnative/Props.h> | ||
#import <react/renderer/components/navigationreactnative/RCTComponentViewHelpers.h> | ||
|
||
#import "RCTFabricComponentsPlugins.h" | ||
|
||
using namespace facebook::react; | ||
|
||
@interface NVTabBarPagerItemComponentView () <RCTNVTabBarPagerItemViewProtocol> | ||
@end | ||
|
||
@implementation NVTabBarPagerItemComponentView | ||
|
||
- (instancetype)initWithFrame:(CGRect)frame | ||
{ | ||
if (self = [super initWithFrame:frame]) { | ||
} | ||
return self; | ||
} | ||
|
||
#pragma mark - RCTComponentViewProtocol | ||
|
||
+ (ComponentDescriptorProvider)componentDescriptorProvider | ||
{ | ||
return concreteComponentDescriptorProvider<NVTabBarPagerItemComponentDescriptor>(); | ||
} | ||
|
||
@end | ||
|
||
Class<RCTComponentViewProtocol> NVTabBarPagerItemCls(void) | ||
{ | ||
return NVTabBarPagerItemComponentView.class; | ||
} | ||
|
||
#endif |
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