Showing a UIWebView in Cocos2d 2.x project - uiwebview

I'd like to display a UIWebView within a CCLayer for a Cocos2d 2.x project. I found the CCUIViewWrapper, but didn't get it to work with 2.x.
I don't really care about handling rotation and animation. I just wan't to display content from a web page on layer and also have a sprite to be able to go back to the previous scene.
Please help!
// Johan

If you don't want to use new version 2.0 features (I'm not using them myself at this point), then you can mix UIViews with Cocos by simply adding other views to your root view controller. After all, Cocos is itself a single view on the controller (if that's how you have it set up), and just add another view.
You can then easily tell the view controller to show the other UIViews by using the NSNotificationCenter, which I recommend in general over trying to communicate with the view controller from the Cocos layer.

Related

Flutter Desktop:Best Practice for Persisting SideNavigationMenu Between Routes?

Background:
  Since build v2.10.0, Desktop Support has been introduced into Flutter Stable Channel.
  I am trying to develop a Desktop Application with it, achieving an adaptive split-view
Situation
  As it is illustrated above,I'd like a customized(Arbitary,Drawer-Like) sidemenu widget to be FIXED (Undismissable) in adjacent to the root navigator of MaterialApp.When a new route has been pushed into the route stack,I need the hero animation only covers the content part and leave the SideMenu untouched.
  Since MaterialApp hold the entire navigator (Have not find out a way to replace the root navigator or wrap it with any other container), I cannot customize the MaterialApp Layout.
  The main consideration why I don't want to put SideMenu out of MaterialApp is that I want to use the whole material things for SideMenu building which requires context information such us MediaQuery, Directionality,Locale etc... And I want there only one entry to setup Material-relationed configurations to keep the style consistancy of the whole design.
In Short
Split Layout
Customizable Persistant SideMenu
No Hero for Side
Official-Styled Code Pattern
Question
If it's possible, I do not prefer modifying any source code of official packages.
How to achieve this in a Flutter/Material way?
Maybe MaterialApp.build could be helpful?

Adding UIWebView to second (not first) Storyboard view controller

Getting started with xCode 4.6.3 and I'm running into a hiccup.
I've built a simple app using the UIWebView to display a local HTML file and it's contents. I used that to debug any issues with the HTML and/or image displays and I'm all set.
Now I need to recreate that within a larger project I've built with storyboards for all my navigations between multiple view controllers. My issue comes when I'm trying to control-click drag from the WebView into the ViewController.h code below the #interface like many tutorials show, and that worked fine within my smaller single view controller app. It won't do it. I know I'm missing something obvious here. Am I going to have the set up these screens (I have multiple ones to do this same way) as separate xib files and add them into my main project?
Thanks for any help and clarification.
-Chris
You can create a class called for example myWebViewController and in Interface builder add a UIWebView to it. The control+drag to the header file will work.
Every time you want a UIViewController that has a browser in it, define its class as myWebViewController in Interface Builder.
Try not to repeat code. If you see UIViewControllers or any other UIView...that do the same thing, you can group them into a class that you use over and over.

What is the best way to design the GUI in javafx 2.0?

In javafx 2.0 it is possible to create the layout by using FXML approach or by using normal java code.
What is the best way with respect to a well designed set of UIs. In my application there is about 100 sub UIs.
Thanks
FXML looks more logical for that purpose. By using FXML
you split business logic from view
you get option to edit design without recompiling project.
you get design as structured xml tree which is much easier to edit comparing to potentially randomly ordered java code
with SceneBuider tool you get an option to use visual editor for your fxml files
Get JavaFX Scenebuilder here.
FXForm2 is a library providing automatic JavaFX 2.0 form generation.
however FXForm2 is not full WYSIWYG GUI design tool.
http://dooapp.github.io/FXForm2/
Scene builder should be a good starting point to create unique UIs of your application. Considering you have 100s of UIs, I assume that some of their "appearances" should be identical with slightly different functions. You can load the FXML dynamically and assign controller at run time. Which means 1 FXML file can be used with multiple controllers. Which can save you some time while keeping the code dynamic for easier maintenance.
FXMLLoader loader = new FXMLLoader(getClass().getResource("DBedit.fxml"));
loader.setController(new DBeditEntityUser());
So, to make use of the same FXML with a different controller.
FXMLLoader loader = new FXMLLoader(getClass().getResource("DBedit.fxml"));
loader.setController(new DBeditEntityUserLevel());
Hope this helps.
fyi,
road map for Java fx http://javafx.com/roadmap/ shows that the scene builder will be released around middle of the year. From the above web page:
"JavaFX Scene Builder is a WYSIWYG GUI design tool for the
JavaFX platform. It enables designing user interface screens by simply
dragging and positioning GUI components from a palette onto a scene.
The tool generates files in FXML format2 that can be used within a project
in any IDE such as NetBeans or Eclipse. The JavaFX Scene Builder can be
used to create GUI for desktop applications and applets that run in a browser."

What View Component does the Google Plus App (Stream) use?

if you use the Google Plus App on Android and switch to the Stream, you get a view where you can swipe to the left and right between the All circles/Incoming/Nearby-Stream. What view component is used for this? Is this a standard Android component? Or where can I find democode how i can build such a view component?
You should take a look at the ViewPager from Android Compatibility Package for the desired widget/swipe navigation. Find more about it here
http://developer.android.com/sdk/compatibility-library.html
Also, checkout this recently posted tutorial and some sample code on ViewPager by Richard:
http://geekyouup.blogspot.com/2011/07/viewpager-example-from-paug.html
It is a combination of a ViewPager together with an indicator for where you are currently and where you can go swiping left and right.
A sample of how this can be done along with code you can use in your own apps may for example be found here. I've played with this code a little and it works pretty well.
None of the default widgets/views. I guess, it's some kind of a custom view with swipe functionality.
Honeycomb opens up a few new widgets which seem to have these functionality. Have a look here.
http://developer.android.com/sdk/android-3.0.html (New Widgets)
I used APKTool to take a look at what's going on. Hopefully it is okay to post this here. This is from version 1.0.2 of the G+ APK.
removed google+ app code as per CommonsWare's suggestion
So, it looks like they're using standard views, though perhaps with a good deal of gesture detection and smooth animation magic.
EDIT) If you really want to know about the exact inner-workings of what is going on in the Stream activity, I suggest you use APKTool yourself and examine the .smali code

Desktop-like jsf-web-application

I want to create a desktop-like application with JSF 2.0 and Primefaces 2.2.1
I created a main Layout with two divs, the upper div containing a menubar with several submenus. When the user chooses a menuitem, I want to show the spezifyed xhtml page in the bottom div of my main layout, without loading the full page. So I am thinking of Ajax to do it. But I don't know how to realize it.
And by the way, is there a chance to change a p:menubar or a p:submenu by javascript?
Can someone help me?
At the risk of being down-voted, may I suggest that since it sounds like you're at the beginning of your project, you should consider a framework other than JSF 2.0 because it sounds like you're shoe-horning. GWT is the most obvious candidate. If you're used to desktop app development (especially in Java), Vaadin is another great candidate.

Resources