public ViewHolder(View itemView, SingleEditAdapter adpt) : base(itemView)
 {
     view      = itemView;
     this.adpt = adpt;
     view.FindViewById <ImageButton>(Resource.Id.editbtn).Click   += ReplaceClick;
     view.FindViewById <ImageButton>(Resource.Id.trimbtn).Click   += TrimClick;
     view.FindViewById <CardView>(Resource.Id.cardview).Click     += View_Click;
     view.FindViewById <ImageButton>(Resource.Id.imageadd).Click  += ImageAdd;
     view.FindViewById <ImageButton>(Resource.Id.titleadd).Click  += TitleAdd;
     view.FindViewById <ImageButton>(Resource.Id.deletebtn).Click += ViewHolder_Click;
 }
 public SwapCallback(Editor editor, SingleEditAdapter adapter, SliverEditAdapter timeline) : base(ItemTouchHelper.Left | ItemTouchHelper.Right, 0)
 {
     _adapter    = adapter;
     _timeline   = timeline;
     this.editor = editor;
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetTheme(Resource.Style.Theme_Normal);

            SetContentView(Resource.Layout.Editor);

            bottompanel = FindViewById <FrameLayout>(Resource.Id.selector);

            FindViewById <FloatingActionButton>(Resource.Id.savebtn).Click += Editor_Click;
            FindViewById <ImageButton>(Resource.Id.audiobtn).Click         += Editor_Click1;
            FindViewById <ImageButton>(Resource.Id.helpbtn).Click          += Editor_Click2;

            //selector:
            var fragmentTransaction = SupportFragmentManager.BeginTransaction();

            allclipsfragment = new AllClipsFragment(AllClipsFragment.ClipViewMode.EDITING);
            fragmentTransaction.Add(Resource.Id.selector, allclipsfragment);
            fragmentTransaction.Commit();
            (allclipsfragment as IImagePausable).Pause();

            allclipsfragment.OnPreview    += Fragment_OnPreview;
            allclipsfragment.OnChosen     += Fragment_OnChosen;
            allclipsfragment.OnOpenIngest += IngestOpen;


            //recyclerview
            var listView       = FindViewById <RecyclerView>(Resource.Id.editlist);
            var mLayoutManager = new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false);

            _adapter              = new SingleEditAdapter(this);
            _adapter.OnChange    += _adapter_OnChange;
            _adapter.OnPreview   += _adapter_OnPreview;
            _adapter.OnTrim      += _adapter_OnTrim;
            _adapter.OnDelete    += _adapter_OnDelete;
            _adapter.HasStableIds = true;
            listView.SetLayoutManager(mLayoutManager);
            listView.SetAdapter(_adapter);

            timeline = FindViewById <RecyclerView>(Resource.Id.timeline);
            var mLayoutManager1 = new LinearLayoutManager(this, LinearLayoutManager.Horizontal, false);

            timeline.SetLayoutManager(mLayoutManager1);
            _sliveradapter = new SliverEditAdapter(this);
            timeline.SetAdapter(_sliveradapter);

            preview = FindViewById <EditVideoView>(Resource.Id.edit_preview);
            //preview.OnEndOfVideo += Preview_OnEndOfVideo;
            preview.OnInPointChanged  += Preview_OnInPointChanged;
            preview.OnOutPointChanged += Preview_OnOutPointChanged;
            preview.OnPositionChange  += Preview_OnPositionChange;
            preview.HideDetails();

            lefttimetotal = FindViewById <TextView>(Resource.Id.lefttimetotal);

            tracker = FindViewById <View>(Resource.Id.pos);

            ItemTouchHelper.Callback callback    = new SwapCallback(this, _adapter, _sliveradapter);
            ItemTouchHelper          touchHelper = new ItemTouchHelper(callback);

            touchHelper.AttachToRecyclerView(listView);

            EditorWizard.ShowWizard(this, false);

            //autosave function:
            autosaver = new BackgroundWorker();
            autosaver.WorkerSupportsCancellation = true;
            autosaver.DoWork += Autosaver_DoWork;
            autosaver.RunWorkerAsync();
        }