android


Let a user delete a imageview


Is there a way to allow a user to delete an imageview if it already has a on touch listener being used for drag and drop? Is there another way to delete one when a user wants too?
This is my on drop listener at the moment. How can I tell if I drop in a certain area to delete?
private final class myListener implements View.OnTouchListener {
public boolean onTouch(View view, MotionEvent event) {
final int x = (int) event.getRawX();
final int y = (int) event.getRawY();
switch (event.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
RelativeLayout.LayoutParams layparms = (RelativeLayout.LayoutParams) view.getLayoutParams();
xCoord = x - layparms.leftMargin;
yCoord = y - layparms.topMargin;
break;
case MotionEvent.ACTION_UP:
break;
case MotionEvent.ACTION_POINTER_DOWN:
break;
case MotionEvent.ACTION_POINTER_UP:
break;
case MotionEvent.ACTION_MOVE:
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams)view.getLayoutParams();
layoutParams.leftMargin = x - xCoord;
layoutParams.topMargin = y - yCoord;
layoutParams.rightMargin = -250;
layoutParams.bottomMargin = -250;
view.setLayoutParams(layoutParams);
break;
default:
break;
}
return true;
}

Related Links

Honeycomb: Several fragments in each Tab in Action Bar
Selecting default action on Android
<TextView /> OR <TextView></TextView>
JQueryMobile - styles not applied in Webview (Android)
Update Application Feature in Android
Actionbarsherlock background image
Can I integrate samsung “All Share” with my android application on samsung phones
How to update datas with ContentProvider?
Can error in opening a camera be fixed in android?
How to tell if the user has finally quit all your activities in android application
How to synchronize client IDs from different devices (Android, iPhone, etc.) and backend server IDs
What's the best way to handle similar applications with almost identical core functions?
How to create a bigger bitmap from an existing bitmap
application crashes when I use a broadcast reciever
How to find the amount of data that is transferred when I make a web service call from my android app? [closed]
cocos2d-android: how to play/pause a game state

Categories

HOME
go
assembly
adal
hyperlink
google-spreadsheet
flex
devise
knitr
pdfbox
scripting
alsa
echo
openpyxl
enthought
emoji
ipmitool
flash-player
http-post
sse
gmm
swagger-2.0
google-maps-autocomplete
simpleitk
dapper-extensions
subclass
sqlpackage
eviews
scatter3d
playstation-portable
fstream
contacts
sendbird
dynamic-jasper
fossil
yowsup
protege4
hivemq
apic
salesforce-communities
alphabetical
google-knowledge-graph
password-protection
mongoose-schema
opensmpp
watchface
datacachefactory
portforwarding
oracle-service-bus
apache-spark-dataset
vaadin-elements
servermanager
jboss-4.2.x
configurationmanager
posixct
trojan
java-websocket
shinobi
android-instrumentation
restore
rmongo
materialized-path-pattern
angular2-testing
pytables
envi
tinkerpop3
sklearn-pandas
lz77
httpruntime.cache
concept-insights
jnlua
pypiserver
flock
toolkit
mod-proxy
botan
ansi
primitive-types
contrast
tweenlite
encryption-asymmetric
ora-00904
xml-dsig
multiautocompletetextview
getopt
inputmismatchexception
dtmf
workitem
ui-select2
pagedown
alice
web-notifications
android-loadermanager
azman
apache-commons-dbutils
urlrewriter
user-tracking
android-holo-everywhere
mbeans
event-receiver
timertask
data-mapping
cldc
flvplayback
ifilter
mathematical-typesetting
idatareader

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App