Dynamic swipe/select timeout

This commit is contained in:
M66B 2023-08-02 16:54:22 +02:00
parent 085bd37cad
commit 2fd935c4ff
2 changed files with 7 additions and 2 deletions

View File

@ -102,6 +102,7 @@ import android.view.ScrollCaptureCallback;
import android.view.ScrollCaptureSession; import android.view.ScrollCaptureSession;
import android.view.SubMenu; import android.view.SubMenu;
import android.view.View; import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.AnimationUtils; import android.view.animation.AnimationUtils;
@ -402,7 +403,6 @@ public class FragmentMessages extends FragmentBase
private static final int MAX_MORE = 100; // messages private static final int MAX_MORE = 100; // messages
private static final int MAX_SEND_RAW = 50; // messages private static final int MAX_SEND_RAW = 50; // messages
private static final int SWIPE_DISABLE_SELECT_DURATION = 500; // milliseconds
private static final float LUMINANCE_THRESHOLD = 0.7f; private static final float LUMINANCE_THRESHOLD = 0.7f;
private static final int ITEM_CACHE_SIZE = 10; // Default: 2 items private static final int ITEM_CACHE_SIZE = 10; // Default: 2 items
@ -2918,7 +2918,7 @@ public class FragmentMessages extends FragmentBase
if (isCurrentlyActive) if (isCurrentlyActive)
selectionPredicate.setEnabled(false); selectionPredicate.setEnabled(false);
else else
getMainHandler().postDelayed(enableSelection, SWIPE_DISABLE_SELECT_DURATION); getMainHandler().postDelayed(enableSelection, ViewConfiguration.getLongPressTimeout() + 100);
} }
Context context = getContext(); Context context = getContext();

View File

@ -85,6 +85,7 @@ import android.view.Display;
import android.view.InflateException; import android.view.InflateException;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewConfiguration;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -3085,6 +3086,10 @@ public class Log {
long size = 0; long size = 0;
File file = attachment.getFile(context); File file = attachment.getFile(context);
try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file))) { try (OutputStream os = new BufferedOutputStream(new FileOutputStream(file))) {
size += write(os, String.format("Photo picker=%b\r\n", Helper.hasPhotoPicker()));
size += write(os, String.format("Double tap timeout=%d\r\n", ViewConfiguration.getDoubleTapTimeout()));
size += write(os, String.format("Long press timeout=%d\r\n", ViewConfiguration.getLongPressTimeout()));
for (Class<?> cls : new Class[]{ for (Class<?> cls : new Class[]{
ActivitySendSelf.class, ActivitySendSelf.class,
ActivitySearch.class, ActivitySearch.class,