gestures

How to best handle fling gesture for Android ListActivity

◇◆丶佛笑我妖孽 提交于 2019-11-29 03:49:49
问题 I have an Android app with a ListActivity in the main view. The list contains a LinearLayout with a TextView and a hidden delete Button. The delete Button will be hidden by default. I want to use a fling gesture to show the button. I am able to detect the fling gesture thanks to question #937313 on stackoverflow. It's not clear to me how to determine which item in the list was flung, since the onTouch listener listens to the ListView . The item is not necessarily selected so getSelected*

The import com.android.internal.R cannot be resolved

馋奶兔 提交于 2019-11-29 02:33:12
问题 Hi i am working with Gestures and i need to import but i m getting error com.android.internal.R; The import com.android.internal.R cannot be resolved kindly help me , please 回答1: You don't say why you need access to com.android.internal.R , but the sad fact is that you simply cannot import it (the "internal" is a clue that it's not part of the public API). Google doesn't expose this because it is subject to change. It is possible to get to the internal resources by calling Resources.getSystem

How to detect a swipe-to-delete gesture in a customized UITableviewCell?

一曲冷凌霜 提交于 2019-11-28 18:26:10
I have customized a UITableViewCell and I want to implement "swipe to delete". But I don't want the default delete button. Instead, I want to do something different. What would be the easiest way to implement this? Are there some methods which get called when the user swipes to delete a cell? Can I prevent then the default delete button from appearing? Right now I think I must implement my own logic to avoid the default delete button and shrink animations which happen in swipe to delete in the default implementation of UITableViewCell. Maybe I have to use a UIGestureRecognizer? If you want to

How to implement swipe gestures for mobile devices?

那年仲夏 提交于 2019-11-28 16:20:49
I have an application made in AngularJS which has arrow key navigation to switch views. I want to implement this navigation using swipe for touch devices. I tried jGestures library but it doesn't go well with swipe. I have been recommended NOT to use jquery mobile . Is there any other way to implement swipe? EDIT: It does not detect swipe cleanly. I tested it on multiple devices, including iPad and it takes multiple swipes to do an action(routing in my case). I made this function for my needs. Feel free to use it. Works great on mobile devices. function detectswipe(el,func) { swipe_det = new

drawing on iphone

狂风中的少年 提交于 2019-11-28 11:29:22
I am trying to develop an iPhone application for children which will be able to draw characters on screen with touch and I want to know how to match the character drawn with good character of the alphabet. How will i compare the two shapes (drawing and existing) Any idea?? some code? Using GLGestureRecognizer you can create a catalogue and it will compute a metric between an input point array against an "alphabet" you predefine. GLGestureRecognizer is an Objective-C implementation of the $1 Unistroke Recognizer, a simple gesture recognition algorithm (see Credits below). It is made available

The UICollectionView “swipe-away” in iOS7 app manager?

风流意气都作罢 提交于 2019-11-28 07:02:41
On any 2014+ iPhone or iPad, double-click the home button to see the "app manager" This is a left-right UICollectionView BUT it has a "swipe-away" gesture .. swipe up. How is it done? It's not so easy to "remove" a cell from a UICollectionView. Footnote for googlers .. for the general problem of "peeling off", "tearing away", one cell from a collection view, here's a full tidy explanation: https://stackoverflow.com/a/24339705/294884 Hope it helps someone. mbehan It can be much simpler than the comments on your question are suggesting. Your cell should contain a view (the thing that you're

iOS - Can an app running in the background send touch / gesture events to another app in the foreground?

ⅰ亾dé卋堺 提交于 2019-11-28 02:12:52
问题 I have been asked to develop an app that will record and later "play back" touches and gestures onto another app running in the foreground. From my experience and knowledge, this is not possible unless both apps are setup to send/receive data between them through notifications or other methods. Also, it would be a huge risk for apps and their data to be exposed to anybody. I am 99% sure this is not possible, but was just curious if anyone else has come across something similar (or

JavaFX ListView with touch events for scrolling up and down

为君一笑 提交于 2019-11-28 02:10:57
I would like to implement a scrollable ListView with gestures, just like in mobiles and tablets, to scroll up and down my list with a finger. But my current list selects an item as soon as I click down on the list. How can I achieve this? I couldn't find any example at the Oracle tutorials. private ObservableList<Document> items = FXCollections.observableArrayList(); @FXML ListView<Document> listView; { ... listView.setItems(items); listView.getStylesheets().add("style/listview.css"); listView.setStyle("-fx-background-insets: 0 ;"); // remove 1px border of listview container listView

Android: Detect if user touches and drags out of button region?

只愿长相守 提交于 2019-11-27 18:18:01
In Android, how can we detect if a user touches on button and drags out of region of this button? Check the MotionEvent.MOVE_OUTSIDE: Check the MotionEvent.MOVE: private Rect rect; // Variable rect to hold the bounds of the view public boolean onTouch(View v, MotionEvent event) { if(event.getAction() == MotionEvent.ACTION_DOWN){ // Construct a rect of the view's bounds rect = new Rect(v.getLeft(), v.getTop(), v.getRight(), v.getBottom()); } if(event.getAction() == MotionEvent.ACTION_MOVE){ if(!rect.contains(v.getLeft() + (int) event.getX(), v.getTop() + (int) event.getY())){ // User moved

How to detect a swipe-to-delete gesture in a customized UITableviewCell?

邮差的信 提交于 2019-11-27 11:20:36
问题 I have customized a UITableViewCell and I want to implement "swipe to delete". But I don't want the default delete button. Instead, I want to do something different. What would be the easiest way to implement this? Are there some methods which get called when the user swipes to delete a cell? Can I prevent then the default delete button from appearing? Right now I think I must implement my own logic to avoid the default delete button and shrink animations which happen in swipe to delete in