android-gesture

Android Swipe to change fragments not working

烂漫一生 提交于 2019-12-20 03:59:08
问题 I am trying to make an app where a user can swipe and change which fragment they are seeing on the screen. I can not use view pager because I want the user to be able to swipe to different fragments forever. Here is the detector in my fragment: class MyGestureDetector extends SimpleOnGestureListener { @Override public boolean onDown(MotionEvent e) { return true; } @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { if(e1.getX() - e2.getX() >

Android O - fingerprint gesture callback not working

纵饮孤独 提交于 2019-12-19 05:46:23
问题 I am testing on Pixel device with Fingerprint Gestures ON from accessibility. I am trying to get the gesture callbacks using FingerprintGestureController but never getting any gestures in return even after I turn the accessibility ON for this app from Settings->Accessibility. isGestureDetectionAvailable() is always returning false to me. Can someone please help. Here is the code: my_gesture_service.xml <accessibility-service xmlns:android="http://schemas.android.com/apk/res/android" android

Could not get Touch event for TYPE_SYSTEM_OVERLAY

本小妞迷上赌 提交于 2019-12-18 15:18:43
问题 I like to develop an app that is similar to Swapps .i am trying to display a button on top of any screen and that should occur only on a swiping action.I tried with the below code WindowManager.LayoutParams params = new WindowManager.LayoutParams(); params.type =WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY; params.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN; params.format =PixelFormat.TRANSLUCENT; params.height = WindowManager.LayoutParams.WRAP_CONTENT; params.width =

rotation and scaling using multi touch in android

雨燕双飞 提交于 2019-12-18 10:52:27
问题 i want to rotate and scale the image on multi touch event, i am able to drag, scale the image but i can't understand the rotation of image. i am facing problem so please help me asap. my code is there public class Touch extends Activity implements OnTouchListener { private static final String TAG = "Touch"; // These matrices will be used to move and zoom image Matrix matrix = new Matrix(); Matrix matrix1 = new Matrix(); Matrix savedMatrix = new Matrix(); Matrix savedMatrix2 = new Matrix(); //

Android libgdx swipe left and right detection using gesture listener

余生长醉 提交于 2019-12-18 04:21:56
问题 I have displayed a image at the center of the screen with libgdx. If i swipe left the image should move left and if i swipe right image should move right . Subsequent swipes to the left should move the image left. The same should happen for right. I used GestureListener . It works to some extent in the sense if i swipe left first image moves left. But after that if i try to swipe right the image still moves left. So how do i overcome this in libgdx?? class MyGestureListener implements

Can LongPress trigger after move events?

▼魔方 西西 提交于 2019-12-13 17:08:10
问题 I am working on a simple android app, my Requirement is, "After some move events(MotionEvent.ACTION_MOVE is true) on the screen, if the user stops moving for few seconds some where with out taking finger from the screen, then need to perform some action." *I learnt that LongPress is something which triggers when user doesn't make any move after the down event is triggered(MotionEvent.ACTION_DOWN).* So is there any way to trigger LongPress after Moving around in the screen? Or should I create

No implementation of GestureDetector will work on android app

梦想与她 提交于 2019-12-12 04:57:25
问题 I am trying to add a GestureDetector to an activity in my app. I have tried several different methods from youtube and stackoverflow none are working. No errors are showing and nothing happens when I swipe or use any gesture. I have put debugging logs all along the way and none are registering in the logcat Im all out of ideas now. It is the onFling() method I am mainly interested in. I am putting up two methods i have tried. I have removed some code and changed it to make more reader

Android run time exception while using gestureImageView and ViewGroup

柔情痞子 提交于 2019-12-11 20:48:36
问题 Hi i am new to Android application. I want to add zooming effect to my image. I took a sample tutorial from [https://github.com/jasonpolites/gesture-imageview][1] and copied sample code from there. But when I was tried to run the java code in eclipse, an exception is raised. Codes are attached here. ViewIndia.java public class ViewIndia extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_view

How to get the bitmap of complete scrolled area of view implemented with GestureListener with Scroller

余生长醉 提交于 2019-12-11 18:07:34
问题 What I have Tried: I'm drawing shapeDrawables in onDraw(Canvas canvas) in a custom view with using GestureListener in view for Scroller (not scrollview). code is available on Gist I'm trying to take the Bitmap image of that view which contains GestureListener with Scroller implementation public void save(String fname, View view) throws FileNotFoundException { try { String filename = Environment.getExternalStorageDirectory() .toString(); File f = new File(filename, "myImage.png"); f

How to properly set fixTransX & fixTransY of TouchImageView to implement doubleTap to ZoomOut?

痴心易碎 提交于 2019-12-10 17:38:01
问题 I am using TouchImageView from here. I am trying to implement ZoomOut for double tap. I have done it partially. But, I am facing some issues when zoomed out. If I zoom the Image & if I give a double tap, then image is not getting rendered properly. Here is my modified version TouchImageView.java package com.bharath.downloadissuedemo; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Matrix; import android.graphics.PointF; import android.graphics.drawable