Scroll repeat

This commit is contained in:
M66B 2020-07-08 21:40:44 +02:00
parent 0c0b154793
commit 7f31bd5a7b
1 changed files with 4 additions and 2 deletions

View File

@ -210,6 +210,7 @@ import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
import static android.text.format.DateUtils.DAY_IN_MILLIS; import static android.text.format.DateUtils.DAY_IN_MILLIS;
import static android.text.format.DateUtils.FORMAT_SHOW_DATE; import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
import static android.text.format.DateUtils.FORMAT_SHOW_WEEKDAY; import static android.text.format.DateUtils.FORMAT_SHOW_WEEKDAY;
import static android.view.KeyEvent.ACTION_DOWN;
import static android.view.KeyEvent.ACTION_UP; import static android.view.KeyEvent.ACTION_UP;
import static androidx.recyclerview.widget.RecyclerView.NO_POSITION; import static androidx.recyclerview.widget.RecyclerView.NO_POSITION;
import static org.openintents.openpgp.OpenPgpSignatureResult.RESULT_KEY_MISSING; import static org.openintents.openpgp.OpenPgpSignatureResult.RESULT_KEY_MISSING;
@ -4860,6 +4861,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
return false; return false;
boolean up = (event.getAction() == ACTION_UP); boolean up = (event.getAction() == ACTION_UP);
boolean down = (event.getAction() == ACTION_DOWN);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean volumenav = prefs.getBoolean("volumenav", false); boolean volumenav = prefs.getBoolean("volumenav", false);
@ -4894,12 +4896,12 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
case KeyEvent.KEYCODE_PAGE_UP: case KeyEvent.KEYCODE_PAGE_UP:
case KeyEvent.KEYCODE_DPAD_UP: case KeyEvent.KEYCODE_DPAD_UP:
if (viewType == AdapterMessage.ViewType.THREAD) if (viewType == AdapterMessage.ViewType.THREAD)
return (up && onScroll(context, true)); return (down && onScroll(context, true));
break; break;
case KeyEvent.KEYCODE_PAGE_DOWN: case KeyEvent.KEYCODE_PAGE_DOWN:
case KeyEvent.KEYCODE_DPAD_DOWN: case KeyEvent.KEYCODE_DPAD_DOWN:
if (viewType == AdapterMessage.ViewType.THREAD) if (viewType == AdapterMessage.ViewType.THREAD)
return (up && onScroll(context, false)); return (down && onScroll(context, false));
break; break;
} }