Exemplo n.º 1
0
        //Creates UI
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            mapIntent = new Intent(this, typeof(MapActivity));

            // Create UI
            SetContentView(Resource.Layout.MainPageNavigation);
            drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout);

            // Init toolbar
            var toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            // Attach item selected handler to navigation view
            navigatorView = FindViewById <NavigationView>(Resource.Id.nav_view);
            navigatorView.NavigationItemSelected += NavigationView_NavigationItemSelected;
            navigatorView.SetCheckedItem(Resource.Id.nav_home);

            // Create ActionBarDrawerToggle button and add it to the toolbar
            drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, Resource.String.open_drawer, Resource.String.close_drawer);
            drawerLayout.AddDrawerListener(drawerToggle);
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            drawerToggle.SyncState();

            //Setup Fab menu
            create_menu = FindViewById <Clans.Fab.FloatingActionMenu>(Resource.Id.create_menu);
            create_menu.LongClickable = false;
            create_menu.LongClick    += create911Event;
            create_menu.SetOnMenuButtonClickListener(this);


            //Setup call 911 floating action button
            call_911            = FindViewById <Clans.Fab.FloatingActionButton>(Resource.Id.call_911);
            call_911.Click     += create911Event;
            call_911.Visibility = ViewStates.Gone;

            //Setup call campus floating action button
            call_campus            = FindViewById <Clans.Fab.FloatingActionButton>(Resource.Id.call_campus);
            call_campus.Click     += createCampusEvent;
            call_campus.Visibility = ViewStates.Gone;

            //Setup register a local event floating action button
            register_event            = FindViewById <Clans.Fab.FloatingActionButton>(Resource.Id.register_event);
            register_event.Click     += createLocalEvent;
            register_event.Visibility = ViewStates.Gone;

            //Add home fragment to view
            FragmentTransaction transaction = this.FragmentManager.BeginTransaction();
            HomeFragment        home        = new HomeFragment();

            transaction.Add(Resource.Id.fragment_container, home).Commit();

            Button eventHistoryButton = FindViewById <Button>(Resource.Id.nav_history);
        }
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);
            this.fabSend     = view.FindViewById <FloatingActionButton> (Resource.Id.fabSend);
            this.fabDelete   = view.FindViewById <FloatingActionButton> (Resource.Id.fabDelete);
            this.coordinator = view.FindViewById <CoordinatorLayout> (Resource.Id.coordinatorLayout);

            this.fam = view.FindViewById <FloatingActionMenu> (Resource.Id.menu);
            this.fam.HideMenuButton(false);
        }
Exemplo n.º 3
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            menuRed         = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_red);
            menuYellow      = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_yellow);
            menuGreen       = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_green);
            menuBlue        = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_blue);
            menuDown        = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_down);
            menuLabelsRight = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_labels_right);

            fab1 = view.FindViewById <FloatingActionButton> (Resource.Id.fab1);
            fab2 = view.FindViewById <FloatingActionButton> (Resource.Id.fab2);
            fab3 = view.FindViewById <FloatingActionButton> (Resource.Id.fab3);


            FloatingActionButton programFab1 = new FloatingActionButton(this.Activity);

            programFab1.ButtonSize = FloatingActionButton.SizeMini;
            programFab1.LabelText  = this.GetString(Resource.String.lorem_ipsum);
            programFab1.SetImageResource(Resource.Drawable.ic_edit);
            menuRed.AddMenuButton(programFab1);
            programFab1.Click += ProgramFab1_Click;

            ContextThemeWrapper  context     = new ContextThemeWrapper(this.Activity, Resource.Style.MenuButtonsStyle);
            FloatingActionButton programFab2 = new FloatingActionButton(context);

            programFab2.LabelText = "Programmatically added button";
            programFab2.SetImageResource(Resource.Drawable.ic_edit);
            menuYellow.AddMenuButton(programFab2);


            fab1.Enabled = false;
            menuRed.SetOnMenuButtonClickListener(this);
            menuRed.SetClosedOnTouchOutside(true);
            menuBlue.IconAnimated = false;


            menuDown.HideMenuButton(false);
            menuRed.HideMenuButton(false);
            menuYellow.HideMenuButton(false);
            menuGreen.HideMenuButton(false);
            menuBlue.HideMenuButton(false);
            menuLabelsRight.HideMenuButton(false);


            fabEdit = view.FindViewById <FloatingActionButton> (Resource.Id.fab_edit);
            fabEdit.SetShowAnimation(AnimationUtils.LoadAnimation(this.Activity, Resource.Animation.scale_up));
            fabEdit.SetHideAnimation(AnimationUtils.LoadAnimation(this.Activity, Resource.Animation.scale_down));
        }
Exemplo n.º 4
0
 private void IncreaseProgress(FloatingActionButton fab, int i)
 {
     if (i <= this.maxProgress)
     {
         fab.SetProgress(i, false);
         int progress = ++i;
         this.uiHandler.PostDelayed(() => IncreaseProgress(fab, progress), 30);
     }
     else
     {
         this.uiHandler.PostDelayed(() => fab.HideProgress(), 200);
         this.progressTypes.AddLast(ProgressType.ProgressNoAnimation);
     }
 }
Exemplo n.º 5
0
        private void ActionButton_Click(object sender, EventArgs e)
        {
            FloatingActionButton fabButton = sender as FloatingActionButton;

            if (fabButton != null)
            {
                if (fabButton.Id == Resource.Id.fab2)
                {
                    fabButton.Visibility = ViewStates.Gone;
                }
                else if (fabButton.Id == Resource.Id.fab3)
                {
                    fabButton.Visibility = ViewStates.Visible;
                }
                Toast.MakeText(this.Activity, fabButton.LabelText, ToastLength.Short).Show();
            }
        }
Exemplo n.º 6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.EmployerHome);
            job_listview = FindViewById <ListView>(Resource.Id.job_listview);
            FloatingActionButton add_btn = FindViewById <FloatingActionButton>(Resource.Id.add_btn);

            add_btn.Click += AddTransaction;

            //joblist.Add(new JobList("Enzo Cruz", "P200 - P300", "Dec 03, 2017 | @10:00 PM", "Nail Technician"));
            //joblist.Add(new JobList("Marvin Dela Cruz", "P500 - P800", "Dec 03, 2017 | @03:00 PM", "Plumber Services"));
            job_listview.Adapter = new JobListAdapter(this, joblist);

            Button add_row_btn = FindViewById <Button>(Resource.Id.add_row_btn);

            add_row_btn.Click += Add_Row;
        }
Exemplo n.º 7
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            var locales = Java.Util.Locale.GetAvailableLocales();

            this.progressTypes = new LinkedList <ProgressType> ();
            foreach (var item in (ProgressType [])Enum.GetValues(typeof(ProgressType)))
            {
                this.progressTypes.AddLast(item);
            }

            fab        = view.FindViewById <FloatingActionButton> (Resource.Id.fab);
            fab.Max    = this.maxProgress;
            fab.Click += FabClickHandler;


            RecyclerView recyclerView = view.FindViewById <RecyclerView> (Resource.Id.my_recycler_view);

            recyclerView.HasFixedSize = true;
            recyclerView.SetLayoutManager(new LinearLayoutManager(this.Activity));
            recyclerView.SetAdapter(new LanguageAdapter(locales));
            recyclerView.AddOnScrollListener(new RecyclerScrollListener(this.fab, this.scrollOffset));
        }
Exemplo n.º 8
0
 public RecyclerScrollListener(FloatingActionButton fab, int scrollOffset)
 {
     this.fab          = fab;
     this.scrollOffset = scrollOffset;
 }
Exemplo n.º 9
0
 public override void OnViewCreated(View view, Bundle savedInstanceState)
 {
     base.OnViewCreated(view, savedInstanceState);
     this.listView = view.FindViewById <ListView> (Resource.Id.list);
     this.fab      = view.FindViewById <FloatingActionButton> (Resource.Id.fab);
 }
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.NotificationCard, container, false);

            _favoritesViewModel = Stops.Setup.IoC.Container.Get <Core.ViewModels.FavoritesViewModel>();
            _favoritesViewModel.Load();


            Clans.Fab.FloatingActionMenu fabbutton = view.FindViewById <Clans.Fab.FloatingActionMenu>(Resource.Id.mainMapFragmentButtonFab);

            Clans.Fab.FloatingActionButton stop = view.FindViewById <Clans.Fab.FloatingActionButton>(Resource.Id.stop);

            stop.Click += (sender, e) =>
            {
                var second = new Intent(Application.Context, typeof(RootStopFavoritesActivty));;
                StartActivity(second);

                fabbutton.Close(true);
            };


            var layout = view.FindViewById <FrameLayout>(Resource.Id.notificationcardroot);


            var prms = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            prms.Height             = MapBridge.Instance.windowHeight;
            layout.LayoutParameters = prms;



            /*
             * Create Recyckleview
             */
            // mPhotoAlbum = new PhotoAlbum();

            mRecyclerView = view.FindViewById <RecyclerView>(Resource.Id.recyclerView);

            // Plug in the linear layout manager:
            mLayoutManager = new LinearLayoutManager(Application.Context);
            mRecyclerView.SetLayoutManager(mLayoutManager);

            // Plug in my adapter:
            mAdapter = new PhotoAlbumAdapter(_favoritesViewModel.GetList());

            mAdapter.ItemClick += (sender, e) =>
            {
                int photoNum = e;
                FavoriteBridge.Instance.Trigger("FavoriteSelected", _favoritesViewModel.GetList()[photoNum]);

                //mAdapter.NotifyDataSetChanged();
            };

            mAdapter.LongClick += (object sender, int e) => {
                _favoritesViewModel.RemoveInList(e);
                _favoritesViewModel.Load();
                mAdapter.UpdateList(_favoritesViewModel.GetList());
                mAdapter.NotifyDataSetChanged();
            };


            mRecyclerView.SetAdapter(mAdapter);

            return(view);
        }