Example #1
0
        public static int GetToolbarHeight()
        {
            if (tbParams != null && tbParams.Height > 0)
            {
                return(tbParams.Height);
            }

            var toolbarParamsString = FileCacheHelper.ReadCacheFile(CacheCatagory, CacheFile);

            if (string.IsNullOrEmpty(toolbarParamsString))
            {
                return(0);
            }

            tbParams = JsonConvert.DeserializeObject <ToolbarParams>(toolbarParamsString);
            return(tbParams.Height);
        }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (savedInstanceState != null)
            {
                var annotationsPanelStatusCache = FileCacheHelper.ReadCacheFile(
                    ContentActivity.CacheCatagory, string.Format(
                        AnnotationsPanelStatusCacheFile,
                        ((ContentActivity)Activity).AsyncTaskActivityGUID));

                if (annotationsPanelStatusCache != null)
                {
                    status = JsonConvert.DeserializeObject <AnnotationsPanelFragmentStatus>(annotationsPanelStatusCache);
                }
            }

            var v = inflater.Inflate(Resource.Layout.contentpage_annotationspanel_fragment, container, false);

            ivTagFilter            = v.FindViewById <ImageView>(Resource.Id.ivTagFilter);
            rvAnnotationList       = v.FindViewById <RecyclerView>(Resource.Id.rvAnnotationList);
            rgAnnotationTypeFilter = v.FindViewById <RadioGroup>(Resource.Id.rgAnnotationTypeFilter);

            annotationListLayoutManager             = new LinearLayoutManager(Activity);
            annotationListLayoutManager.Orientation = LinearLayoutManager.Vertical;
            rvAnnotationList.SetLayoutManager(annotationListLayoutManager);
            alrvAdaptor = new AnnotationListAdaptor(
                this,
                Resource.Layout.contentpage_annotationlist_annotationitem,
                TagContainerTotalWidthMargins);
            alrvAdaptor.SetAnnotationList(FakeAnnotationList);
            rvAnnotationList.SetAdapter(alrvAdaptor);

            rvAnnotationList.ViewTreeObserver.AddOnGlobalLayoutListener(this);

            ivTagFilter.Click += delegate
            {
                var tagFilterDialogFragment = new TagFilterDialogFragment();
                tagFilterDialogFragment.Show(FragmentManager.BeginTransaction(), TagFilterDialogFragment.FragmentTag);
            };

            rgAnnotationTypeFilter.Check(status.AnnotationTypeFilter);
            rgAnnotationTypeFilter.CheckedChange += AnnotationTypeFilterCheckedChange;

            return(v);
        }
Example #3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            if (MainFragmentStatus == null)
            {
                var mainFragmentStatusCache = FileCacheHelper.ReadCacheFile(
                    ContentActivity.CacheCatagory,
                    string.Format(
                        MainFragmentStatusCacheFile,
                        ((ContentActivity)Activity).AsyncTaskActivityGUID));
                if (!string.IsNullOrEmpty(mainFragmentStatusCache))
                {
                    MainFragmentStatus = JsonConvert.DeserializeObject <ContentMainFragmentState>(mainFragmentStatusCache);
                }
            }

            if (MainFragmentStatus == null)
            {
                MainFragmentStatus = new ContentMainFragmentState();
            }

            var v = inflater.Inflate(Resource.Layout.content_main_fragment, container, false);

            if (((ContentActivity)Activity).Publication == null)
            {
                return(v);
            }

            //llLeftPanelContainer = v.FindViewById<LinearLayout>(Resource.Id.llLeftPanelContainer);
            //frLeftPanelContainer = v.FindViewById<FrameLayout>(Resource.Id.frLeftPanelContainer);
            llLeftPanelContainerStub = v.FindViewById <LinearLayout>(Resource.Id.llLeftPanelContainerStub);

            llMainBoard = v.FindViewById <LinearLayout>(Resource.Id.llMainBoard);

            //rgMainTab = v.FindViewById<RadioGroup>(Resource.Id.rgMainTab);
            //rbContents = v.FindViewById<RadioButton>(Resource.Id.rbContents);
            //rbIndex = v.FindViewById<RadioButton>(Resource.Id.rbIndex);
            rbAnnotations = v.FindViewById <RadioButton>(Resource.Id.rbAnnotations);

            //rgMainTab.CheckedChange += MainTabCheckedChange;

            LogHelper.Debug("dbg", "ContentMainFragment::OnCreateView");

            //var fragment = Activity.SupportFragmentManager.FindShowingFragmentById(Resource.Id.frLeftPanelContainer);
            //if (fragment == null)
            //{

            //    //var tocPanelFragment = new TOCPanelFragment();
            //    //transaction.Add(Resource.Id.frLeftPanelContainer, tocPanelFragment, TOCPanelFragment.FragmentTag);


            //}
            //var transaction = Activity.SupportFragmentManager.BeginTransaction();

            //transaction.Add(Resource.Id.frRightPanelContainer, contentFragment, ContentFragment.FragmentTag).Commit();
            //Activity.SupportFragmentManager.SaveFragmentInstanceState(new ContentFragment());

            var loginFragment = new ContentFragment();

            Activity.SupportFragmentManager.BeginTransaction().Add(Resource.Id.frRightPanelContainer, loginFragment).Commit();


            OpenContentPage();
            //Refresh();
            //SetLeftPanelStatus();

            return(v);
        }