From 4769c8c09f0d9efdaf4c6bab464a7fff687074a1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 28 Nov 2011 13:01:04 +0300 Subject: [PATCH] implement swiping between articles (in small screen mode) --- res/layout/article_fragment.xml | 6 +-- src/org/fox/ttrss/ArticleFragment.java | 63 +++++++++++++++++++++++++- 2 files changed, 64 insertions(+), 5 deletions(-) diff --git a/res/layout/article_fragment.xml b/res/layout/article_fragment.xml index 2a45daf3..679d73df 100644 --- a/res/layout/article_fragment.xml +++ b/res/layout/article_fragment.xml @@ -14,15 +14,15 @@ android:paddingLeft="4dip" > - + + android:orientation="vertical" > =SWIPE_THRESHOLD_VELOCITY && + Math.abs(dX)>=SWIPE_MIN_DISTANCE ) { + if (dX>0) { + //Log.d(TAG, "Right swipe"); + + if (m_prevArticle != null) + m_articleOps.openArticle(m_prevArticle, R.anim.slide_right); + + } else { + //Log.d(TAG, "Left swipe"); + + if (m_nextArticle != null) + m_articleOps.openArticle(m_nextArticle, 0); + + } + return true; + /* } else if (Math.abs(dX)=SWIPE_THRESHOLD_VELOCITY && + Math.abs(dY)>=SWIPE_MIN_DISTANCE ) { + if (dY>0) { + Log.d(TAG, "Up swipe"); + } else { + Log.d(TAG, "Down swipe"); + } + return true; */ + } + return false; + } + }; }