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

How can I modify this PDF reader code so it can acess files inside the assets folder?
Adding two edittext values together and displaying result in another edittext
app-debug.apk does not exist on disk
unable to receive data from dialogFragment in a fragment
Calling a BroadcastReceiver in a Service from MainActivity
Webview page loading error
Listview can't displayed the last item
Database value store in variable, cannot used by listview?
additonal line space in textview
android best way to load video from RSTP?
SQL statement producing data I do not want
android verify subscription validity from app every time (dayli) online and offline without a personal server
Google Map getMapAsync() NullPointerException
Error during creating dialog inside onDestroy : Can not perform this action after onSaveInstanceState Android
Android studio which version is good for development?
Unable to create GridView element in layout

Categories

HOME
notepad++
paraview
prism
c++11
ns-3
numbers
yahoo-finance
sublimetext
pdfbox
google-cloud-functions
hpc
crystal-reports-2013
jax-ws
jtextpane
elasticsearch-5
okhttp
heap
github-enterprise
onedrive-api
dreamweaver
smartclient
topology
asp.net-core-webapi
beta
perlbrew
draft-js-plugins
definitelytyped
beautifier
jasmine-node
cppreference
failover
realm-mobile-platform
google-earth
calculation
hibernate-validator
playstation-portable
linkedhashmap
jwplayer6
sharepoint-workflow
openproject
railstutorial.org
doc
sharp-snmp
glm-math
signal-strength
term
sundials
gpg-signature
d3-force-directed
gameplay-kit
rmongo
docpad
redistributable
neon
nikeplus-api
asyncdisplaykit
sapi
decimalformat
microsoft-reporting
poppler
rubaxa-sortable
page.js
lasso
amiga
cwrsync
nutiteq
git-ftp
aspectj-maven-plugin
kubuntu
rrule
infosphere-spl
spy++
webfinger
machine-instruction
wcm
lnk
matrix-inverse
winginx
square-bracket
sbcl
sphinxql
ui-select2
octal
android-icons
pstack
xcode3.2
saleslogix
usertype
lr
resharper-6.0
isapi-extension
django-piston
silverlight-oob
escrow
image-capture

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