Exemplo n.º 1
0
        public override void OnDestroyView()
        {
            base.OnDestroyView();

            if (tagm != null)
            {
                tagm.Release();
                tagm = null;
            }

            if (ddm != null)
            {
                ddm.Release();
                ddm = null;
            }

            if (sm != null)
            {
                sm.Release();
                sm = null;
            }

            if (wrappedAdapter != null)
            {
                WrapperAdapterUtils.ReleaseAll(wrappedAdapter);
                wrappedAdapter = null;
            }

            ia  = null;
            llm = null;
        }
Exemplo n.º 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            Dialog.RequestWindowFeature((int)WindowFeatures.NoTitle);
            Dialog.SetCanceledOnTouchOutside(true);

            var vwDialog = inflater.Inflate(Resource.Layout.annotation_edittags_popup, container);

            rcAnnotationList = vwDialog.FindViewById <RecyclerView>(Resource.Id.rcAnnotationList);
            vwDialog.FindViewById <View>(Resource.Id.ivAddTag).Click += delegate
            {
                NewEditTagDialogFragment.NewInstance().Show(
                    Activity.SupportFragmentManager.BeginTransaction(),
                    NewEditTagDialogFragment.NewEditTagDialogFragmentTag);
                Dismiss();
            };

            llm             = new LinearLayoutManager(Activity);
            llm.Orientation = LinearLayoutManager.Vertical;
            llm.ScrollToPosition(0);
            rcAnnotationList.SetLayoutManager(llm);

            tagm = new RecyclerViewTouchActionGuardManager();
            tagm.SetInterceptVerticalScrollingWhileAnimationRunning(true);
            tagm.Enabled = true;

            ddm = new RecyclerViewDragDropManager();
            ddm.SetInitiateOnLongPress(true);
            ddm.SetInitiateOnMove(false);

            sm = new RecyclerViewSwipeManager();
            sm.UserHandleSwipeUi = true;

            if (editTagsListAdaptor == null)
            {
                editTagsListAdaptor = new EditTagsListAdaptor(OnEditTag, OnDeleteTag, OnSortTag);
            }

            editTagsListAdaptor.SetTagList(AnnCategoryTagUtil.Instance.GetTags());

            wrappedAdapter = ddm.CreateWrappedAdapter(editTagsListAdaptor);
            wrappedAdapter = sm.CreateWrappedAdapter(wrappedAdapter);

            ia = new SwipeDismissItemAnimator();

            rcAnnotationList.SetAdapter(wrappedAdapter);
            rcAnnotationList.SetItemAnimator(ia);

            tagm.AttachRecyclerView(rcAnnotationList);
            sm.AttachRecyclerView(rcAnnotationList);
            ddm.AttachRecyclerView(rcAnnotationList);

            return(vwDialog);
        }
Exemplo n.º 3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var v = inflater.Inflate(Resource.Layout.organise_publications_fragment, container, false);

            rvPublicationList = v.FindViewById <RecyclerView>(Resource.Id.rvPublicationList);

            llm             = new LinearLayoutManager(Activity);
            llm.Orientation = LinearLayoutManager.Vertical;
            llm.ScrollToPosition(0);
            rvPublicationList.SetLayoutManager(llm);

            tagm = new RecyclerViewTouchActionGuardManager();
            tagm.SetInterceptVerticalScrollingWhileAnimationRunning(true);
            tagm.Enabled = true;

            ddm = new RecyclerViewDragDropManager();
            ddm.SetInitiateOnLongPress(true);
            ddm.SetInitiateOnMove(false);

            sm = new RecyclerViewSwipeManager();
            sm.UserHandleSwipeUi = true;

            if (organisePublicationsListAdaptor == null)
            {
                organisePublicationsListAdaptor = new OrganisePublicationsListAdaptor(OnDeletePub, OnSortPub);
            }

            organisePublicationsListAdaptor.SetPubList(DataCache.INSTATNCE.PublicationManager.PublicationList);

            wrappedAdapter = ddm.CreateWrappedAdapter(organisePublicationsListAdaptor);
            wrappedAdapter = sm.CreateWrappedAdapter(wrappedAdapter);

            ia = new SwipeDismissItemAnimator();

            rvPublicationList.SetAdapter(wrappedAdapter);
            rvPublicationList.SetItemAnimator(ia);

            tagm.AttachRecyclerView(rvPublicationList);
            sm.AttachRecyclerView(rvPublicationList);
            ddm.AttachRecyclerView(rvPublicationList);
            return(v);
        }
Exemplo n.º 4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            StatusBarTintHelper.SetStatusBarColor(this);

            // Create your application here
            SetContentView(Resource.Layout.annotations_edittags_activity);

            llRootView = FindViewById <LinearLayout>(Resource.Id.llRootView);

            FindViewById <View>(Resource.Id.ivAddTag).Click += delegate
            {
                var intent = new Intent(this, typeof(NewTagActivity));
                StartActivity(intent);
            };

            FindViewById <LinearLayout>(Resource.Id.llStatusBarStub).LayoutParameters =
                new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, StatusBarTintHelper.GetStatusBarHeight());

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar_actionbar);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowHomeEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            Title = MainApp.ThisApp.Resources.GetString(Resource.String.AnnotationEditTagsPage_EditTags);

            //------------------------
            rcAnnotationList = FindViewById <RecyclerView>(Resource.Id.rcAnnotationList);
            var llm = new LinearLayoutManager(this);

            llm.Orientation = LinearLayoutManager.Vertical;
            llm.ScrollToPosition(0);
            rcAnnotationList.SetLayoutManager(llm);

            var tagm = new RecyclerViewTouchActionGuardManager();

            tagm.SetInterceptVerticalScrollingWhileAnimationRunning(true);
            tagm.Enabled = true;

            var ddm = new RecyclerViewDragDropManager();

            ddm.SetInitiateOnLongPress(true);
            ddm.SetInitiateOnMove(false);

            var sm = new RecyclerViewSwipeManager();

            sm.UserHandleSwipeUi = true;

            var sa = new EditTagsListAdaptor(this);

            sa.SetTagList(tagList);

            RecyclerView.Adapter wrappedAdapter = ddm.CreateWrappedAdapter(sa);
            wrappedAdapter = sm.CreateWrappedAdapter(wrappedAdapter);

            GeneralItemAnimator ia = new SwipeDismissItemAnimator();

            rcAnnotationList.SetAdapter(wrappedAdapter);
            rcAnnotationList.SetItemAnimator(ia);

            tagm.AttachRecyclerView(rcAnnotationList);
            sm.AttachRecyclerView(rcAnnotationList);
            ddm.AttachRecyclerView(rcAnnotationList);
        }