Fix so feed icons are scaled nicely when rotating view RCL_3
authorSebastian Brannstrom <sebastianb@symbian.org>
Sat, 30 Oct 2010 14:06:37 +0100
branchRCL_3
changeset 311 606f4f6babf6
parent 310 2e0299e13cbf
child 312 2faae209e72b
Fix so feed icons are scaled nicely when rotating view
application/inc/PodcastFeedView.h
application/src/PodcastFeedView.cpp
engine/src/FeedInfo.cpp
--- a/application/inc/PodcastFeedView.h	Sat Oct 30 13:52:07 2010 +0100
+++ b/application/inc/PodcastFeedView.h	Sat Oct 30 14:06:37 2010 +0100
@@ -44,6 +44,7 @@
 		TBool ViewingShows();
 
  	   void CheckConfirmExit();
+ 	   void ShowItem(TUint aUid);
 
 	protected:
 	    void ConstructL();
--- a/application/src/PodcastFeedView.cpp	Sat Oct 30 13:52:07 2010 +0100
+++ b/application/src/PodcastFeedView.cpp	Sat Oct 30 14:06:37 2010 +0100
@@ -163,6 +163,7 @@
 	                                  TUid aCustomMessageId,
 	                                  const TDesC8& aCustomMessage)
 	{
+	DP("CPodcastFeedView::DoActivateL BEGIN");
 	CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage);
 	
 	if (aPrevViewId.iViewUid == KUidPodcastShowsViewID)
@@ -177,8 +178,9 @@
 	if (iFirstActivateAfterLaunch)
 		{
 		iFirstActivateAfterLaunch = EFalse;
-		iListContainer->Listbox()->ScrollToMakeItemVisible(0);
 		}
+
+	DP("CPodcastFeedView::DoActivateL END");
 	}
 
 void CPodcastFeedView::DoDeactivate()
@@ -365,7 +367,8 @@
 		CFbsBitmap* bmpCopy = new (ELeave) CFbsBitmap;
 		CleanupStack::PushL(bmpCopy);
 		bmpCopy->Duplicate(aFeedInfo.FeedIcon()->Handle());
-		icons->AppendL( CGulIcon::NewL(bmpCopy, NULL));
+		icons->AppendL( CGulIcon::NewL(AknIconUtils::CreateIconL(bmpCopy), NULL));
+		
 		iFeedIdForIconArray.Append(aFeedInfo.Uid());
 		CleanupStack::Pop(bmpCopy);			
 		iconIndex = icons->Count()-1;
@@ -567,6 +570,22 @@
 	CleanupStack::PopAndDestroy( array );		
 	}
 
+void CPodcastFeedView::ShowItem(TUint aUid)
+	{
+	TInt listIndex = -1;
+	for (TUint i=0;i<iItemIdArray.Count();i++)
+		{
+		if (iItemIdArray[i] == aUid)
+			{
+			listIndex = i;
+			}
+		}
+		
+	if (listIndex != -1)
+		iListContainer->Listbox()->ScrollToMakeItemVisible(listIndex);
+
+	}
+
 void CPodcastFeedView::HandleAddFeedUrlL()
 	{
 	TBuf<KFeedUrlLength> url;
@@ -599,10 +618,7 @@
 			iEikonEnv->ReadResourceL(message, R_ADD_FEED_SUCCESS);
 			if(ShowQueryMessageL(message))
 				{
-				CFeedInfo *info = iPodcastModel.FeedEngine().GetFeedInfoByUid(newFeedInfo->Uid());
-				
-				iPodcastModel.SetActiveFeedInfo(info);			
-				AppUi()->ActivateLocalViewL(KUidPodcastShowsViewID,  TUid::Uid(0), KNullDesC8());
+				ShowItem(newFeedInfo->Uid());
 				iPodcastModel.FeedEngine().UpdateFeedL(newFeedInfo->Uid());
 				}
 			}
--- a/engine/src/FeedInfo.cpp	Sat Oct 30 13:52:07 2010 +0100
+++ b/engine/src/FeedInfo.cpp	Sat Oct 30 14:06:37 2010 +0100
@@ -225,7 +225,7 @@
 		{
 		// If this fails, no reason to worry
 		iFeedIcon = new CFbsBitmap();
-		TRAP_IGNORE(aPodcastModel->ImageHandler().LoadFileAndScaleL(FeedIcon(), ImageFileName(), TSize(64,56), *this, Uid()));
+		TRAP_IGNORE(aPodcastModel->ImageHandler().LoadFileAndScaleL(FeedIcon(), ImageFileName(), TSize(128,128), *this, Uid()));
 		}	
 	DP("CFeedInfo::SetImageFileNameL END");
 	}