org.robovm.objc.Selector Java Examples
The following examples show how to use
org.robovm.objc.Selector.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IosControllerManager.java From gdx-controllerutils with Apache License 2.0 | 5 votes |
public static void enableICade(UIViewController controller, Selector action) { for (int i = 0; i < ICadeController.KEYS_TO_HANDLE.length(); i++) { controller.addKeyCommand(new UIKeyCommand(Character.toString(ICadeController.KEYS_TO_HANDLE.charAt(i)), UIKeyModifierFlags.None, action)); } controller.becomeFirstResponder(); Gdx.app.log("Controllers", "iCade support activated"); }
Example #2
Source File: MetalBasic2DViewController.java From robovm-samples with Apache License 2.0 | 5 votes |
@Override public void viewDidLoad() { super.viewDidLoad(); getView().setBackgroundColor(UIColor.white()); setupMetal(); buildPipeline(); timer = UIScreen.getMainScreen().getDisplayLink(this, Selector.register("redraw")); timer.addToRunLoop(NSRunLoop.getMain(), NSRunLoopMode.Default); }
Example #3
Source File: QuestionViewController.java From robovm-samples with Apache License 2.0 | 5 votes |
/** * We must disambiguate which QuestionViewController should handle the * exitToQuizStart: action as there will be several QuestionViewController * instances on the navigation stack when the unwind segue is triggered. By * default, a UINavigationController (or QuizContainerViewController) * searches its viewControllers array in reverse. Without overriding this * method, the QuestionViewController directly preceding the results screen * would be selected as the destination of the unwind segue. */ @Override public boolean canPerformUnwind(Selector action, UIViewController fromViewController, NSObject sender) { // Always check if the view controller implements the unwind action by // calling the super's implementation. if (super.canPerformUnwind(action, fromViewController, sender)) { // The first QuestionViewController in the navigation stack should // handle the unwind action. return this == ((UINavigationController) getParentViewController()).getViewControllers().get(0); } return false; }
Example #4
Source File: MetalBasic3DViewController.java From robovm-samples with Apache License 2.0 | 4 votes |
private void dispatchGameLoop() { // create a game loop timer using a display link timer = UIScreen.getMainScreen().getDisplayLink(this, Selector.register("gameloop")); timer.setFrameInterval(interval); timer.addToRunLoop(NSRunLoop.getMain(), NSRunLoopMode.Default); }
Example #5
Source File: IOSMini2DxGraphics.java From mini2Dx with Apache License 2.0 | 4 votes |
@Callback @BindSelector("shouldAutorotateToInterfaceOrientation:") private static boolean shouldAutorotateToInterfaceOrientation (IOSUIViewController self, Selector sel, UIInterfaceOrientation orientation) { return self.shouldAutorotateToInterfaceOrientation(orientation); }