0

I'm currently creating an app for SmartGlasses. It has an SDK that has some basic swipe Gesture and a custom Gesture Detector. I want to integrate this with my current code.

picture.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (touches < 4) {
                    v.setBackgroundResource(picList.get(touches));
                    touches++;

                } else {
                    touches = 0;
                    loop = 1;
                    v.setBackgroundResource(picList.get(touches));
                }
            }
        });

I'm using this to go in a loop of images.

The SDK, one of its functions, is SlideRight(). And also a onTouchEvent().

@Override
    public boolean onTouchEvent(MotionEvent event) {
        if (mGestureDetector.onTouchEvent(event)) {
            return true;
        }else {
            return false;
        }
    }
---------

 @Override
    public boolean onSlideRight(boolean b) {
        return false;
    }

How can I call this function and get it to do at least a Log.d when swiping right?

Hevar
  • 1
  • 1
  • Calling delegated functions directly is not a good idea because it has its own logic when should be called. If you want to extend the functionality of those functions you could try to create a Kotlin extension. -> https://kotlinlang.org/docs/reference/extensions.html – Haris Sep 11 '20 at 06:56
  • An exception could be if this library provides functions for interactions for those delegated actions. – Haris Sep 11 '20 at 07:02
  • It's a pretty old SDK. so it only shows the functions but not how to use it. – Hevar Sep 11 '20 at 07:05

0 Answers0