protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.activity_main); // folderModeSwitch = FindViewById <Switch>(Resource.Id.switch_folder_mode); multipleModeSwitch = FindViewById <Switch>(Resource.Id.switch_multiple_mode); cameraOnlySwitch = FindViewById <Switch>(Resource.Id.switch_camera_only); pickImageButton = FindViewById <Button>(Resource.Id.button_pick_image); launchFragmentButton = FindViewById <Button>(Resource.Id.button_launch_fragment); recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); pickImageButton.Click += (s, e) => { Start(); }; launchFragmentButton.Click += (s, e) => { launchFragment(); }; adapter = new ImageAdapter(this); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false); recyclerView.SetLayoutManager(layoutManager); recyclerView.SetAdapter(adapter); }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); recyclerView = (RecyclerView)view.FindViewById(Resource.Id.recyclerView); pickImageButton = (Button)view.FindViewById(Resource.Id.button_pick_image); pickImageButton.Click += (s, e) => { start(); }; adapter = new ImageAdapter(view.Context); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(view.Context, LinearLayoutManager.Horizontal, false); recyclerView.SetLayoutManager(layoutManager); recyclerView.SetAdapter(adapter); }