Skip to content

Commit

Permalink
temporaly remove touch tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliskov committed Dec 7, 2024
1 parent 16bfe9e commit a1f332a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,28 +263,28 @@ public void onClick(View v) {
}
});

// MOD: Open a video from a single tap
viewHolder.mHolder.view.setOnTouchListener(new OnTouchListener() {
private long downTimeMs;

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View v, MotionEvent event) {
// Handle UP instead of DOWN to give enough time to move a focus to the touched item
// Skip long touch (only open context menu)
if (event.getAction() == MotionEvent.ACTION_UP && System.currentTimeMillis() - downTimeMs < 500) {
ItemBridgeAdapter.ViewHolder ibh = (ItemBridgeAdapter.ViewHolder)
mRowViewHolder.mGridView.getChildViewHolder(viewHolder.itemView);
if (mRowViewHolder.getOnItemViewClickedListener() != null) {
mRowViewHolder.getOnItemViewClickedListener().onItemClicked(viewHolder.mHolder,
ibh.mItem, mRowViewHolder, (ListRow) mRowViewHolder.mRow);
}
} else if (event.getAction() == MotionEvent.ACTION_DOWN) {
downTimeMs = System.currentTimeMillis();
}
return false;
}
});
//// MOD: Open a video from a single tap
//viewHolder.mHolder.view.setOnTouchListener(new OnTouchListener() {
// private long downTimeMs;
//
// @SuppressLint("ClickableViewAccessibility")
// @Override
// public boolean onTouch(View v, MotionEvent event) {
// // Handle UP instead of DOWN to give enough time to move a focus to the touched item
// // Skip long touch (only open context menu)
// if (event.getAction() == MotionEvent.ACTION_UP && System.currentTimeMillis() - downTimeMs < 500) {
// ItemBridgeAdapter.ViewHolder ibh = (ItemBridgeAdapter.ViewHolder)
// mRowViewHolder.mGridView.getChildViewHolder(viewHolder.itemView);
// if (mRowViewHolder.getOnItemViewClickedListener() != null) {
// mRowViewHolder.getOnItemViewClickedListener().onItemClicked(viewHolder.mHolder,
// ibh.mItem, mRowViewHolder, (ListRow) mRowViewHolder.mRow);
// }
// } else if (event.getAction() == MotionEvent.ACTION_DOWN) {
// downTimeMs = System.currentTimeMillis();
// }
// return false;
// }
//});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,27 @@ public void onClick(View view) {
}
});

// MOD: Open a video from a single tap
itemView.setOnTouchListener(new OnTouchListener() {
private long downTimeMs;

@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouch(View v, MotionEvent event) {
// Handle UP instead of DOWN to give enough time to move a focus to the touched item
// Skip long touch (only open context menu)
if (event.getAction() == MotionEvent.ACTION_UP && System.currentTimeMillis() - downTimeMs < 500) {
if (getOnItemViewClickedListener() != null) {
// Row is always null
getOnItemViewClickedListener().onItemClicked(
itemViewHolder.mHolder, itemViewHolder.mItem, null, null);
}
} else if (event.getAction() == MotionEvent.ACTION_DOWN) {
downTimeMs = System.currentTimeMillis();
}
return false;
}
});
//// MOD: Open a video from a single tap
//itemView.setOnTouchListener(new OnTouchListener() {
// private long downTimeMs;
//
// @SuppressLint("ClickableViewAccessibility")
// @Override
// public boolean onTouch(View v, MotionEvent event) {
// // Handle UP instead of DOWN to give enough time to move a focus to the touched item
// // Skip long touch (only open context menu)
// if (event.getAction() == MotionEvent.ACTION_UP && System.currentTimeMillis() - downTimeMs < 500) {
// if (getOnItemViewClickedListener() != null) {
// // Row is always null
// getOnItemViewClickedListener().onItemClicked(
// itemViewHolder.mHolder, itemViewHolder.mItem, null, null);
// }
// } else if (event.getAction() == MotionEvent.ACTION_DOWN) {
// downTimeMs = System.currentTimeMillis();
// }
// return false;
// }
//});
}
}

Expand Down

0 comments on commit a1f332a

Please sign in to comment.