android.view.View.startDrag()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(250)

本文整理了Java中android.view.View.startDrag()方法的一些代码示例,展示了View.startDrag()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.startDrag()方法的具体详情如下:
包路径:android.view.View
类名称:View
方法名:startDrag

View.startDrag介绍

暂无

代码示例

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onLongClick(View v) {
 ClipData clip=ClipData.newRawUri(title.getText(), videoUri);
 View.DragShadowBuilder shadow=new View.DragShadowBuilder(thumbnail);
 itemView.startDrag(clip, shadow, Boolean.TRUE, 0);
 return(true);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onLongClick(View v) {
 ClipData clip=ClipData.newRawUri(title.getText(), videoUri);
 View.DragShadowBuilder shadow=new View.DragShadowBuilder(thumbnail);
 itemView.startDrag(clip, shadow, null, 0);
 return(true);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onLongClick(View v) {
 ClipData clip=ClipData.newRawUri(title.getText(), videoUri);
 View.DragShadowBuilder shadow=new View.DragShadowBuilder(thumbnail);
 itemView.startDrag(clip, shadow, null, 0);
 return(true);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onLongClick(View v) {
 ClipData clip=ClipData.newRawUri(title.getText(), videoUri);
 View.DragShadowBuilder shadow=new View.DragShadowBuilder(thumbnail);
 itemView.startDrag(clip, shadow, null, 0);
 return(true);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onLongClick(View v) {
 ClipData clip=ClipData.newRawUri(title.getText(), videoUri);
 View.DragShadowBuilder shadow=new View.DragShadowBuilder(thumbnail);
 itemView.startDrag(clip, shadow, null, 0);
 return(true);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public boolean onLongClick(View v) {
 if (listener!=null) {
  listener.onStartDrag();
 }
 ClipData clip=ClipData.newRawUri(title.getText(), videoUri);
 View.DragShadowBuilder shadow=new View.DragShadowBuilder(thumbnail);
 itemView.startDrag(clip, shadow, Boolean.TRUE, 0);
 return(true);
}

代码示例来源:origin: Neamar/KISS

mainActivity.closeContextMenu();
View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
view.startDrag(null, shadowBuilder, view, 0);
view.setVisibility(View.INVISIBLE);
return true;

代码示例来源:origin: stackoverflow.com

ImageButton.setOnLongClickListener(new OnLongClickListener() {
     @Override
     public boolean onLongClick(View v) {
       View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(v);
       v.startDrag(null, shadowBuilder, v, 0);
       deleteAreaForAdapter.setVisibility(View.VISIBLE);
       deleteAreaForAdapter.startAnimation(slide_in);
       v.setVisibility(View.INVISIBLE);
       return true;
     }
   });

代码示例来源:origin: stackoverflow.com

public boolean onLongClick(View v)
 {
 dragged_view = v;       
 removeTransition(v);
 ClipData data = ClipData.newPlainText("path", ((TextView)v.findViewById(R.id.file_name)).getText());
 v.startDrag(data, new Shadow(v, c), v, 0);
 return true;
 }

代码示例来源:origin: stackoverflow.com

private final class MyTouchListener implements OnTouchListener {   public boolean onTouch(View view, MotionEvent motionEvent) {
 if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
  ClipData data = ClipData.newPlainText("", "");
  DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
  view.startDrag(data, shadowBuilder, view, 0);
  view.setVisibility(View.INVISIBLE);
  return true;
 } else {
 return false;
 }   } }

代码示例来源:origin: stackoverflow.com

@Override
public boolean onTouch(View v, MotionEvent event) {
  if (event.getAction() == MotionEvent.ACTION_MOVE) {
    Toast.makeText(getActivity(), "onClick", Toast.LENGTH_LONG).show();
    ClipData dragData = ClipData.newPlainText(
        AbstractFragment.BUTTON_ID_TAG, "" + v.getId());
    DragShadowBuilder shadow = new CanvasDragShadow(v);
    v.startDrag(dragData, shadow, null, 0);
    return true;
  }
  return false;
}

代码示例来源:origin: stackoverflow.com

private final class MyTouchListener implements OnTouchListener {
 public boolean onTouch(View view, MotionEvent motionEvent) {
 if (motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
  ClipData data = ClipData.newPlainText("", "");
  DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
  view.startDrag(data, shadowBuilder, view, 0);
  view.setVisibility(View.INVISIBLE);
  return true;
 } else {
  return false;
 }
 }
}

代码示例来源:origin: hencoder/PlusDemo

@Override
  public boolean onLongClick(View v) {
    draggedView = v;
    v.startDrag(null, new DragShadowBuilder(v), v, 0);
    return false;
  }
});

代码示例来源:origin: oliexdev/openScale

@Override
public void onLongPress(MotionEvent event) {
  int x = Math.round(event.getX());
  int y = Math.round(event.getY());
  boundView.startDrag(null, new dragShadowBuilder(boundView, x, y), this, 0);
}

代码示例来源:origin: nglauber/dominando_android2

public boolean onTouch(View view, MotionEvent me) {
  int action = me.getAction();
  if (action == MotionEvent.ACTION_DOWN) {
    ClipData data = ClipData.newPlainText("", "");
    View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view);
    view.startDrag(data, shadowBuilder, view, 0);
    view.setVisibility(View.INVISIBLE);
    return true;
  }
  return false;
}
@Override

代码示例来源:origin: Solartisan/DragDropListView

@Override
  public boolean onLongClick(View v) {
    // NOTE The drag shadow is handled in the ListView.
    v.startDrag(EMPTY_CLIP_DATA, new DragShadowBuilder(),
        DragDropListView.DRAG_FAVORITE_TILE, 0);
    return true;
  }
});

代码示例来源:origin: THEONE10211024/ApiDemos

public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("dot", "Dot : " + v.toString());
    v.startDrag(data, new ANRShadowBuilder(v, mAnrType == ANR_SHADOW),
        (Object)v, 0);
    return true;
  }
});

代码示例来源:origin: federicoiosue/checklistview

private void actionDown(View view) {
  View v = (View) view.getParent();
  v.startDrag(null, new ChecklistViewDragShadowBuilder(v), v, 0);
  if (App.getSettings().getDragVibrationEnabled()) {
    ((Vibrator) view.getContext().getSystemService(Context.VIBRATOR_SERVICE)).vibrate(App.getSettings()
        .getDragVibrationDuration());
  }
}

代码示例来源:origin: ianhanniballake/TripleSolitaire

@Override
  public boolean onTouch(final View v, final MotionEvent event) {
    if (event.getAction() != MotionEvent.ACTION_DOWN || gameState.isWasteEmpty())
      return false;
    final ClipData dragData = ClipData.newPlainText(gameState.getWasteCard(0), gameState.getWasteCard(0));
    return v.startDrag(dragData, new View.DragShadowBuilder(v), 0, 0);
  }
});

代码示例来源:origin: sytolk/TaxiAndroidOpen

@LongClick(R.id.fab)
void statusLongClick(View clickedView) {
  //Log.i(TAG,"LONG click");
  clickedView.startDrag(null, new View.DragShadowBuilder(clickedView), fab, 0);
  fab.setVisibility(View.INVISIBLE);
}

相关文章

View类方法