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. Android 2.0.1 SocketTimeoutException received with FTP Data channel

Hello James,

Did you correctly add the TCP port in the URL entered in Runftp?
Like:

$ o sftp://hogeh...@blahblah.com:50000

Also check to see if you enabled the port 50000, meaning it is not
blocked
by a packet filter like iptables.
You could try FTPS which has easier setup in ProFTPD if you just want
security over your file transfer.

Ryu

-- 

2. Strange platform error in Droid(2.0.1), Hero(1.5)

Hi,
I have been running into strange problems. here is the stacktrace it seems ,
there is nowhere the error is in my application, I donot know why this
exception/error is comming..

java.lang.NullPointerException at
android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:355) at
android.widget.ArrayAdapter.getView(ArrayAdapter.java:323) at
android.widget.AbsListView.obtainView(AbsListView.java:1274) at
android.widget.ListView.makeAndAddView(ListView.java:1668) at
android.widget.ListView.fillDown(ListView.java:637) at
android.widget.ListView.fillFromTop(ListView.java:694) at
android.widget.ListView.layoutChildren(ListView.java:1521) at
android.widget.AbsListView.onLayout(AbsListView.java:1113) at
android.view.View.layout(View.java:6831) at
android.widget.FrameLayout.onLayout(FrameLayout.java:333) at
android.view.View.layout(View.java:6831) at
android.widget.FrameLayout.onLayout(FrameLayout.java:333) at
android.view.View.layout(View.java:6831) at
android.view.ViewRoot.performTraversals(ViewRoot.java:996) at
android.view.ViewRoot.handleMessage(ViewRoot.java:1633) at
android.os.Handler.dispatchMessage(Handler.java:99) at
android.os.Looper.loop(Looper.java:123) at
android.app.ActivityThread.main(ActivityThread.java:4338) at
java.lang.reflect.Method.invokeNative(Native Method) at
java.lang.reflect.Method.invoke(Method.java:521) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) at
dalvik.system.NativeStart.main(Native Method)

-- 

3. Unable to get the trigger with Repeat Alarm when set in BootUp Sequence

4. try to see hprof dump from ddms

5. android and google docs

6. Waiting for Debugger on Release Version.

7. EMMA code coverage