protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Fixed); // Create your application here _bottomBar = BottomBar.AttachShy(FindViewById <CoordinatorLayout>(Resource.Id.myCoordinator), FindViewById(Resource.Id.myScrollingContent), savedInstanceState); _bottomBar.UseFixedMode(); // update BottomNavigationBar nuget package to 1.0.9 _bottomBar.UseDarkThemeWithAlpha(false); _bottomBar.SetItems(new [] { new BottomBarTab(Resource.Drawable.ic_recents, "Recents"), new BottomBarTab(Resource.Drawable.ic_favorites, "Favorites"), new BottomBarTab(Resource.Drawable.ic_nearby, "Nearby") }); _bottomBar.SetOnTabClickListener(this); _bottomBar.SetActiveTabColor(Color.Red); // _bottomBar.SetActiveTabColor(Resources.GetColor(Resource.Color.colorAccent, Theme)); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); handler = new Handler(); toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); toolbar.SetNavigationIcon(Resource.Drawable.search_dark_24dp); SetSupportActionBar(toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); toolbar.SetNavigationOnClickListener(this); searchView = FindViewById <SearchView>(Resource.Id.searchView); searchView.Focusable = false; searchView.SetIconifiedByDefault(true); searchView.OnActionViewExpanded(); searchView.SetOnQueryTextListener(this); var searchAutoComplete = (SearchView.SearchAutoComplete)searchView.FindViewById(Resource.Id.search_src_text); searchAutoComplete.SetTextColor(GetColorStateList(Resource.Color.title_color)); searchAutoComplete.SetTextSize(Android.Util.ComplexUnitType.Sp, 14); searchAutoComplete.SetHintTextColor(GetColorStateList(Resource.Color.subtitle_color)); searchAutoComplete.OnFocusChangeListener = this; StatusBarCompat.SetOrdinaryToolBar(this); bottomBar = BottomBar.AttachShy(FindViewById <CoordinatorLayout>(Resource.Id.coordinatorLayout), FindViewById(Resource.Id.frameContent), savedInstanceState); bottomBar.UseFixedMode(); bottomBar.SetItems(Resource.Menu.bottombar_menu); bottomBar.SetOnTabClickListener(this); }
private void IntializeUI(Bundle savestate) { EnableLocationDialog(); FacebookSdk.SdkInitialize(this.ApplicationContext); mProfileTracker = new MyProfileTracker(); SetContentView(Resource.Layout.home_page); toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.Title = "HOME"; var navigationView = FindViewById <NavigationView>(Resource.Id.nav_views); View headerview = navigationView.InflateHeaderView(Resource.Layout.drawer_header); UserName = headerview.FindViewById <TextView>(Resource.Id.userName); UserImage = headerview.FindViewById <ImageView>(Resource.Id.userImage); ISharedPreferences prefs = this.GetSharedPreferences("MYPROFILE", FileCreationMode.Private); if (prefs.GetString("username", "") != null && prefs.GetString("profilePic", "") != null) { UserImage.Visibility = ViewStates.Gone; ProfilePictureView fbProfilePicture = headerview.FindViewById <ProfilePictureView>(Resource.Id.facebook_profile_pic); fbProfilePicture.Visibility = ViewStates.Visible; string name = prefs.GetString("username", ""); string profilePic = prefs.GetString("profilepic", ""); UserName.Text = name; fbProfilePicture.ProfileId = profilePic; } TextView userLocationView = headerview.FindViewById <TextView>(Resource.Id.userLocation); userLocationView.Click += UserLocationView_Click; drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawerLayout); var drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, Resource.String.drawer_open, Resource.String.drawer_close); drawerLayout.AddDrawerListener(drawerToggle); drawerToggle.SyncState(); //SupportActionBar.Show(); // FindViewById<Button>(Resource.Id.button1).Click += HomePage_Click; iconList.Add(Resource.Raw.ic_bike); iconList.Add(Resource.Raw.ic_bike); iconList.Add(Resource.Raw.ic_service); iconList.Add(Resource.Raw.ic_gallery); dotslayout = FindViewById <LinearLayout>(Resource.Id.HomePageDotsContainer); imagePager = FindViewById <ViewPager>(Resource.Id.homePageImagePagerContainer); homeRView = FindViewById <RecyclerView>(Resource.Id.homePageRView); _layoutManager = new GridLayoutManager(this, 2); homeRView.SetLayoutManager(_layoutManager); RecycleHomeIconAdapter RVadapter = new RecycleHomeIconAdapter(this, iconList, iconNameList); homeRView.SetAdapter(RVadapter); RVadapter.ItemClick += RVadapter_ItemClick; imageList.Add(Resource.Raw.image1); imageList.Add(Resource.Raw.image4); imageList.Add(Resource.Raw.image2); PageImageAdapter adapter = new PageImageAdapter(this, imageList); imagePager.Adapter = adapter; imagePager.SetCurrentItem(0, true); imagePager.AddOnPageChangeListener(this); setUiPageViewController(); Bundle savestates = new Bundle(); // _bottomNavBar = BottomBar.Attach(this, bundle); _bottomNavBar = BottomBar.AttachShy((CoordinatorLayout)FindViewById(Resource.Id.homePageCoordinatorLayout), FindViewById(Resource.Id.homePageScrollingContent), savestates); _bottomNavBar.SetItems(Resource.Menu.bottomMenuBar); _bottomNavBar.SetOnMenuTabClickListener(this); navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected; }