pull/619/head
Niels Andriesse 4 years ago
parent c69d66e6a4
commit c79b9e3397

@ -99,7 +99,6 @@ class ConversationActivityV2 : PassphraseRequiredActionBarActivity() {
override fun onPrepareOptionsMenu(menu: Menu): Boolean { override fun onPrepareOptionsMenu(menu: Menu): Boolean {
ConversationMenuHelper.onPrepareOptionsMenu(menu, menuInflater, thread, this) { onOptionsItemSelected(it) } ConversationMenuHelper.onPrepareOptionsMenu(menu, menuInflater, thread, this) { onOptionsItemSelected(it) }
// FIXME: Make the menu respect the current app theme
super.onPrepareOptionsMenu(menu) super.onPrepareOptionsMenu(menu)
return true return true
} }

@ -21,12 +21,10 @@ class ConversationRecyclerView : RecyclerView {
} }
override fun onInterceptTouchEvent(e: MotionEvent): Boolean { override fun onInterceptTouchEvent(e: MotionEvent): Boolean {
Log.d("Test", "here")
val velocityTracker = velocityTracker ?: return super.onInterceptTouchEvent(e) val velocityTracker = velocityTracker ?: return super.onInterceptTouchEvent(e)
velocityTracker.computeCurrentVelocity(1000) // Specifying 1000 gives pixels per second velocityTracker.computeCurrentVelocity(1000) // Specifying 1000 gives pixels per second
val vx = velocityTracker.xVelocity val vx = velocityTracker.xVelocity
val vy = velocityTracker.yVelocity val vy = velocityTracker.yVelocity
Log.d("Test", "vx: $vx, vy: $vy")
// Only allow swipes to the left; allowing swipes to the right interferes with some back gestures // Only allow swipes to the left; allowing swipes to the right interferes with some back gestures
if (vx > 0) { return super.onInterceptTouchEvent(e) } if (vx > 0) { return super.onInterceptTouchEvent(e) }
// Return false if abs(v.x) > abs(v.y) so that only swipes that are more horizontal than vertical // Return false if abs(v.x) > abs(v.y) so that only swipes that are more horizontal than vertical

Loading…
Cancel
Save