Exemple #1
0
        private void setAdapter()
        {
            loading.Visibility = ViewStates.Gone;

            if (((StatusShare)this.Activity).shareList == null || ((StatusShare)this.Activity).shareList.Length == 0)
            {
                empty.Visibility = ViewStates.Visible;
            }
            else
            {
                this.adapter         = new UpdateAdapter(this.Activity, ((StatusShare)this.Activity).shareList, this.Activity.LayoutInflater);
                this.list.Adapter    = this.adapter;
                this.list.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => {
                    ((StatusShare)this.Activity).ReplaceFragment(UpdateDetailsFragment.newInstance((StatusShare)this.Activity, e.Position), true);
                };

//				for (int i = 0; i < adapter.Count; i++){
//					adapter.GetItem (i).loadThumbnail (this.Activity, KinveyService.getClient (), adapter);
//				}

                foreach (UpdateEntity update in  ((StatusShare)this.Activity).shareList)
                {
                    update.loadThumbnail(this.Activity, KinveyService.getClient(), adapter);
                }
            }
        }
        public void loadThumbnail(Activity act, Client c, UpdateAdapter adapter)
        {
            Stream output = new MemoryStream();

            c.File().download(new FileMetaData(attachement.id), output, new KinveyDelegate <FileMetaData> {
                onSuccess = (meta) => {
                    BitmapFactory.Options options = new BitmapFactory.Options();
                    options.InSampleSize          = 4;

                    Bitmap ret = BitmapFactory.DecodeStream(output, new Rect(), options);                      //(output, 0, outarray.Length, options);

                    this.thumbnail = ret;

                    act.RunOnUiThread(() => {
                        adapter.NotifyDataSetChanged();
                    });
                }
            });
        }
Exemple #3
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Resource.Id.menu_status_post:
                ((StatusShare)Activity).ReplaceFragment(new UpdateEditFragment(), true);
                return(true);

            case Resource.Id.menu_refresh:
                adapter = null;
                loadUpdates();
                return(true);

            case Resource.Id.menu_sign_out:
                KinveyService.logout();
                Activity.Finish();

                return(true);
            }

            return(base.OnOptionsItemSelected(item));
        }