Best code examples for Android DragEvent class (android.view.DragEvent)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android DragEvent class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android DragEvent examples from Open Source projects
This code example shows how to use the following methods: getAction, getClipData
101:	switch (event.getAction()) { 
-
115:	mPocket.stash(event.getClipData()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getAction, getClipData, getLocalState, getX, getY
148:	switch (event.getAction()) 
-
173:	ClipData.Item item = event.getClipData().getItemAt(0); 
-
177:	View screen = (View) event.getLocalState(); 
-
180:	int posX = Math.round(event.getX() - screen.getMeasuredWidth() / 2); 
181:	int posY = Math.round(event.getY() - screen.getMeasuredHeight() / 2); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getAction, getLocalState, getX, getY
44:	switch (event.getAction()) { 
-
47:	View view = (View) event.getLocalState(); 
-
54:	view.setX((int)event.getX() + 5 - view.getWidth() / 2); 
55:	view.setY((int)event.getY() + 5 - view.getHeight() / 2); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getAction, getClipData, getX, getY
36:	int action = event.getAction(); 
-
58:	event.getX() + ", " + event.getY()); 
-
67:	ClipData data = event.getClipData(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getAction, getClipData, getX, getY
38:	int action = event.getAction(); 
-
61:	"drag proceeding in dropTarget: " + event.getX() 
62:	+ ", " + event.getY()); 
-
71:	ClipData data = event.getClipData(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getAction, getLocalState, getResult
42:	int dragAction = dragEvent.getAction(); 
-
44:	ListViewItem dragView = (ListViewItem) dragEvent.getLocalState(); 
-
60:	return !dragEvent.getResult(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAction
100:	boolean flag = super.onDrag(v, event); 
101:	switch (event.getAction()) { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAction, getX, getY
88:	int action = event.getAction(); 
89:	float x = event.getX(); 
90:	float y = event.getY(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAction, getLocalState, getY
103:	int action = event.getAction(); 
-
111:	if (event.getY() < vCenter) { 
-
122:	mDragDropListener.onDragLocation(pos, (int)event.getY(), vCenter); 
-
134:	int dragItemPosition = ((Integer)event.getLocalState()); 
-
137:	if (event.getY() < vCenter) { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAction, getLocalState, getResult
124:	View view = (View) event.getLocalState(); 
-
127:	switch (event.getAction()) { 
-
166:	if (!event.getResult()) { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAction, getLocalState
153:	int action = event.getAction(); 
154:	switch (event.getAction()) { 
-
171:	View view = (View) event.getLocalState(); 
-
187:	TextView view3 = (TextView) event.getLocalState(); 
-
202:	View view2 = (View) event.getLocalState(); 
-
216:	if (dropEventNotHandled(event)) { 
217:	View view2 = (View) event.getLocalState(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAction, getClipData
78:	final int action = event.getAction(); 
-
102:	ClipData.Item item = event.getClipData().getItemAt(0); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAction, getLocalState
58:	int action = event.getAction(); 
59:	switch (event.getAction()) { 
-
71:	View view = (View) event.getLocalState(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAction, getLocalState
133:	int action = event.getAction(); 
134:	switch (event.getAction()) { 
-
146:	View view = (View) event.getLocalState(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAction, getClipData
25:	final int action = event.getAction(); 
-
70:	ClipData.Item item = event.getClipData().getItemAt(0); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getX, getY
43:	float x = e.getX(); 
44:	float y = e.getY(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAction, getLocalState
57:	int action = event.getAction(); 
58:	switch (event.getAction()) { 
-
70:	View view = (View) event.getLocalState(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAction, getClipDescription
42:	final int action = event.getAction(); 
-
50:	if (event.getClipDescription().hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN)) { 
-
98:	String value = event.getClipDescription().getLabel().toString(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAction, getLocalState
28:	int action = event.getAction(); 
29:	switch (event.getAction()) { 
-
43:	View view = (View) event.getLocalState(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getAction, getClipDescription
53:	switch (event.getAction()) { 
-
84:	final ClipDescription clipDesc = event.getClipDescription(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAction, getClipDescription
19:	int action = event.getAction(); 
-
23:	if (event.getClipDescription().hasMimeType(ClipDescription.MIMETYPE_TEXT_PLAIN)) { 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAction, getLocalState
117:	Fallacy fallacy = (Fallacy) event.getLocalState(); 
-
119:	switch (event.getAction()) { 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAction, getLocalState
95:	if (event.getLocalState() != this) { 
-
99:	int action = event.getAction(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAction, getClipData
101:	if(event.getAction() == DragEvent.ACTION_DRAG_ENTERED) { 
-
104:	else if(event.getAction() == DragEvent.ACTION_DRAG_EXITED) { 
-
107:	else if(event.getAction() == DragEvent.ACTION_DROP) { 
-
109:	ClipData clip = event.getClipData(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getX, getY
272:	double x = ((event.getX()/v.getWidth())-0.5)*2*127; 
273:	double y = ((event.getY()/v.getHeight())-0.5)*2*127; 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAction, getClipData
114:	final int action = event.getAction(); 
-
151:	ClipData.Item data = event.getClipData().getItemAt(0); 
-
154:	ClipData.Item position = event.getClipData().getItemAt(1); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAction, getLocalState
139:	if (event.getLocalState() == null) { 
-
144:	View draggedView = (View) event.getLocalState(); 
-
147:	switch (event.getAction()) { 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAction, getLocalState
106:	int action = event.getAction(); 
-
123:	Fallacy payload = (Fallacy) event.getLocalState(); 
-
140:	Fallacy payload = (Fallacy) event.getLocalState(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAction, getLocalState
78:	View dragged = (View) event.getLocalState(); 
-
81:	int action = event.getAction(); 
82:	switch (event.getAction()) { 
-
114:	View v = (View) event.getLocalState(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAction
69:	switch (event.getAction()) 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getClipDescription
84:	final ClipDescription clipDesc = event.getClipDescription(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getAction
35:	int action = event.getAction(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getClipDescription
229:	ClipDescription clipDesc = event.getClipDescription(); 
Full Snippet Info
3
CodeRank
This code example shows how to use the following methods: getAction
57:	switch (event.getAction()) { 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getResult
141:	return !dragEvent.getResult(); 
Full Snippet Info
4
CodeRank
This code example shows how to use the following methods: getLocalState
287:	final View droppedView = (View) event.getLocalState(); 
Full Snippet Info
3
CodeRank
Related Android DragEvent Questions & Answers:
Other Android DragEvent Examples
49:	
50:	    @Override
51:	    public boolean onDrag(View v, DragEvent event) {
52:	      int action = event.getAction();
53:	      switch (event.getAction()) {

Read More

See Code Examples for Android DragEvent Methods: