Home
last modified time | relevance | path

Searched refs:event (Results 1 – 25 of 157) sorted by relevance

1234567

/development/samples/ApiDemos/src/com/example/android/apis/graphics/
DTouchPaint.java339 public boolean onTrackballEvent(MotionEvent event) { in onTrackballEvent() argument
340 final int action = event.getActionMasked(); in onTrackballEvent()
347 final int N = event.getHistorySize(); in onTrackballEvent()
348 final float scaleX = event.getXPrecision() * TRACKBALL_SCALE; in onTrackballEvent()
349 final float scaleY = event.getYPrecision() * TRACKBALL_SCALE; in onTrackballEvent()
351 moveTrackball(event.getHistoricalX(i) * scaleX, in onTrackballEvent()
352 event.getHistoricalY(i) * scaleY); in onTrackballEvent()
354 moveTrackball(event.getX() * scaleX, event.getY() * scaleY); in onTrackballEvent()
369 public boolean onTouchEvent(MotionEvent event) { in onTouchEvent() argument
370 return onTouchOrHoverEvent(event, true /*isTouch*/); in onTouchEvent()
[all …]
DShadowCardDrag.java212 public boolean onTouch(View v, MotionEvent event) { in onCreate()
213 switch (event.getAction()) { in onCreate()
215 downX = event.getX() - mCard.getTranslationX(); in onCreate()
216 downY = event.getY() - mCard.getTranslationY(); in onCreate()
217 downTime = event.getDownTime(); in onCreate()
224 mDragState.onDown(event.getDownTime(), event.getX(), event.getY()); in onCreate()
228 mCard.setTranslationX(event.getX() - downX); in onCreate()
229 mCard.setTranslationY(event.getY() - downY); in onCreate()
231 mDragState.onMove(event.getEventTime(), event.getX(), event.getY()); in onCreate()
DCompass.java39 public void onSensorChanged(SensorEvent event) {
41 … "sensorChanged (" + event.values[0] + ", " + event.values[1] + ", " + event.values[2] + ")");
42 mValues = event.values;
DSensorTest.java84 public void onSensorChanged(SensorEvent event) {
89 diff[i] = Math.round(mScale[i] * (event.values[i] - mPrev[i]) * 0.45f);
93 mPrev[i] = event.values[i];
99 Log.e(TAG, "sensorChanged " + event.sensor.getName() +
100 " (" + event.values[0] + ", " + event.values[1] + ", " +
101 event.values[2] + ")" + " diff(" + diff[0] +
/development/ndk/sources/android/ndk_helper/
DgestureDetector.cpp139 int32_t PinchDetector::FindIndex( const AInputEvent* event, int32_t id ) in FindIndex() argument
141 int32_t count = AMotionEvent_getPointerCount( event ); in FindIndex()
144 if( id == AMotionEvent_getPointerId( event, i ) ) in FindIndex()
150 GESTURE_STATE PinchDetector::Detect( const AInputEvent* event ) in Detect() argument
153 int32_t action = AMotionEvent_getAction( event ); in Detect()
155 event_ = event; in Detect()
157 int32_t count = AMotionEvent_getPointerCount( event ); in Detect()
161 vec_pointers_.push_back( AMotionEvent_getPointerId( event, 0 ) ); in Detect()
167 vec_pointers_.push_back( AMotionEvent_getPointerId( event, iIndex ) ); in Detect()
182 int32_t released_pointer_id = AMotionEvent_getPointerId( event, index ); in Detect()
[all …]
DgestureDetector.h128 int32_t FindIndex( const AInputEvent* event, int32_t id );
139 virtual GESTURE_STATE Detect( const AInputEvent* event );
151 int32_t FindIndex( const AInputEvent* event, int32_t id );
161 virtual GESTURE_STATE Detect( const AInputEvent* event );
/development/samples/browseable/BatchStepSensor/src/com.example.android.batchstepsensor/cardstream/
DCardLayout.java60 public boolean onTouchEvent(MotionEvent event) { in onTouchEvent() argument
61 switch(event.getAction()){ in onTouchEvent()
67 return super.onTouchEvent(event); in onTouchEvent()
71 public boolean onInterceptTouchEvent(MotionEvent event) { in onInterceptTouchEvent() argument
73 switch(event.getAction()){ in onInterceptTouchEvent()
76 mSwiping = Math.abs(mDownX - event.getX()) > mTouchSlop; in onInterceptTouchEvent()
80 mDownX = event.getX(); in onInterceptTouchEvent()
81 mDownY = event.getY(); in onInterceptTouchEvent()
/development/samples/browseable/BasicMultitouch/src/com.example.android.basicmultitouch/
DTouchDisplayView.java133 public boolean onTouchEvent(MotionEvent event) { in onTouchEvent() argument
135 final int action = event.getAction(); in onTouchEvent()
152 int id = event.getPointerId(0); in onTouchEvent()
154 TouchHistory data = TouchHistory.obtain(event.getX(0), event.getY(0), in onTouchEvent()
155 event.getPressure(0)); in onTouchEvent()
181 int index = event.getActionIndex(); in onTouchEvent()
182 int id = event.getPointerId(index); in onTouchEvent()
184 TouchHistory data = TouchHistory.obtain(event.getX(index), event.getY(index), in onTouchEvent()
185 event.getPressure(index)); in onTouchEvent()
210 int id = event.getPointerId(0); in onTouchEvent()
[all …]
/development/samples/ApiDemos/src/com/example/android/apis/view/
DHover.java77 public boolean onHover(View v, MotionEvent event) { in onCreate()
78 switch (event.getAction()) { in onCreate()
82 event.getX(), event.getY())); in onCreate()
87 event.getX(), event.getY())); in onCreate()
92 event.getX(), event.getY())); in onCreate()
DHoverInterceptorView.java48 public boolean onInterceptHoverEvent(MotionEvent event) { in onInterceptHoverEvent() argument
52 return super.onInterceptHoverEvent(event); in onInterceptHoverEvent()
56 public boolean onHoverEvent(MotionEvent event) { in onHoverEvent() argument
58 if (mInterceptHover && event.getAction() != MotionEvent.ACTION_HOVER_EXIT) { in onHoverEvent()
65 return super.onHoverEvent(event); in onHoverEvent()
DGameView.java118 public boolean onKeyDown(int keyCode, KeyEvent event) { in onKeyDown() argument
123 if (event.getRepeatCount() == 0) { in onKeyDown()
154 step(event.getEventTime()); in onKeyDown()
157 return super.onKeyDown(keyCode, event); in onKeyDown()
161 public boolean onKeyUp(int keyCode, KeyEvent event) { in onKeyUp() argument
194 step(event.getEventTime()); in onKeyUp()
197 return super.onKeyUp(keyCode, event); in onKeyUp()
207 public boolean onGenericMotionEvent(MotionEvent event) { in onGenericMotionEvent() argument
212 if (event.isFromSource(InputDevice.SOURCE_CLASS_JOYSTICK) in onGenericMotionEvent()
213 && event.getAction() == MotionEvent.ACTION_MOVE) { in onGenericMotionEvent()
[all …]
DGameControllerInput.java121 public boolean dispatchKeyEvent(KeyEvent event) { in dispatchKeyEvent() argument
123 InputDeviceState state = getInputDeviceState(event.getDeviceId()); in dispatchKeyEvent()
125 switch (event.getAction()) { in dispatchKeyEvent()
127 if (state.onKeyDown(event)) { in dispatchKeyEvent()
132 if (state.onKeyUp(event)) { in dispatchKeyEvent()
138 return super.dispatchKeyEvent(event); in dispatchKeyEvent()
142 public boolean dispatchGenericMotionEvent(MotionEvent event) { in dispatchGenericMotionEvent() argument
145 if (event.isFromSource(InputDevice.SOURCE_CLASS_JOYSTICK) in dispatchGenericMotionEvent()
146 && event.getAction() == MotionEvent.ACTION_MOVE) { in dispatchGenericMotionEvent()
148 InputDeviceState state = getInputDeviceState(event.getDeviceId()); in dispatchGenericMotionEvent()
[all …]
DDraggableDot.java186 public boolean onDragEvent(DragEvent event) { in onDragEvent() argument
188 switch (event.getAction()) { in onDragEvent()
191 Log.i(TAG, "Drag started, event=" + event); in onDragEvent()
217 Log.i(TAG, "Got a drop! dot=" + this + " event=" + event); in onDragEvent()
221 processDrop(event); in onDragEvent()
238 Log.i(TAG, "other drag event: " + event); in onDragEvent()
246 private void processDrop(DragEvent event) { in processDrop() argument
247 final ClipData data = event.getClipData(); in processDrop()
254 if (event.getLocalState() == (Object) this) { in processDrop()
/development/cmds/monkey/src/com/android/commands/monkey/
DMonkeyPowerEvent.java87 ContentValues event = new ContentValues(); in bufferLogEvent() local
88 event.put("date", tagTime); in bufferLogEvent()
89 event.put("tag", tag); in bufferLogEvent()
92 event.put("value", value); in bufferLogEvent()
94 mLogEvents.add(event); in bufferLogEvent()
109 ContentValues event = events[i]; in writeLogEvents() local
110 buffer.append(MonkeyUtils.toCalendarTime(event.getAsLong("date"))); in writeLogEvents()
111 buffer.append(event.getAsString("tag")); in writeLogEvents()
112 if (event.containsKey("value")) { in writeLogEvents()
113 String value = event.getAsString("value"); in writeLogEvents()
/development/samples/ApiDemos/src/com/example/android/apis/accessibility/
DCustomViewAccessibilityActivity.java81 public void onInitializeAccessibilityEvent(AccessibilityEvent event) { in onInitializeAccessibilityEvent() argument
82 super.onInitializeAccessibilityEvent(event); in onInitializeAccessibilityEvent()
86 event.setChecked(isChecked()); in onInitializeAccessibilityEvent()
105 public void onPopulateAccessibilityEvent(AccessibilityEvent event) { in onPopulateAccessibilityEvent() argument
106 super.onPopulateAccessibilityEvent(event); in onPopulateAccessibilityEvent()
112 event.getText().add(text); in onPopulateAccessibilityEvent()
148 public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) { in tryInstallAccessibilityDelegate()
149 super.onInitializeAccessibilityEvent(host, event); in tryInstallAccessibilityDelegate()
153 event.setChecked(isChecked()); in tryInstallAccessibilityDelegate()
173 public void onPopulateAccessibilityEvent(View host, AccessibilityEvent event) { in tryInstallAccessibilityDelegate()
[all …]
/development/samples/ControllerSample/src/com/example/controllersample/
DGameView.java128 public boolean onKeyDown(int keyCode, KeyEvent event) { in onKeyDown() argument
129 int deviceId = event.getDeviceId(); in onKeyDown()
132 if (currentShip.onKeyDown(keyCode, event)) { in onKeyDown()
133 step(event.getEventTime()); in onKeyDown()
138 return super.onKeyDown(keyCode, event); in onKeyDown()
142 public boolean onKeyUp(int keyCode, KeyEvent event) { in onKeyUp() argument
143 int deviceId = event.getDeviceId(); in onKeyUp()
146 if (currentShip.onKeyUp(keyCode, event)) { in onKeyUp()
147 step(event.getEventTime()); in onKeyUp()
152 return super.onKeyUp(keyCode, event); in onKeyUp()
[all …]
/development/ndk/platforms/android-9/include/
Dthread_db.h83 td_event_e event; member
133 extern td_err_e td_ta_set_event(td_thragent_t const * agent, td_thr_events_t * event);
135 extern td_err_e td_ta_event_addr(td_thragent_t const * agent, td_event_e event, td_notify_t * notif…
138 td_thr_events_t * event);
140 extern td_err_e td_ta_event_getmsg(td_thragent_t const * agent, td_event_msg_t * event);
149 td_event_e event);
/development/samples/browseable/DataLayer/Wearable/src/com.example.android.wearable.datalayer/
DMainActivity.java143 for (DataEvent event : events) { in onDataChanged()
144 if (event.getType() == DataEvent.TYPE_CHANGED) { in onDataChanged()
145 String path = event.getDataItem().getUri().getPath(); in onDataChanged()
147 DataMapItem dataMapItem = DataMapItem.fromDataItem(event.getDataItem()); in onDataChanged()
161 generateEvent("DataItem Changed", event.getDataItem().toString()); in onDataChanged()
166 } else if (event.getType() == DataEvent.TYPE_DELETED) { in onDataChanged()
167 generateEvent("DataItem Deleted", event.getDataItem().toString()); in onDataChanged()
169 generateEvent("Unknown data event type", "Type = " + event.getType()); in onDataChanged()
194 public void onMessageReceived(MessageEvent event) { in onMessageReceived() argument
195 LOGD(TAG, "onMessageReceived: " + event); in onMessageReceived()
[all …]
/development/samples/browseable/BasicAccessibility/src/com.example.android.basicaccessibility/
DDialView.java137 public void onPopulateAccessibilityEvent(AccessibilityEvent event) { in onPopulateAccessibilityEvent() argument
138 super.onPopulateAccessibilityEvent(event); in onPopulateAccessibilityEvent()
141 int eventType = event.getEventType(); in onPopulateAccessibilityEvent()
150 event.getText().add("Mode selected: " + Integer.toString(mActiveSelection + 1) + "."); in onPopulateAccessibilityEvent()
151 event.setItemCount(SELECTION_COUNT); in onPopulateAccessibilityEvent()
152 event.setCurrentItemIndex(mActiveSelection); in onPopulateAccessibilityEvent()
158 event.getText().add("Tap to change."); in onPopulateAccessibilityEvent()
/development/ndk/sources/android/libportable/arch-x86/
Depoll.c21 int WRAP(epoll_ctl)(int epfd, int op, int fd, struct epoll_event_portable *event) in WRAP()
25 x86_epoll_event.events = event->events; in WRAP()
26 x86_epoll_event.data = event->data; in WRAP()
/development/ndk/platforms/android-9/samples/native-activity/jni/
Dmain.c168 static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) { in engine_handle_input() argument
170 if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION) { in engine_handle_input()
172 engine->state.x = AMotionEvent_getX(event, 0); in engine_handle_input()
173 engine->state.y = AMotionEvent_getY(event, 0); in engine_handle_input()
277 ASensorEvent event; in android_main() local
279 &event, 1) > 0) { in android_main()
281 event.acceleration.x, event.acceleration.y, in android_main()
282 event.acceleration.z); in android_main()
/development/samples/browseable/FindMyPhone/Application/src/com.example.android.wearable.findphone/
DSoundAlarmListenerService.java70 for (DataEvent event : dataEvents) { in onDataChanged()
71 if (event.getType() == DataEvent.TYPE_DELETED) { in onDataChanged()
72 Log.i(TAG, event + " deleted"); in onDataChanged()
73 } else if (event.getType() == DataEvent.TYPE_CHANGED) { in onDataChanged()
75 DataMap.fromByteArray(event.getDataItem().getData()).get(FIELD_ALARM_ON); in onDataChanged()
/development/samples/Support4Demos/src/com/example/android/supportv4/widget/
DExploreByTouchHelperActivity.java106 public boolean dispatchHoverEvent(MotionEvent event) { in dispatchHoverEvent() argument
108 if (mTouchHelper.dispatchHoverEvent(event)) { in dispatchHoverEvent()
112 return super.dispatchHoverEvent(event); in dispatchHoverEvent()
116 public boolean onTouchEvent(MotionEvent event) { in onTouchEvent() argument
117 switch (event.getAction()) { in onTouchEvent()
121 final int itemIndex = getItemIndexUnder(event.getX(), event.getY()); in onTouchEvent()
128 return super.onTouchEvent(event); in onTouchEvent()
259 int virtualViewId, AccessibilityEvent event) { in onPopulateEventForVirtualView() argument
270 event.getText().add(item.description); in onPopulateEventForVirtualView()
/development/ndk/platforms/android-3/include/
Dthread_db.h80 td_event_e event; member
128 extern td_err_e td_ta_set_event(td_thragent_t const * agent, td_thr_events_t * event);
130 extern td_err_e td_ta_event_addr(td_thragent_t const * agent, td_event_e event, td_notify_t * notif…
132 extern td_err_e td_ta_event_getmsg(td_thragent_t const * agent, td_event_msg_t * event);
/development/samples/browseable/WatchViewStub/Wearable/src/com.example.android.google.wearable.watchviewstub/
DMainActivity.java75 public boolean dispatchTouchEvent(MotionEvent event) { in dispatchTouchEvent() argument
76 return mGestureDetector.onTouchEvent(event) || super.dispatchTouchEvent(event); in dispatchTouchEvent()
81 public void onLongPress(MotionEvent event) { in onLongPress() argument

1234567