protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

            contentFragment = ContentFragment.NewInstance(Resource.Drawable.content_music);
            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, contentFragment)
            .Commit();

            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            drawerLayout.SetScrimColor(Color.Transparent);
            linearLayout        = FindViewById <LinearLayout>(Resource.Id.left_drawer);
            linearLayout.Click += (s, e) =>
            {
                drawerLayout.CloseDrawers();
            };

            SetActionBar();
            CreateMenuList();

            viewAnimator = new Yalantis.Com.Sidemenu.Util.ViewAnimator(this, listMenuItems, contentFragment, drawerLayout, this);
        }
Beispiel #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_main);

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            indicator       = new DrawerArrowDrawable(this);
            indicator.Color = Color.White;
            SupportActionBar.SetHomeAsUpIndicator(indicator);

            SetTransformer();
            // setListener();
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawerLayout);
            drawerLayout.SetScrimColor(Color.Transparent);
            drawerLayout.AddDrawerListener(this);
        }
Beispiel #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_main);

            contentFragment = ContentFragment.NewInstance(Resource.Drawable.content_music);
            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, contentFragment)
            .Commit();

            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);
            drawerLayout.SetScrimColor(Android.Graphics.Color.Transparent);
            linearLayout = FindViewById <LinearLayout>(Resource.Id.left_drawer);
            linearLayout.SetOnClickListener(new ViewOnClick(v =>
            {
                drawerLayout.CloseDrawers();
            }));

            SetActionBar();
            CreateMenuList();
            viewAnimator = new Yalantis.Com.Sidemenu.Util.ViewAnimator(this, list, contentFragment, drawerLayout, this);
        }
        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.");
        }
Beispiel #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //RegisterRecentHistoryChangeCallback();

            StatusBarTintHelper.SetStatusBarColor(this);

            Android.Util.Log.Info("DBG", "Set MyPublicationsActivity[" + asyncTaskActivityGUID + "].");

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

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

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar_actionbar);
            SetSupportActionBar(toolbar);

            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);
            rcHistoryList.Visibility = ViewStates.Invisible;

            var frgContainer = SupportFragmentManager.FindFragmentById(Resource.Id.frgContainer);

            if (frgContainer == null)
            {
                var publicationsMainFragment = new PublicationsMainFragment();
                SupportFragmentManager.BeginTransaction().Add(Resource.Id.frgContainer, publicationsMainFragment).Commit();
            }

            if (savedInstanceState != null)
            {
                asyncTaskActivityGUID = savedInstanceState.GetString(
                    AsyncUIOperationRepeater.ASYNC_ACTIVITY_GUID);
                if (savedInstanceState.GetBoolean(IsPublicationFilterShowingDropDown))
                {
                    Task.Run(delegate
                    {
                        Thread.Sleep(100);
                        Application.SynchronizationContext.Post(_ =>
                        {
                            if (PublicationListFragment != null)
                            {
                                PublicationListFragment.ForceShowPublicationFilterDropDown();
                            }
                        }, null);
                    });
                }
            }

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

            AsyncUIOperationRepeater.INSTATNCE.RegisterAsyncTaskActivity(this);
            Android.Util.Log.Info("DBG", "MyPublicationsActivity[" + asyncTaskActivityGUID + "] Created.");
        }
Beispiel #6
0
 public void SetScrimColor(Color color)
 {
     _drawer.SetScrimColor(color);
 }