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); }
public UIView(NSCoder aDecoder) { super((SkipInit) null); initObject(init(aDecoder)); } /*</constructors>*/
@Override public void show() { alertWindow.makeKeyAndVisible(); alertWindow.getRootViewController().getView().addSubview(this); Platform.getPlatform().runOnUIThread(() -> { setTransform(CGAffineTransform.Identity().concat(CGAffineTransform.createScale(0.5, 0.5))); isShown = true; UIView.animate(0.3, () -> { setAlpha(1); setTransform(CGAffineTransform.Identity()); }); }); }
@Override // from ViewController public void viewDidAppear(boolean animated) { super.viewDidAppear(animated); // plat.log().debug("viewDidAppear(" + animated + ")"); view.bindDrawable(); plat.graphics().viewDidInit(getView().getBounds()); }
@Override public void layoutSubviews() { super.layoutSubviews(); setFrame(parent.getBounds()); CGSize totalSize = new CGSize(); CGRect indicatorF = indicator.getBounds(); indicatorF.getSize().setWidth(Math.min(indicatorF.getSize().getWidth(), maxWidth)); totalSize.setWidth(Math.max(totalSize.getWidth(), indicatorF.getSize().getWidth())); indicatorF.setX(Math.round((bounds.getSize().getWidth() - indicatorF.getSize().getWidth()) / 2) + xPos); indicator.setFrame(indicatorF); yPos += indicatorF.getSize().getHeight();
public Rectangle getSafeAreaInsets() { if (Foundation.getMajorSystemVersion() < 11) { return rectangle; } else { UIView view = UIApplication.getSharedApplication().getKeyWindow().getRootViewController().getView(); UIEdgeInsets edgeInsets = view.getSafeAreaInsets(); double top = edgeInsets.getTop() * view.getContentScaleFactor(); double bottom = edgeInsets.getBottom() * view.getContentScaleFactor(); double left = edgeInsets.getLeft() * view.getContentScaleFactor(); double right = edgeInsets.getRight() * view.getContentScaleFactor(); rectangle.set((float) left, (float) bottom, (float) right, (float) top); return rectangle; } }
@Override public void hide() { Platform.getPlatform().runOnUIThread(() -> { if (isShown) { UIView.animate(0.3, () -> { setTransform(CGAffineTransform.Identity().concat(CGAffineTransform.createScale(1.5, 1.5))); setAlpha(0.02); }, (complete) -> { setAlpha(0); removeFromSuperview(); alertWindow.setHidden(true); }); } }); }
@Override // from ViewController public void didRotate(UIInterfaceOrientation fromOrient) { super.didRotate(fromOrient); // platform.log().debug("didRotate(" + fromOrient + "): " + bounds); platform.graphics().setSize(getView().getBounds()); platform.didRotate(fromOrient); }
public UIView(@ByVal CGRect frame) { super((SkipInit) null); initObject(init(frame)); } public UIView(NSCoder aDecoder) { super((SkipInit) null); initObject(init(aDecoder)); }
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); }
@Override // from ViewController public void didRotate(UIInterfaceOrientation fromOrient) { super.didRotate(fromOrient); // plat.log().debug("didRotate(" + fromOrient + "): " + bounds); plat.graphics().boundsChanged(getView().getBounds()); plat.orient.emit(new RoboOrientEvent.DidRotate(fromOrient)); }
@Method(selector = "initWithCoder:") public UIView(NSCoder aDecoder) { super((SkipInit) null); initObject(init(aDecoder)); } /*</constructors>*/
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); }
@Override // from ViewController public void viewDidAppear(boolean animated) { super.viewDidAppear(animated); // platform.log().debug("viewDidAppear(" + animated + "): " + bounds); EAGLContext.setCurrentContext(view.getContext()); platform.graphics().ctx.viewDidAppear(); platform.graphics().setSize(getView().getBounds()); }
@Method(selector = "initWithCoder:") public UIView(NSCoder aDecoder) { super((SkipInit) null); initObject(init(aDecoder)); } /*</constructors>*/
textfield.setText(""); textfield.setSecureTextEntry(false); ((IOSApplication)Gdx.app).getUIViewController().getView().addSubview(textfield); break; case setTextFieldListener:
@Method(selector = "initWithFrame:") public UIView(@ByVal CGRect frame) { super((SkipInit) null); initObject(init(frame)); } @Method(selector = "initWithCoder:")
@Method(selector = "initWithFrame:") public UIView(@ByVal CGRect frame) { super((SkipInit) null); initObject(init(frame)); } @Method(selector = "initWithCoder:")