Ejemplo n.º 1
0
            public void BindData(ExplerAdapter adapter, int position, ExplerItem item)
            {
                Path.Text = item.Name;
                Layout.SetOnClickListener(new AnonymousOnClickListener(v => adapter.ItemClick(item)));
                Path.SetOnClickListener(new AnonymousOnClickListener(v => adapter.ItemClick(item)));

                if (item.IsPicture)
                {
                    var thumbnail = TryCatch.Current.Invoke(null, () => GetImageThumbnail(item.FullName, Icon.Width, Icon.Height));
                    if (thumbnail == null)
                    {
                        Icon.SetImageResource(item.Icon);
                    }
                    else
                    {
                        Icon.SetImageBitmap(thumbnail);
                    }
                }
                else
                {
                    Icon.SetImageResource(item.Icon);
                }

                Size.Text = item.Size.FormetFileSize();
                Layout.SetOnLongClickListener(new AnonymousLongClickListener(v =>
                {
                    adapter.SelectedPosition = position;
                    return(false);
                }));
            }
Ejemplo n.º 2
0
 public void Add(ExplerAdapter adater, List <ExplerItem> items)
 {
     for (var i = 0; i < items.Count; i++)
     {
         var item = items[i];
         Add(adater, item, i);
     }
 }
Ejemplo n.º 3
0
        public void Add(ExplerAdapter adater, ExplerItem item, int position)
        {
            var one = new FileSizeAsyncTask(adater, item, position);

            this.Add(one);
            one.Owner = this;
            one.Execute();
        }
Ejemplo n.º 4
0
 void InitListView()
 {
     ListView  = FindViewById <RecyclerView>(Resource.Id.FileExpleror_RecyclerView);
     NodeTree  = FindViewById <TextView>(Resource.Id.FileExpleror_NodeTree);
     EmptyView = FindViewById <RelativeLayout>(Resource.Id.FileExpleror_EmptyContent);
     RegisterForContextMenu(ListView);
     Adapter                    = new ExplerAdapter(this);
     Adapter.Extensions         = Extensions;
     Adapter.AfterItemsChanged += AdapterChanged;
     Adapter.ItemClick         += ItemClick;
     Adapter.SetData(Roots);
     ListView.SetLayoutManager(new LinearLayoutManager(this));
     ListView.SetAdapter(Adapter);
 }
Ejemplo n.º 5
0
 public FileSizeAsyncTask(ExplerAdapter adater, ExplerItem item, int position)
 {
     Adapter  = adater;
     Item     = item;
     Position = position;
 }