touch-event

WebView getting rid of double tap zoom.

社会主义新天地 提交于 2019-12-29 07:38:07
问题 I read many tickets on the topic of Zooming in WebViews and didnt came to an answer for my case. Here´s my setup: I´m using a custom webview with generally these settings: getSettings().setBuiltInZoomControls(false); getSettings().setSupportZoom(false); getSettings().setUseWideViewPort(true); getSettings().setLoadWithOverviewMode(true); Let me note right here that i depend on OverviewMode and as well on WideViewPort to Scale my WebView. I´m also Overriding my OnTouchEvent and and delegate all

Catch onTouch event by parent, handle it and pass to children

 ̄綄美尐妖づ 提交于 2019-12-29 05:03:05
问题 I tried to understand how Android handle touch event and got a little bit confused. From what I understand touch event are send to the root view and pass down to the children. I have a FrameLayout that is a container for Fragment . First fragment view is a ScrollView , second one is some kind of Gallery (HorizontalListView) and the last one is also FrameLayout . Only one fragment in the layout each time. What I want to do is to identify user swipes on the screen, for the app use. I want to

onTouchevent() vs onTouch()

柔情痞子 提交于 2019-12-28 04:53:08
问题 After many experiments with onTouchEvent and onTouch, I found that onTouch works everywhere you want (whether it is in activity or view) as long as you have declared the interface and put the Listener right! On the other hand, onTouchEvent only works inside a View! Is my assumption correct? Is this the real difference? 回答1: Yes you are correct - onTouch() is used by users of the View to get touch events while onTouchEvent() is used by derived classes of the View to get touch events. 回答2: I

place a image at the touched area in android

本小妞迷上赌 提交于 2019-12-25 05:30:33
问题 I need to create a image wherever the user touched on the screen. If the user touches more places, the image should be shown in all the places. I used the following code. package com.tag.image; import android.app.Activity; import android.graphics.Canvas; import android.os.Bundle; import android.view.MotionEvent; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.Toast; public class TagsOverImage extends Activity { /** Called when the activity is first

android onclick method want image path

倖福魔咒の 提交于 2019-12-25 00:52:35
问题 I display image from the web in my application. It is running perfectly My Question is : what is method,function to take current image URL when I click on image.? (I passed url as string for display). I used this method: private String getAnImageUrl() { i++; if(i >= images.length){ i = 0; } public class ImageExampleXML extends Activity { private String reviewImageLink; private final String images[] = {"http://clients..../britney.jpg", "http://client...../evala.jpg", "http://clients......

Catch onTouch event by Custom 2d Scrollview parent, handle it and pass to children

你。 提交于 2019-12-25 00:09:07
问题 I'm trying to implement Catch onTouch event by parent, handle it and pass to children butt failed to do that. Gist of full 2d scroll code is here what I have tried: Override the method dispatchTouchEvent , and sent the MotionEvent to a GestureDetector @Override public boolean dispatchTouchEvent (MotionEvent ev) { // return super.dispatchTouchEvent(ev); boolean result = super.dispatchTouchEvent(ev); if (gestureDetector.onTouchEvent(ev)) { return result; } //If not scrolling vertically (more y

How do I make the width of and element change when a touch and drag is detected on a touch device?

心不动则不痛 提交于 2019-12-24 17:12:39
问题 I have a slider that I built that changes the width of it to slide the element into view. On a desktop there are buttons to do this. I want to be able to make the slider work with a touch and drag event and for it to be smooth like iosslider. I have found a way that works but it is choppy and does not always respond. My code... <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script> <script type="text/javascript">$(document).bind("mobileinit", function(){$

Android ACTION_UP does not get fired after ACTION_MOVE

别说谁变了你拦得住时间么 提交于 2019-12-24 10:47:27
问题 I'm trying to create a view programmatically, and change its background according to its click state. I know I can do this with xml drawables, but I want to learn to program it too. But if I press on my view, then slide my finger, the view gets stuck in pressed state. (white = 0xaaffffff background) My code is this : Edit: I solved the problem. Here is the working code : mainContainer.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { //

handling touch events in Android when using multiple views/layouts

喜夏-厌秋 提交于 2019-12-24 08:50:02
问题 I'm very new to Android programming, and trying to understand touch events with nested views. To start, here's a description of my app: I have a relative layout that I've added via the GUI editor. Everything is default. I've also created a class called ClipGrid that extends ScrollView. Nested inside that, I make a HorizontalScrollView. Inside of that, I make a TableLayout and it's rows. The rows contain buttons. The end result is a grid of buttons. It displays 4x4 at once, but can scroll

phonegap touch event / div overflow

南楼画角 提交于 2019-12-23 22:17:52
问题 My problem: I have a css div with a table (jquery-mobile 1.0), - If I add too much rows in the div (overflow) the touch event isnt't fireing the javascript functions...any idea? it,s not fireing the functions and " overflow, before it's working fine !) $('#mytable').append('<tr><td width=20%> <a href=add.html onclick=setId('+row.UserId+');> <img src=./icons/patientendaten.png width=48px height=48px></a></td> <td width=20%>'+row.Datum+'</td><td width=20%>'+row.Patient+'</td> <td width=20%>