Example #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            UserDialogs.Init(this);
            // Set our view from the "main" layout resource

            SetContentView(Resource.Layout.take_order);

            gridViewMenuItems     = FindViewById <GridView>(Resource.Id.gridViewMenuItems);
            spinnerMenuCategories = FindViewById <Spinner>(Resource.Id.spinnerMenuCategories);
            listviewOrderItems    = FindViewById <ListView>(Resource.Id.listviewOrderItems);
            textViewTotal         = FindViewById <TextView>(Resource.Id.textViewTotal);
            btnSubmitOrder        = FindViewById <Button>(Resource.Id.buttonSubmitOrder);

            menuAdapter = new MenuAdapter(this, orderList);

            listviewOrderItems.Adapter = menuAdapter;

            GetCategories();

            spinnerMenuCategories.ItemSelected += SpinnerMenuCategories_ItemSelected;

            listviewOrderItems.ItemClick += listviewOrderItems_ItemClick;

            btnSubmitOrder.Click += delegate
            {
                SubmitOrder();
            };
        }
Example #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);
            activity = this;

            toolbar = FindViewById <V7Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(false);
            SupportActionBar.SetHomeButtonEnabled(true);

            navigationView = FindViewById <NavigationView>(Resource.Id.navigation_view);
            drawerLayout   = FindViewById <DrawerLayout>(Resource.Id.navigation_drawer);

            toggle = new SmootherDrawerToggle(this, drawerLayout, toolbar, Resource.String.openDrawer, Resource.String.closeDrawer);
            drawerLayout.AddDrawerListener(toggle);
            toggle.SyncState();

            listview = FindViewById <ExpandableListView>(Resource.Id.nav_menu);

            mAdapter = new MenuAdapter(ApplicationContext, mainFileAndFolders, filesAndFolders, this);
            listview.SetAdapter(mAdapter);

            replaceFragment(runningFragment);
        }
Example #3
0
 private void initDropDownMenuAdapter()
 {
     mDropDownMenuAdapter = new MenuAdapter(Activity, mWrapperButtons, mWrapperText,
                                            mMenuParams.MenuObjects, mMenuParams.ActionBarSize);
     mDropDownMenuAdapter.SetOnItemClickListener(this);
     mDropDownMenuAdapter.SetOnItemLongClickListener(this);
     mDropDownMenuAdapter.SetAnimationDuration(mMenuParams.AnimationDuration);
 }
        public override void OnActivityCreated(Bundle p0)
        {
            base.OnActivityCreated(p0);

            var menuAdapter = new MenuAdapter(Activity.ApplicationContext);

            listView.Adapter = menuAdapter;
            selectOption(0);
        }
Example #5
0
        public void AddToOrder(Model.Menu menu)
        {
            orderList.Add(menu);

            menuAdapter = new MenuAdapter(this, orderList);

            listviewOrderItems.Adapter = menuAdapter;

            SetPrice();
        }
Example #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            base.SetContentView(Resource.Layout.Menu);


            _lstMenu = new List <Dominio.Entidade.Menu>();
            _lstMenu.Add(new Dominio.Entidade.Menu()
            {
                Id = 1, Descricao = "Realizar venda a um usuario e associar pulseira com ingresso", Titulo = "Venda", Imagem = "money"
            });
            _lstMenu.Add(new Dominio.Entidade.Menu()
            {
                Id = 2, Descricao = "Disponibilizar nova pulseira a um usuario", Titulo = "Vincular", Imagem = "linknew"
            });
            _lstMenu.Add(new Dominio.Entidade.Menu()
            {
                Id = 3, Descricao = "Registrar usuario no evento", Titulo = "Entrada", Imagem = "entradanew"
            });
            _lstMenu.Add(new Dominio.Entidade.Menu()
            {
                Id = 4, Descricao = "Gerenciar controle de produtos na pulseira", Titulo = "Pedido", Imagem = "permissaousuario"
            });

            _menuListView         = FindViewById <ListView>(Resource.Id.lstMenu);
            _menusAdp             = new MenuAdapter(this, _lstMenu);
            _menuListView.Adapter = _menusAdp;


            //// EVENTO CLICK ITEM DA LISTA
            if (_menuListView != null)
            {
                _menuListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
                {
                    switch (e.Position)
                    {
                    case 0:
                        StartActivity(new Intent(this, typeof(EventosActivity)));
                        break;

                    case 1:
                        StartActivity(new Intent(this, typeof(RegistrarPulseiraActivity)));
                        break;

                    case 2:
                        StartActivity(new Intent(this, typeof(EntradaEventoActivity)));
                        break;

                    case 3:
                        StartActivity(new Intent(this, typeof(MenuPedidoActivity)));
                        break;
                    }
                };
            }
        }
Example #7
0
 // Update is called once per frame
 void Update()
 {
     if (MenuAdapter.IsBackKeyPressed())
     {
         if (MenuAdapter.IsShown(canvasMain))
         {
             this.OnExitGame();
         }
         else if (MenuAdapter.IsShown(canvasAbout))
         {
             this.OnExitAbout();
         }
         else if (MenuAdapter.IsShown(canvasLevels))
         {
             this.OnExitPlay();
         }
     }
 }
Example #8
0
 public IHttpActionResult Delete(long id)
 {
     try
     {
         using (var manager = new MenuAdapter())
         {
             respSingle.Message     = manager.Deleter.Value.Delete(id);
             respSingle.MessageCode = 200;
             respSingle.ErrorStatus = false;
             respSingle.ErrorCode   = 0;
         }
     }
     catch (Exception ex)
     {
         respSingle.Message     = ex.Message;
         respSingle.MessageCode = 500;
         respSingle.ErrorStatus = true;
         respSingle.ErrorCode   = 1;
     }
     return(Ok(respSingle));
 }
    // Update is called once per frame
    void Update()
    {
        if (MenuAdapter.IsBackKeyPressed())
        {
            if (MenuAdapter.IsShown(partsMenu))
            {
                MenuAdapter.Hide(partsMenu);
                freeCamera.Enable();
            }

            else if (MenuAdapter.IsShown(colorsMenu))
            {
                MenuAdapter.Hide(colorsMenu);
                freeCamera.Enable();
            }

            else
            {
                this.OnExitLevel();
            }
        }
    }
Example #10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            base.SetContentView(Resource.Layout.Menu);


            _lstMenu = new List <Dominio.Entidade.Menu>();
            _lstMenu.Add(new Dominio.Entidade.Menu()
            {
                Id = 1, Descricao = "Cadastrar usuário", Titulo = "Novo", Imagem = "usuarioadd"
            });
            _lstMenu.Add(new Dominio.Entidade.Menu()
            {
                Id = 2, Descricao = "Definir privilégios a um usuário", Titulo = "Permissões", Imagem = "usuarioconfig"
            });

            _menuListView         = FindViewById <ListView>(Resource.Id.lstMenu);
            _menusAdp             = new MenuAdapter(this, _lstMenu);
            _menuListView.Adapter = _menusAdp;


            //// EVENTO CLICK ITEM DA LISTA
            if (_menuListView != null)
            {
                _menuListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
                {
                    switch (e.Position)
                    {
                    case 0:
                        //StartActivity(new Intent(this, typeof(PedidoEntradaActivity)));
                        break;

                    case 1:
                        //StartActivity(new Intent(this, typeof(PedidoSaidaActivity)));
                        break;
                    }
                };
            }
        }
Example #11
0
 public IHttpActionResult GetId(long id)
 {
     try
     {
         using (var manager = new MenuAdapter())
         {
             respSingle.Message     = "Data Founded";
             respSingle.MessageCode = 200;
             respSingle.ErrorStatus = false;
             respSingle.ErrorCode   = 0;
             respSingle.Data        = manager.Query.Value.TransformPost(id);
         }
     }
     catch (Exception ec)
     {
         respSingle.Message     = ec.Message;
         respSingle.MessageCode = 500;
         respSingle.ErrorStatus = true;
         respSingle.ErrorCode   = 1;
     }
     return(Ok(respSingle));
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            base.SetContentView(Resource.Layout.Menu);


            _lstMenu = new List <Dominio.Entidade.Menu>();
            _lstMenu.Add(new Dominio.Entidade.Menu()
            {
                Id = 1, Descricao = "Listar todos produtos disponiveis", Titulo = "Visualizar", Imagem = "visualizar"
            });
            _lstMenu.Add(new Dominio.Entidade.Menu()
            {
                Id = 2, Descricao = "Cadastrar produto", Titulo = "Novo", Imagem = "add"
            });

            _menuListView         = FindViewById <ListView>(Resource.Id.lstMenu);
            _menusAdp             = new MenuAdapter(this, _lstMenu);
            _menuListView.Adapter = _menusAdp;


            //// EVENTO CLICK ITEM DA LISTA
            if (_menuListView != null)
            {
                _menuListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
                {
                    switch (e.Position)
                    {
                    case 0:
                        StartActivity(new Intent(this, typeof(ProdutoActivity)));
                        break;

                    case 1:
                        //StartActivity(new Intent(this, typeof(PedidoSaidaActivity)));
                        break;
                    }
                };
            }
        }
    // Response to click on Colors button (while in the level)
    public void OnButtonColors()
    {
        if (MenuAdapter.IsShown(partsMenu))
        {
            MenuAdapter.Hide(partsMenu);
            MenuAdapter.Show(colorsMenu);
            freeCamera.Disable();
        }

        else if (MenuAdapter.IsShown(colorsMenu))
        {
            MenuAdapter.Hide(partsMenu);
            MenuAdapter.Hide(colorsMenu);
            freeCamera.Enable();
        }

        else
        {
            MenuAdapter.Hide(partsMenu);
            MenuAdapter.Show(colorsMenu);
            freeCamera.Disable();
        }
    }
Example #14
0
        public IHttpActionResult Put([FromBody] MenuDTO dto)
        {
            var user = ActionContext.ActionArguments["UserDTO"] as UserDTO;

            if (user == null)
            {
                respSingle.Message     = "user doesn't exist";
                respSingle.MessageCode = 500;
                respSingle.ErrorStatus = true;
                respSingle.ErrorCode   = 1;
                return(Ok(respSingle));
            }

            try
            {
                using (var manager = new MenuAdapter())
                {
                    var response = manager.Updater.Value.Update(dto, user.UserId);
                    var result   = manager.Query.Value.TransformPost(response.MenuId);

                    respSingle.Message     = "Data Updated";
                    respSingle.MessageCode = 200;
                    respSingle.ErrorStatus = false;
                    respSingle.ErrorCode   = 0;
                    respSingle.Data        = result;
                }
            }
            catch (Exception ex)
            {
                respSingle.Message     = ex.Message;
                respSingle.MessageCode = 500;
                respSingle.ErrorStatus = true;
                respSingle.ErrorCode   = 1;
            }
            return(Ok(respSingle));
        }
    public CameraOrbit freeCamera;                                              // Camera

    //---------------------------------------------------------------------------------------------------
    //--------------------------------------- Game mechanics --------------------------------------------
    //---------------------------------------------------------------------------------------------------
    // Use this for initialization
    void Start()
    {
        MenuAdapter.Hide(partsMenu);
        MenuAdapter.Hide(colorsMenu);
    }
 // Response to click on Exit button (while in the level)
 public void OnExitLevel()
 {
     MenuAdapter.Hide(partsMenu);
     MenuAdapter.Hide(colorsMenu);
     SceneManager.LoadSceneAsync("menu");
 }
Example #17
0
 private void FillList()
 {
     _items = GetItemsFromResources();
     ListAdapter = new MenuAdapter(_items, this);
 }
Example #18
0
 // Response to click on About button (while in the main menu)
 public void OnAbout()
 {
     // Hide all except about menu
     MenuAdapter.Hide(canvasMain); MenuAdapter.Show(canvasAbout); MenuAdapter.Hide(canvasLevels);
 }
	public static void Toggle(Canvas c) {
		if (MenuAdapter.IsHidden(c))
			MenuAdapter.Show(c);
		else if (MenuAdapter.IsShown(c))
			MenuAdapter.Hide(c);
	}
Example #20
0
 // Response to click on Play button (while in the main menu)
 public void OnPlay()
 {
     // Hide all except levels menu
     MenuAdapter.Hide(canvasMain); MenuAdapter.Hide(canvasAbout); MenuAdapter.Show(canvasLevels);
 }
	public static bool IsLevel() {
		return !MenuAdapter.IsMenu();
	}
	public static bool IsSmartphone() {
		return (MenuAdapter.IsAndroid() || MenuAdapter.IsIPhone());
	}
	public static bool IsPC() {
		return (MenuAdapter.IsWindows() || MenuAdapter.IsOSX() || MenuAdapter.IsLinux());
	}
Example #24
0
		private async void SetAdapter(){
            foundLocalBoxes = await DataLayer.Instance.GetLocalBoxes ();

			menuAdapter = new MenuAdapter (Activity, foundLocalBoxes);
			ListAdapter = menuAdapter;
		}
Example #25
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            base.SetContentView(Resource.Layout.Menu);


            _lstMenu = new List <Dominio.Entidade.Menu>();
            _lstMenu.Add(new Dominio.Entidade.Menu()
            {
                Id = 1, Descricao = "Gerenciar acesso de usuario a eventos", Titulo = "Pulseira", Imagem = "ticketbranca"
            });
            _lstMenu.Add(new Dominio.Entidade.Menu()
            {
                Id = 2, Descricao = "Cadastro de eventos", Titulo = "Evento", Imagem = "evento"
            });
            _lstMenu.Add(new Dominio.Entidade.Menu()
            {
                Id = 3, Descricao = "Gerenciar  permissão de usuarios", Titulo = "Usuário", Imagem = "usuarios"
            });
            _lstMenu.Add(new Dominio.Entidade.Menu()
            {
                Id = 4, Descricao = "Gerenciar produtos disponiveis para compra", Titulo = "Produto", Imagem = "garrafa"
            });
            _lstMenu.Add(new Dominio.Entidade.Menu()
            {
                Id = 0, Descricao = "Enviar e receber dados do servidor", Titulo = "Sincronizar", Imagem = "syncbranca"
            });

            _menuListView         = FindViewById <ListView>(Resource.Id.lstMenu);
            _menusAdp             = new MenuAdapter(this, _lstMenu);
            _menuListView.Adapter = _menusAdp;


            if (_menuListView != null)
            {
                _menuListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) =>
                {
                    switch (e.Position)
                    {
                    case 0:
                        StartActivity(new Intent(this, typeof(MenuPulseiraActivity)));
                        break;

                    case 1:
                        StartActivity(new Intent(this, typeof(EventoCadActivity)));
                        break;

                    case 2:
                        StartActivity(new Intent(this, typeof(MenuUsuarioActivity)));
                        break;

                    case 3:
                        StartActivity(new Intent(this, typeof(MenuProdutoActivity)));
                        break;

                    case 4:
                        ProgressDialog progressDialog;
                        progressDialog = ProgressDialog.Show(this, "Aguarde...", "Sincronizando dados...", true);
                        new Thread(new ThreadStart(delegate {
                            Thread.Sleep(3000);
                            if (progressDialog != null)
                            {
                                RunOnUiThread(() => progressDialog.Hide());
                            }

                            RunOnUiThread(() => Toast.MakeText(this, "Dados Sincronizados com sucesso", ToastLength.Short).Show());
                        })).Start();
                        break;
                    }
                };
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            _logging.WriteLine(Lib.Logging.MessageType.Information, "Starting application in MainActivity OnCreate method");
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            SetContentView(Resource.Layout.Main);
            drawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawerLayout);

            drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, Resource.String.DrawerOpenDescription, Resource.String.DrawerCloseDescription);

            drawerLayout.SetDrawerListener(drawerToggle);
            ActionBar.SetIcon(Android.Resource.Color.Transparent);
            ActionBar.SetDisplayHomeAsUpEnabled(true);

            drawerListView = FindViewById<ListView>(Resource.Id.drawerListView);
            menuAdapter = new MenuAdapter (this);
            drawerListView.Adapter = menuAdapter;
            drawerListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => OnMenuItemClick(e.Position);
            var aboutFrag = menuAdapter.MenuItems.FirstOrDefault(x => x.Manager.GetType() == typeof(AboutFragment));
            var aboutPos = menuAdapter.MenuItems.IndexOf (aboutFrag);
            drawerListView.SetItemChecked(aboutPos, true);	// Highlight the About Fragment at startup
            OnMenuItemClick(aboutPos);                     // Load About Fragment at startup
        }
Example #27
0
    public Canvas canvasLevels;                                                                 // Levels meny canvas

    //---------------------------------------------------------------------------------------------------
    //--------------------------------------- Game mechanics --------------------------------------------
    //---------------------------------------------------------------------------------------------------
    // Use this for initialization
    void Start()
    {
        // Hide all except main menu
        MenuAdapter.Show(canvasMain); MenuAdapter.Hide(canvasAbout); MenuAdapter.Hide(canvasLevels);
    }