@Override
    public View onCreateFloatView(int position) {
      View view =
          dragSortListView.getChildAt(
              position
                  + dragSortListView.getHeaderViewsCount()
                  - dragSortListView.getFirstVisiblePosition());
      if (view == null) {
        return null;
      }
      View userRowLayout = view.findViewById(R.id.user_row_layout);
      if (userRowLayout != null) {
        userRowLayout.setPressed(false);
        userRowLayout.setSelected(false);
        userRowLayout.setActivated(false);
      }

      // Take a picture of the selected item and add it to the holder with shadow we have prepared.
      view.setDrawingCacheEnabled(true);
      floatBitmap = Bitmap.createBitmap(view.getDrawingCache());
      view.setDrawingCacheEnabled(false);

      if (floatView == null) {
        LayoutInflater inflater = activity.getLayoutInflater();
        floatView = inflater.inflate(R.layout.user_row_dragged, null);
      }
      ImageView imageView = floatView.findViewById(R.id.user_row_dragged_image);
      imageView.setImageBitmap(floatBitmap);
      imageView.setLayoutParams(new RelativeLayout.LayoutParams(view.getWidth(), view.getHeight()));

      return floatView;
    }
Event when user start dragging the item.
java/com/google/android/apps/authenticator/AuthenticatorActivity.java