Ejemplo n.º 1
0
        private void OnItemClick(object sender, int position)
        {
            string title = _listItems[position].Title;

            ap.PutString("title", title);
            ap.Commit();

            GlobalParams.getInstance().setTitle(title);

            StartActivity(_listItems[position].PageType);
        }
Ejemplo n.º 2
0
        private void UpdateCredentialsInCache(string email, string token)
        {
            AppPreferences ap = new AppPreferences(this);

            ap.PutString("email", email);
            ap.PutString("token", token);
            ap.Commit();

            GlobalParams.getInstance().setEmail(email);
            GlobalParams.getInstance().setToken(token);
        }
Ejemplo n.º 3
0
        private void UpdatePesquisasInCache()
        {
            List <Pesquisa> listaPesquisa = serviceWrapper.DespesasPorPesquisa();

            //ADD LISTA DE PESQUISA EM CACHE
            AppPreferences ap = new AppPreferences(this);

            ap.PutListStringSet("listaPesquisa", listaPesquisa);
            ap.Commit();
            //var lst = ap.GetString("listaPesquisa", "");
            //var lsts = JsonConvert.DeserializeObject<List<Pesquisa>>(lst);

            GlobalParams.getInstance().setListaPesquisas(listaPesquisa);
        }
Ejemplo n.º 4
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            ap = new AppPreferences(this);

            SetContentView(Resource.Layout.activity_list);

            _toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(_toolbar);

            SupportActionBar.Title = GlobalParams.getInstance().getTitle();

            _rv = FindViewById <RecyclerView>(Resource.Id.rv);
            _rv.HasFixedSize = true;

            _rvLayoutManager = new LinearLayoutManager(this);
            _rv.SetLayoutManager(_rvLayoutManager);

            _listItems = new List <ListItem> {
                new ListItem {
                    Title = "Nova entrevista", PageType = typeof(QuestionarioActivity)
                },
                //new ListItem {Title = "Nova entrevista", PageType = typeof(QuestionarioFinalActivity)},
                new ListItem {
                    Title = "Mapa", PageType = typeof(MapaActivity)
                },
                new ListItem {
                    Title = "Despesas", PageType = typeof(DespesaActivity)
                }
            };

            _adapter            = new CustomAdapter(_listItems, this.Resources);
            _adapter.ItemClick += OnItemClick;
            _rv.SetAdapter(_adapter);
        }