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. Hardcase HTC EVO plus bonu

Order 1 warna merah sudah japri mohon no rek nya boss.

Salam,

Fransiskus 
-----Original Message-----
From: gunggu <gun...@gmail.com>
Sender: id-android@googlegroups.com
Date: Sat, 24 Jul 2010 01:22:33 
To: <id-android@googlegroups.com>
Reply-To: id-android@googlegroups.com
Subject: [id-android] [WTS]Hardcase HTC EVO plus bonus

Siap juwal, cuman ada 3 biji:

Hardcase {*filter*}ized buat HTC EVO plus bonus: screenguard PET Japan (clear)

Warna tersedia:
- Merah
- Hitam
- Biru
Hard case nya yang dua tingkap, bukan cuman buat back cover aja. Solusi juga
bagi yang sering ga sengaja kepencet softbutton nya.

Hard case in action lihat attachments, yang merah ama biru keren abiz
euy.....
Price....
Rp 110 ribu including bonus

Ongkir cek ke JNE aja
Pembayaran via BCA or Mandiri

Siapa cepat dia dapat, silahkan japri saja langsung ke gunggu - et - gmail
--

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

Join:  http://www.***.com/ 
Moderator: id.andr...@gmail.com
ID Android Developer:  http://www.***.com/ 
ID Android Surabaya:  http://www.***.com/ 
ID Android on FB:  http://www.***.com/ 

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

Join:  http://www.***.com/ 
Moderator: id.andr...@gmail.com
ID Android Developer:  http://www.***.com/ 
ID Android Surabaya:  http://www.***.com/ 
ID Android on FB:  http://www.***.com/ 

2. Windows 7 issue? gen [in HelloAndroid] does not exist

Okay, if my comment is not relevant then I apologize.





It says, "This bug only applies on Windows and only with JRE 1.6u21"
Actually the message was: Message-id:<4c44dec7.1030...@samhobbs.org> Date: Mon, 19 Jul 2010 16:24:55 -0700 From: Sam Hobbs<s...@samhobbs.org> Subject: [android-beginners] Crashing/hanging problem with recent JDK/JRE update on Windows It is a link to: Crashing/hanging problem with recent JDK/JRE update on Windowshttp://www.eclipse.org/forums/index.php?t=msg&th=171988&start=0&
I installed Java 1.6.20 which avoids the Eclipse problem. Did you get it working for 64 bit Windows? I didn't see an update on your thread (

3. Panduan Nge-root Galaxy Spica

4. Windows 7 issue? gen [in HelloAndroid] does not exist

5. RIP+MOD Nemo Player dari Acer Liquid, Gudeg MO

6. OOT Game storm eight?

7. Windows 7 issue? gen [in HelloAndroid] does not exist