Skip to content

Commit 1edf757

Browse files
committed
chore(Android): make the library build with legacy architecture (#217)
## Description This PR adds missing delegates & interfaces required for Paper build to succeed. The `TestBottomTabs` example fails to run, however it is outside of the PR scope to fix this. Will be done in follow up. ## Test code and steps to reproduce `Example` should build just fine. ## Checklist - [ ] Ensured that CI passes
1 parent f11364e commit 1edf757

File tree

4 files changed

+214
-0
lines changed

4 files changed

+214
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/**
2+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3+
*
4+
* Do not edit this file as changes may cause incorrect behavior and will be lost
5+
* once the code is regenerated.
6+
*
7+
* @generated by codegen project: GeneratePropsJavaDelegate.js
8+
*/
9+
10+
package com.facebook.react.viewmanagers;
11+
12+
import android.view.View;
13+
import androidx.annotation.Nullable;
14+
import com.facebook.react.bridge.ColorPropConverter;
15+
import com.facebook.react.bridge.ReadableMap;
16+
import com.facebook.react.uimanager.BaseViewManager;
17+
import com.facebook.react.uimanager.BaseViewManagerDelegate;
18+
import com.facebook.react.uimanager.LayoutShadowNode;
19+
20+
public class RNSBottomTabsManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RNSBottomTabsManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
21+
public RNSBottomTabsManagerDelegate(U viewManager) {
22+
super(viewManager);
23+
}
24+
@Override
25+
public void setProperty(T view, String propName, @Nullable Object value) {
26+
switch (propName) {
27+
case "tabBarBackgroundColor":
28+
mViewManager.setTabBarBackgroundColor(view, ColorPropConverter.getColor(value, view.getContext()));
29+
break;
30+
case "tabBarBlurEffect":
31+
mViewManager.setTabBarBlurEffect(view, (String) value);
32+
break;
33+
case "tabBarTintColor":
34+
mViewManager.setTabBarTintColor(view, ColorPropConverter.getColor(value, view.getContext()));
35+
break;
36+
case "tabBarItemTitleFontFamily":
37+
mViewManager.setTabBarItemTitleFontFamily(view, value == null ? null : (String) value);
38+
break;
39+
case "tabBarItemTitleFontSize":
40+
mViewManager.setTabBarItemTitleFontSize(view, value == null ? 0f : ((Double) value).floatValue());
41+
break;
42+
case "tabBarItemTitleFontWeight":
43+
mViewManager.setTabBarItemTitleFontWeight(view, value == null ? null : (String) value);
44+
break;
45+
case "tabBarItemTitleFontStyle":
46+
mViewManager.setTabBarItemTitleFontStyle(view, value == null ? null : (String) value);
47+
break;
48+
case "tabBarItemTitleFontColor":
49+
mViewManager.setTabBarItemTitleFontColor(view, ColorPropConverter.getColor(value, view.getContext()));
50+
break;
51+
case "tabBarItemTitlePositionAdjustment":
52+
mViewManager.setTabBarItemTitlePositionAdjustment(view, (ReadableMap) value);
53+
break;
54+
case "tabBarItemIconColor":
55+
mViewManager.setTabBarItemIconColor(view, ColorPropConverter.getColor(value, view.getContext()));
56+
break;
57+
case "tabBarItemBadgeBackgroundColor":
58+
mViewManager.setTabBarItemBadgeBackgroundColor(view, ColorPropConverter.getColor(value, view.getContext()));
59+
break;
60+
case "controlNavigationStateInJS":
61+
mViewManager.setControlNavigationStateInJS(view, value == null ? false : (boolean) value);
62+
break;
63+
default:
64+
super.setProperty(view, propName, value);
65+
}
66+
}
67+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3+
*
4+
* Do not edit this file as changes may cause incorrect behavior and will be lost
5+
* once the code is regenerated.
6+
*
7+
* @generated by codegen project: GeneratePropsJavaInterface.js
8+
*/
9+
10+
package com.facebook.react.viewmanagers;
11+
12+
import android.view.View;
13+
import androidx.annotation.Nullable;
14+
import com.facebook.react.bridge.ReadableMap;
15+
16+
17+
public interface RNSBottomTabsManagerInterface<T extends View> {
18+
void setTabBarBackgroundColor(T view, @Nullable Integer value);
19+
void setTabBarBlurEffect(T view, @Nullable String value);
20+
void setTabBarTintColor(T view, @Nullable Integer value);
21+
void setTabBarItemTitleFontFamily(T view, @Nullable String value);
22+
void setTabBarItemTitleFontSize(T view, float value);
23+
void setTabBarItemTitleFontWeight(T view, @Nullable String value);
24+
void setTabBarItemTitleFontStyle(T view, @Nullable String value);
25+
void setTabBarItemTitleFontColor(T view, @Nullable Integer value);
26+
void setTabBarItemTitlePositionAdjustment(T view, @Nullable ReadableMap value);
27+
void setTabBarItemIconColor(T view, @Nullable Integer value);
28+
void setTabBarItemBadgeBackgroundColor(T view, @Nullable Integer value);
29+
void setControlNavigationStateInJS(T view, boolean value);
30+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/**
2+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3+
*
4+
* Do not edit this file as changes may cause incorrect behavior and will be lost
5+
* once the code is regenerated.
6+
*
7+
* @generated by codegen project: GeneratePropsJavaDelegate.js
8+
*/
9+
10+
package com.facebook.react.viewmanagers;
11+
12+
import android.view.View;
13+
import androidx.annotation.Nullable;
14+
import com.facebook.react.bridge.ColorPropConverter;
15+
import com.facebook.react.bridge.ReadableMap;
16+
import com.facebook.react.uimanager.BaseViewManager;
17+
import com.facebook.react.uimanager.BaseViewManagerDelegate;
18+
import com.facebook.react.uimanager.LayoutShadowNode;
19+
20+
public class RNSBottomTabsScreenManagerDelegate<T extends View, U extends BaseViewManager<T, ? extends LayoutShadowNode> & RNSBottomTabsScreenManagerInterface<T>> extends BaseViewManagerDelegate<T, U> {
21+
public RNSBottomTabsScreenManagerDelegate(U viewManager) {
22+
super(viewManager);
23+
}
24+
@Override
25+
public void setProperty(T view, String propName, @Nullable Object value) {
26+
switch (propName) {
27+
case "isFocused":
28+
mViewManager.setIsFocused(view, value == null ? false : (boolean) value);
29+
break;
30+
case "tabKey":
31+
mViewManager.setTabKey(view, value == null ? null : (String) value);
32+
break;
33+
case "tabBarBackgroundColor":
34+
mViewManager.setTabBarBackgroundColor(view, ColorPropConverter.getColor(value, view.getContext()));
35+
break;
36+
case "tabBarBlurEffect":
37+
mViewManager.setTabBarBlurEffect(view, (String) value);
38+
break;
39+
case "tabBarItemTitleFontFamily":
40+
mViewManager.setTabBarItemTitleFontFamily(view, value == null ? null : (String) value);
41+
break;
42+
case "tabBarItemTitleFontSize":
43+
mViewManager.setTabBarItemTitleFontSize(view, value == null ? 0f : ((Double) value).floatValue());
44+
break;
45+
case "tabBarItemTitleFontWeight":
46+
mViewManager.setTabBarItemTitleFontWeight(view, value == null ? null : (String) value);
47+
break;
48+
case "tabBarItemTitleFontStyle":
49+
mViewManager.setTabBarItemTitleFontStyle(view, value == null ? null : (String) value);
50+
break;
51+
case "tabBarItemTitleFontColor":
52+
mViewManager.setTabBarItemTitleFontColor(view, ColorPropConverter.getColor(value, view.getContext()));
53+
break;
54+
case "tabBarItemTitlePositionAdjustment":
55+
mViewManager.setTabBarItemTitlePositionAdjustment(view, (ReadableMap) value);
56+
break;
57+
case "tabBarItemIconColor":
58+
mViewManager.setTabBarItemIconColor(view, ColorPropConverter.getColor(value, view.getContext()));
59+
break;
60+
case "tabBarItemBadgeBackgroundColor":
61+
mViewManager.setTabBarItemBadgeBackgroundColor(view, ColorPropConverter.getColor(value, view.getContext()));
62+
break;
63+
case "title":
64+
mViewManager.setTitle(view, value == null ? null : (String) value);
65+
break;
66+
case "iconSFSymbolName":
67+
mViewManager.setIconSFSymbolName(view, value == null ? null : (String) value);
68+
break;
69+
case "selectedIconSFSymbolName":
70+
mViewManager.setSelectedIconSFSymbolName(view, value == null ? null : (String) value);
71+
break;
72+
case "badgeValue":
73+
mViewManager.setBadgeValue(view, value == null ? null : (String) value);
74+
break;
75+
case "specialEffects":
76+
mViewManager.setSpecialEffects(view, (ReadableMap) value);
77+
break;
78+
default:
79+
super.setProperty(view, propName, value);
80+
}
81+
}
82+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
3+
*
4+
* Do not edit this file as changes may cause incorrect behavior and will be lost
5+
* once the code is regenerated.
6+
*
7+
* @generated by codegen project: GeneratePropsJavaInterface.js
8+
*/
9+
10+
package com.facebook.react.viewmanagers;
11+
12+
import android.view.View;
13+
import androidx.annotation.Nullable;
14+
import com.facebook.react.bridge.ReadableMap;
15+
16+
17+
public interface RNSBottomTabsScreenManagerInterface<T extends View> {
18+
void setIsFocused(T view, boolean value);
19+
void setTabKey(T view, @Nullable String value);
20+
void setTabBarBackgroundColor(T view, @Nullable Integer value);
21+
void setTabBarBlurEffect(T view, @Nullable String value);
22+
void setTabBarItemTitleFontFamily(T view, @Nullable String value);
23+
void setTabBarItemTitleFontSize(T view, float value);
24+
void setTabBarItemTitleFontWeight(T view, @Nullable String value);
25+
void setTabBarItemTitleFontStyle(T view, @Nullable String value);
26+
void setTabBarItemTitleFontColor(T view, @Nullable Integer value);
27+
void setTabBarItemTitlePositionAdjustment(T view, @Nullable ReadableMap value);
28+
void setTabBarItemIconColor(T view, @Nullable Integer value);
29+
void setTabBarItemBadgeBackgroundColor(T view, @Nullable Integer value);
30+
void setTitle(T view, @Nullable String value);
31+
void setIconSFSymbolName(T view, @Nullable String value);
32+
void setSelectedIconSFSymbolName(T view, @Nullable String value);
33+
void setBadgeValue(T view, @Nullable String value);
34+
void setSpecialEffects(T view, @Nullable ReadableMap value);
35+
}

0 commit comments

Comments
 (0)