@Override public void didFinishLoad(UIWebView webView) { String loadedUrl = webView.getRequest().getURL().getAbsoluteString(); log.debug("DidFinishHtmlLoad {}", loadedUrl); if (loadedUrl.startsWith("http://oauth.team-cachebox.de/") || loadedUrl.startsWith("http://staging.oauth.team-cachebox.de/")) { //parse content of oauth result String content = webView.evaluateJavaScript("document.body.textContent"); String search = "Access token: "; int pos = content.indexOf(search) + search.length(); // between pos und pos2 shut be a valid AccessToken!!! final String accessToken = content.substring(pos).trim(); log.debug("pos: {}, AccesToken= {}", pos, accessToken); this.callBack.callBack(accessToken); //reload GlView webView.removeFromSuperview(); ((IOSApplication) Gdx.app).getUIWindow().setRootViewController(this.mainViewController); ((IOSApplication) Gdx.app).getUIWindow().makeKeyAndVisible(); } }
@Override protected void getPlatformDescriptionView(final GenericCallBack<PlatformDescriptionView> callBack) { log.debug("show WebView as descriptionView"); try { if (descriptionView == null) { UIViewController mainViewController = ((IOSApplication) Gdx.app).getUIWindow().getRootViewController(); descriptionView = new IOS_DescriptionView(mainViewController); log.debug("return new DescriptionView"); } else { log.debug("return existing DescriptionView"); } callBack.callBack(descriptionView); } catch (Exception e) { log.error("show web view", e); } }
@Override protected IOSApplication createApplication() { Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() { @Override public void uncaughtException(Thread t, Throwable e) { /* * Avoid instantiating LoggerFactory in a static context to work around a race condition * caused by IOSApplication changing System.out/System.err */ Logger logger = LoggerFactory.getLogger(IosLauncher.class); logger.error("Uncaught exception from {}", t, e); } }); IOSApplicationConfiguration config = new IOSApplicationConfiguration(); InternalGdxFileSystem resourceFileSystem = new InternalGdxFileSystem(""); IosLocalFileSystem outputFileSystem = new IosLocalFileSystem(); Launcher launcher = new Launcher(resourceFileSystem, outputFileSystem); return new IOSApplication(launcher, config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new Game(new Advertisements() { @Override public void showAds() { } }), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); final String version = NSBundle.getMainBundle().getInfoDictionaryObject("CFBundleShortVersionString").toString(); return new IOSApplication(new PixelDungeon(new PDPlatformSupport(version, null, new IOSInputProcessor())), config); }
@Override protected IOSApplication createApplication() { CB.setGlobalScale(1); final String appDir = System.getenv("HOME"); final String localPath = appDir + "/Library/local/"; LibgdxLogger.PROPERTIES_FILE_HANDLE = new LibgdxLoggerIosFileHandle(localPath, Files.FileType.Absolute).child(LibgdxLogger.CONFIGURATION_FILE_XML); LibgdxLogger.initial(LibgdxLogger.PROPERTIES_FILE_HANDLE); //initialize platform bitmap factory IosGraphics.init(); //initialize platform connector PlatformConnector.init(new IOS_PlatformConnector(this)); IOSApplicationConfiguration config = new IOSApplicationConfiguration(); config.multisample = GLKViewDrawableMultisample._4X; config.orientationLandscape = false; config.orientationPortrait = true; config.stencilFormat = GLKViewDrawableStencilFormat._8; GdxAssets.init("assets/"); GLAdapter.init(new IosGL()); return new IOSApplication(new CacheboxMain(), config); }
@Override public void display() { CGRect rect = new CGRect(20, 20, 200, 200); webView.setAccessibilityFrame(rect); mainViewController.addChildViewController(this); webView.setBounds(rect); ((IOSApplication) Gdx.app).getUIWindow().addSubview(webView); }
@Override protected void generateApiKey(GenericCallBack<String> callBack) { log.debug("show WebView for get API key"); try { UIViewController mainViewController = ((IOSApplication) Gdx.app).getUIWindow().getRootViewController(); GenerateApiKeyWebViewController controller = new GenerateApiKeyWebViewController(callBack, mainViewController); ((IOSApplication) Gdx.app).getUIWindow().setRootViewController(controller); ((IOSApplication) Gdx.app).getUIWindow().makeKeyAndVisible(); } catch (Exception e) { log.error("show web view", e); } }
@Override public void _getMultilineTextInput(final Input.TextInputListener listener, String title, String text, String hint) { textInputView = new IOS_TextInputView(((IOSApplication) Gdx.app).getUIWindow() .getRootViewController(), text, new IOS_TextInputView.Callback() { @Override public void okClicked(String text) { listener.input(text); Gdx.app.postRunnable(new Runnable() { @Override public void run() { disposeInputView(); } }); } @Override public void cancelClicked() { Gdx.app.postRunnable(new Runnable() { @Override public void run() { disposeInputView(); } }); } }); // buildUIAlertView(listener, title, text, hint); }
private void domob() { final UIViewController controller = ((IOSApplication) Gdx.app).getUIViewController(); DMSplashAdController cotroller = new DMSplashAdController("56OJzBWouN1uFPD9LZ", "16TLmT-vApG01NUvNJDvaK-s", getWindow()); cotroller.setDelegate(this); //cotroller.loadView(); cotroller.present(); // if (cotroller.getIsReady()) { //cotroller.present(); // } }
@Override public void showBanner() { /* * final GADBannerView mBannerView = new * GADBannerView(GADAdSize.smartBannerPortrait()); * mBannerView.setAdUnitID("ca-app-pub-1743332321423234/2574098708"); * * final UIViewController controller = ((IOSApplication) * Gdx.app).getUIViewController(); * * GADRequest request = GADRequest.create(); List<String> devices = new * ArrayList<String>(); devices.add(GADRequest.GAD_SIMULATOR_ID); * mBannerView.setRootViewController(controller); * controller.getView().addSubview(mBannerView); * * mBannerView.loadRequest(request); */ final UIViewController controller = ((IOSApplication) Gdx.app).getUIViewController(); DMAdView mAdView = new DMAdView("56OJzBWouN1uFPD9LZ", "16TLmT-vApG01NUvNBqMTlRz"); mAdView.setDelegate(this); mAdView.setFrame(new CGRect(0, 0, DMAdView.DOMOB_AD_SIZE_320x50.getWidth(), DMAdView.DOMOB_AD_SIZE_320x50.getHeight())); mAdView.setRootViewController(controller); controller.getView().addSubview(mAdView); mAdView.loadAd(); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new GGVmApplication(GameModuleProvider.provideGameModule(), MobileMenu.class, TouchInputProcessor.class), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new MainClass(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new MyGdxGame(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new GdxArtemisGame(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new Asteroids(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new FlappyChapa(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new CaramelosGame(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); Control[] controls = new Control[] {new ControlTouch()}; return new IOSApplication(new Client(controls, new Audio()), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new FlappyBaran(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new Klooni(null), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new Polymorph(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new PonytronGame(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new GftGame(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new ZombieBirdGame(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new OnyxGame(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new Confundrum(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new LePendu(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new QuackHack(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new MSDFTestGame(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new myCanvas(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new PewPew(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new RebelInvader(), config); }
@Override protected IOSApplication createApplication() { IOSApplicationConfiguration config = new IOSApplicationConfiguration(); return new IOSApplication(new Main(), config); }