Exemple #1
0
        private async Task RequestStories(bool isLoadingMore)
        {
            TimeLine timeLine = null;

            if (isLoadingMore)
            {
                if (StoryDataList.Count > 0)
                {
                    timeLine = await DataRequester.RequestNextTimeLine(StoryDataList.Last().Time.ToString());
                }
            }
            else
            {
                ResetStories();
                timeLine = await DataRequester.RequestLatestTimeLine();

                if (timeLine != null && timeLine.Items != null && timeLine.Items.Count > 0)
                {
                    CurrentStoryId = timeLine.Items.First().Id.ToString();
                }
            }

            if (timeLine == null || timeLine.Items == null)
            {
                return;
            }
            timeLine.Adjust();
            StoryDataList.AddRange(timeLine.Items);
        }
Exemple #2
0
        public async Task RefreshStories(bool isLoadingMore)
        {
            HotCircleStories hotCircleStories = null;

            if (isLoadingMore)
            {
                if (StoryDataList.Count > 0)
                {
                    hotCircleStories = await DataRequester.RequestNextStoriesForCircle(CircleId, StoryDataList.Last().Time.ToString());
                }
            }
            else
            {
                ResetStorys();
                hotCircleStories = await DataRequester.RequestLatestStoriesForCircle(CircleId);

                if (hotCircleStories != null && hotCircleStories.Stories != null && hotCircleStories.Stories.Count > 0)
                {
                    CurrentStoryId = hotCircleStories.Stories.First().Id.ToString();
                }
            }

            if (hotCircleStories == null || hotCircleStories.Stories == null || hotCircleStories.Stories.Count == 0)
            {
                return;
            }

            hotCircleStories.Stories.ForEach(story => story.AdjustForHotCircleStory(Circle));
            StoryDataList.AddRange(hotCircleStories.Stories);
        }