this is a very general Question to LWUIT.
I'm developing for Nokia S40 phones.
I'm having a List in a form which functions as a Menu. The Form has an ActionListener which listens to SoftkeyEvents and also the List click events.
It's doing this by e.g.:
if (evt.getCommand() != null) {
if (evt.getCommand().getCommandName().equals("Back")) {
if (Display.getInstance().getCurrent().getUIID().equals("SubMenu")) {
and:
if (Display.getInstance().getCurrent().getUIID().equals("Menu") ) {
The problem is:
the menu seems to be hypersensitive to scrolling but not sensitive enough to clicking.
Means: If you try to click a menu entry in the List, the List very often scrolls instead of actually catching the link.
Is there some way to influence this behaviour?
Updated answer: FYI We had S40 touch phones and our QA didn't report these issues as far as I recall. Keep in mind this is a resistive screen hence it can't handle fingers, it works best with the finger nail and you will get bad results otherwise. With the finger you will get drag events all over the place which is why you are probably experiencing what I explain bellow.
You are probably seeing this because LWUIT received pointerDragged events from the phone and hence made the decision that a drag operation is in progress. There are general rule of thumb values for pointer drag event blocking within LWUIT implementation (to prevent over eager platforms from sending too many drag events). If a platform sends "inappropriate" drag events LWUIT will just drop them to avoid confusing your application.
Display.setDragStartPercentage() allows you to tune the percentage of the screen that the finger needs to move in order to trigger a drag. By default if the system sends 7 drag events we activate the drag regardless, that option is only configurable to the LWUITImplementation authors.
Related
I was wondering if it is possible to create something like a menu that I can drag either by the side or from above on a wearable device. But I don't want it to affect the activity I have. You know like on a smart phone and you drag down the menu with some settings like brightness, rotation, etc...
To elaborate, I have a timer with a progress bar, but my activity would be overcrowded if I added any other stuff. So I want something to drag from the top of the screen to check on something, then drag again to return to my view that has the timer and progress bar. I basically have an activity where I make some selections, I wanted my selections to appear in that draggable menu thing to check to see my selections displayed there.
There are two drawer components for the type of behavior that you describe. Which one is better depends on the specifics of your implementation. The documentation for Navigation Drawer and Action Drawer can be found here.
I am writing a MonoTouch iOS app. I have read many postings about ResignFirstResponder and I am using that.
My app is a typical table view app. I have done my own custom table cell view. The UITextField controls that cause the numeric keypad to come up in the first place are all on the custom table cell.
Currently I have it so that if you tap on the background of the cell I call ResignFirstResponder on all the text fields. This seems to work, but is not intuitive. I had a new beta tester get it last night and he tapped on one of the text fields and the keypad came up and he was lost as to how to get rid of it. After I told him to just tap the background, he now is fine, but obviously I want a solution that is obvious and doesn't require me to tell everyone how it works.
I read one post about a way to add a DONE button to the keypad, but it looked like a total hack and even broke when 3.2.1 came out and I don't want to have to worry about my app breaking when a new OS comes out.
Suggestions?
I would keep the background click->ResignFirstResponder that you have already, but add to it.
Curious, what button do you have set in the bottom right of the keyboard? There are options to show a Done, Search, Go, Next etc. buttons that can be setup to ResignFirstResponder. Pick the button that makes sense in your situation.
You can hook into the bottom right button by setting a callback to UITextField.ShouldReturn and calling ResignFirstResponder. You can just return false (that return value is for allowing line breaks in your UITextField).
Found an example here of hooking up ShouldReturn.
I need to create a magnifier like feature in my app. Like the "loupe" effect on the iphone !
The problem is that I need to do that inside a popup window and I don't get how to make it work !
The popup window display a grid of colors that I generate and draw one by one using shapeDrawables. What I want is to display that color bigger, zoom on it when the user touch and move his finger around the popup window (color grid). The idea is to create a tracking-zooming effect on the colors so the user can see more clearly under wich color his finger is currently located.
Problems are :
I can't seem to create another popup window on top of this one, Android limitation I think ?
If I modify the current shapeDrawable, resize it, change the boundaries, It needs to re-display the popup window before it takes effect (which is not acceptable of course)
So, anyone knows of a way I could draw over that popup window ?
EDIT :
I've tried solving this issue using a Custom Toast object...But it doesn't quite do the trick. It works, but toast object appears slowly and so the touch motion is not in sync at all with the user movement over the color grid.
I'm not sure if this will help you or not, but you might be able to accomplish this by using a second Activity... this second Activity would use Android's translucent theme if you include the following attribute in your manifest:
<activity android:theme="#android:style/Theme.Translucent">
This second activity will now only contain what you place in your layout. That is... the "real" activity you're running will still be visible behind it (anywhere you don't cover it up with views in the new layout).
You also might prefer Theme.Dialog if you really want to resemble a popup.
Something to keep in mind if you take this approach is you will probably want to override onWindowFocusChanged() in the new activity, and finish() in the event of you losing focus. Additionally, you'll need to figure out how to share your data between the two activities.
I have an android spinner which I call via the performClick method to show a list of items (the actual control is hidden from the user and is called from a checkbox, too complex to explain why I have done it this way).
If I do not want an item in the list, how can I dismiss the popup by clicking on the black area?
Does this make sense? :/
Edit: Sorry, forgot to mention that the users will not be able to operate the bottom buttons (device is going to be galaxy tab) as they will be covered up with protective layer due as they will be outdoors.
usually such a control is dismissed using the back key in the android applications. So I would suggest that you find a way to do it the same way on your control.
'Esc' button should do the same job..
Currently working on a mobile app in J2ME and have questions with ChoiceGroup radio button answer options. Any suggestion on how to make it so that no default answer is selected? We've tried:
cg8.setSelectedIndex( -1, true ); But get an out of bounds exception error
and
cg8.setSelectedFlags( boolean[] ) with all false, but also get another error.
To get around this, we've also tried creating an invisible radio button and have that set as selected, but couldn't find a way to make an invisible radio button either.
Any thoughts or suggestions would be great appreciated!!
It sounds to me like the platform is enforcing an appropriate convention, although I must apologise for taking a purist standpoint here; this won't really answer your question.
Radio buttons are used when there are multiple exclusive choices, of which one must be made; it makes a certain amount of sense, therefore, for the user interface to ensure that something is always selected. Ideally, the initial selection in a radio group should always be a safe and sensible default.
As far as I know, the only way to not have any radio button pre-selected is to draw the control yourself. Re-implement a radio button list using a Canvas or a CustomItem.
It's a lot of work, unfortunately.
You should look into LWUIT as it may have an intermediary solution.