mirror of
https://github.com/KokaKiwi/BarInsta
synced 2025-07-13 06:42:01 +00:00
Changes: 1. Separate out view holders for feed post types. 2. Improve performance for binding. 4. Initiating migration from Glide to Fresco, as performance of Fresco is way better. 3. Prefetch feed view thumbnails to get aspect ratio, to improve layout performance. 4. If auto play is off, the videos in feed are not loaded until play is pressed. 5. Lots of optimizations here and there.
73 lines
1.9 KiB
Java
73 lines
1.9 KiB
Java
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
package awais.instagrabber.customviews.drawee;
|
|
|
|
import android.view.GestureDetector;
|
|
import android.view.MotionEvent;
|
|
|
|
/**
|
|
* Wrapper for SimpleOnGestureListener as GestureDetector does not allow changing its listener.
|
|
*/
|
|
public class GestureListenerWrapper extends GestureDetector.SimpleOnGestureListener {
|
|
|
|
private GestureDetector.SimpleOnGestureListener mDelegate;
|
|
|
|
public GestureListenerWrapper() {
|
|
mDelegate = new GestureDetector.SimpleOnGestureListener();
|
|
}
|
|
|
|
public void setListener(GestureDetector.SimpleOnGestureListener listener) {
|
|
mDelegate = listener;
|
|
}
|
|
|
|
@Override
|
|
public void onLongPress(MotionEvent e) {
|
|
mDelegate.onLongPress(e);
|
|
}
|
|
|
|
@Override
|
|
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
|
|
return mDelegate.onScroll(e1, e2, distanceX, distanceY);
|
|
}
|
|
|
|
@Override
|
|
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
|
|
return mDelegate.onFling(e1, e2, velocityX, velocityY);
|
|
}
|
|
|
|
@Override
|
|
public void onShowPress(MotionEvent e) {
|
|
mDelegate.onShowPress(e);
|
|
}
|
|
|
|
@Override
|
|
public boolean onDown(MotionEvent e) {
|
|
return mDelegate.onDown(e);
|
|
}
|
|
|
|
@Override
|
|
public boolean onDoubleTap(MotionEvent e) {
|
|
return mDelegate.onDoubleTap(e);
|
|
}
|
|
|
|
@Override
|
|
public boolean onDoubleTapEvent(MotionEvent e) {
|
|
return mDelegate.onDoubleTapEvent(e);
|
|
}
|
|
|
|
@Override
|
|
public boolean onSingleTapConfirmed(MotionEvent e) {
|
|
return mDelegate.onSingleTapConfirmed(e);
|
|
}
|
|
|
|
@Override
|
|
public boolean onSingleTapUp(MotionEvent e) {
|
|
return mDelegate.onSingleTapUp(e);
|
|
}
|
|
}
|