ontouchlistener Questions

7

Solved

I am trying to catch double-tap events using OnTouchListener. I figure I would set a long for motionEvent.ACTION_DOWN, and a different long for a second motionEvent.ACTION_DOWN and measure the time...
Insular asked 6/9, 2011 at 3:16

2

Solved

I'm using a gesture detector to capture scroll events from a scroll view: val gestureDetector = GestureDetector(this.fragment.activity, ScrollGestureListener(scrollView)) scrollView.setOnTouchListe...
Afternoons asked 7/10, 2022 at 19:22

9

Solved

I have created a onTouchListener. Unfortunately onTouch() method throws me a warning: com/calculator/activitys/Calculator$1#onTouch should call View#performClick when a click is detected What do...
Salvadorsalvadore asked 25/7, 2014 at 9:23

6

Solved

I have to finish Activity when user offer a right swipe anywhere in the screen. I have tried with GestureDetector and that is works fine if there is neither ScrollView nor RescyclerView exists in t...
Smote asked 15/7, 2016 at 5:6

9

Solved

I want a to create a button that changes size (little bit smaller) when it's pressed, and after the button is released again the size should change back to normal size.I am using Scale xml to achie...

12

Solved

I'll admit straight off that I'm new to development and trying my hand at Android. I've been trying to search the 'net to find advice on how to implement some "Hold Button to Repeat Action&quo...
Penicillin asked 26/11, 2010 at 9:58

6

I need to do something when the user clicks the ImageButton I've tried to create a static class that implements both OnClickListener and OnTouchListener static class ClickListenerForScrolling impl...
Grunt asked 20/7, 2012 at 11:46

6

Solved

When I try to add onTouchListner() to a button, it gets me the Button has setOnTouchListener called on it but does not override performClick warning. Does anyone know how to fix it? btnle...
Thigpen asked 4/11, 2017 at 3:34

7

Solved

How to override performClick in Kotlin to avoid warning? next.setOnTouchListener(View.OnTouchListener { view, motionEvent -> when (motionEvent.action){ MotionEvent.ACTION_DOWN -> { val ic...
Pneumoencephalogram asked 8/11, 2017 at 1:23

0

I have a Recyclerview and that allow user to change scale by swipping up, I use the gestureDetector and onFling for this, this works fine, but then the user should able to click on an Item of recyc...

4

Solved

I am using TabView and in it, I am using Fragment to load each tab. I want to get the Touch event when the user touches any of the fragments. Fragment Code public MobileBankingFragment() { // Req...

4

I need to animate an icon of an arrow when opening and closing a spinner in Android. I can rotate the arrow when opening the spinner: I just put a setOnTouchListener on the Spinner. The problem co...

13

Solved

I am trying to handle touch events and click events on a button. I do the following: button.setOnClickListener(clickListener); button.setOnTouchListener(touchListener); When any one listener is ...
Handspike asked 1/3, 2011 at 19:32

9

Solved

I have a ScrollView that surrounds my entire layout so that the entire screen is scrollable. The first element I have in this ScrollView is a HorizontalScrollView block that has features that can b...

7

Solved

How do I detect the touch event if the user touches on view A and drags to bottom over the view B. I want to detect the touch event in View B. I added touch listener in view B but doesn't receive ...
Bellis asked 19/10, 2012 at 18:20

1

I have drawn an overlay using WindowManager. it's width and height are WindowManager.LayoutParams.MATCH_PARENT with transparent background. My view must be match parent and handle circle touch ...
Aegaeon asked 20/8, 2018 at 6:5

4

I am able to simulate tap events on typical android views (textbox, button, etc.) using MotionEvent.obtain, like this: int meta_state = 0; MotionEvent motionEvent = MotionEvent.obtain( SystemCl...
Galahad asked 2/1, 2014 at 16:8

2

Solved

I want to implement a movable imageView when it is drag. The dragging is working perfectly alright. But when i drag to the end , the imageView goes out of the screen. How can i make the movable of ...
Emblazonry asked 4/4, 2016 at 12:29

9

Solved

I am trying to see if there is a way to create a single method to implement a touch listener for multiple buttons, seeing as I have quite a few buttons that do almost exactly the same thing. The on...
Scattering asked 25/7, 2013 at 16:53

2

Solved

I'm building an interface where I need to process touch events. In particular I would to be able to enable them only to a confined area in a fragment. To better understand the problem, to respect t...
Vocalise asked 19/2, 2014 at 13:41

2

Solved

I know how to scale the button to a determinated value, but is there a way to increase/decrease the button size per time as long the user is touching it? Something like this: Button myButton = (Bu...
Marcasite asked 20/7, 2016 at 7:10

0

How to prevent swiping in androidx ViewPager2 when the touch event is coming from inside a nested view (e.g. a HorizontalScrollView, etc)? I expected this to be possible by overriding ViewPager2.on...

3

Solved

I've seen some solutions here, but none of them works for me. I am using View.OnTouchListener class to detect click and drag events in my app code. But that beautiful ripple effect is now gone (per...

4

Solved

I'm having a problem with my Button staying in a highlighted state, after doing the following: public class MainActivity extends AppCompatActivity { @SuppressLint("ClickableViewAccessibility") ...
Zootechnics asked 10/11, 2019 at 14:50

2

Solved

i have this code package com.tct.soundTouch; import android.app.Activity; import android.media.MediaPlayer; import android.os.Bundle; import android.view.MotionEvent; import android.view.View; i...
Soliloquy asked 9/3, 2011 at 23:0

© 2022 - 2024 — McMap. All rights reserved.