mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Fix Java compile errors in JS-generated receiveCommand method
Summary: This diff adds a missing `switch` statement Reviewed By: makovkastar Differential Revision: D16892042 fbshipit-source-id: c162655445f3c0891d2377595a9389d419713bdf
This commit is contained in:
1 parent
b9899222a3
commit
cddc2c6c72
2 files changed
+22
-16
No files matched your search
+9
-7
@@ -43,7 +43,9 @@ const propSetterTemplate = `
|
||||
|
||||
const commandsTemplate = `
|
||||
public void receiveCommand(::_INTERFACE_CLASSNAME_::<T> viewManager, T view, String commandName, ReadableArray args) {
|
||||
::_COMMAND_CASES_::
|
||||
switch (commandName) {
|
||||
::_COMMAND_CASES_::
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -173,13 +175,13 @@ function generateCommandCasesString(
|
||||
const commandMethods = component.commands
|
||||
.map(command => {
|
||||
return `case "${command.name}":
|
||||
viewManager.${toSafeJavaString(
|
||||
command.name,
|
||||
false,
|
||||
)}(${getCommandArguments(command)});
|
||||
break;`;
|
||||
viewManager.${toSafeJavaString(
|
||||
command.name,
|
||||
false,
|
||||
)}(${getCommandArguments(command)});
|
||||
break;`;
|
||||
})
|
||||
.join('\n' + ' ');
|
||||
.join('\n' + ' ');
|
||||
|
||||
return commandMethods;
|
||||
}
|
||||
|
||||
+13
-9
@@ -168,12 +168,14 @@ public class CommandNativeComponentManagerDelegate<T extends View, U extends Bas
|
||||
}
|
||||
|
||||
public void receiveCommand(CommandNativeComponentManagerInterface<T> viewManager, T view, String commandName, ReadableArray args) {
|
||||
case \\"flashScrollIndicators\\":
|
||||
viewManager.flashScrollIndicators(view);
|
||||
break;
|
||||
case \\"allTypes\\":
|
||||
viewManager.allTypes(view, args.getInt(0), args.getFloat(1), args.getDouble(2), args.getString(3), args.getBoolean(4));
|
||||
break;
|
||||
switch (commandName) {
|
||||
case \\"flashScrollIndicators\\":
|
||||
viewManager.flashScrollIndicators(view);
|
||||
break;
|
||||
case \\"allTypes\\":
|
||||
viewManager.allTypes(view, args.getInt(0), args.getFloat(1), args.getDouble(2), args.getString(3), args.getBoolean(4));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
",
|
||||
@@ -208,9 +210,11 @@ public class CommandNativeComponentManagerDelegate<T extends View, U extends Bas
|
||||
}
|
||||
|
||||
public void receiveCommand(CommandNativeComponentManagerInterface<T> viewManager, T view, String commandName, ReadableArray args) {
|
||||
case \\"hotspotUpdate\\":
|
||||
viewManager.hotspotUpdate(view, args.getInt(0), args.getInt(1));
|
||||
break;
|
||||
switch (commandName) {
|
||||
case \\"hotspotUpdate\\":
|
||||
viewManager.hotspotUpdate(view, args.getInt(0), args.getInt(1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
",
|
||||
|
||||
Reference in new issue
Block a user