Browse files

Change in client to display the new news on top

  • Loading branch information...
1 parent 0da9f0d commit 44c679aff5c9aa19312b89211276d686c8b9d5f8 @crimsonred crimsonred committed Mar 8, 2013
View
4 demos/newsfeed/Admin/Mac/PubnubNewsFeedAdmin/PubnubNewsFeedAdmin.userprefs
@@ -1,10 +1,10 @@
-<Properties>
+<Properties MonoDevelop.MonoMac.LastXamMacNagTime="03/08/2013 04:42:50">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|x86" />
<MonoDevelop.Ide.Workbench ActiveDocument="PubnubNewsFeedAdmin/PubNubMessagingClass.cs">
<Files>
<File FileName="PubnubNewsFeedAdmin/MainWindowController.cs" Line="110" Column="1" />
<File FileName="PubnubNewsFeedAdmin/RssReader.cs" Line="69" Column="3" />
- <File FileName="PubnubNewsFeedAdmin/PubNubMessagingClass.cs" Line="113" Column="1" />
+ <File FileName="PubnubNewsFeedAdmin/PubNubMessagingClass.cs" Line="29" Column="40" />
<File FileName="../MonoTouch/Pubnub-Messaging/Pubnub-Messaging.Tests/WhenAClientIsPresented.cs" Line="94" Column="1" />
<File FileName="PubnubNewsFeedAdmin/Pubnub.cs" Line="1784" Column="1" />
</Files>
View
2 demos/newsfeed/Admin/Mac/PubnubNewsFeedAdmin/PubnubNewsFeedAdmin/MainWindowController.cs
@@ -54,7 +54,7 @@ void Initialize ()
channelList.Add(channel0);
Channel channel1 = new Channel("Sports", "https://news.google.com/news/feeds?pz=1&cf=all&ned=us&hl=en&topic=s&output=rss", true);
channelList.Add(channel1);
- Channel channel2 = new Channel("Super Bowl", "https://news.google.com/news/feeds?pz=1&cf=all&ned=us&hl=en&q=Super+Bowl+Halftime+Show+2012&output=rss", true);
+ Channel channel2 = new Channel("Technology", "https://news.google.com/news/feeds?pz=1&cf=all&ned=us&hl=en&topic=tc&output=rss", true);
channelList.Add(channel2);
View
1 demos/newsfeed/Admin/Mac/PubnubNewsFeedAdmin/PubnubNewsFeedAdmin/PubNubMessagingClass.cs
@@ -72,7 +72,6 @@ public void Presence ()
void HereNowHandler (object result)
{
- string response = "";
IList<object> responseFields = result as IList<object>;
if ((responseFields [0] != null) && (responseFields [0].ToString() != "0"))
{
View
2 demos/newsfeed/Client/MonoTouch/PubnubNewsFeedClient/PubnubNewsFeedClient.userprefs
@@ -3,7 +3,7 @@
<MonoDevelop.Ide.Workbench ActiveDocument="PubnubNewsFeedClient/NewsFeedMain.cs">
<Files>
<File FileName="PubnubNewsFeedClient/AppDelegate.cs" Line="42" Column="6" />
- <File FileName="PubnubNewsFeedClient/NewsFeedMain.cs" Line="29" Column="63" />
+ <File FileName="PubnubNewsFeedClient/NewsFeedMain.cs" Line="79" Column="32" />
<File FileName="PubnubNewsFeedClient/Rss.cs" Line="26" Column="1" />
<File FileName="PubnubNewsFeedClient/Pubnub.cs" Line="1388" Column="1" />
<File FileName="PubnubNewsFeedClient/NewsElement.cs" Line="158" Column="1" />
View
17 demos/newsfeed/Client/MonoTouch/PubnubNewsFeedClient/PubnubNewsFeedClient/NewsFeedMain.cs
@@ -151,10 +151,23 @@ public void Display (Rss.RssNews news)
//this.Animating = false;
if(secOutput.Count > 30)
{
- secOutput.RemoveRange(0, secOutput.Count - 30);
+ secOutput.RemoveRange(30, secOutput.Count-1);
}
+
if (secOutput.Count > 0) {
- secOutput.Insert (secOutput.Count, newsElement); }
+ //secOutput.Insert (secOutput.Count, newsElement);
+
+ int count=0;
+ foreach(NewsElement element in secOutput)
+ {
+ if(element.Date <= newsElement.Date)
+ {
+ break;
+ }
+ count++;
+ }
+ secOutput.Insert (count, newsElement);
+ }
else
{
secOutput.Add (newsElement);

0 comments on commit 44c679a

Please sign in to comment.