protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var path = Intent.GetStringExtra(EXTRA_PATH); mPath = string.IsNullOrWhiteSpace(path) ? "" : path; SetContentView(Resource.Layout.activity_files); var toolbar = (Android.Support.V7.Widget.Toolbar)FindViewById(Resource.Id.app_bar); SetSupportActionBar(toolbar); var fab = (FloatingActionButton)FindViewById(Resource.Id.fab); fab.Click += (s, e) => { PerformWithPermissions(RES_REQUEST_CODE); }; var recyclerView = (RecyclerView)FindViewById(Resource.Id.files_list); mFilesAdapter = new FilesAdapter(PicassoClient.GetPicasso()); mFilesAdapter.MetadataSelected += (sender, metadata) => { if (metadata is FolderMetadata folderMetadata) { StartActivity(GetIntent(this, folderMetadata.PathLower)); } else if (metadata is FileMetadata fileMetadata) { mSelectedFile = fileMetadata; PerformWithPermissions(WES_REQUEST_CODE); } }; recyclerView.SetLayoutManager(new LinearLayoutManager(this)); recyclerView.SetAdapter(mFilesAdapter); mSelectedFile = null; }
void InitAndLoadData(String accessToken) { DropboxClientFactory.Init(accessToken); PicassoClient.Init(ApplicationContext, DropboxClientFactory.GetClient()); LoadData(); }