xamarin.android - In Mono For Droid How to move ImageView when I touch it? -
i'm using mono-for-droid. have imageview , want move follow finger when touch , stop moving when release finger.
here code, please advice how it?
using system; using system.collections.generic; using system.linq; using system.text; using android.app; using android.content; using android.os; using android.runtime; using android.views; using android.widget; using android.util; using android.graphics.drawables; using android.content.res; [assembly: usespermission(name = android.manifest.permission.systemalertwindow)] namespace extremekeyboard { [service] public class chatheadservice: android.app.service { system.threading.timer _timer; private iwindowmanager windowmanager; private imageview reminderhead; private drawable icon; private android.views.windowmanagerlayoutparams loparams; public override void onstart(android.content.intent intent, int startid) { base.onstart(intent, startid); var windowservice = this.getsystemservice(android.content.context.windowservice); var windowmanager = windowservice.javacast<android.views.iwindowmanager>(); reminderhead = new imageview(this); reminderhead.setimageresource(resource.drawable.icon); loparams = new android.views.windowmanagerlayoutparams( android.views.windowmanagerlayoutparams.wrapcontent, android.views.windowmanagerlayoutparams.wrapcontent, android.views.windowmanagertypes.phone, android.views.windowmanagerflags.notfocusable, android.graphics.format.translucent); loparams.gravity = gravityflags.top | gravityflags.left; loparams.x = 0; loparams.y = 100; windowmanager.addview(reminderhead, loparams); } public override android.os.ibinder onbind(android.content.intent intent) { throw new notimplementedexception(); } } }
Comments
Post a Comment