Workaround for long tap on selected item issue
authorteknolog
Sun, 28 Feb 2010 21:19:40 +0000
changeset 26 71493655568a
parent 25 ae65906c4347
child 27 f21a29fc4769
Workaround for long tap on selected item issue
application/inc/PodcastListView.h
application/sis/podcatcher_udeb.sis
application/sis/podcatcher_udeb_signed.sis
application/sis/podcatcher_urel.sis
application/sis/podcatcher_urel_signed.sis
application/src/PodcastFeedView.cpp
application/src/PodcastListView.cpp
--- a/application/inc/PodcastListView.h	Sun Feb 28 20:09:49 2010 +0000
+++ b/application/inc/PodcastListView.h	Sun Feb 28 21:19:40 2010 +0000
@@ -63,7 +63,9 @@
 		void ScrollToVisible();
     	void Draw(const TRect& aRect) const;
     	
-		CEikFormattedCellListBox * iListbox;		
+    	void SetLongTapDetected(TBool aLongTapDetected);
+
+    	CEikFormattedCellListBox * iListbox;		
 
 	protected:
 		TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
@@ -73,6 +75,8 @@
 		MKeyEventListener* iKeyEventListener;
 		MPointerListener* iPointerListener;
         CAknsBasicBackgroundControlContext* iBgContext;
+		 TBool iLongTapDetected;
+
 	};
 
 
Binary file application/sis/podcatcher_udeb.sis has changed
Binary file application/sis/podcatcher_udeb_signed.sis has changed
Binary file application/sis/podcatcher_urel.sis has changed
Binary file application/sis/podcatcher_urel_signed.sis has changed
--- a/application/src/PodcastFeedView.cpp	Sun Feb 28 20:09:49 2010 +0000
+++ b/application/src/PodcastFeedView.cpp	Sun Feb 28 21:19:40 2010 +0000
@@ -211,12 +211,19 @@
 
 	switch(aEventType)
 		{
-#ifndef SYMBIAN1_UI
+		case EEventPenDownOnItem:
+			DP("PEN DOWN");
+			break;
+			
+//#ifndef SYMBIAN1_UI
 	case EEventItemClicked:
-#endif
+		DP("SINGLE TAP");
+		break;
+//#endif
 	case EEventEnterKeyPressed:
 	case EEventItemDoubleClicked:
 	case EEventItemActioned:
+		DP("DOUBLE TAP");
 			{
 			const RFeedInfoArray* sortedItems = NULL;
 			TInt index = iListContainer->Listbox()->CurrentItemIndex();
@@ -561,6 +568,8 @@
 			CPodcastListView::HandleCommandL(aCommand);
 			break;
 		}
+	
+	iListContainer->SetLongTapDetected(EFalse); // in case we got here by long tapping
 	UpdateToolbar();
 	}
 
@@ -960,11 +969,13 @@
 void CPodcastFeedView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */)
 {
 	DP("CPodcastListView::HandleLongTapEventL BEGIN");
-	
+
 	if (iUpdatingAllRunning) {
 		return; // we don't allow feed manipulation while update is running
 	}
-	
+
+	iListContainer->SetLongTapDetected(ETrue);
+
 	const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1
 	TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems(
 			iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight;
--- a/application/src/PodcastListView.cpp	Sun Feb 28 20:09:49 2010 +0000
+++ b/application/src/PodcastListView.cpp	Sun Feb 28 21:19:40 2010 +0000
@@ -100,6 +100,11 @@
         }
     }
 
+void CPodcastListContainer::SetLongTapDetected(TBool aLongTapDetected)
+	{
+	iLongTapDetected = aLongTapDetected;
+	}
+
 void CPodcastListContainer::HandleResourceChange(TInt aType)
 {
 	switch( aType )
@@ -161,8 +166,11 @@
 	if (iPointerListener)
 		iPointerListener->PointerEventL(aPointerEvent);
 
-	// Call base class HandlePointerEventL()
-	CCoeControl::HandlePointerEventL(aPointerEvent);
+	// Call base class HandlePointerEventL() if not a long tap
+	if (!iLongTapDetected)
+		{
+		CCoeControl::HandlePointerEventL(aPointerEvent);
+		}
 	}
 
 
@@ -362,7 +370,7 @@
 void CPodcastListView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */)
 {
 	DP("CPodcastListView::HandleLongTapEventL BEGIN");
-	
+	iListContainer->SetLongTapDetected(ETrue);
 	const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1
 	TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems(
 			iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight;