My WL6.1.0.1 hybrid application have an overflow (with css set to -webkit-overflow-scrolling: touch) which scrolls just fine, but I don't see the scroll bar, neither the android feedback when I hit the bottom of the scroll (that glowing light that android have).
Curiously enough if I access the same application via "Common Resources" using the chrome browser on my android device, both the scroll bar and the feedback shows up.
I added the following code to my main java class on the native side (the one that extends WLDroidGap and have the app name)
public void onWLInitCompleted(Bundle savedInstanceState){
super.loadUrl(getWebMainFilePath());
// Add custom initialization code after this line
this.appView.setVerticalScrollBarEnabled(true);
this.appView.setVerticalScrollbarOverlay(true);
}
But it still doesn't work, any ideas?
For the "feedback", you are probably referring to EdgeEffect (when reaching the bottom of the view). If so, it is working for me like this:
public void onWLInitCompleted(Bundle savedInstanceState){
super.loadUrl(getWebMainFilePath());
// Add custom initialization code after this line
this.appView.setOverScrollMode(appView.OVER_SCROLL_ALWAYS);
}
You can set this in the onCreate as well...
For showing the scrollbar, I think you need to use awakenScrollBars() in combination with setVerticalScrollBarEnabled.
That said, I don't know the use case of your app, but typically in an app you would not want a scrollbar unless specifically in a list or something like that (and maybe not even there...).
Additionally, because you are developing a Hybrid app in Worklight and may target additional environments there are alternative solutions instead of delving into native code, such as using iScroll which can take care of much more than just scrolling, but also the "bounce" effect and other things.
Related
We're still using the Classic UI in our AEM instance but I'm trying to push everyone to start using the Touch UI. The problem is, I cannot seem to get ANY components to show up in the side rail. I have enabled every single component in design mode, and they show up just fine in the Classic UI sidekick, but my side rail shows absolutely nothing, not even out-of-the-box components. And I know I have Touch UI-enabled components available since, if I drag a component into a page from Classic UI and then switch to Touch UI, I'm able to edit that component no problem. I just can't drag-and-drop anything while in Touch UI.
Anyone have any ideas on this? I've restarted the server because I read about caching issues, etc, and that solved nothing.
Thanks for any help you can provide!
To enable the components into Touch UI below steps you can follow.
Example taken for http://localhost:4502/editor.html/content/geometrixx-outdoors/en/men/coats/edmonton-winter.html page
Change the mode of the page to Design
Select the parsys by clicking on the "Drag Components here"
Then click on the Configure for that parsys. which will open up parsys design dialog
Choose components that you are looking for to add to page. (Here i have chosen Text -Sightly component for demo )
Where the component will appear in Edit mode as shown below.
Unlike Classic UI dialogs which use the following structure
primaryType - 'cq:Dialog'
xtype - 'Dialog'
Touch UI dialogs should have the following key/value pairs:
primaryType - 'unstructured'
resourceType - 'cq/gui/components/authoring/dialog'
Followed by your dialog structure. You will need the corresponding dialog construct to enable component usage in either Classic UI or Touch UI.
This HelpX article provides high level information concerning the differences between the two dialog types.
I am developing a Swing application with custom CSS rendering. As part of the system I use JDialogs as well, but I need to access certain components outside of the dialog (emergency buttons).
For this I chose following method:
all dialogs are non-modal. Those I want to make quasi-modal, will be setAlwaysOnTop.
There is always one quasi modal dialog up. In this case I put another dialog up, below this one, full-screen, semi-permanent.
This "blur" dialog shall cover the whole screen, catch mouse events and forward them to the emergency buttons only. In parallel I opened gaps on it so that the emergency buttons can be seen through the semipermanent surface without any effect.
The blur dialog can never be focused or activated (I have a vetoable listener for this)
Everything works fine, until someting happens and the blur dialog seems to cover my quasi-modal dialog. However, if I move any external application window over it, the quasi-modal dialog remains on the top. Instead of a complicated explanation, see picture un following link: http://lost.lost.hu/javascreen.png
So far I tried to debug repaints, events, everything, and could not find anything that would cause this. Especially the case depicted above challenges me to understand what is going on here.
I have recently updated to Java 1.7, in hope to get rid of this phenomenon, but today it came back.
I use XMonad+gnome as window Manager. I have the problem that, when I run a Java Web Start applicacion, It olways show an empty window, like the screen:
Is there something I can do to fix it?
UPDATE:
I tried simple programs from JWS Examples and it works, right. So it should be a problem of the application.
The failed aaplication is Blast2Go.
Change the name of the window manager to a known one like LG3D:
startupHook = setWMName "LG3D"
I had the exact same problem with my own Java code and using the other suggested solutions (setWMName, MToolkit, etc.) did not solve the problem with Xmonad. I must note that in other window managers (e.g. fluxbox), the app works as expected. In my case, however, I figured out the problem. If you have access to the source of the Java app, I suggest you consider the following:
If you have any JFrame or JPanel or other containers, you should explicitly define their layouts. If you set the layout to null, then the dimensions of the container must be set explicitly. Otherwise, the container won't be rendered at all. For instance, I have a JPanel that contains all my widgets. I'd rather have full control over the layout, so I set the layout to null, and then explicitly set the dimensions for the JPanel:
jContentPane.setLayout(null);
jContentPane.setPreferredSize(new Dimension(appletWidth,appletHeight+100));
Hope this helps.
I'd like to open a html-page in a webview and make it auto-scroll downwards automatically in accordance with an interval set through a timer.
Although below example is for desktop, this link should give you an idea what I want to achieve (enable autoscrolling in the upper right part of the page):
example
First I thought about opening a webpage and then use some kind of code which would simulate/trigger DPAD-down (or Arrow-down). In Windows Mobile, I believe there was something called SendKeys but I couldn't find something similar in the Android-SDK (except for a test-SDK which I doubt I could use for publishing my app in AndroidMarket) so I guess the way mentioned above is not possible.
Another solution could perhaps be a java-script but the webpages are not created by me so I can't insert any anchor.
However, I noted that Webview has some methods called PageDown (and PageUp) which could also be a solution but I am afraid a PageDown would be too much for scrolling the way I want. I want the scrolling to be slow and smooth, more like a line at a time.
Do you have any ideas how I could implement this? I'd really appreciate your help.
You could try using,
View.scrollBy(int x, int y) to scroll the WebView.Use:
computeVerticalScrollOffset(),
computeVerticalScrollExtent() computeVerticalScrollRange() to calculate a maximum y value.
In swing(GUI) application I used JButtons.
Now I need the same application in MIDP and I'm conuse...
I need Idea for what to use with and an example of how to use it and what kind of listener might possible fits.(Because I need to refresh the shown screen after every click on a button)
And one more question: I use Netbins with the simulator of cell-phone.The screen is very tiny,
so is there any way to make this screen larger,In case I need to show something too width?
Lets say,something like 11-15 buttons...
I don't think there's anything that's exactly equivalent to a JButton, but I think you could solve your problem by implementing a Command though. I found a lot of examples:
MIDP Programming with J2ME (This one is a bit long. It's actually an entire chapter from a book and the Command example starts on page 4.)
Enterprise J2ME: developing mobile Java applications (Also a book, but I linked to the relevant section.)
J2ME Programming (Part I) (I like the CommandProcessor.java code example in this one.)
Visual Mobile Designer Custom Components: Creating Login Screens
Add Command to MIDlet (This one has the shortest and clearest example code, but it unfortunately doesn't have a screen shot of the final result.)
And one more question: I use Netbins with the simulator of cell-phone.The screen is very tiny, so is there any way to make this screen larger,In case I need to show something too width? Lets say,something like 11-15 buttons...
There is a way to choose an emulator with larger size screen. Last time I checked, Netbeans documentation had instructions on how to do that.
Though, before doing so, I would recommend you to find out whether the real device you're targeting will have such a screen. Because if its screen will be as tiny as the default emulator then your UI might look totally different from what you designed with large size emulator.
Take for example 11-15 buttons you mention - do you expect real device to have screen large enough to display these conveniently for user?