Esempio n. 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.roadwheels);

            roadwheelsPager = FindViewById <ViewPager>(Resource.Id.roadwheelsImagePagerContainer);
            dotsLayout      = FindViewById <LinearLayout>(Resource.Id.roadwheelsDotsContainer);
            registerbtn     = FindViewById <Button>(Resource.Id.registerUser);
            loginbtn        = FindViewById <Button>(Resource.Id.loginUser);

            imagesList.Add(Resource.Raw.image1);
            imagesList.Add(Resource.Raw.image2);
            imagesList.Add(Resource.Raw.image4);

            PageImageAdapter adapter = new PageImageAdapter(this, imagesList);

            roadwheelsPager.Adapter = adapter;

            roadwheelsPager.SetCurrentItem(0, true);

            roadwheelsPager.AddOnPageChangeListener(this);

            setUpUiDots();

            registerbtn.Click += Registerbtn_Click;
            loginbtn.Click    += Loginbtn_Click;
        }
Esempio n. 2
0
        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;
        }