示例#1
0
 public void Refresh()
 {
     currentDataIndex = 0;
     adapter          = new ActivityItemAdapter(Activity);
     RetrieveActivityData(adapter);
     ListAdapter = adapter;
 }
示例#2
0
        void RetrieveActivityData(ActivityItemAdapter adapter)
        {
            int count = currentDataIndex == 0 ? 5 : 10;
            var query = CreateQuery(skip: currentDataIndex, limit: count);

            if (currentDataIndex == 0)
            {
                loadingBar.Visibility = ViewStates.Visible;
                noContent.Visibility  = ViewStates.Gone;
            }
            query.FindInBackground(new TabFindCallback((ps, e) => {
                if (e == null)
                {
                    if (ps.Count == 0)
                    {
                        if (currentDataIndex == 0)
                        {
                            loadingBar.Visibility = ViewStates.Gone;
                            noContent.Visibility  = ViewStates.Visible;
                        }
                        return;
                    }
                    var tabObjects = ps.Select(TabObject.FromParse).ToList();
                    adapter.FeedData(tabObjects);
                    currentDataIndex += count;
                    loading           = false;
                }
                else
                {
                    Log.Error("ActivityRetriever", e.ToString());
                    loading = false;
                }
            }));
        }
示例#3
0
        public override void OnAttach(Activity activity)
        {
            base.OnAttach(activity);

            adapter          = new ActivityItemAdapter(activity);
            currentDataIndex = 0;
            ListAdapter      = adapter;
        }
示例#4
0
        public override void OnAttach(Activity activity)
        {
            base.OnAttach (activity);

            adapter = new ActivityItemAdapter (activity);
            currentDataIndex = 0;
            ListAdapter = adapter;
        }
示例#5
0
 public void Refresh()
 {
     currentDataIndex = 0;
     adapter = new ActivityItemAdapter (Activity);
     RetrieveActivityData (adapter);
     ListAdapter = adapter;
 }
示例#6
0
 void RetrieveActivityData(ActivityItemAdapter adapter)
 {
     int count = currentDataIndex == 0 ? 5 : 10;
     var query = CreateQuery (skip: currentDataIndex, limit: count);
     if (currentDataIndex == 0) {
         loadingBar.Visibility = ViewStates.Visible;
         noContent.Visibility = ViewStates.Gone;
     }
     query.FindInBackground (new TabFindCallback ((ps, e) => {
         if (e == null) {
             if (ps.Count == 0) {
                 if (currentDataIndex == 0) {
                     loadingBar.Visibility = ViewStates.Gone;
                     noContent.Visibility = ViewStates.Visible;
                 }
                 return;
             }
             var tabObjects = ps.Select (TabObject.FromParse).ToList ();
             adapter.FeedData (tabObjects);
             currentDataIndex += count;
             loading = false;
         } else {
             Log.Error ("ActivityRetriever", e.ToString ());
             loading = false;
         }
     }));
 }