/// <summary>
        /// Initialization of Bottom Menu
        /// </summary>
        private void BottomMenuInitializer()
        {
            BottomNavigationView navigation = FindViewById <BottomNavigationView>(Resource.Id.navigation);

            navigation.SetOnNavigationItemSelectedListener(this);

            BottomNavigationItemView itemCompare    = navigation.FindViewById <BottomNavigationItemView>(Resource.Id.navigation_compare);
            BottomNavigationItemView itemStatistics = navigation.FindViewById <BottomNavigationItemView>(Resource.Id.navigation_statistics);
            BottomNavigationItemView itemFeedback   = navigation.FindViewById <BottomNavigationItemView>(Resource.Id.navigation_feedback);

            itemCompare.SetIconTintList(ColorStateList.ValueOf(Color.ParseColor("#707070")));
            itemStatistics.SetIconTintList(ColorStateList.ValueOf(Color.ParseColor("#707070")));
            itemFeedback.SetIconTintList(ColorStateList.ValueOf(Color.ParseColor("#dc3546")));
        }
Example #2
0
 public void Navigation_Visibility(BottomNavigationView navigation, string Role)
 {
     if (String.Equals(Role, "Manager"))
     {
         var b = navigation.FindViewById(Resource.Id.navigation_AddUser);
         b.Visibility = ViewStates.Invisible;
     }
     if (String.Equals(Role, "User"))
     {
         var b = navigation.FindViewById(Resource.Id.navigation_AddUser);
         b.Visibility = ViewStates.Invisible;
         var c = navigation.FindViewById(Resource.Id.navigation_AddTask);
         c.Visibility = ViewStates.Invisible;
     }
 }
        /// <summary>
        /// Initialization of Bottom Menu
        /// </summary>
        private void BottomMenuInitializer()
        {
            BottomNavigationView navigation = FindViewById <BottomNavigationView>(Resource.Id.navigation);

            navigation.SetOnNavigationItemSelectedListener(this);

            BottomNavigationItemView itemCompare    = navigation.FindViewById <BottomNavigationItemView>(Resource.Id.navigation_compare);
            BottomNavigationItemView itemStatistics = navigation.FindViewById <BottomNavigationItemView>(Resource.Id.navigation_statistics);
            BottomNavigationItemView itemFeedback   = navigation.FindViewById <BottomNavigationItemView>(Resource.Id.navigation_feedback);

            itemCompare.SetIconTintList(ColorStateList.ValueOf(Color.ParseColor("#707070")));
            itemStatistics.SetIconTintList(ColorStateList.ValueOf(Color.ParseColor("#dc3546")));
            itemFeedback.SetIconTintList(ColorStateList.ValueOf(Color.ParseColor("#707070")));

            chartbutton = FindViewById <Button>(Resource.Id.chartbutton);
            statbutton  = FindViewById <Button>(Resource.Id.statbutton);

            statbutton.Click += (s, e) => {
                StartActivity(new Intent(Intent.ActionView, Android.Net.Uri.Parse("https://play.google.com/store/apps/details?id=com.wave.skillmeter")));
            };
            chartbutton.Click += (s, e) => {
                StartActivity(new Intent(Intent.ActionView, Android.Net.Uri.Parse("https://play.google.com/store/apps/details?id=com.wtwave.wtinsider")));
            };
        }
Example #4
0
        public async void scanner()
        {
            MobileBarcodeScanner.Initialize(Application);

            var scanner = new ZXing.Mobile.MobileBarcodeScanner();

            var result = await scanner.Scan();

            if (result != null)
            {
                ISharedPreferencesEditor keyfcm = sharedPreferences.Edit();
                keyfcm.PutString("registerdeviceid", result.Text);
                keyfcm.Commit();

                Intent i = new Intent(this, typeof(RegisterListDevices));
                StartActivity(i);
            }
            View view = bottomNavigationView.FindViewById(Resource.Id.action_home);

            view.PerformClick();
        }
        private void InflateMenu(Context context)
        {
            if (BottomNavigationView == null)
            {
                throw new ArgumentNullException(nameof(BottomNavigationView));
            }

            if (BottomNavigationView.Menu == null)
            {
                throw new ArgumentNullException(nameof(BottomNavigationView.Menu));
            }

            for (var i = 0; i < _viewModel.TabViewModels.Count; i++)
            {
                var tabViewModel = _viewModel.TabViewModels[i];
                var iconId       = GetImageResourceId(tabViewModel.Key);

                var menuItem = BottomNavigationView.Menu.Add(Menu.None, i, Menu.None, tabViewModel.Title);
                menuItem?.SetIcon(iconId);

                var itemView  = BottomNavigationView.FindViewById <BottomNavigationItemView>(i);
                var badgeView = new BadgeView <TKey>(context);

                if (BadgeTextColor != null)
                {
                    badgeView.TextColor = BadgeTextColor;
                }

                if (BadgeBackgroundColor != null)
                {
                    badgeView.BackgroundColor = BadgeBackgroundColor;
                }

                badgeView.SetViewModel(tabViewModel);
                itemView?.AddView(badgeView);
            }
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.main_activity);

            // Setup toolbar
            Toolbar toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            toolbar.SetTitle(Resource.String.applicationname); // Set toolbar title here

            if (toolbar != null)
            {
                SetSupportActionBar(toolbar);
                //SupportActionBar.SetDisplayHomeAsUpEnabled(true);
                SupportActionBar.SetHomeButtonEnabled(false);
            }

            // Setup FloatingActionButton click
            FloatingActionButton navigateToCreateInvoicesActivityFloatingActionButton = FindViewById <FloatingActionButton>(Resource.Id.floatingactionbutton_navigatetoinvoicescreateviewmodel);

            navigateToCreateInvoicesActivityFloatingActionButton.Click +=
                delegate
            {
                Intent intent = new Intent(this, typeof(InvoicesCreateActivity));
                StartActivity(intent);
            };

            // Setup BottomNavigationView clicks
            BottomNavigationView bottomNavigationView = FindViewById <BottomNavigationView>(Resource.Id.bottom_navigation);

            bottomNavigationView.NavigationItemSelected += (sender, e) =>
            {
                Android.Support.V4.App.FragmentTransaction fragmentTransaction =
                    this.SupportFragmentManager.BeginTransaction();
                fragmentTransaction.SetCustomAnimations(Resource.Animation.abc_fade_in, Resource.Animation.abc_fade_out);

                switch (e.Item.ItemId)
                {
                case Resource.Id.bottomnavigationview_invoices:
                    InvoicesFragment invoicesFragment = new InvoicesFragment();
                    fragmentTransaction.Replace(Resource.Id.main_container, invoicesFragment);
                    fragmentTransaction.Commit();

                    // show the floating action button
                    navigateToCreateInvoicesActivityFloatingActionButton.Show();
                    break;

                case Resource.Id.bottomnavigationview_configuration:
                    ConfigurationFragment configurationFragment = new ConfigurationFragment();
                    fragmentTransaction.Replace(Resource.Id.main_container, configurationFragment);
                    fragmentTransaction.Commit();

                    // hide the floating action button
                    navigateToCreateInvoicesActivityFloatingActionButton.Hide();

                    break;
                }
            };

            // OnCreate only run once when this activity is created. So let's set the default
            // fragment to show by 'clicking' on the bottomnavigationview_invoices button.
            View bottomNavigationViewInvoicesButton = bottomNavigationView.FindViewById(Resource.Id.bottomnavigationview_invoices);

            bottomNavigationViewInvoicesButton.PerformClick();
        }