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. Theme.Dialog Activity and Context Menu

Hi All , i have dialog style activity
android:theme="@android:style/Theme.Dialog"

When i attached context menu to it
        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);
        }

        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
                super.onCreateOptionsMenu(menu);

                MenuItem item = null;
                item = menu.add(0, Menu.FIRST, Menu.NONE, "Test Context Menu in
Dialog Theme");
                item.setIcon(android.R.drawable.ic_menu_edit);

                return true;
        }

The menu appears about 50 px from the bottom of this dialog. So if
activity screen is too small - it right in the middle of the screen.
Is there any way to anchor  menu to the bottom of the screen ?
layout :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        <ImageView
                android:id="@+id/icon"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10sp"
                android:src="@drawable/icon" />
        <TextView
                android:id="@+id/title"
                android:layout_toRightOf="@id/icon"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignTop="@id/icon"
                android:layout_alignBottom="@id/icon"
                android:gravity="left|center"
                android:text="Title" />
        <ImageView
                android:id="@+id/divider"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/icon"
                android:layout_gravity="left"
                android:src="@drawable/dialog_divider_horizontal_light" />
        <TextView
                android:id="@+id/note"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/divider"
                android:layout_marginLeft="10sp"
                android:layout_marginBottom="10sp"
                android:layout_marginTop="10sp"
                android:text="Some Text" />

</RelativeLayout>




--~--~---------~--~----~------------~-------~--~----~

2. Separator at top of ListView

Is there a way to force a separator at the top of a ListView?

--~--~---------~--~----~------------~-------~--~----~

3. Contract Android Developer openings

4. play streaming source with wap network

5. Can java files build into library(.so) files ?

6. Google Checkout API

7. How to cancel a connection ?