dispatchTouchEvent

by Business Talk » Sat, 09 Jan 2010 02:15:29 GMT


Sponsored Links
 How can I programmatically press/release a button? I was playing with
the button.dispatchTouchEvent(motionEvent); but failed to
programmatically generate  the MotionEvent to be passed to the
dispatchTouchEvent



dispatchTouchEvent

by Business Talk » Sat, 09 Jan 2010 02:37:37 GMT


 I found the way to generate the MotionEvent, and it's
MotionEvent.obtain



> dispatchTouchEvent


Sponsored Links


dispatchTouchEvent

by jbo » Wed, 27 Jan 2010 04:28:07 GMT


 i , i have a qustion about onTouch event, I have a layout that
consist of 2 elements, a WebView and on top of it a TextView and then
a custom view, that expand all over the screen and is transparent.
With these i want to carch touch events and delegate to the correct
widget either TextView or WebView depending on the touch event
position (MoseEvent).

[code]
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<TextView
android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>

<WebView android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/label"/>

</RelativeLayout>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">

<com.frame.TransparentPanel android:id="@+id/transparent_panel"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>

</LinearLayout>

</FrameLayout>
[/code]


[code]
public class TransparentPanel extends LinearLayout
{
private Paint innerPaint, borderPaint ;
private List<PointF> pointsToDraw = new ArrayList<PointF>();
private WebView webview;
private Paint touchPaint;

public TransparentPanel(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}

public TransparentPanel(Context context) {
super(context);
init();
}

private void init() {
touchPaint = new Paint();
touchPaint.setARGB(255, 0, 0, 255);
touchPaint .setAntiAlias(true);
touchPaint .setStyle(Style.STROKE);
touchPaint .setStrokeWidth(2);

innerPaint = new Paint();
innerPaint.setARGB(0, 100, 75, 75); //gray
innerPaint.setAntiAlias(true);

borderPaint = new Paint();
borderPaint.setARGB(255, 255, 255, 255);
borderPaint.setAntiAlias(true);
borderPaint.setStyle(Style.STROKE);
borderPaint.setStrokeWidth(2);
}

public void setInnerPaint(Paint innerPaint) {
this.innerPaint = innerPaint;
}

public void setBorderPaint(Paint borderPaint) {
this.borderPaint = borderPaint;
}

@Override
public boolean onTouchEvent(MotionEvent



Other Threads

1. Fwd: Looking for bride,Latest jobs in Dubai,and Internships

http://www.weeklyjobs.tk


   - COMMERCIAL SUPERVISOR ,
Dubai<http://jobsweek.blogspot.com/2009/05/commercial-supervisor-dubai.html>
   - MANAGER OF OPERATIONS,
Gulf<http://jobsweek.blogspot.com/2009/05/manager-of-operations-gulf.html>
   - PROFESSIONAL SERVICE ENGINEERS ,
Dubai<http://jobsweek.blogspot.com/2009/05/professional-service-engineers-dubai.html>
   - PARTS & SERVICES MARKETING MANAGER ,
Duba<http://jobsweek.blogspot.com/2009/05/parts-services-marketing-manager-duba.html>
   - Electrician ,
Dubai<http://jobsweek.blogspot.com/2009/05/electrician-dubai.html>
   - Oracle Database
Administrator<http://jobsweek.blogspot.com/2009/05/oracle-database-administrator.html>
   - SEO Article
writer<http://jobsweek.blogspot.com/2009/05/seo-article-writer.html>
   - Web/Graphic
Designer<http://jobsweek.blogspot.com/2009/05/webgraphic-designer.html>
   - Jobs @ Engro
Foods<http://jobsweek.blogspot.com/2009/05/jobs-engro-foods.html>
   - ORACLE 
Developer<http://jobsweek.blogspot.com/2009/05/oracle-developer.html>
   - JOB OPENINGS @
Palmchip<http://jobsweek.blogspot.com/2009/05/job-openings-palmchip.html>
   - Intern @ CAST <http://jobsweek.blogspot.com/2009/05/intern-cast.html>
   - INTERNSHIPS @
NADRA<http://jobsweek.blogspot.com/2009/05/internships-nadra.html>
   - Jobs In Dubai <http://jobsweek.blogspot.com/2009/05/jobs-in-dubai.html>
   - NASA <http://jobsweek.blogspot.com/2009/05/nasa.html>
   - Internship Opportunities @ Green
Belt<http://jobsweek.blogspot.com/2009/05/internship-opportunities-green-belt.html>
   - Branch Manager - Rental Solutions &
Services<http://jobsweek.blogspot.com/2009/05/branch-manager-rental-solutions.html>
   - Manager 
Electrical<http://jobsweek.blogspot.com/2009/05/manager-electrical.html>
   - Jobs in HPL : Engineer Vacancies in Hindustan
Pref...<http://jobsweek.blogspot.com/2009/05/jobs-in-hpl-engineer-vacancies-in.html>
   - Jobs in ARMY : Engineer Vacancies in INDIA
ARMY<http://jobsweek.blogspot.com/2009/05/jobs-in-army-engineer-vacancies-in.html>
   - Youth Internship
Program<http://jobsweek.blogspot.com/2009/05/youth-internship-program.html>

Apnay Classified Ads

   - Good Condition Flat For
Sale<http://apnayads.blogspot.com/2009/05/good-condition-flat-for-sale.html>
   - Apartment For
Rent<http://apnayads.blogspot.com/2009/05/apartment-for-rent.html>
   - Marriage <http://apnayads.blogspot.com/2009/05/marriage.html>
   - Looking for a
Groom<http://apnayads.blogspot.com/2009/05/looking-for-groom.html>
   - Looking for
wife<http://apnayads.blogspot.com/2009/05/looking-for-wife.html>
   - LOOKING FOR
BRIDE<http://apnayads.blogspot.com/2009/05/looking-for-bride.html>
   - HOME TUTIONS <http://apnayads.blogspot.com/2009/05/home-tutions.html>
   - yamha 100 
endoro<http://apnayads.blogspot.com/2009/05/yamha-100-endoro.html>
   - Charade 1984,91 for sale Pkr
150,000<http://apnayads.blogspot.com/2009/05/charade-198491-for-sale-pkr-150000.html>
   - TOYOTA STARLET 1000 CC.1979
MODEL<http://apnayads.blogspot.com/2009/05/toyota-starlet-1000-cc1979-model.html>
   - Cool chiller/ fridge
Pkr15,000<http://apnayads.blogspot.com/2009/05/cool-chiller-fridge-pkr15000.html>
   - Radio Controlled
Aeroplane<http://apnayads.blogspot.com/2009/05/radio-controlled-aeroplane.html>
   - FOR SALE LG
KG-288<http://apnayads.blogspot.com/2009/05/for-sale-lg-kg-288.html>
   - Need a tutor for
matric<http://apnayads.blogspot.com/2009/05/need-tutor-for-matric.html>
   - Tutor available in North Nazimabad
Town<http://apnayads.blogspot.com/2009/05/tutor-available-in-north-nazimabad-town.html>
   - CAR FOR SALE <http://apnayads.blogspot.com/2009/05/car-for-sale.html>

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

2. How can I listen for MApView page load completed event Options

Hi
In my application to load the map its taking time
so how can I detect when the map got loaded completely
plz help me ??
--~--~---------~--~----~------------~-------~--~----~

3. Run Android with Eee PC resolution using grub2+915resolution

4. Run Android with Eee PC resolution using grub2+915resolution

5. Do non-US locale DateFormats not work in the 1.5 SDK?

6. Error creating an Android Virtual Device

7. bug in android.intent.action.PHONE_STATE