long-press

Combining jQuery Mobile taphold and jQuery UI draggable

大憨熊 提交于 2019-12-21 12:37:41
问题 I'm working on a mobile application where I'm trying to combine jQuery UI's draggable functionality with jQuery Mobile's taphold event. The idea is that an element becomes draggable when a taphold is executed. Draggable is being initialized on elements in the following code: $('div.rect', '#outerBox').draggable({ containment: "parent", grid: [50, 50], disabled: true, stop: function(event, ui) { $(this).draggable('disable'); $(this).removeClass('highlighted'); } }); As you can see the

MultichoiceModeListener on RecyclerView android

一世执手 提交于 2019-12-19 10:28:13
问题 I have a recyclerview with respective adapter. I want to show multiple customview menu options in toolbar on the long press of recyclerview item. Any help is highly appreciated. Thanks in advance. 回答1: I'm doing the same work. This post is helpful: RecyclerView with choice modes Basically you have to add this code in your OnLongClick method @Override public boolean onLongClick(View view) { if (!mMultiSelector.isSelectable()) { ((AppCompatActivity) getActivity()).startSupportActionMode

disable the intent filter from android manifest programatically

徘徊边缘 提交于 2019-12-18 04:55:08
问题 In my activity i have a web view and in manifest.xml i have declared intent filter like this <activity android:name=".ui.socialNetwork.MySocialNetworkActivity" android:configChanges="orientation|screenSize" android:process=":fb" android:screenOrientation="portrait" > </activity> <activity-alias android:targetActivity=".ui.socialNetwork.MySocialNetworkActivity" android:name=".AliasMySocialNetworkActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent

Hiding of the Toast for long press on actionBar item

空扰寡人 提交于 2019-12-17 16:34:13
问题 Is some possible way how to hide the toast after long-press on the ActionBar item? I didn't setup a title for the item but it is still there - empty toast. <item android:id="@+id/ab_main_menu_dots" android:icon="@drawable/action_icons_dots" android:showAsAction="always"> <menu> <item android:id="@+id/ab_main_menu_my_profile" android:showAsAction="never" android:title="@string/ab_my_profile"> </item> <item android:id="@+id/ab_main_menu_settings" android:showAsAction="never" android:title="

Detect touch press vs long press vs movement?

蹲街弑〆低调 提交于 2019-12-17 02:46:06
问题 I'm currently fiddling around with Android programming, but I have a small problem detecting different touch events, namely a normal touch press (press on the screen and release right away), a long press (touch the screen and hold the finger on it) and movement (dragging on the screen). What I wanted to do is have an image (of a circle) on my screen which I can drag around. Then when I press it once (short/normal press) a Toast comes up with some basic information about it. When I long press

How to implement long press using manipulation events in windows phone 8?

≯℡__Kan透↙ 提交于 2019-12-13 05:15:08
问题 Since GestureListener is deprecated, we are now left with three events namely ManipulationStarted , ManipulationDelta , ManipulationCompleted . My custom listbox enables, swiping left and right on listbox items to do certain functions. How do I use the manipulation events to detect long press on a listboxitem? I want to implement the long press in such a way that the swipe left and right is not broken. Any clue/idea would be of great help! 回答1: Windows Phone 8 includes a Hold event. Can you

iOS: Two Gestures, One Target-Action

本秂侑毒 提交于 2019-12-13 05:09:20
问题 I'm implementing the Messages app copy-message feature. You can either double tap or long press on a message to copy it. How do I do that? I was thinking of adding two gesture recognizers to the view, one UITapGestureRecognizer (with numberOfTapsRequired set to 2 ) and one UILongPressGestureRecognizer . They would both have the same target & action. Then, I think for each of them, I'd call requireGestureRecognizerToFail: , passing the other gesture recognizer. Is my thinking correct? Is there

Change the long click functionality of the home button

戏子无情 提交于 2019-12-12 20:19:39
问题 I am looking for Android 'trick' to change the functionality of the long click on the home button. Currently, long click on the home button open the task manager. Instead, I want the long click to act as short click which means take us to the home page of the default launcher. Ideally, this trick will work for all Android versions, but if it will work for 2.3.x only or 4.x.x only then this is good enough. (I managed to disable the long click with Android 2.3.x but now i am looking to use the

How to get stepper and longpress to coexist?

妖精的绣舞 提交于 2019-12-12 04:18:03
问题 I tried setting up a view with a longpress gesture and a stepper configured for continuous updates. With the longpress, the continuous feature of the stepper does not occur. For now, I've disabled the longpress. I guess I don't need it. But for future reference, how would I allow for both to coexist? Just to be clear, here is the way the screen was set up when I tried this. App was set up with a simple view controller. A subview was added to this view (could have been a controller, but I just

Long press on a view using AndroidViewClient

和自甴很熟 提交于 2019-12-12 01:38:36
问题 How can I simulate long press on a view (for example a button) using AndroidViewClient? The touch method of ViewClient always performs a simple press on its input (even if I set type argument to adbClient.DOWN ) Edit: The touch method in adbclient.py has a type argument, but it is not used in method body. In MonkeyRunner , when the type is DOWN , it performs longpress. def touch(self, x, y, eventType=DOWN_AND_UP): self.shell('input tap %d %d' % (x, y)) 回答1: I find the answer for my question