Beispiel #1
0
        private void SetupBottomNavigationView()
        {
            try
            {
                NavigationTabBar        = FindViewById <NavigationTabBar>(Resource.Id.ntb_horizontal);
                FragmentBottomNavigator = new FragmentBottomNavigationView(this);

                CardFragment = new CardMachFragment();

                TrendingFragment      = new TrendingFragment();
                NotificationsFragment = new NotificationsFragment();
                ProfileFragment       = new ProfileFragment();

                FragmentBottomNavigator.FragmentListTab0.Add(CardFragment);

                if (AppSettings.ShowTrending)
                {
                    FragmentBottomNavigator.FragmentListTab1.Add(TrendingFragment);
                }

                FragmentBottomNavigator.FragmentListTab2.Add(NotificationsFragment);
                FragmentBottomNavigator.FragmentListTab4.Add(ProfileFragment);

                FragmentBottomNavigator.SetupNavigation(NavigationTabBar);
                NavigationTabBar.SetModelIndex(0, true);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private void SetupBottomNavigationView()
        {
            try
            {
                NavigationTabBar = FindViewById <LinearLayout>(Resource.Id.ntb_horizontal);

                FragmentBottomNavigator = new CustomNavigationController(this);
                CardFragment            = new CardMachFragment();
                TrendingFragment        = new TrendingFragment();
                NotificationsFragment   = new NotificationsFragment();
                ProfileFragment         = new ProfileFragment();


                FragmentBottomNavigator.FragmentListTab0.Add(CardFragment);
                FragmentBottomNavigator.FragmentListTab1.Add(TrendingFragment);
                FragmentBottomNavigator.FragmentListTab2.Add(NotificationsFragment);
                //FragmentBottomNavigator.FragmentListTab3.Add(LibraryFragment);
                FragmentBottomNavigator.FragmentListTab4.Add(ProfileFragment);


                FragmentBottomNavigator.ShowFragment0();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Beispiel #3
0
        private void ListItemClicked(int position)
        {
            Android.Support.V4.App.Fragment fragment = null;
            switch (position)
            {
            case 0:
                fragment = new BrowseFragment();
                break;

            case 1:
                fragment = new FriendsFragment();
                break;

            case 2:
                fragment = new ProfileFragment();
                break;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();

            this.drawerListView.SetItemChecked(position, true);
            SupportActionBar.Title = this.title = Sections [position];
            this.drawerLayout.CloseDrawers();
        }
Beispiel #4
0
        private void DrawerListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            Android.Support.V4.App.Fragment fragment = null;
            TextView tvItemMenu = e.View.FindViewById <TextView>(Resource.Id.textViewMenuItem);

            switch (tvItemMenu.Text)
            {
            case "Beranda":
                fragment = m_GoFoodFragment;
                // startBeranda();return;
                break;

            case "Status Pesanan":
                fragment = m_MyOrderFragment;    // new MyOrderFragment(this, member_id);
                break;

            case "My Profile":
                fragment = new ProfileFragment();
                break;

            case "Help":
                fragment = new BrowseFragment();
                break;

            case "LogOut":
                m_member  = null;
                member_id = 0;
                this.drawerListView.Adapter = new ItemMenuAdapter(this, SectionsNoLogin);
                m_settingCurrentLogin.Val_2 = "0";
                m_settingSvc.Update(m_settingCurrentLogin);
                Toast.MakeText(this, "You has been logged out.", ToastLength.Short).Show();
                Refresh("GoFoodFragment");
                return;

            //break;
            case "Login":
                Intent intent = new Intent(this, typeof(StartScreenActivity));
                StartActivityForResult(intent, 1);
                break;
            }
            if (fragment != null)
            {
                SupportFragmentManager.BeginTransaction()
                .Replace(Resource.Id.content_frame, fragment)
                .Commit();

                this.drawerListView.SetItemChecked(e.Position, true);
                if (member_id > 0)
                {
                    SupportActionBar.Title = this.title = SectionsLogin[e.Position];
                }
                else
                {
                    SupportActionBar.Title = this.title = SectionsNoLogin[e.Position];
                }

                this.drawerLayout.CloseDrawers();
            }
        }
Beispiel #5
0
        public bool OnNavigationItemSelected(IMenuItem item)
        {
            switch (item.ItemId)
            {
            case Resource.Id.navigation_publications:

                if (PublicationsFragment == null)
                {
                    this.PublicationsFragment = new PublicationsFragment();
                    this.FragmentCommit(PublicationsFragment, "Publications");
                }
                ShowFragment(PublicationsFragment);

                return(true);

            case Resource.Id.navigation_advert:

                if (AdvertFragment == null)
                {
                    AdvertFragment = new AdvertFragment();
                    this.FragmentCommit(AdvertFragment, "Advert");
                }
                ShowFragment(AdvertFragment);
                return(true);

            case Resource.Id.navigation_charity:

                if (CharityFragment == null)
                {
                    CharityFragment = new CharityFragment();
                    this.FragmentCommit(CharityFragment, "Charity");
                }
                ShowFragment(CharityFragment);
                return(true);

            case Resource.Id.navigation_organization:

                if (organizationFragment == null)
                {
                    organizationFragment = new OrganizationFragment();
                    this.FragmentCommit(organizationFragment, "Organization");
                }
                ShowFragment(organizationFragment);
                return(true);

            case Resource.Id.navigation_account:

                if (ProfileFragment == null)
                {
                    ProfileFragment = new ProfileFragment();
                    this.FragmentCommit(ProfileFragment, "Profile");
                }
                ShowFragment(ProfileFragment);
                return(true);
            }
            return(false);
        }
Beispiel #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.main_activity);
            navigation = FindViewById <BottomNavigationView>(Resource.Id.navigation);
            navigation.NavigationItemSelected += Navigation_NavigationItemSelected;
            navigation.SelectedItemId          = Resource.Id.nav_home;

            var fragmentTransaction = SupportFragmentManager.BeginTransaction();

            fragmentTransaction.Add(Resource.Id.main_content_fragments_placeholder, new HomeFragment());
            fragmentTransaction.SetTransition(4097);
            fragmentTransaction.Commit();

            profileFragment = new ProfileFragment();
        }
Beispiel #7
0
        private void _navigationView_NavigationItemSelected(object sender, NavigationView.NavigationItemSelectedEventArgs e)
        {
            switch (e.MenuItem.ItemId)
            {
            case Resource.Id.nav_exit:
            {
                var    dialog  = new Android.App.AlertDialog.Builder(this);
                string message = "Вы действительно хотите выйти?";
                dialog.SetMessage(message);

                dialog.SetPositiveButton("Да", delegate { LogOut(); });
                dialog.SetNegativeButton("Нет", delegate { });
                dialog.Show();
                break;
            }

            case Resource.Id.nav_profile:
            {
                var trans = SupportFragmentManager.BeginTransaction();
                var categoriesContainerFragment = ProfileFragment.newInstance();
                trans.Replace(Resource.Id.mainFragmentContainer, categoriesContainerFragment);
                trans.Commit();
                break;
                break;
            }

            case Resource.Id.nav_feed:
            {
                ShowFeed();
                break;
            }

            case Resource.Id.nav_groups:
            {
                var trans = SupportFragmentManager.BeginTransaction();
                var categoriesContainerFragment = GroupsFragment.newInstance(false);
                trans.Replace(Resource.Id.mainFragmentContainer, categoriesContainerFragment);
                trans.Commit();
                break;
            }
            }
            e.MenuItem.SetChecked(true);
            _drawerLayout.CloseDrawers();
        }
        protected override void OnCreate(Bundle bundle)
        {
            try
            {
                base.OnCreate (bundle);
                SetContentView (Resource.Layout.TabsLayout);

                FragmentTransaction transaction = FragmentManager.BeginTransaction();
                ProfileFragment sltFragment = new ProfileFragment();
                transaction.Replace(Resource.Id.flTabs, sltFragment);
                transaction.Commit();
            }
            catch (Exception e)
            {
                new AlertDialog.Builder (this)
                    .SetMessage(e.Message + "\n\n" + e.StackTrace)
                    .SetTitle("Application Error")
                    .Show();
            }
        }
Beispiel #9
0
        private void ListItemClicked(int position)
        {
            Android.Support.V4.App.Fragment fragment = null;
            switch (position)
            {
            case 0:
                fragment = new BrowseFragment();
                Title    = "Monkeys";
                break;

            case 2:
                fragment = new ProfileFragment();
                Title    = "James Montemagno";
                break;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();
        }
Beispiel #10
0
 public void OnItemSelected(int id)
 {
     if (id == Resource.Id.navHome)
     {
         HomeFragment home = new HomeFragment();
         home.PanicButtonEventHandler += Home_PanicButtonEventHandler;
         SupportFragmentManager.BeginTransaction()
         .Replace(Resource.Id.fragHost, home)
         .Commit();
     }
     if (id == Resource.Id.navAwareness)
     {
         AwarenessFragment awareness = new AwarenessFragment();
         SupportFragmentManager.BeginTransaction()
         .Replace(Resource.Id.fragHost, awareness)
         .Commit();
     }
     if (id == Resource.Id.navForum)
     {
         ForumFragment forum = new ForumFragment();
         SupportFragmentManager.BeginTransaction()
         .Replace(Resource.Id.fragHost, forum)
         .Commit();
     }
     if (id == Resource.Id.navAlerts)
     {
         AlertsFragment alerts = new AlertsFragment();
         SupportFragmentManager.BeginTransaction()
         .Replace(Resource.Id.fragHost, alerts)
         .Commit();
         alerts.ShowMapHandler += Alerts_ShowMapHandler;
     }
     if (id == Resource.Id.navUserProfile)
     {
         ProfileFragment profile = new ProfileFragment();
         SupportFragmentManager.BeginTransaction()
         .Replace(Resource.Id.fragHost, profile)
         .Commit();
     }
 }
Beispiel #11
0
        protected override void initializeFragments()
        {
            base.initializeFragments();

            feedFragment    = new FeedFragment();
            searchFragment  = new SearchFragment();
            profileFragment = new ProfileFragment();

            var trans = SupportFragmentManager.BeginTransaction();

            trans.Add(Resource.Id.fragmentContainer, searchFragment, "search");
            trans.Hide(searchFragment);

            trans.Add(Resource.Id.fragmentContainer, profileFragment, "profile");
            trans.Hide(profileFragment);

            trans.Add(Resource.Id.fragmentContainer, feedFragment, "feed");

            currentFragment = feedFragment;

            trans.Commit();
        }
        private void ListItemClicked(int position)
        {
            var parentView = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);

            Android.Support.V4.App.Fragment fragment = null;
            switch (position)
            {
            case 0:
                fragment = new OverviewFragment();
                break;

            case 1:
                fragment = new AccountsFragment();
                break;

            case 2:
                fragment = new CategoriesFragment();
                break;

            case 3:
                fragment = new StatisticsFragment();
                break;

            case 4:
                fragment = new ImportExportFragment();
                break;

            case 5:
                fragment = new ProfileFragment();
                break;
            }

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();
        }
        public void ShowState(MainState state)
        {
            this.state = state;
            if (actualFragment != null)
            {
                var removeTransaction = ChildFragmentManager.BeginTransaction();
                removeTransaction.Remove(actualFragment);
                removeTransaction.Commit();
            }
            switch (state)
            {
            case MainState.PASSPORT:
                actualFragment = QRcodeFragment.NewInstance();
                break;

            case MainState.PROFILE:
                actualFragment = ProfileFragment.NewInstance();
                break;
            }
            var transaction = ChildFragmentManager.BeginTransaction();

            transaction.Add(Resource.Id.content, actualFragment);
            transaction.Commit();
        }
Beispiel #14
0
    void Awake()
    {
        persister = GetComponent<PersistanceDriver>();
        fragments = GetComponentsInChildren<SaveFragment>();

        profile = GetComponentInChildren<ProfileFragment>();
        character = GetComponentInChildren<CharacterFragment>();
        weapons = GetComponentInChildren<WeaponsFragment>();
        treasury = GetComponentInChildren<TreasuryFragment>();
        battles = GetComponentInChildren<BattlesFragment>();
    }
        //Switch для обработки выбора пунктов Navigation Drawer
        private void SelectItem(int position)
        {
            switch (position)
            {
            //Мероприятия
            case 0:
            {
                if (fragments[position] == null)
                {
                    var fragment = new EventsListFragment();
                    fragments[position] = fragment;
                    //_lastFragment = fragment;
                    var arguments = new Bundle();
                    arguments.PutString(EventsListFragment.Account, "Emeri"); arguments.PutString(EventsListFragment.Password, "Emeri");
                    fragment.Arguments = arguments;
                    FragmentManager.BeginTransaction()
                    .Replace(Resource.Id.content_frame, fragment, "eventfragment")
                    .AddToBackStack("eventfragment")
                    .SetTransition(FragmentTransit.FragmentFade).Commit();
                }
                else if (fragments[position].IsVisible)
                {
                }
                else
                {
                    //var xyz = fragments[position].Tag;
                    var fragmentTag = Resources.GetStringArray(Resource.Array.FragmentTagMenuArray)[position];
                    ChangeFragment(fragmentTag, position);
                }

                break;
            }

            //Календарь
            case 1:
            {
                if (fragments[position] == null)
                {
                    var fragment = new CalendarFragment();
                    fragments[position] = fragment;
                    var fragmentTag = Resources.GetStringArray(Resource.Array.FragmentTagMenuArray)[position];
                    ChangeFragment(fragmentTag, position);
                }
                else if (fragments[position].IsVisible)
                {
                }
                else
                {
                    //var xyz = fragments[position].Tag;
                    var fragmentTag = Resources.GetStringArray(Resource.Array.FragmentTagMenuArray)[position];
                    ChangeFragment(fragmentTag, position);
                }

                break;
            }

            //Мои события
            case 2:
            {
                if (fragments[position] == null)
                {
                    var fragment = new MyEventsFragment();
                    fragments[position] = fragment;
                    var fragmentTag = Resources.GetStringArray(Resource.Array.FragmentTagMenuArray)[position];
                    ChangeFragment(fragmentTag, position);
                }
                else if (fragments[position].IsVisible)
                {
                }
                else
                {
                    //var xyz = fragments[position].Tag;
                    var fragmentTag = Resources.GetStringArray(Resource.Array.FragmentTagMenuArray)[position];
                    ChangeFragment(fragmentTag, position);
                }

                break;
            }

            //Фильтрация
            case 3:
            {
                if (fragments[position] == null)
                {
                    var fragment = new FiltrationFragment();
                    fragments[position] = fragment;
                    var fragmentTag = Resources.GetStringArray(Resource.Array.FragmentTagMenuArray)[position];
                    ChangeFragment(fragmentTag, position);
                }
                else if (fragments[position].IsVisible)
                {
                }
                else
                {
                    //var xyz = fragments[position].Tag;
                    var fragmentTag = Resources.GetStringArray(Resource.Array.FragmentTagMenuArray)[position];
                    ChangeFragment(fragmentTag, position);
                }

                break;
            }

            //Профиль
            case 4:
            {
                if (fragments[position] == null)
                {
                    var fragment = new ProfileFragment();
                    fragments[position] = fragment;
                    var fragmentTag = Resources.GetStringArray(Resource.Array.FragmentTagMenuArray)[position];
                    ChangeFragment(fragmentTag, position);
                }
                else if (fragments[position].IsVisible)
                {
                }
                else
                {
                    //var xyz = fragments[position].Tag;
                    var fragmentTag = Resources.GetStringArray(Resource.Array.FragmentTagMenuArray)[position];
                    ChangeFragment(fragmentTag, position);
                }

                break;
            }

            default:
                break;
            }

            _drawerList.SetItemChecked(position, true);
            //ActionBar.Title = _title = _menuTitles[position];
            _title = _menuTitles[position];
            _drawer.CloseDrawer(_drawerList);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            try
            {
                base.OnCreate(savedInstanceState);

                Methods.App.FullScreenApp(this);
                SetTheme(AppSettings.SetTabDarkTheme ? Resource.Style.MyTheme_Dark_Base : Resource.Style.MyTheme_Base);

                AddFlagsWakeLock();

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

                Instance = this;

                TracksCounter = new TracksCounter(this);

                CardFragment          = new CardMachFragment();
                TrendingFragment      = new TrendingFragment();
                NotificationsFragment = new NotificationsFragment();
                ProfileFragment       = new ProfileFragment();

                if (AppSettings.ShowPaypal)
                {
                    InitPayPalPayment = new InitPayPalPayment(this);
                }

                if (AppSettings.ShowInAppBilling)
                {
                    BillingPayment = new InitInAppBillingPayment(this);
                }

                if (AppSettings.EnableAppFree)
                {
                    AppSettings.PremiumSystemEnabled = false;
                }

                //Get Value
                SetupBottomNavigationView();

                GetMyInfoData();

                string type = Intent.GetStringExtra("TypeNotification") ?? "Don't have type";
                if (!string.IsNullOrEmpty(type) && type != "Don't have type")
                {
                    //var result = DbDatabase.Get_data_Login_Credentials();

                    var intent = new Intent(this, typeof(UserProfileActivity));

                    if (type == "got_new_match")
                    {
                        intent.PutExtra("EventPage", "HideButton");
                    }
                    else if (type == "like")
                    {
                        intent.PutExtra("EventPage", "likeAndClose");
                    }
                    else
                    {
                        intent.PutExtra("EventPage", "Close");
                    }

                    intent.PutExtra("DataType", "OneSignal");
                    intent.PutExtra("ItemUser", JsonConvert.SerializeObject(OneSignalNotification.UserData));
                    StartActivity(intent);
                }

                SetService();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        //private Android.Support.V7.Widget.SearchView _searchView;        //dfdfds

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            string text     = Intent.GetStringExtra("Account") ?? "Emeri";
            string workMode = Intent.GetStringExtra("Password") ?? "Data not available";

            //TO DO
            //if (workMode == "q") { WorkingInetAndSQL.DeleteRowsInDBIfNeed("events.sqlite"); };

            FragmentLaunched = "main";
            try
            {
                SetContentView(Resource.Layout.MainOld);
            }
            catch (Exception e) { var a = e; throw; }

            SupportActionBar.SetDisplayShowHomeEnabled(true);

            if (FragmentLaunched == "main")
            {
                try
                {
                    FragmentManager.BeginTransaction()
                    .Remove(_lastFragment);
                    _lastFragment.Dispose();
                }
                catch (Exception e) { var k = e.Message; }
            }

            //Первоначальная загрузка
            _flyOut = FindViewById <FlyOutContainer>(Resource.Id.FlyOutContainer);

            //ГЛАВНОЕ МЕНЮ контейнера
            var menuButton = FindViewById(Resource.Id.MenuButton);

            menuButton.Click += (sender, e) =>
            {
                _flyOut.AnimatedOpened = !_flyOut.AnimatedOpened;
            };

            // mess with fragments begin //
            var eventsListFragment = new EventsListFragment();

            _lastFragment = eventsListFragment;

            var arguments = new Bundle();

            arguments.PutString(EventsListFragment.Account, "Emeri");
            arguments.PutString(EventsListFragment.Password, "Emeri");
            eventsListFragment.Arguments = arguments;

            FragmentManager.BeginTransaction()
            .Add(Resource.Id.content_frame, eventsListFragment)
            .Commit();

            //Избавляемся от фрагмента, если открываем профиль аккаунта - ProfileFragments
            var profileTextView = FindViewById <TextView>(Resource.Id.textView6);

            profileTextView.Click += (sender, args) =>
            {
                var profileFragment = new ProfileFragment();

                FragmentManager.BeginTransaction()
                .Remove(_lastFragment)
                .Add(Resource.Id.content_frame, profileFragment)
                .Commit();

                _lastFragment.Dispose();
                _lastFragment = profileFragment;

                _flyOut.ExternalyClosed();
            };

            //Избавляемся от фрагмента, если открываем события - EventListFragments
            var eventsListTextView = FindViewById <TextView>(Resource.Id.textView1);

            eventsListTextView.Click += (sender, args) =>
            {
                var eventsListFragment2 = new EventsListFragment();

                FragmentManager.BeginTransaction()
                .Remove(_lastFragment)
                .Add(Resource.Id.content_frame, eventsListFragment2)
                .Commit();

                _lastFragment.Dispose();
                _lastFragment = eventsListFragment2;

                _flyOut.ExternalyClosed();
            };
        }