Why isn鈥檛 multi-touch wor king for imagebuttons?

by niko20 » Wed, 05 May 2010 01:42:31 GMT


Sponsored Links
 Hi,

No, it's because the android team decided to implement MultiTouch in a
way that it only can be used on one "View". For example, ImageButtons
are views. Each ImageButton is a seperate "View" object. The Android
multitouch does not just map touches to multiple views like that
(which I think it should, but the android team does not). Instead you
end up having to create a View yourself, and drawing the three buttons
yourself, since multitouch comes to a View as additional touch
coordinates. In other words, you can only use multitouch "per view".
It can't spread across multiple views. You basically need to create
one big view object that takes up most of the screen and then draw the
buttons yourself, and then handle the multitouch messages passed to
that view.

Unless there is an easier way that I know of, but I dont think there
is. IMO how they "implemented" multitouch is too hackish, and should
have been transparent to developers by the system automatically
posting messages to each view that was being touched, instead, you
have to rewrite the apps completely to handle it.

-niko



>



Why isn鈥檛 multi-touch wor king for imagebuttons?

by Bob Kerns » Fri, 07 May 2010 23:05:14 GMT


 What about using a TouchDelegate to examine the touches first, and
forward them as separate events?

I haven't tried it, or even thought about it for more than two
minutes, but...




> >


Sponsored Links


Other Threads

1. requestLocationUpdates issue

Hi,

My class listed below is not working. No idea whatsoever. The
onLocationChanged method is never getting called !
I checked the logs for any errors/exceptions. I have the required
permissions set (fine and course locations).
I doubt the Context I'm setting from the caller. I'm using
getApplicationContext() to pass to the setContext method in this
class.
Can anyone please help ?

public class GPSSensor implements CASensor {

        private String LTAG = this.getClass().getName();
        Context myContext;
        private String GPSData;
        public LocationManager lMgr;
        public LocationListener myLocListener = new LocationListener() {

                public void onStatusChanged(String provider, int status, Bundle
extras) {
                        Log.v(LTAG, "=========== Here 1 ============");
                }

                public void onProviderEnabled(String provider) {
                        Log.v(LTAG, "=========== Here 2 ============");
                }

                public void onProviderDisabled(String provider) {
                        Log.v(LTAG, "=========== Here 3 ============");
                }

                public void onLocationChanged(Location location) {
                        if (location != null){
                                GPSData = location.getLatitude() + "," + 
location.getLongitude();
                                Log.v(LTAG, "GPS data received ===========> " + 
GPSData);
                        }
                        else
                                Log.v(LTAG, "Location is null ===========> ");
                }
        };

        public String getCurrentData() {
                return GPSData;
        }

        public void setContext(Context context) {
                myContext = context;
        }

        public boolean startSensing() {
                if (myContext == null){
                        Log.w(LTAG, "myContext not set");
                        return false;
                }
                Log.v(LTAG, "Starting location updates !");

                lMgr = (LocationManager)
myContext.getSystemService(Context.LOCATION_SERVICE);
                lMgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0,
myLocListener);
                //lMgr.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 
0,
0, myLocListener);
                Log.v(LTAG, "Registered myLocListener for GPS");
                return true;
        }

        public boolean stopSensing() {
                if (myContext == null){
                        Log.w(LTAG, "myContext not set");
                        return false;
                }
                Log.v(LTAG, "Stopping location updates !");
                lMgr.removeUpdates(myLocListener);
                return false;
        }

}//GPSSensor

-- 

2. java.lang.Object in aidl

Hello,

I have a aidl interface in a service. In this interface I want to
create a function that can return a int, double or string. In Java I
can do that with the java.lang.Object type. But this type is not a
basic java type or a parceble, so I can't use this in aidl. Somebody
knows a way to still do this in aidl?

Kind regards,

Peter

-- 

3. How to get wifi account and password in code?

4. access to the edittexts inside adapter

5. how to depress the onLongClick() when drag a view

6. Movie class for displaying animated GIF files.

7. ImageView animation: rotate a certain amount of degrees at some set interval