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. Eh ternyata goggles bener :-)

Berarti Paul pake Google Android ..wakakakak...sol

------Original Message------
From: lucky sebastian
Sender: Id Android
To: Id Android
ReplyTo: Id Android
Subject: [id-android] Eh ternyata goggles bener :-)
Sent: Jul 12, 2010 7:25 PM

Masih inget lagi kita gathering terakhir di fcone? Lagi itu kita iseng bikin 
contoh kasus tentang cut tari, mirip apa bener. Google Goggles jawab bener. Dan 
CT sekarang ngaku.
Nah inget sebelum kasus ct kita bahas apa? Kita bahas google goggles,buzz dan 
google translate. Disana kita bilang spanyol jadi juara dunia... Dan kejadian 
kan :-D Hebat goggles...
Sorry kalau attachment nya banyak :-) 
Salam,
Lucky Sebastian
-- "Indonesian Android Community [id-android]"  Join: 

2. OOT : Seminar Android vs iPhone

Maaf posting perdana tentang promosi Semianr Android vs iPhone.
Seminar ini tidak ada maksud untuk saling menghantam namun memberikan
wacana dan kebebasan para pengguna smartphone maupun calon pengguna
smartphone.

Seminar ini akan diselenggarakan tgl 24 Juli 2010 di Jogja.
Informasi lebih lanjut 
http://mti.ugm.ac.id/new/?type=news&submenu=news&main_id=25&id=101.
Perbandingan Froyo dan iOS4, 
http://milisdad.blogspot.com/2010/07/android-22-dan-ios4.html

Trims.

-- 
"Indonesian Android Community [id-android]" 

3. Pick a contact - only with phone, email ...

4. Disabling TabWidget

5. Remove me from adroid group

6. How to use libnetfilter_queue in android

7. how to get the actual data of GPS?