touch-event

how to make header of listview not to consume the touch event

假装没事ソ 提交于 2019-12-10 23:37:00
问题 What I want I want the header of listView not to consume the touch event Problem I have a FrameLayout.In it, there are a mapview and a listview. The listview has a transparent header view in order to show more of the mapview. Now the header view response to the touch events, but I want dispatch these events to the mapview. How to do? I have tried headerView.setEnabled(false) headerView.setClickable(false) mListView.addHeaderView(headerView, null, false) All of them failed, any advice? 回答1: I

Opengl-es onTouchEvents problem or a draw problem? [closed]

梦想与她 提交于 2019-12-10 23:03:06
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I am just getting started with using opengl in my apps and I get it fine =) but I've hit a brick wall recently as I have been attempting to work out methods of user input. I decided to start with a simple process

Where should I implement the Android onTouchListener?

本小妞迷上赌 提交于 2019-12-10 19:35:37
问题 I am new to Android development and at the moment I must make a decision of where to control the gesture input, but I just don't know the pros and cons of where to grab the touch input. I have been given two alternatives, can you please explain to me the pros and cons of either way? Set listener on View; implement methods: faceView.setOnTouchListener(new OnTouchListener(){ public boolean onTouch(View arg0, MotionEvent arg1){ return false; } ); or Override method within View public boolean

Detect OnTouch on AppWidget. If is it possible?

依然范特西╮ 提交于 2019-12-10 19:29:50
问题 Detect OnTouch on AppWidget. If is it possible? Hello! I'm trying to create my first AppWidget for Android 2.1 in which a client may have a chance to select an item on my custom view. I'm going to create a custom view and a slider for it and client may select by pulling slider over the custom view. For this purpose I want to detect onTouch for AppWidget (to determine X-, Y- coordinates), is there way to do this? I saw a list of valid widgets which can be used in AppWidget: AnalogClock Button

Android Jelly Bean service that receives all touch events

被刻印的时光 ゝ 提交于 2019-12-10 16:01:15
问题 I am an undergraduate research assistant working on an android accessibility project. My task involves collecting as much data about the user experience as possible, including touch events and other view interactions. I require 2 services: an accessibility service to gather details about the view current interaction, and a TouchListener service that is able to intercept MotionEvents . My problem is with the TouchListener service. Is there any known way to intercept all touch events and pass

Android ACTION_UP even never called

冷暖自知 提交于 2019-12-10 14:16:57
问题 I'm trying to make a small android Jump and Run game but my problem is that i can't configure the event ACTION_UP right. Here my Code: public boolean onTouchEvent(MotionEvent event) { switch(event.getAction()){ case MotionEvent.ACTION_DOWN: Log.d("OTE", "down"); touchDownTrue = true; break; case MotionEvent.ACTION_UP: Log.d("OTE", "UP"); touchDownTrue = false; break; } } the case MotionEvent.ACTION_UP is never called and i don't know why, the same happens if i use ACTION_CANCEL 回答1: After I

Override UIGestureRecognizer touchesBegan

a 夏天 提交于 2019-12-10 13:58:55
问题 I have 1 Main View and 1 SubView : Main View > SubView I think that the Main View is "stealing" the events from the SubView . For example, when I tap on the SubView , only the Main View GestureRecognizer is fire. Here is my custom GestureRecognizer (which intercepts every touch event): import UIKit import UIKit.UIGestureRecognizerSubclass class MainGestureRecognizer: UIGestureRecognizer { override func touchesBegan(touches: NSSet!, withEvent event: UIEvent!) { super.touchesBegan(touches,

Android onTouchEvent Coordinates Skip around

断了今生、忘了曾经 提交于 2019-12-10 12:42:58
问题 I my app, I have an element that requires the user to move it around on the screen, and to do this I am using a RelativeLayout and on onTouchListener. The problem that I am having, is that inside of my onTouchListener , I am getting some weird results for getX() and getY() . I added the following line of code into my onTouch() -> ACTION_MOVE block: Log.v("example", "Touch: {x:" + event.getX() + " } {y:" + event.getY() + "}"); Below are my LogCat results. 04-29 03:16:11.000: V/myApp(24188):

Android - User paints lines with their finger

时光毁灭记忆、已成空白 提交于 2019-12-10 11:23:15
问题 I want to build a tool on Android where the user can paint some simple objects over a picture (eg line, circle or arrow). I started trying the line part first, and indeed I could succeed on painting it. The logic is that the user taps at one point and then drags their finger, painting the line. I use a class like this (it is based on DonGru's answer here): public class DrawView extends View { Paint paint = new Paint(); float Sx, Sy, Lx, Ly; public DrawView(Context context, float x1, float y1,

Connect the dots of an imageview

眉间皱痕 提交于 2019-12-10 10:07:20
问题 It is a difficult task to create an app for kids and i am given a task of creating an connect the dots app. example https://play.google.com/store/apps/details?id=zok.android.dots i have done some tutorials of onTouchEvent. i know how to paint on screen Draw in Canvas by finger, Android i am getting the dot coordinates using this Android: How do I get the x y coordinates within an image / ImageView? example but I really don't know how to achieve this target. I'd really appreciate a solution to