forked from software-mansion/react-native-screens
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(android): Implement missing codegen interfaces (software-mansio…
…n#2163) ## Description Currently when we change native props autogenerated by codegen we need to manually update changed files. We're going to automate so everything is copied automatically, but as a first step we need to implement those that aren't yet. This is what this PR introduces. ## Test code and steps to reproduce Go through Example app, nothing should change.
- Loading branch information
1 parent
9f21a7b
commit fb8c7e6
Showing
6 changed files
with
271 additions
and
26 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
25 changes: 25 additions & 0 deletions
25
...oid/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContainerManagerDelegate.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,25 @@ | ||
/** | ||
* 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 RNSScreenContainerManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & RNSScreenContainerManagerInterface<T>> extends BaseViewManagerDelegate<T, U> { | ||
public RNSScreenContainerManagerDelegate(U viewManager) { | ||
super(viewManager); | ||
} | ||
@Override | ||
public void setProperty(T view, String propName, @Nullable Object value) { | ||
super.setProperty(view, propName, value); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...id/src/paper/java/com/facebook/react/viewmanagers/RNSScreenContainerManagerInterface.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 RNSScreenContainerManagerInterface<T extends View> { | ||
// No props | ||
} |
99 changes: 99 additions & 0 deletions
99
android/src/paper/java/com/facebook/react/viewmanagers/RNSSearchBarManagerDelegate.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,99 @@ | ||
/** | ||
* 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.bridge.ColorPropConverter; | ||
import com.facebook.react.bridge.ReadableArray; | ||
import com.facebook.react.uimanager.BaseViewManagerDelegate; | ||
import com.facebook.react.uimanager.BaseViewManagerInterface; | ||
|
||
public class RNSSearchBarManagerDelegate<T extends View, U extends BaseViewManagerInterface<T> & RNSSearchBarManagerInterface<T>> extends BaseViewManagerDelegate<T, U> { | ||
public RNSSearchBarManagerDelegate(U viewManager) { | ||
super(viewManager); | ||
} | ||
@Override | ||
public void setProperty(T view, String propName, @Nullable Object value) { | ||
switch (propName) { | ||
case "hideWhenScrolling": | ||
mViewManager.setHideWhenScrolling(view, value == null ? false : (boolean) value); | ||
break; | ||
case "autoCapitalize": | ||
mViewManager.setAutoCapitalize(view, (String) value); | ||
break; | ||
case "placeholder": | ||
mViewManager.setPlaceholder(view, value == null ? null : (String) value); | ||
break; | ||
case "placement": | ||
mViewManager.setPlacement(view, (String) value); | ||
break; | ||
case "obscureBackground": | ||
mViewManager.setObscureBackground(view, value == null ? false : (boolean) value); | ||
break; | ||
case "hideNavigationBar": | ||
mViewManager.setHideNavigationBar(view, value == null ? false : (boolean) value); | ||
break; | ||
case "cancelButtonText": | ||
mViewManager.setCancelButtonText(view, value == null ? null : (String) value); | ||
break; | ||
case "barTintColor": | ||
mViewManager.setBarTintColor(view, ColorPropConverter.getColor(value, view.getContext())); | ||
break; | ||
case "tintColor": | ||
mViewManager.setTintColor(view, ColorPropConverter.getColor(value, view.getContext())); | ||
break; | ||
case "textColor": | ||
mViewManager.setTextColor(view, ColorPropConverter.getColor(value, view.getContext())); | ||
break; | ||
case "disableBackButtonOverride": | ||
mViewManager.setDisableBackButtonOverride(view, value == null ? false : (boolean) value); | ||
break; | ||
case "inputType": | ||
mViewManager.setInputType(view, value == null ? null : (String) value); | ||
break; | ||
case "hintTextColor": | ||
mViewManager.setHintTextColor(view, ColorPropConverter.getColor(value, view.getContext())); | ||
break; | ||
case "headerIconColor": | ||
mViewManager.setHeaderIconColor(view, ColorPropConverter.getColor(value, view.getContext())); | ||
break; | ||
case "shouldShowHintSearchIcon": | ||
mViewManager.setShouldShowHintSearchIcon(view, value == null ? true : (boolean) value); | ||
break; | ||
default: | ||
super.setProperty(view, propName, value); | ||
} | ||
} | ||
|
||
@Override | ||
public void receiveCommand(T view, String commandName, ReadableArray args) { | ||
switch (commandName) { | ||
case "blur": | ||
mViewManager.blur(view); | ||
break; | ||
case "focus": | ||
mViewManager.focus(view); | ||
break; | ||
case "clearText": | ||
mViewManager.clearText(view); | ||
break; | ||
case "toggleCancelButton": | ||
mViewManager.toggleCancelButton(view, args.getBoolean(0)); | ||
break; | ||
case "setText": | ||
mViewManager.setText(view, args.getString(0)); | ||
break; | ||
case "cancelSearch": | ||
mViewManager.cancelSearch(view); | ||
break; | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
android/src/paper/java/com/facebook/react/viewmanagers/RNSSearchBarManagerInterface.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,37 @@ | ||
/** | ||
* 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; | ||
import androidx.annotation.Nullable; | ||
|
||
public interface RNSSearchBarManagerInterface<T extends View> { | ||
void setHideWhenScrolling(T view, boolean value); | ||
void setAutoCapitalize(T view, @Nullable String value); | ||
void setPlaceholder(T view, @Nullable String value); | ||
void setPlacement(T view, @Nullable String value); | ||
void setObscureBackground(T view, boolean value); | ||
void setHideNavigationBar(T view, boolean value); | ||
void setCancelButtonText(T view, @Nullable String value); | ||
void setBarTintColor(T view, @Nullable Integer value); | ||
void setTintColor(T view, @Nullable Integer value); | ||
void setTextColor(T view, @Nullable Integer value); | ||
void setDisableBackButtonOverride(T view, boolean value); | ||
void setInputType(T view, @Nullable String value); | ||
void setHintTextColor(T view, @Nullable Integer value); | ||
void setHeaderIconColor(T view, @Nullable Integer value); | ||
void setShouldShowHintSearchIcon(T view, boolean value); | ||
void blur(T view); | ||
void focus(T view); | ||
void clearText(T view); | ||
void toggleCancelButton(T view, boolean flag); | ||
void setText(T view, String text); | ||
void cancelSearch(T view); | ||
} |