touch-event

Android - How to circular zoom/magnify part of image?

和自甴很熟 提交于 2019-11-28 17:34:50
I am trying to allow the user to touch the image and then basically a cirular magnifier will show that will allow the user to better select a certain area on the image. When the user releases the touch the magnified portion will dissapear. This is used on several photo editing apps and I am trying to implement my own version of it. The code I have below does magnify a circular portion of the imageview but does not delete or clear the zoom once I release my finger. I currently set a bitmap to a canvas using canvas = new Canvas(bitMap); and then set the imageview using takenPhoto.setImageBitmap

Android drawing a line to follow your finger

一个人想着一个人 提交于 2019-11-28 16:54:43
What I want to do is to draw a line that will follow my finger. I've created a custom view, and I have an onTouchEvent() that works. I can draw a static line in the onDraw() method without much trouble. I'm not really sure how to get the line to draw as my finger moves though. public boolean onTouchEvent(MotionEvent event) { super.onTouchEvent(event); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: { Log.e(TAG, " - DOWN -"); Log.e(TAG, " getX: " + event.getX()); break; } case MotionEvent.ACTION_UP: { Log.e(TAG, " - UP -"); Log.e(TAG, " getX: " + event.getX()); break; } } return true

Dynamically generated line with glow effective

我们两清 提交于 2019-11-28 16:00:05
I want to draw line with glow effect like this The problem - i must generate this line in program in dependence on user's interaction ( the form of line will be generated in onTouchEvent - ACTION_MOVE ). Can i generate this effect without xml files or drawing premaid bitmap ? sharl I imitate this effect in this way : Draw line with BlurMaskFilter ; Draw over it normal line. I use Path class to generate line and save coordinates of MOVE_ACTION event to generate only part of path what i need. Create 2 Paint() s: _paintSimple = new Paint(); _paintSimple.setAntiAlias(true); _paintSimple.setDither

Android MediaController intercepts all other touch events

…衆ロ難τιáo~ 提交于 2019-11-28 13:28:43
The top half of my app has a VideoView with a MediaController under it. The bottom half is an image with some buttons. While the MediaController is visible, the buttons below are not clickable. It's like while the MediaController is visible, it intercepts all other touch events, even if they are not within the bounds of the MediaController . Any idea around that? Ivan Bartsov You can check out my answer on overriding dispatchTouchEvent() to pass clicks through MediaController to an underlying Button , but I'm guessing there's something wrong with the way you use MediaController. Can you post

how can i bind touch events for a marker in google maps?

雨燕双飞 提交于 2019-11-28 12:25:53
google maps api does not support touch events but now i need to do some thing on the map and marker, such as long tap the map, tap the marker,drag the marker. what i wanna do is the same as the google maps client for iOS I implemented touch events the same way as shreedhar, but using the "mousedown" event. I've found that "click" isn't triggered on mobile devices when using the Google Maps API in a webview (i.e. PhoneGap), but the "mousedown" event is triggered by a tap on mobile or a click on the web. window.infowindow = new google.maps.InfoWindow({ content: 'content' }); google.maps.event

onTouchEvent onClick onLongClick calls

早过忘川 提交于 2019-11-28 12:04:36
In our application we handle the events in button to record data. So initially when i use setOnLongClickListener() and setOnClickListener() together with the same button, it work fine for us. That means it will call both this listener base on the click and LongClick of the button. Now when i tried to use setOnTouchListener() with the same button together with setOnLongClickListener() and setOnClickListener() then only OnTouch event is working, rest onclick and onLongclick event doesnt work. Can anyone tell me why this happen and if possible explain me with an example. The code i use is..

jquery touchstart in browser

半腔热情 提交于 2019-11-28 09:04:20
As touchstart/touchend is yet not supported in most of the desktop browsers. How can I create touchstart event that will be the same as mousedown event (that is supported in all browsers). I want something like this $('obj').bind('touchstart', function(e){ }); will be translated into $('obj').bind('mousedown', function(e){ }) You can bind both at once... $('obj').bind('touchstart mousedown', function(e){ }); If you want to mousedown event to fire touchstart events automatically (so you only need to bind touchstart ) use... $(document).bind('mousedown', function(event) { $(event.target).trigger

UIView animation prevents touch events? [duplicate]

自闭症网瘾萝莉.ら 提交于 2019-11-28 07:42:59
问题 This question already has an answer here: UIView animations canceling any touch input? 2 answers On Objective-C when animation starts on the UIView, no touch interaction is accepted. how can we handle this? 回答1: Use UIViewAnimationOptionAllowUserInteraction as an option parameter in method animateWithDuration:delay:options:animations:completion: UIViewAnimationOptions 来源: https://stackoverflow.com/questions/17810576/uiview-animation-prevents-touch-events

Receiving Touch Events from a Service (Solution?)

百般思念 提交于 2019-11-28 06:37:12
问题 So, earlier I posted a question about receiving touch events from a service (apparently no one knows the answer). After trying to figure it out myself for hours, I gave up and decided to email a developer known as RubberBigPepper. I asked him how he did it in his app Volume control and he promptly responded " TYPE_SYSTEM_ALERT window ". What does this mean, and how can it be implemented in code? EDIT: I used the following method: getWindow().addFlags(WindowManager.LayoutParams.TYPE_SYSTEM

Android firing onTouch event for multiple ImageViews

蓝咒 提交于 2019-11-28 06:12:42
问题 I have several ImageViews, and I want the onTouch event to fire for each of them when I drag my finger across multiple images. At present the onTouch event is only firing on the first ImageView (or actually on multiple ImageViews but only when multitouching the screen). Pseudo code: for(int i=0;i<5;i++){ ImageView img=new ImageView(this); LinearLayout.LayoutParams layoutParams=new LinearLayout.LayoutParams(width,height); img.setImageResource(R.drawable.cell); img.setOnTouchListener(this);