mouse hover events

by Nitin Mahajan » Mon, 30 Aug 2010 13:24:50 GMT


Sponsored Links
 Hello,

Is there a implementation for Mouse Hover events in Android? I want
basically the CSS hover to work on my browser, since I am using the non
mobile platform. And further the views should receive the mouse enter and
mouse leave events.

For mouse cursor I applied the x-86 mouse support patch.

regards
-Nitin

-- 



mouse hover events

by Dianne Hackborn » Mon, 30 Aug 2010 14:19:36 GMT


 Android currently doesn't support mouse input, so has no concept of mouse
hover.




> website: 


Sponsored Links


mouse hover events

by ABTHUL RAZEETH » Mon, 30 Aug 2010 14:35:47 GMT


 X86 patch just draws a mouse pointer and all the mouse events are converted
to MotionEvent before it is delivered to the framework. Touch you see a
mouse in x_86 porting, a full fledged event level support for Mouse is not
available.

-abthul




> website: 



Other Threads

1. troubleshooting

Basic Microsoft Windows XP troubleshooting
http://freedownloadablebooks.blogspot.com/2008/03/basic-microsoft-windows-xp.html
Basic Microsoft Windows 2000 troubleshooting.
http://freedownloadablebooks.blogspot.com/2008/03/basic-microsoft-windows-2000.html
Basic Microsoft Windows NT 4.0 troubleshooting
http://freedownloadablebooks.blogspot.com/2008/03/basic-microsoft-windows-nt-40.html
Basic Microsoft Windows ME troubleshooting.
http://freedownloadablebooks.blogspot.com/2008/03/basic-microsoft-windows-me.html
Basic Microsoft Windows 98 troubleshooting.
http://freedownloadablebooks.blogspot.com/2008/03/basic-microsoft-windows-98.html
Basic Microsoft Windows 95 troubleshooting.
http://freedownloadablebooks.blogspot.com/2008/03/basic-microsoft-windows-95.html
Basic Microsoft Windows 3.x troubleshooting.
http://freedownloadablebooks.blogspot.com/2008/03/basic-microsoft-windows-3x.html
Basic Microsoft DOS troubleshooting
http://freedownloadablebooks.blogspot.com/2008/03/basic-microsoft-dos-troubleshooting.html
Basic software troubleshooting.
http://freedownloadablebooks.blogspot.com/2008/03/basic-software-troubleshooting.html
Basic Microsoft Internet Explorer troubleshooting
http://freedownloadablebooks.blogspot.com/2008/03/basic-microsoft-internet-explorer.html
Basic game troubleshooting.
http://freedownloadablebooks.blogspot.com/2008/03/basic-game-troubleshooting.html

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

2. HOWTO: SimpleCursorAdapter with custom row display

I have been playing around with Android for a couple of weeks and am
finally getting somewhere with a small application I have written
which downloads Yahoo traffic data according to the current GPS
position and a set radius.  In the process of this I have created a
content provider which holds the current traffic data. This was based
mostly on the Notepad example in the SDK.  The main activity is
subclassed from ListActivity and the row layout is:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="horizontal">

     <TextView android:id="@+id/title"
         android:textSize="16px"
         android:textStyle="bold"
         android:layout_width="140px"
         android:layout_height="wrap_content"/>

     <TextView android:id="@+id/description"
         android:textSize="12px"
         android:textStyle="italic"
         android:layout_width="200px"
         android:layout_height="wrap_content"/>
    <ImageView
        android:id="@+id/type"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>
</LinearLayout>

What I wanted was to be able to use "managedQuery" and point it at my
custom adapter which would handle populating the title, description
and ICON columns according to the values in the content provider.

The example here has a good explanation of the custom adapter but uses
a List to provide the row objects before mapping the type to a weather
icon.

http://mylifewithandroid.blogspot.com/2008/04/custom-widget-adapters.html

I wanted to subclass SimpleCursorAdapter which would let me use a
"managedQuery" to handle all the list stuff. I haven't seen this
anywhere else (I apologise if this seems blindingly obvious). The
secret to making a custom view for the list row is to override the
"getView" method and use the current "Cursor" to access the data
fields for the row. Here is my class:

public class TrafficDataAdapter extends SimpleCursorAdapter
{
    private Context context;
    private int layout;

    public TrafficDataAdapter(Context context, int layout, Cursor
c,String[] from, int[] to)
    {
        super(context, layout, c, from, to);

        this.context = context;
        this.layout = layout;
    }

    /**
     * Custom view translates columns into appropriate text, images
etc.
     *
     * (non-Javadoc)
     * @see android.widget.CursorAdapter#getView(int,
android.view.View, android.view.ViewGroup)
     */
    public View getView(int position, View convertView, ViewGroup
parent)
    {
        // Cursor to current item
        Cursor cursor = getCursor();

        ViewInflate inflate = ViewInflate.from(context);
        View v = inflate.inflate(layout, parent, false, null);

        TextView titleControl = (TextView) v.findViewById(R.id.title);
        if (titleControl != null)
        {
                int index = cursor.getColumnIndex(TrafficData.Strings.TITLE);
                String title = cursor.getString(index);
                titleControl.setText(title);
        }

        TextView descriptionControl = (TextView)
v.findViewById(R.id.description);
        if (descriptionControl != null)
        {
                int index =
cursor.getColumnIndex(TrafficData.Strings.DESCRIPTION);
                String description = cursor.getString(index);
                descriptionControl.setText(description);
        }

        ImageView typeControl = (ImageView) v.findViewById(R.id.type);
        if (typeControl != null)
        {
                int index = cursor.getColumnIndex(TrafficData.Strings.TYPE);
                int type = cursor.getInt(index);
 
typeControl.setImageResource(TrafficData.getTypeResource(type));
        }

        return v;
    }
}


The helper method "TrafficData.getTypeResource(type)" takes the type
value and returns an image resource which is an icon to denote the
traffic event type (accident, roadworks etc).

    public static int getTypeResource(int type)
    {
        switch (type)
        {
            case ACCIDENT:
                return R.drawable.accident_panel_slight;
            case RESTRICTION:
                return R.drawable.restriction_panel_medium;
            case ROADWORK:
                return R.drawable.roadwork_panel_severe;
            case TRANSPORT:
                return R.drawable.transport_pane_medium;
            case VISIBILITY:
                return R.drawable.visibility_panel_slight;
            case WEATHER:
                return R.drawable.weather_sunny;
        }

        return android.R.drawable.unknown_image;
    }

The call to set the adapter from the list activity is:

        mCursor = managedQuery(getIntent().getData(), PROJECTION,
null, null);

        TrafficDataAdapter trafficAdapter = new
TrafficDataAdapter(this,
                                                                 
R.layout.situation_row,
                                                                 mCursor,
                                                                 PROJECTION,
                                                                 new int[] { 
R.id.title,
R.id.description});
        setListAdapter(trafficAdapter);


I hope this helps someone else.

Al

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

3. Final SDK build available (84853); deadline extended to Tuesday, August 5?????

4. Anyone have packages android.net & java.net???

5. Developer impressions and lessons learned from iPhone App Store launch

6. Which package of HttpClient to use ?

7. CLDC