Commit 83435cd4 authored by Hussein's avatar Hussein

P4A-928 Add click threshold to item click to about double click.

parent f36757a5
......@@ -141,6 +141,7 @@ import static com.fsck.k9.fragment.MLFProjectionInfo.UID_COLUMN;
public class MessageListFragment extends PEpFragment implements ConfirmationDialogFragmentListener, LoaderCallbacks<Cursor> {
private static final long CLICK_THRESHOLD_MILLIS = 1000;
private FloatingActionButton fab;
private ProgressBar loadingView;
private Rating worstThreadRating;
......@@ -903,6 +904,7 @@ public class MessageListFragment extends PEpFragment implements ConfirmationDial
// }
private boolean isLongClicked;
private long lastClicked = 0;
private void initializeLayout() {
listView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
......@@ -927,8 +929,9 @@ public class MessageListFragment extends PEpFragment implements ConfirmationDial
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (!isLongClicked) {
if (!isLongClicked && (System.currentTimeMillis()-lastClicked) > CLICK_THRESHOLD_MILLIS) {
onMessageClick(parent, view, position, id);
lastClicked = System.currentTimeMillis();
}
isLongClicked = false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment