@Override public UIInterfaceOrientationMask getSupportedInterfaceOrientations () { long mask = 0; if (app.config.orientationLandscape) { mask |= ((1 << UIInterfaceOrientation.LandscapeLeft.value()) | (1 << UIInterfaceOrientation.LandscapeRight.value())); } if (app.config.orientationPortrait) { mask |= ((1 << UIInterfaceOrientation.Portrait.value()) | (1 << UIInterfaceOrientation.PortraitUpsideDown.value())); } return new UIInterfaceOrientationMask(mask); }
@Override public Orientation getNativeOrientation () { switch (app.uiApp.getStatusBarOrientation()) { case LandscapeLeft: case LandscapeRight: return Orientation.Landscape; default: return Orientation.Portrait; } }
@Override public String getContents () { return UIPasteboard.getGeneralPasteboard().getString(); } };
private void createDefaultTextField () { textfield = new UITextField(new CGRect(10, 10, 100, 50)); //Parameters // Setting parameters textfield.setKeyboardType(UIKeyboardType.Default); textfield.setReturnKeyType(UIReturnKeyType.Done); textfield.setAutocapitalizationType(UITextAutocapitalizationType.None); textfield.setAutocorrectionType(UITextAutocorrectionType.No); textfield.setSpellCheckingType(UITextSpellCheckingType.No); textfield.setHidden(true); // Text field needs to have at least one symbol - so we can use backspace textfield.setText("x"); app.getUIViewController().getView().addSubview(textfield); }
void setupPeripherals () { //motionManager = new CMMotionManager(); setupAccelerometer(); setupCompass(); UIDevice device = UIDevice.getCurrentDevice(); if (device.getModel().equalsIgnoreCase("iphone")) hasVibrator = true; if (app.getIosVersion() >= 9){ UIForceTouchCapability forceTouchCapability = UIScreen.getMainScreen().getTraitCollection().getForceTouchCapability(); pressureSupported = forceTouchCapability == UIForceTouchCapability.Available; } }
@Override public void clicked (UIAlertView view, long clicked) { if (clicked == 0) { // user clicked "Cancel" button listener.canceled(); } else if (clicked == 1) { // user clicked "Ok" button UITextField textField = view.getTextField(0); listener.input(textField.getText()); } delegate = null; }
@Override public void setOnscreenKeyboardVisible (boolean visible) { if (textfield == null) createDefaultTextField(); if (visible) { textfield.becomeFirstResponder(); textfield.setDelegate(textDelegate); } else { textfield.resignFirstResponder(); } }
@Override public boolean openURI (String URI) { NSURL url = new NSURL(URI); if (uiApp.canOpenURL(url)) { uiApp.openURL(url); return true; } return false; } }
@Override public boolean shouldEndEditing (UITextField textField) { // Text field needs to have at least one symbol - so we can use backspace textField.setText("x"); Gdx.graphics.requestRendering(); return true; }
@Override public void setContents (String content) { UIPasteboard.getGeneralPasteboard().setString(content); }
private void createDefaultTextField () { textfield = new UITextField(new CGRect(10, 10, 100, 50)); //Parameters // Setting parameters textfield.setKeyboardType(UIKeyboardType.Default); textfield.setReturnKeyType(UIReturnKeyType.Done); textfield.setAutocapitalizationType(UITextAutocapitalizationType.None); textfield.setAutocorrectionType(UITextAutocorrectionType.No); textfield.setSpellCheckingType(UITextSpellCheckingType.No); textfield.setHidden(true); // Text field needs to have at least one symbol - so we can use backspace textfield.setText("x"); app.getUIViewController().getView().addSubview(textfield); }
void setupPeripherals () { //motionManager = new CMMotionManager(); setupAccelerometer(); setupCompass(); UIDevice device = UIDevice.getCurrentDevice(); if (device.getModel().equalsIgnoreCase("iphone")) hasVibrator = true; if (app.getIosVersion() >= 9){ UIForceTouchCapability forceTouchCapability = UIScreen.getMainScreen().getTraitCollection().getForceTouchCapability(); pressureSupported = forceTouchCapability == UIForceTouchCapability.Available; } }
@Override public void clicked (UIAlertView view, long clicked) { if (clicked == 0) { // user clicked "Cancel" button listener.canceled(); } else if (clicked == 1) { // user clicked "Ok" button UITextField textField = view.getTextField(0); listener.input(textField.getText()); } delegate = null; }
@Override public UIInterfaceOrientationMask getSupportedInterfaceOrientations () { long mask = 0; if (app.config.orientationLandscape) { mask |= ((1 << UIInterfaceOrientation.LandscapeLeft.value()) | (1 << UIInterfaceOrientation.LandscapeRight.value())); } if (app.config.orientationPortrait) { mask |= ((1 << UIInterfaceOrientation.Portrait.value()) | (1 << UIInterfaceOrientation.PortraitUpsideDown.value())); } return new UIInterfaceOrientationMask(mask); }
@Override public void setOnscreenKeyboardVisible (boolean visible) { if (textfield == null) createDefaultTextField(); if (visible) { textfield.becomeFirstResponder(); textfield.setDelegate(textDelegate); } else { textfield.resignFirstResponder(); } }
@Override public String getContents () { return UIPasteboard.getGeneralPasteboard().getString(); } };
@Override public void setContents (String content) { UIPasteboard.getGeneralPasteboard().setString(content); }
@Override public Orientation getNativeOrientation () { switch (app.uiApp.getStatusBarOrientation()) { case LandscapeLeft: case LandscapeRight: return Orientation.Landscape; default: return Orientation.Portrait; } }
@Override public int getRotation () { // we measure orientation counter clockwise, just like on Android switch (app.uiApp.getStatusBarOrientation()) { case LandscapeLeft: return 270; case PortraitUpsideDown: return 180; case LandscapeRight: return 90; case Portrait: default: return 0; } }
@Override public int getRotation () { // we measure orientation counter clockwise, just like on Android switch (app.uiApp.getStatusBarOrientation()) { case LandscapeLeft: return 270; case PortraitUpsideDown: return 180; case LandscapeRight: return 90; case Portrait: default: return 0; } }