use of android.view.GestureDetector.SimpleOnGestureListener in project android_packages_apps_Dialer by MoKee.
the class AccessibleAnswerFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
ViewGroup group = (ViewGroup) inflater.inflate(R.layout.accessible_answer_fragment, container, false);
mTouchListener = new TouchListener();
mGestureDetector = new GestureDetector(getContext(), new SimpleOnGestureListener() {
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
return AccessibleAnswerFragment.this.onFling(e1, e2, velocityX, velocityX);
}
});
mAnswer = group.findViewById(R.id.accessible_answer_fragment_answer);
mAnswer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d(TAG, "Answer Button Clicked");
onAnswer(VideoProfile.STATE_AUDIO_ONLY, getContext());
}
});
mDecline = group.findViewById(R.id.accessible_answer_fragment_decline);
mDecline.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d(TAG, "Decline Button Clicked");
onDecline(getContext());
}
});
mText = group.findViewById(R.id.accessible_answer_fragment_text);
mText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d(TAG, "Text Button Clicked");
onText();
}
});
return group;
}
use of android.view.GestureDetector.SimpleOnGestureListener in project FoldableLayout by alexvasilkov.
the class FoldableListLayout method init.
private void init(Context context) {
gestureDetector = new GestureDetector(context, new SimpleOnGestureListener() {
@Override
public boolean onDown(MotionEvent event) {
return FoldableListLayout.this.onDown();
}
@Override
public boolean onScroll(MotionEvent e1, MotionEvent e2, float distX, float distY) {
return FoldableListLayout.this.onScroll(e1, e2);
}
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velX, float velY) {
return FoldableListLayout.this.onFling(velY);
}
});
gestureDetector.setIsLongpressEnabled(false);
animator = ObjectAnimator.ofFloat(this, "foldRotation", 0f);
minDistanceBeforeScroll = ViewConfiguration.get(context).getScaledTouchSlop();
flingAnimation = new FlingAnimation();
foldShading = new SimpleFoldShading();
setChildrenDrawingOrderEnabled(true);
}
Aggregations