示例#1
0
        private async void SetUpContentRecycler(RecyclerView recyclerView, View view)
        {
            ((SimpleItemAnimator)recyclerView.GetItemAnimator()).SupportsChangeAnimations = false;
            recyclerView.SetLayoutManager(new LinearLayoutManager(Context));
            recyclerView.AddItemDecoration(new VerticalSpaceItemDecoration(20)
            {
                ShouldShowBeforeFirst = true
            });

            _currentPath = FilePathHelper.INITIAL_LOCAL_DIRECTORY;
            _isAtRoot    = true;

            _localFetcher = new LocalFetcher(FilePathHelper.INITIAL_LOCAL_DIRECTORY);

            //var thumbnailGenerator = new ThumbnailGenerator();
            //_previewManager = new PreviewManager(thumbnailGenerator);

            await _localFetcher.Fetch();

            _contentAdapter            = new ContentAdapter(Activity, _localFetcher.RootContents.Cast <IContent>().ToList());
            _contentAdapter.ItemClick += (s, args) => OpenContent(args.Item);

            //_contentAdapter.SetMultiChoiceModeListener(this);
            //_contentAdapter.ItemClick += FragmentHelper.Push(Activity, IncidentDetailsFragment.Instantiate(args.Item.PetID, args.Item.IncidentTypeID));

            recyclerView.SetAdapter(_contentAdapter);
        }
示例#2
0
        public IFetcher CreateFetcher(bool fakeFetcher, Primitive.Config.IHttpConfig config)
        {
            if (fakeFetcher)
            {
                if (localFetcher is null)
                {
                    localFetcher = new LocalFetcher(config);
                }

                return(localFetcher);
            }
            else
            {
                if (httpFetcher is null)
                {
                    var client = new HttpClientWrapper();
                    httpFetcher = new HttpFetcher(config, client);
                }
                return(httpFetcher);
            }
        }