void BnveToAccentColor(int index) { //Set all to white var img = bnve.GetIconAt(1); var txt = bnve.GetLargeLabelAt(1); img.SetColorFilter(Color.Rgb(255, 255, 255)); txt.SetTextColor(Color.Rgb(255, 255, 255)); var img0 = bnve.GetIconAt(0); var txt0 = bnve.GetLargeLabelAt(0); img0.SetColorFilter(Color.Rgb(255, 255, 255)); txt0.SetTextColor(Color.Rgb(255, 255, 255)); var img2 = bnve.GetIconAt(2); var txt2 = bnve.GetLargeLabelAt(2); img2.SetColorFilter(Color.Rgb(255, 255, 255)); txt2.SetTextColor(Color.Rgb(255, 255, 255)); var img3 = bnve.GetIconAt(3); var txt3 = bnve.GetLargeLabelAt(3); img3.SetColorFilter(Color.Rgb(255, 255, 255)); txt3.SetTextColor(Color.Rgb(255, 255, 255)); //Sets Accent Color var imgindex = bnve.GetIconAt(index); var textindex = bnve.GetLargeLabelAt(index); imgindex.SetColorFilter(Color.Rgb(24, 191, 242)); textindex.SetTextColor(Color.Rgb(24, 191, 242)); }
void BnveToAccentColor(int index) { //Setting icon on nav bar to colour white var img0 = bnve.GetIconAt(0); var txt0 = bnve.GetLargeLabelAt(0); img0.SetColorFilter(Color.Rgb(255, 255, 255)); txt0.SetTextColor(Color.Rgb(255, 255, 255)); var img1 = bnve.GetIconAt(1); var txt1 = bnve.GetLargeLabelAt(1); img1.SetColorFilter(Color.Rgb(255, 255, 255)); txt1.SetTextColor(Color.Rgb(255, 255, 255)); var img3 = bnve.GetIconAt(2); var txt3 = bnve.GetLargeLabelAt(2); img3.SetColorFilter(Color.Rgb(255, 255, 255)); txt3.SetTextColor(Color.Rgb(255, 255, 255)); var img4 = bnve.GetIconAt(3); var txt4 = bnve.GetLargeLabelAt(3); img4.SetColorFilter(Color.Rgb(255, 255, 255)); txt4.SetTextColor(Color.Rgb(255, 255, 255)); //Sets different colour on selected icon on nav bar var imgindex = bnve.GetIconAt(index); var textindex = bnve.GetLargeLabelAt(index); imgindex.SetColorFilter(Color.Rgb(24, 191, 242)); textindex.SetTextColor(Color.Rgb(24, 191, 242)); }
// change color on selection void BnveToAccentColor(int index) { // set all to white var img = bnve.GetIconAt(1); var txt = bnve.GetLargeLabelAt(1); img.SetColorFilter(Android.Graphics.Color.Rgb(255, 255, 255)); txt.SetTextColor(Android.Graphics.Color.Rgb(255, 255, 255)); var img0 = bnve.GetIconAt(0); var txt0 = bnve.GetLargeLabelAt(0); img.SetColorFilter(Android.Graphics.Color.Rgb(255, 255, 255)); txt.SetTextColor(Android.Graphics.Color.Rgb(255, 255, 255)); //var img2 = bnve.GetIconAt(2); //var txt2 = bnve.GetLargeLabelAt(2); //img.SetColorFilter(Android.Graphics.Color.Rgb(255, 255, 255)); //txt.SetTextColor(Android.Graphics.Color.Rgb(255, 255, 255)); var img3 = bnve.GetIconAt(3); var txt3 = bnve.GetLargeLabelAt(3); img.SetColorFilter(Android.Graphics.Color.Rgb(255, 255, 255)); txt.SetTextColor(Android.Graphics.Color.Rgb(255, 255, 255)); // sets accent color var imgindex = bnve.GetIconAt(index); var textindex = bnve.GetLargeLabelAt(index); //imgindex.SetColorFilter(Android.Graphics.Color.Rgb(24, 191, 242)); //textindex.SetTextColor(Android.Graphics.Color.Rgb(24, 191, 242)); }
void Connectviews() { goOnlineButton = (Button)FindViewById(Resource.Id.goOnlineButton); bnve = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve); #pragma warning disable CS0618 // Type or member is obsolete bnve.EnableItemShiftingMode(false); #pragma warning restore CS0618 // Type or member is obsolete #pragma warning disable CS0618 // Type or member is obsolete bnve.EnableShiftingMode(false); #pragma warning restore CS0618 // Type or member is obsolete goOnlineButton.Click += GoOnlineButton_Click; bnve.NavigationItemSelected += Bnve_NavigationItemSelected; var img0 = bnve.GetIconAt(0); var txt0 = bnve.GetLargeLabelAt(0); img0.SetColorFilter(Color.Rgb(24, 191, 242)); txt0.SetTextColor(Color.Rgb(24, 191, 242)); viewpager = (ViewPager)FindViewById(Resource.Id.viewpager); viewpager.OffscreenPageLimit = 3; viewpager.BeginFakeDrag(); SetupViewPager(); homeFragment.CurrentLocation += HomeFragment_CurrentLocation; homeFragment.TripActionArrived += HomeFragment_TripActionArrived; homeFragment.callRider += HomeFragment_callRider; homeFragment.Navigate += HomeFragment_Navigate; homeFragment.TripActionStartTrip += HomeFragment_TripActionStartTrip; homeFragment.TripActionEndTrip += HomeFragment_TripActionEndTripAsync; }
private void ConnectViews() { _goOnlineButton = FindViewById <Button>(Resource.Id.goOnlineButton); _bnve = FindViewById <BottomNavigationViewEx>(Resource.Id.bnve); _bnve.EnableItemShiftingMode(false); _bnve.EnableShiftingMode(false); _goOnlineButton.Click += GoOnlineButton_Click; _bnve.NavigationItemSelected += Bnve_NavigationItemSelected; var img0 = _bnve.GetIconAt(0); var txt0 = _bnve.GetLargeLabelAt(0); img0.SetColorFilter(Color.Rgb(24, 191, 242)); txt0.SetTextColor(Color.Rgb(24, 191, 242)); _viewpager = (ViewPager)FindViewById(Resource.Id.viewpager); _viewpager.OffscreenPageLimit = 3; _viewpager.BeginFakeDrag(); SetupViewPager(); _homeFragment.CurrentLocation += HomeFragment_CurrentLocation; _homeFragment.TripActionArrived += HomeFragment_TripActionArrived; _homeFragment.CallRider += HomeFragment_CallRider; _homeFragment.Navigate += HomeFragment_Navigate; _homeFragment.TripActionStartTrip += HomeFragment_TripActionStartTrip; _homeFragment.TripActionEndTrip += HomeFragment_TripActionEndTrip; }
private BadgeView AddBadgeViewAt(int position, String text, int shape) { // get position ImageView icon = bnve.GetIconAt(position); int[] pos = new int[2]; icon.GetLocationInWindow(pos); var actionBar = SupportActionBar; // action bar height int actionBarHeight = 0; if (actionBar != null) { actionBarHeight = actionBar.Height; } float x = (pos[0] + icon.MeasuredWidth * 0.7f); float y = (pos[1] - actionBarHeight - icon.MeasuredHeight * 1.25f); // calculate width int width = 16 + 4 * (text.Length - 1); int height = 16; BadgeView badgeView = BadgeFactory.Create(this) .SetTextColor(Color.White) .SetWidthAndHeight(width, height) .SetBadgeBackground(Color.Red) .SetTextSize(10) .SetBadgeGravity((int)(GravityFlags.Left | GravityFlags.Top)) .SetBadgeCount(text) .SetShape(shape) .Bind(FindViewById(Resource.Id.rl_root)); badgeView.SetX(x); badgeView.SetY(y); badgeView.Visibility = ViewStates.Visible; return(badgeView); }