コード例 #1
0
  private void fireClickEvent(VirtualFile file, int startPosition, int endPosition) {
    ClickEvent e = new ClickEvent(file, startPosition, endPosition);

    for (ClickListener listener : myClickListeners) {
      listener.referenceClicked(e);
    }
  }
コード例 #2
0
ファイル: LPad.java プロジェクト: Del-Gin/LGame
 protected void processTouchPressed() {
   final float x =
       MathUtils.bringToBounds(0, baseWidth, Touch.getX() - getScreenX()) / baseWidth - 0.5f;
   final float y =
       MathUtils.bringToBounds(0, baseHeight, Touch.getY() - getScreenY()) / baseHeight - 0.5f;
   if (x == 0 && y == 0) {
     return;
   }
   if (MathUtils.abs(x) > MathUtils.abs(y)) {
     if (x > 0) {
       this.isRight = true;
       this.isClick = true;
       this.centerX = offsetX + x + (baseWidth - dotWidth) / 2 + dotWidth * 0.75f;
       this.centerY = offsetY + y + (baseHeight - dotHeight) / 2;
       if (listener != null) {
         listener.right();
       }
     } else if (x < 0) {
       this.isLeft = true;
       this.isClick = true;
       this.centerX = offsetX + x + (baseWidth - dotWidth) / 2 - dotWidth * 0.75f;
       this.centerY = offsetY + y + (baseHeight - dotHeight) / 2;
       if (listener != null) {
         listener.left();
       }
     } else if (x == 0) {
       freeClick();
     }
   } else {
     if (y > 0) {
       this.isDown = true;
       this.isClick = true;
       this.centerX = offsetX + x + (baseWidth - dotWidth) / 2 - 1;
       this.centerY = offsetY + y + (baseHeight - dotHeight) / 2 + dotHeight * 0.75f;
       if (listener != null) {
         listener.down();
       }
     } else if (y < 0) {
       this.isUp = true;
       this.isClick = true;
       this.centerX = offsetX + x + (baseWidth - dotWidth) / 2 - 1;
       this.centerY = offsetY + y + (baseHeight - dotHeight) / 2 - dotHeight * 0.75f;
       if (listener != null) {
         listener.up();
       }
     } else if (y == 0) {
       freeClick();
     }
   }
 }
コード例 #3
0
ファイル: PassesAdapter.java プロジェクト: elloza/ISS
    @Override
    public boolean onLongClick(View v) {

      // If long clicked, passed last variable as true.
      clickListener.onClick(v, getAdapterPosition(), true);
      return true;
    }
コード例 #4
0
ファイル: FragmentDrawer.java プロジェクト: phamnoone/owsdic
 @Override
 public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent e) {
   View child = rv.findChildViewUnder(e.getX(), e.getY());
   if (child != null && clickListener != null && gestureDetector.onTouchEvent(e)) {
     clickListener.onClick(child, rv.getChildPosition(child));
   }
   return false;
 }
コード例 #5
0
 @Override
 public boolean onInterceptTouchEvent(RecyclerView rv, MotionEvent event) {
   View child = rv.findChildViewUnder(event.getX(), event.getY());
   if (null != child && null != clickListener && gestureDetector.onTouchEvent(event)) {
     child.onTouchEvent(event);
     clickListener.onClick(child, rv.getChildPosition(child));
   }
   return false;
 }
コード例 #6
0
 @Override
 public boolean onInterceptTouchEvent(android.support.v7.widget.RecyclerView rv, MotionEvent e) {
   View child = rv.findChildViewUnder(e.getX(), e.getY());
   RecyclerView.ViewHolder finalChild =
       rv.findViewHolderForAdapterPosition(rv.getChildAdapterPosition(child));
   if (child != null && clickListener != null && gestureDetector.onTouchEvent(e) == true) {
     clickListener.onClick(finalChild, rv.getChildPosition(child));
   }
   return false;
 }
コード例 #7
0
ファイル: LPad.java プロジェクト: Del-Gin/LGame
 void freeClick() {
   this.isLeft = false;
   this.isRight = false;
   this.isDown = false;
   this.isUp = false;
   this.isClick = false;
   if (listener != null) {
     listener.other();
   }
 }
コード例 #8
0
 @Override
 public void onClick(View v) {
   if (clickListener != null) {
     clickListener.onItemClick(getAdapterPosition(), v);
   }
 }
コード例 #9
0
 @Override
 public void onClick(View v) {
   clickListener.onClick(v, getAdapterPosition());
 }
コード例 #10
0
 {
     mClickListener.onClick();
 }
コード例 #11
0
ファイル: PassesAdapter.java プロジェクト: elloza/ISS
    @Override
    public void onClick(View v) {

      // If not long clicked, pass last variable as false.
      clickListener.onClick(v, getAdapterPosition(), false);
    }
コード例 #12
0
ファイル: CommentViewHolder.java プロジェクト: phuston/kuky
 @Override
 public void onClick(View v) {
   vClickListener.onClick(v, getPosition());
 }