Weird behavior of ListField on touch devices

Hello!

I have a custom ListField, who has a weird behavoid on palpable devices like the torch and storm. I try to move it with my fingers but it does weird things. If it happened to someone else?

Thank you!

My code is:

public class FancyList extends ListField implements ListFieldCallback, Runnable, ItinetoursResource {
    private Vector rows;
    private Vector rutas;
    private String[] tags;
    private String[] avatars;
    private Bitmap[] fotos;
    private ResourceBundle res;
    private int fotoActual=-1;
    private static final int rowHeight=70;

    public FancyList(Vector rutas) {
        super(0, ListField.MULTI_SELECT);
        this.rutas = rutas;
        setRowHeight(rowHeight);
        res = ResourceBundle.getBundle(BUNDLE_ID, BUNDLE_NAME);
        setEmptyString(res.getString(FANCY_LIST_NINGUN_TOUR_ENCONTRADO), DrawStyle.HCENTER);
        setCallback(this);

        avatars = new String[rutas.size()];
        tags = new String[rutas.size()];
        fotos = new Bitmap[rutas.size()];

        for(int i=0; i 
         
        

As far as I KNOW, the mechanism of scrolling, you talk about work out of the box with a standard ListField.  Have you tried to use a ListField standard to see if you can make it work?

I suspect that your code passes very slowly, because of the significant workload in the painting of each line.  I think that if you've tried this code on a trackpad device, you would have problems scrolling too, have you actually tried on another device?

With regard to obtaining click events working on a ListField, you can find the following useful code.  Using this, you can add a FieldChangeListener to the ListField and it will go through standard fieldChanged code when it is selected.

/**
* Simple extension of the ListField designed to
FieldChangeListener disk on "click here".
*
To examine the methods of field substituted here for more information.
*/

Import net.rim.device.api.ui.component.ListField;
Import net.rim.device.api.ui.TouchEvent;

SerializableAttribute public class ClickableListField extends {ListField

public ClickableListField (int numberOfRows) {}
Super (numberOfRows);
}

protected boolean navigationClick (int status, int time) {}
this.fieldChangeNotify (2);
Returns true;
}

protected boolean touchEvent (TouchEvent message) {}
If click process changed field
If (message.getEvent () == TouchEvent.CLICK) {}
this.fieldChangeNotify (2);
Returns true;
}
Return super.touchEvent (message);
}

}

Tags: BlackBerry Developers

Similar Questions

  • Weird behavior of Safari Dock icon

    For several months now, I noticed a weird behavior of the Safari icon on the dock.

    Note: I have the Safari Dock permanently icon in the dock if the application is running or not for quick access.

    With open Safari, after periods of inactivity or after the awakening of the mode standby, the icon will lose the small black dot on the bottom that indicates an active application.

    By clicking on the icon or a .webloc file reveals that Safari is still active, but because the icon does not animate as it does when it is launched.

    How can I fix and when Safari * is * open its Dock icon indicates that it * all the time *?

    Probably also related...

    All too often, after similar as scenarios above, Safari actually leave - all on its own.

    How can I fix this too?

    Safari has also been freezing quite often lately have to be re-launched or sometimes requiring a restart of the computer system.

    Something is not.

    Go step by step and test.

    1. Disable Extensions and test them.

    Safari > Preferences > Extensions

    Uncheck 'Enable the Extension' and test.

    Enable the Extensions one by one and test.

    To uninstall any extension, select it and click the "Uninstall" button

    2. Quit Safari if it is open.

    Hold down the option key and click on the "Go" menu in the Finder menu bar.

    Select 'Library', then 'Caches.

    Find the folder "com.apple.Safari".

    Right-click on "com.apple.Safari" and select "move to trash".

    Restart Safari.

    3 remove the test and com.apple.Safari.plist file.

    Empty the trash.

    Quit all applications.

    Hold down the option key and click on the "Go" menu in the Finder menu bar.

    Select 'Library' in the menu dropdown.

    Library > Preferences > com.apple.Safari.plist

    Right-click on it and select "place it in the trash.

    Close the Finder window.

    Turn it back on.    Restart Safari.

    If this does not help, "put back" the com.apple.Safari.plist

    Right click on the trash icon in the Dock, then select 'open '.

    Right-click on the com.apple.Safari.plist and select 'Put Back'.

  • Weird behavior of Firefox in Facebook when scrolling down

    Hello

    My Firefox has a weird behavior when I open Facebook and start to scroll, I have attached two images, first image is when I open facebook, everything is ok (I dimmed the contacts), second image is when I start scrolling down, you will see square masive black with blue navigation. That happens only when firefox is "enlarged" and not with windows. I also try to disable all addons or run firefox in safe mode I have also reinstalled it and the problem is still there. Have any suggestions, which could be bad, also if forgot to tell you that any information not hesitate to ask and I will it provide.

    Hello

    Try Firefox Safe mode to see if the problem goes away. Firefox Safe mode is a troubleshooting mode that temporarily disables hardware acceleration, restores some settings and disables add-ons (extensions and themes).

    If Firefox is open, you can restart Firefox Safe mode in the Help menu:

    • Click the menu button

      click Help

      then select restart with disabled modules.

    If Firefox does not work, you can start Firefox in Mode safe as follows:

    • On Windows: Hold down the SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac: Hold the option key during the startup of Firefox.
    • On Linux: Exit Firefox, go to your Terminal and run firefox-safe-mode
      (you may need to specify the installation path of Firefox for example/usr/lib/firefox)

    When the Firefox Safe Mode window appears, select "start mode safe."

    If the problem is not present in Firefox Safe Mode, your problem is probably caused by an extension, theme or hardware acceleration. Please follow the steps described in the section Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems to find the cause.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. This might help others with the same problem.

  • Weird behavior with Signal to simulate and loops

    I'm having a weird behavior with Signal to simulate and while loops. Attached a photo of my program. The problem I have is that when I use Stop to stop inside while loop, then use to restart the inner loop, simulate Signal instantly generates a bunch of points of data between when I pressed Stop and Go. By example, if I stop for 5 seconds, wait 5 seconds, then press Go, it will instantly generate data for t = 5 t = 10. What I need is for the generation of signals to stop when I press stop and continue where it left off when I press Go. How can I accomplish this? I have no idea why he exhibits the behavior described in the first place.

    Hi optometry.

    Can you give us a screenshot of the configuration window for the VI express to simulate signal? I was able to reproduce the problem when I used "Simulate the time of acquisition" at times, but the VI's are featured as you described you wanted when I used "run as fast as possible." Have you tried this setting?

  • Weird behavior of the wifi service

    My project showed very weird behavior. As in the connection of signals and slots he was segfaults. I posted that in here . Also, I couldn't create a QTimer object. This all happened after I have use some features of the wifi_service.h file. My CPP code file is subsequently

    /*
     * WifiController.cpp
     *
     *  Created on: Jul 4, 2013
     *      Author: Roland
     */
    
    #include "WifiController.hpp"
    #include 
    #include "GeoNotification.hpp"
    WifiController::WifiController() {}
    WifiController::~WifiController() {}
    
    int WifiController::toggleWifiState(bool state)
    {
        getWifiState();
        int status = wifi_set_sta_power(state);
        return status;
    
    }
    int WifiController::getWifiState()
    {
        wifi_status_t *status;
        wifi_get_status(status);
        if(*status == WIFI_STATUS_BUSY)
        {
            return 2;
        }
        if(*status == WIFI_STATUS_RADIO_ON)
        {
            return 1;
        }
        if(*status == WIFI_STATUS_RADIO_OFF)
        {
            return 0;
        }
    
        return 0;
    }
    

    The strangeness begins after I call the getWifiState() function. It fills the fi last statement and returns 0. But after these problems occur. But if I don't call this function then, everything works fine.

    This will produce undefined behavior:

    wifi_status_t *status; // unitialized address
    wifi_get_status(status); // wifi_get_status will write into random memory
    

    wifi_get_status waiting for an address of the variable to write to:

    wifi_status_t status;
    wifi_get_status(&status); // & takes the address of status
    

    You will also need to check the return value of wifi_get_status. An example of code:

    http://supportforums.BlackBerry.com/T5/native-development/check-the-WiFi-signal-with-quot-WiFi-get-s...

  • Detect the Touch vs Non touch devices...

    Hello again,

    Is there a way to touch detection and non touchscreen devices from the code?

    I need to provide a different set of cod file based on the customer's device.  If the device is touchscreen allows then the user must download the appropriate with a capacity touch cod file.

    Thanks in advance for your prompt response.

    In your application, you can determine if the device is a touch or a non touch device with the following code:

    public static boolean isTouchDevice() {
        return new Canvas() { protected void paint(Graphics graphics) { }}.hasPointerEvents();
    }
    

    Use these imports:

    import javax.microedition.lcdui.Canvas;
    import javax.microedition.lcdui.Graphics;
    

    This code will work also on older devices.

  • 4.7 the difference between touch and non-touch devices

    Hi all

    I want to differentiate between touch and non touch devices to devices based on OS 4.7. For example Storm and Storm2 are touch while the tower is not touch. is there an API or how we can make a difference.

    Thanks in advacne

    Touchscreen.isSupported () should solve your problem.

  • Mouse enter becomes double-click on touch device (iPad)!

    Hi all

    I created an interactive site through edge animate.

    I use the mouse in order to show the effects of mouse.

    When I view the site on my iPad (and other Apple iOS Tablet/mobile devices) - this enter/mouseover effects becomes a click (or press start etc.).

    This means that each button requires a "double tap" / "double click" in order to activate this button.

    I have searched high and low for a solution for this but couldn't find anything.

    Can someone please?

    Desired effect:

    Code or solution that will eliminate the effect 'double click' my site on touch devices.

    Thank you!

    Jason

    I managed to work on a fix for this.

    Problem = double tap to get a click event for the button to work on the Apple iPad or iPhone.

    -He would record a mouse enter / mouse move events as an event of button on iOs

    Solution = # add touch version of modernizer

    = # Add this to your creation of scene complete - if (Modernizr.touch) {console.log ("Touch Me!")  } else {console.log ("can't touch this!")}

  • Animated - border slide on touch devices

    Hi there, I hope someone might be able to assist with some questions I have with my experiences with "Drag and Drop" on touch devices.

    I use Edge animate CC 20141 (not sure if it is a part of the problem)

    Using 'Punch Touch' I'm able to drag and drop objects on the stage (after the tutorial from Paul Trani), but annoyingly you must first type the point on the touchscreen device, before you can drag.

    Can anyone tell me why and how I might be able to drag it right away without having to do this initial contact? It works fine on the desktop - the problem, it's just with touchscreens.

    Thanks in advance

    I use the latest version and it works on mobile phones. So I don't know what your problems are.

    Here is the updated file with the latest version of Animate.

    Drag and Drop example for Edgehero.com

  • NO iphone THEN what other touch devices are available for flash content

    NO iphone THEN what other touch devices are available for flash content. I would like to develop drag and drops etc. for English lo tearn children.

    Hello

    Visit this link

    Best regards

    Peter

    http://www.Adobe.com/mobile/supported_devices/

  • Q10 blackBerry weird behavior when replying to emails

    Hey everybody,

    I wonder if something is wrong with my Q10.

    When replying to mails everything looks normal on my device, but after sending it, I see that the original message is not quoted. City by I mean the ">" prefix emails in plain text format. It is quite confusing because the message header and the original message are not formatted or whatever.

    It gets even worse when I do the answers online. You cannot differentiate between answer and the original message.

    Any ideas what's wrong here or is the normal behavior of the BB10 messaging application?

    Q10 is not quoting the original messages with ' > '.

    It's just the addition at the end with headers:

    Original message

    From:

    Envoy:

    TO:

    Object:

    This is a normal behavior.

  • Peripheral PnP USB - muted, is unplug sound when not touched, "device not recognized" or a malfunction, etc...

    Here is an exhaustive list I hope what happens (it's the Microsoft forums, so I think you guys are going to read a lot of information):

    • The sound on my PnP USB audio device cancels randomly without any reason. It is not to be touched at all, and often happens when I'm even not listen to all the sounds.
    • Before he died, it emits a blur in the helmet noise as it is to be disconnected or the cord is cut or something. I have to unplug it and plug it back several times to make it work.
    • It has been for several months, working properly, this month started anything, for about a week.
    • I can't use my headset because it is loose. I had the USB key to solve this problem, because it's too expensive get taking fixed. I did not buy the device at first hand, I got it from a family member who took my laptop in for repair and the guy he recommended and we sold two of these jacks.
    • When it goes off during a game, I can't sound to return. Sometimes I can fix it on a game (as Portal 2, for example) by going to options and change the type of sound (or any) what's called it headphones to speakers, then back to the helmet. However, the game freezes often when the sound goes off and I have to remove the usb key, and in this case the game should also be repeated. In addition, everything has sound options like that.
    • This happens randomly, but it tends to happen every five minutes or every few seconds, and coincidentally it almost always happens during a loading on a video game screen.
    • It is not always give me a warning sound, especially on the games. He's just quiet.
    • Device Manager does not display a point of exclamation or question marks next to any audio device and the key USB pnp is indicated correctly. In the options of the sound in the Control Panel, there is of the sound bars next to the USB key that indicates that his is read, but it is not in playback mode. The USB pnp is listed as default device, so don't tell me to do. The microphones are turned off as well.
    • It does the same thing in all my usb ports.
    • The driver is up-to-date and meant for Windows 7.
    • I do not install the Windows updates. Updates are bad.
    • Box for what he calls a "USB stereo Audio Adapter external" StarTech.com, or "ICUSBAUDIO". It came with a disc that I used to install the driver, and I went on their website to get one for Windows 7 specifically and installed.
    • I use a computer laptop 64 bit Windows 7. In Device Manager, there are three things listed under sound: Realtek High Definition Audio Intel (r) display Audio and USB PnP Sound Device. None of the USB devices have exclamation points.
    • For the first time today, when the usb unplug sound, my computer tells me "Device not recognized" and said it could have malfunctioned. When I clicked on it for more information, he said that he could not tell me what the usb was even because it was not plugged in, which was not true. I also had a window appears which has tried to install the device driver (already installed) and then was told that the unit had been disconnected before he could do (not true). It just happened, for the second time today a few seconds ago.

    Hello

    Check out the link and run the Fixit and check.

    Hardware devices do not work or are not detected in Windows

    http://support.Microsoft.com/mats/hardware_device_problems/en-us

    Install the Windows updates as some updates can fix a problem.

    As you mention that the computer is second hand troubleshooting accurately would be difficult. I suggest you contact the manufacturer. Check out the link.

    http://www.StarTech.com/support

  • Change selfview Position/location in Touch device

    Hello

    Is it possible to change the position of selfview/location using the touchscreen device by just hold & drag the icon of right-left-top-down, so it appears even on screen.

    I just try this on an EX90 running TC6.3 and here's how it works - in the call, if you click on the free view button, you can hold and drag the window discovers on the touch screen to another location and it moves on the screen and the display (see the screenshot of my touch screen while moving the selvfiew).  The six boxes around the enge of the screen are possible locations for placing the selfview window.

    Wayne

    --

    Remember the frequency responses and mark your question as answered as appropriate.

  • Weird behavior of Shader

    Hello

    This question has also been posted in SO:

    http://StackOverflow.com/questions/15255004/weird-shader-behavior-in-stage3d

    I use this vertex Shader:

    < script id = 'per-fragment-lighting-vs' type = "x-shader/x-vertex" >

    attribute vec3 aVertexPosition;

    attribute vec3 aVertexNormal;

    attribute vec2 aTextureCoord;

    uniform mat4 uMVMatrix;

    uniform mat4 uPMatrix;

    uNMatrix uniform spades3;

    various vec2 vTextureCoord;

    various vec3 vTransformedNormal;

    various vec4 vPosition;

    void main (void) {}

    vPosition = uMVMatrix * vec4 (aVertexPosition, 1.0);

    gl_Position = uPMatrix * vPosition;

    vTextureCoord = aTextureCoord;

    uNMatrix = vTransformedNormal * aVertexNormal;

    }

    < /script >

    But everything I see tile is properly textured object instead.

    If I change the shader like this:

    < script id = "per-fragment-lighting-vs2" type = "x-shader/x-vertex" >

    attribute vec3 aVertexPosition;

    attribute vec3 aVertexNormal;

    attribute vec2 aTextureCoord;

    uniform mat4 uMVMatrix;

    uniform mat4 uPMatrix;

    uNMatrix uniform spades3;

    various vec2 vTextureCoord;

    various vec3 vTransformedNormal;

    various vec4 vPosition;

    void main (void) {}

    gl_Position = uMVMatrix * vec4 (aVertexPosition, 1.0);

    vTextureCoord = aTextureCoord;

    uNMatrix = vTransformedNormal * aVertexNormal;

    }

    < /script >

    And multiply the prospects in actionsctript I see the object mapped properly although it has a different perspective

    Any suggestion?

    Oh I found the solution.

    When you convert a GLSL AGAL the conversor is moving the locations of the values.

    for example:

    In the summits shader: shader fragment:

    vPosition = v0 = v1 vPosition

    vNormal = v1

    vSomething = v2

    I had to create a function that is looking for matches on the names of variables and watch if the index has been moved. For now, he has solved the problem.

  • expandItem super weird behavior

    Well, now it'll be strain some of you:

    I have a tree. Simple, right? So far, Yes. BUT I want to update the dataProvider of the tree when I press a button. Now the difficult thing is that when I update the dataProvider data comes back and he could be in a different order and records (branches) and nodes (leaves) will not be in the same position as before index.

    So, I basically need iterate tree.openItems, store the id of the relevant items that are opened in the tree and then store these values in a table. Then, after my tree is updated, loop in this table and based on the values in the table (id who remain always the same, no matter what position or branches/leaves of the index have) open items that have been opened before I updated the dataProvider.

    Simple in theory, but in application, I get a very strange behavior. My code looks like this:

    public var catOpened:Array = new Array();
    public var updateItems:Boolean = false;

    <! - this is the function that is called when you click on the button that updates the dataProvider - >
    public function updateCategory (): void {}
    for {(var x: String en cat_tree.openItems)}
    catOpened [x] = cat_tree.openItems[x].@id;
    Alert.Show (cat_tree.openItems [x] .@ID);
    }
    updateItems = true;
    categories_list_http. Send();
    }

    <!-this is the function that is called to->
    public function updateCategoriesTree (): void {}
    if(updateItems == true) {}
    for {(var x: String en catOpened)}

    Alert.Show (categories_list.node. (@id () == catOpened [x]) [0]);
    cat_tree.validateNow ();
    cat_tree.expandItem (categories_list.node. (@id () == catOpened [x]), true, false, false);
    }
    updateItems = false;
    }
    }

    Format of the result of my HTTPService is e4x. It should work, right?

    But what I get back is a strange named folder in each elements previously opened, named something like "E31781EA-D5D2-0301-151E-BB3412BF099C" and in this case a node called exactly the same thing. The good news is that is not totally off the mark because he puts at least this weird folder inside the folder whose expandItems is actually supposed to open.

    I posted a screenshot to: http://able.org/dev/screenshot2.jpg

    'Applied Scholastics' and 'Criminon' records were records that were opened before the update the dataProvider, update don't reopen, they just weird records, I opened myself to the screenshot.

    Any ideas? I'm puzzled.

    Thank you!

    So, I thought about it all now (finally).

    I write (once again) the answer so that anyone trying such a feat in the future will not have to go through what I went through.

    It's all in one (SINGLE - well, kinda simple) line of code. It must be longer we had to find a way to do something that actually had a line of code! Well, it's here:

    cat_tree.expandItem (.. categories_list node. (@id == [x] catOpened) .parent () .node [categories_lis.. t node. (@ID==catOpened[x]).childIndex ()], true, false, false);

    And this is probably one of the longest lines of code without spaces, you will ever see.

    So, my duties now look like:

    public var catOpened:Array = new Array();
    public var AlreadyOpened:Array = new Array();
    public var updateItems:Boolean = false;

    public var catVScroll:Number = 0;
    public var catHScroll:Number = 0;

    CATEGORY TREE FUNCTIONS

    public function addCategory (): void {}
    if(updateItems === false) {}
    captureCatTreeSettings();

    var rVars:Object = new Object();
    rVars.category = cat_tree.selectedItem.@id;
    rVars.add_cat = true;
    categories_list_http. Send (rVars);
    }
    }

    private function captureCatTreeSettings (): void {}
    catOpened = new Array();
    for (var x: String in cat_tree.openItems) {catOpened.push(cat_tree.openItems[x].@id) ;}
    catHScroll = cat_tree.horizontalScrollPosition;
    catVScroll = cat_tree.verticalScrollPosition;
    }

    public function removeCategory (): void {}
    if(updateItems === false) {}
    You cannot delete a category with groups inside that you could cause serious harm to the database and people would go "missing".
    If (groups_list. Children () .length () == 0 & cat_tree.selectedItem... Children () .length () == 0) {}
    captureCatTreeSettings();
    var rVars:Object = new Object();
    rVars.category = cat_tree.selectedItem.@id;
    rVars.remove_cat = true;
    categories_list_http. Send (rVars);
    }
    else {}
    Alert.Show ("cannot delete a category unempty!");
    }
    }
    }

    private function updateCategory (): void {}
    if(updateItems === false) {}
    captureCatTreeSettings();
    var TextInput (cat_tree.itemEditorInstance) .text = new_name:String;

    var rVars:Object = new Object();
    rVars.category = cat_tree.selectedItem.@id;
    rVars.new_name = NewName;
    categories_list_http. Send (rVars);
    }
    }

    public function updateCategoriesTree (): void {}
    if(updateItems === true) {}
    cat_tree.invalidateDisplayList ();
    AlreadyOpened = new Array();
    for {(var x: String en catOpened)}
    If (AlreadyOpened.IndexOf (catOpened [x]) =-1) {}
    cat_tree.expandItem (.. categories_list node. (@id == [x] catOpened) .parent () .node [categories_li st.. node. (@ID==catOpened[x]).childIndex ()], true, false, false);
    }
    }
    cat_tree.validateDisplayList ();
    cat_tree.verticalScrollPosition = catVScroll;
    cat_tree.horizontalScrollPosition = catHScroll;
    updateItems = false;
    }
    }

    And my categories_list_http HTTPService tag looks like:

    And my cat_tree tag tree looks like:

    Wow! It's as simple as that. The key lies in the '... ' descriptor (descending). E4X is actually pretty cool when you start to get the hang of it.

    Talk about a learning curve, it's probably best classified as learning 'right angle '. I'm glad that I took the time, I got to understand that, because I learned a LOT on the way.

    Well well, hope that helps someone in the future.

    Above and outside - Taka

Maybe you are looking for