Example #1
0
 public SharePopupMenuItemClickListener(ContentMainFragment hostFragment)
 {
     this.hostFragment = hostFragment;
 }
Example #2
0
 public LeftPanelAnimateListener(ContentMainFragment fragment)
 {
     this.fragment = fragment;
 }
Example #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            StatusBarTintHelper.SetStatusBarColor(this);

            if (savedInstanceState != null)
            {
                asyncTaskActivityGUID = savedInstanceState.GetString(
                    AsyncUIOperationRepeater.ASYNC_ACTIVITY_GUID);
                //if (NavigationManager.Instance.Records.Count == 0)
                //{
                //    // We need not restore data while navigation manager has valid record list.
                //    var navigationCache = FileCacheHelper.ReadCacheFile(
                //        CacheCatagory, string.Format(NavigationCacheFile, asyncTaskActivityGUID));
                //    if (navigationCache != null)
                //    {
                //        NavigationManager.Instance.RestoreRecords(navigationCache);
                //    }

                //    var indexCache = FileCacheHelper.ReadCacheFile(
                //        CacheCatagory, string.Format(IndexCacheFile, asyncTaskActivityGUID));
                //    if (indexCache != null)
                //    {
                //        DataCache.INSTATNCE.IndexList =
                //            JsonConvert.DeserializeObject<PublicationIndexStatus>(indexCache);
                //    }
                //}
            }

            if (string.IsNullOrEmpty(asyncTaskActivityGUID))
            {
                asyncTaskActivityGUID = Guid.NewGuid().ToString();
            }

            SetContentView(Resource.Layout.content_activity);

            //legalDefinePopup = new LegalDefinePopup(this, OnUserDismissLegalDefinePopup);

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

            // Fake Update
            //publication.Value.UpdateCount = 3;

            if (Publication == null)
            {
                CloseContent();
                return;
            }


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

            dlRightDrawer = FindViewById <DrawerLayout>(Resource.Id.dlRightDrawer);
            flRightDrawerPanelContainer = FindViewById <FrameLayout>(Resource.Id.flRightDrawerPanelContainer);
            llHeader = FindViewById <LinearLayout>(Resource.Id.llHeader);
            tvNoHistoryMessageInDrawer = FindViewById <TextView>(Resource.Id.tvNoHistoryMessageInDrawer);

            // Set the shadow layer of drawer layout to totally transparent
            dlRightDrawer.SetScrimColor(Color.Transparent);
            dlRightDrawer.DrawerStateChanged += (object sender, DrawerLayout.DrawerStateChangedEventArgs e) =>
            {
                if (e.NewState == 1)
                {
                    // STATE_DRAGGING
                    // Indicates that a drawer is currently being dragged by the user.
                    hrcAdaptor.RefreshHisoryList();
                    tvNoHistoryMessageInDrawer.Visibility = hrcAdaptor.ItemCount == 0 ? ViewStates.Visible : ViewStates.Gone;
                }
            };

            //rcHistoryList = FindViewById<RecyclerView>(Resource.Id.rcHistoryList);
            //historylistLayoutManager = new LinearLayoutManager(this);
            //historylistLayoutManager.Orientation = LinearLayoutManager.Vertical;
            //rcHistoryList.SetLayoutManager(historylistLayoutManager);
            //hrcAdaptor = new HistoryListAdaptor(
            //    this,
            //    Resource.Layout.content_historylist_item,
            //    OnRecentHistoryItemClick);
            //rcHistoryList.SetAdapter(hrcAdaptor);

            frgContainer = FindViewById <FrameLayout>(Resource.Id.frgContainer);
            var mainFragment = SupportFragmentManager.FindFragmentById(Resource.Id.frgContainer) as ContentMainFragment;

            if (mainFragment == null)
            {
                mainFragment = new ContentMainFragment();
                SupportFragmentManager.BeginTransaction().Add(Resource.Id.frgContainer, mainFragment).Commit();
            }

            SetResult(Result.Canceled);

            AsyncUIOperationRepeater.INSTATNCE.RegisterAsyncTaskActivity(this);
            Android.Util.Log.Info("DBG", "ContentActivity[" + asyncTaskActivityGUID + "] Created.");
        }