Ejemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

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

            //catch passed layout
            string mLoadView = Intent.Extras.Get("LoadView").ToString();

            //catch passed if
            passedId = Convert.ToInt32(Intent.Extras.Get("PassedId").ToString());

            SupportToolbar toolBar = FindViewById <SupportToolbar>(Resource.Id.toolBar);

            SetSupportActionBar(toolBar);

            SupportActionBar ab = SupportActionBar;

            ab.SetDisplayHomeAsUpEnabled(true);
            ab.SetHomeButtonEnabled(true);
            ab.SetDisplayShowTitleEnabled(true);
            ab.SetTitle(Resource.String.viewActivityTitle);

            //Get Fragment Title Holder
            mFragTitle = FindViewById <TextView>(Resource.Id.textFragmentTitle);

            //Get Fragment Holder
            mFrameLayout = Resource.Id.fragmentContainer;

            //instantiate fragments
            mViewShoppingItemFrag = new ViewShoppingItemFragment();

            mStackFrag = new Stack <SupportFragment>();

            LoadView(mLoadView);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

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

            //Get passed list id
            selListId = Convert.ToInt32(Intent.Extras.Get("ListId").ToString());

            var mToolbar = FindViewById <SupportToolbar>(Resource.Id.toolbar);

            SetSupportActionBar(mToolbar);

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            mShopFrame = Resource.Id.shoplist_frame;

            mShopListFrag  = new ViewShoppingListFragment();
            mListItemsFrag = new ViewShoppingItemsFragment();
            mListItemFrag  = new ViewShoppingItemFragment();

            mStackFrag = new Stack <SupportFragment>();

            var trans = SupportFragmentManager.BeginTransaction();

            trans.Add(mShopFrame, mListItemsFrag, "List Items");
            trans.Hide(mListItemsFrag);

            trans.Add(mShopFrame, mShopListFrag, "List Details");

            trans.Commit();

            mCurrentFragment = mShopListFrag;
        }