コード例 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Historique);
            Android.Widget.Toolbar editToolbar = FindViewById <Android.Widget.Toolbar>(Resource.Id.toolbarMenuRE);
            editToolbar.InflateMenu(Resource.Menu.BarMenu);
            editToolbar.MenuItemClick += (sender, e) =>
            {
                switch (e.Item.Order)
                {
                case 0:
                    Intent intentprofil = new Intent(this, typeof(Profil));

                    StartActivity(intentprofil);


                    break;

                case 1:

                    Intent intentMessage = new Intent(this, typeof(Messages));

                    StartActivity(intentMessage);

                    break;

                case 2:
                    Intent intentMesreservation = new Intent(this, typeof(VosHebergement));

                    StartActivity(intentMesreservation);

                    break;

                case 3:
                    Intent intentrecherche = new Intent(this, typeof(VosHebergement));

                    StartActivity(intentrecherche);

                    break;
                }
            };

            try
            {
                ListView listViewHistorique = FindViewById <ListView>(Resource.Id.listViewHistorique);

                toolbar = FindViewById <Android.Widget.Toolbar>(Resource.Id.toolbarMenuRE);
                listViewHistorique.Adapter = new historiqueScreenAdapter(this, ajouter.etiquetteHisto());


                toolbar.InflateMenu(Resource.Menu.BarMenu);
            }catch (Exception ex)
            {
                Toast.MakeText(this, ex.Message, ToastLength.Long).Show();
            }
        }
コード例 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);


            SetContentView(Resource.Layout.VosHebergement);
            Android.Widget.Toolbar editToolbar = FindViewById <Android.Widget.Toolbar>(Resource.Id.toolbarMenuRE);
            editToolbar.InflateMenu(Resource.Menu.BarMenu);
            editToolbar.MenuItemClick += (sender, e) =>
            {
                Intent intentprofil = new Intent(this, typeof(Profil));

                StartActivity(intentprofil);
                Toast.MakeText(this, "Bottom toolbar tapped: " + e.Item.TitleFormatted, ToastLength.Short).Show();



                Intent intentMessage = new Intent(this, typeof(Messages));

                StartActivity(intentMessage);
                Toast.MakeText(this, "Bottom toolbar tapped: " + e.Item.TitleFormatted, ToastLength.Short).Show();


                Intent intentMesreservation = new Intent(this, typeof(VosHebergement));

                StartActivity(intentMesreservation);
                Toast.MakeText(this, "Bottom toolbar tapped: " + e.Item.TitleFormatted, ToastLength.Short).Show();

                Intent intentrecherche = new Intent(this, typeof(VosHebergement));

                StartActivity(intentrecherche);
                Toast.MakeText(this, "Bottom toolbar tapped: " + e.Item.TitleFormatted, ToastLength.Short).Show();
            };

            ListView listView = FindViewById <ListView>(Resource.Id.listViewVpsHebergement);

            listView.Adapter = new VoshebegementScreenHome(this, ajouter.etiquetteVosheb());

            var btnajputer = FindViewById <FloatingActionButton>(Resource.Id.floatingActionButtonAjouter);


            listView.ItemClick += ListView_ItemClick;

            btnajputer.Click += delegate {
                Intent intentAjouterLogement = new Intent(this, typeof(AjouterLogementE1));

                StartActivity(intentAjouterLogement);
            };
        }
コード例 #3
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Messages);
            Android.Widget.Toolbar editToolbar = FindViewById <Android.Widget.Toolbar>(Resource.Id.toolbarMenuRE);
            editToolbar.InflateMenu(Resource.Menu.BarMenu);
            editToolbar.MenuItemClick += (sender, e) =>
            {
                switch (e.Item.Order)
                {
                case 0:
                    Intent intentprofil = new Intent(this, typeof(Profil));

                    StartActivity(intentprofil);


                    break;

                case 1:

                    Intent intentMessage = new Intent(this, typeof(Messages));

                    StartActivity(intentMessage);

                    break;

                case 2:
                    Intent intentMesreservation = new Intent(this, typeof(VosHebergement));

                    StartActivity(intentMesreservation);

                    break;

                case 3:
                    Intent intentrecherche = new Intent(this, typeof(VosHebergement));

                    StartActivity(intentrecherche);

                    break;
                }
            };
        }
コード例 #4
0
        public override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            conversationView = view.FindViewById <ListView>(Resource.Id.@in);
            outDeviceName    = view.FindViewById <TextView>(Resource.Id.deviceselected);
            outEditText      = view.FindViewById <EditText>(Resource.Id.edit_text_out);
            sendButton       = view.FindViewById <Button>(Resource.Id.button_send);
            toolbarBottom    = view.FindViewById <Android.Widget.Toolbar>(Resource.Id.toolbar_bottom);

            toolbarBottom.InflateMenu(Resource.Menu.bluetooth_chat);

            OnCreatdLinerLayout(view);
            OnCreatedSchedule(view);
            OnCreatePower(view);
            OnCreateProgressbar(view);
            OnCreateTextProgress(view);

            outEditText.Visibility      = ViewStates.Invisible;
            sendButton.Visibility       = ViewStates.Invisible;
            conversationView.Visibility = ViewStates.Invisible;

            PairWithBlueToothDevice(false);
        }
コード例 #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);


            SetContentView(Resource.Layout.Profil);
            Android.Widget.Toolbar editToolbar = FindViewById <Android.Widget.Toolbar>(Resource.Id.toolbarMenuRE);
            // recuperer la barre de menu
            editToolbar.InflateMenu(Resource.Menu.BarMenu);
            //barre de menu
            editToolbar.MenuItemClick += (sender, e) =>
            {
                switch (e.Item.Order)
                {
                case 1:
                    Intent intentprofil = new Intent(this, typeof(Profil));

                    StartActivity(intentprofil);


                    break;

                case 2:

                    Intent intentMessage = new Intent(this, typeof(Messages));

                    StartActivity(intentMessage);

                    break;

                case 3:
                    Intent intentMesreservation = new Intent(this, typeof(VosHebergement));

                    StartActivity(intentMesreservation);

                    break;

                case 4:
                    Intent intentrecherche = new Intent(this, typeof(VosHebergement));

                    StartActivity(intentrecherche);

                    break;
                }
            };

            try
            {
                var          nomprenopm      = FindViewById <TextView>(Resource.Id.textViewNomPrenom);
                LinearLayout l1              = FindViewById <LinearLayout>(Resource.Id.linearLayout1);
                LinearLayout Modifierprofil  = FindViewById <LinearLayout>(Resource.Id.linearLayoutModifierProfil);
                LinearLayout GereHebergement = FindViewById <LinearLayout>(Resource.Id.linearLayoutGerevoshebergement);
                LinearLayout mesreservation  = FindViewById <LinearLayout>(Resource.Id.linearLayoutMesReservation);
                LinearLayout deconnexion     = FindViewById <LinearLayout>(Resource.Id.linearLayoutdeconnexion);

                // passer les donnés entre les pages

                ISharedPreferences sharedPreferences = PreferenceManager.GetDefaultSharedPreferences(this);

                string nom    = sharedPreferences.GetString("nom", "");
                string prenom = sharedPreferences.GetString("prenom", "");

                nomprenopm.Text = nom + " " + prenom;



                Modifierprofil.Click += delegate
                {
                    Intent intentmedifierprofil = new Intent(this, typeof(ModifierProfil));

                    StartActivity(intentmedifierprofil);
                };

                GereHebergement.Click += delegate
                {
                    Intent intentGerehebergement = new Intent(this, typeof(VosHebergement));
                    StartActivity(intentGerehebergement);
                };

                mesreservation.Click += delegate
                {
                    Intent intentmesreservation = new Intent(this, typeof(Historique));
                    StartActivity(intentmesreservation);
                };

                //deconnexion
                deconnexion.Click += delegate
                {
                    Intent intentdeconnextion = new Intent(this, typeof(Login));
                    StartActivity(intentdeconnextion);
                };
            }
            catch (Exception ex)
            {
                Toast.MakeText(this, ex.Message, ToastLength.Long).Show();
            }
        }
コード例 #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.DetaileLogement);

            ////  Gallery gallery = (Gallery)FindViewById<Gallery>(Resource.Id.detaillelogementphoto);
            //  gallery.Adapter = new ImageAdapter(this);
            ////  gallery.ItemClick += delegate (object sender, Android.Widget.AdapterView.ItemClickEventArgs args)
            //  {
            //      Toast.MakeText(this, args.Position.ToString(), ToastLength.Short).Show();
            //  };



            Android.Widget.Toolbar editToolbar = FindViewById <Android.Widget.Toolbar>(Resource.Id.toolbarMenuRE);
            var titre          = FindViewById <TextView>(Resource.Id.textViewtitre);
            var description    = FindViewById <TextView>(Resource.Id.textViewdescription);
            var textcham       = FindViewById <TextView>(Resource.Id.textViewchambre);
            var lircommentaire = FindViewById <TextView>(Resource.Id.textViewlirplus);
            var voyageurs      = FindViewById <TextView>(Resource.Id.textViewVoyageur);
            var btnreserver    = FindViewById <Button>(Resource.Id.buttonreserver);


            ISharedPreferences sharedPreferences = PreferenceManager.GetDefaultSharedPreferences(this);

            // passer les donnés entre les pages

            titre.Text       = Intent.GetStringExtra("Nom");
            description.Text = Intent.GetStringExtra("description");
            voyageurs.Text   = Intent.GetStringExtra("nbpersonne") + "  Voyageurs";
            textcham.Text    = Intent.GetStringExtra("nbcouchage") + " lits ";

            btnreserver.Click += delegate {
                Intent intentreservee = new Intent(this, typeof(Reserver));

                StartActivity(intentreservee);
            };
            lircommentaire.Click += delegate
            {
                Intent intentcom = new Intent(this, typeof(Commentaire));

                StartActivity(intentcom);
            };



            editToolbar.InflateMenu(Resource.Menu.BarMenu);
            editToolbar.MenuItemClick += (sender, e) =>
            {
                switch (e.Item.Order)
                {
                case 0:
                    Intent intentprofil = new Intent(this, typeof(Profil));

                    StartActivity(intentprofil);


                    break;

                case 1:

                    Intent intentMessage = new Intent(this, typeof(Messages));

                    StartActivity(intentMessage);

                    break;

                case 2:
                    Intent intentMesreservation = new Intent(this, typeof(VosHebergement));

                    StartActivity(intentMesreservation);

                    break;

                case 3:
                    Intent intentrecherche = new Intent(this, typeof(VosHebergement));
                    StartActivity(intentrecherche);

                    break;
                }
            };
        }
コード例 #7
0
        private CardView CreateCardViewScheme1(string symbol, string description, string chgText, string timeText,
                                               string valueText, string numberOfCoinsText, string priceText, Color chgColor, int changeIcon)
        {
            CardView cardView = new CardView(Context);

            int cardViewWidth;                                              //175

            cardViewWidth = (GetScreenWidthInPixels() - DpToPixels(6)) / 2; //210

            GridLayout.LayoutParams gridLayoutParams = new GridLayout.LayoutParams();
            gridLayoutParams.Width       = cardViewWidth;
            gridLayoutParams.Height      = DpToPixels(170);
            gridLayoutParams.LeftMargin  = DpToPixels(2);
            gridLayoutParams.RightMargin = DpToPixels(2);
            gridLayoutParams.TopMargin   = DpToPixels(2);

            RelativeLayout rl = new RelativeLayout(cardView.Context);

            cardView.Tag = new Identifier(symbol);
            cardView.AddView(rl);

            GestureDetector _gestureDetector = new GestureDetector(cardView.Context, new GestureListener());

            _gestureDetector.DoubleTap += (object sender, GestureDetector.DoubleTapEventArgs e) =>
            {
                //apply double tap code here
                //var activity = (MainActivity)this.Activity;
                //activity.DisplayCandleChart(symbolDoubleTapped);
                Toast.MakeText(Context, "Double click", ToastLength.Short).Show();
            };

            cardView.Touch += (object sender, View.TouchEventArgs e) =>
            {
                CardView cv = sender as CardView;

                if (cv != null)
                {
                    symbolDoubleTapped = ((Identifier)cv.Tag).Name;
                }

                _gestureDetector.OnTouchEvent(e.Event);
            };

            Button topColorStripe = new Button(cardView.Context);

            //topColorStripe.SetBackgroundColor(CryptoCoinColors.GetCryptoCoinColor(symbol));
            RelativeLayout.LayoutParams lpbb = CreateRelativeLayoutParams();
            lpbb.Width  = ViewGroup.LayoutParams.MatchParent;
            lpbb.Height = DpToPixels(6);
            topColorStripe.LayoutParameters = lpbb;
            topColorStripe.Id = 100;
            rl.AddView(topColorStripe);

            TextView symTV = CreateTextViewEx(symbol, Color.Black, 30, TypefaceStyle.Bold, cardView.Context);

            //symTV.LayoutParameters = CreateRelativeLayoutParams();
            RelativeLayout.LayoutParams lps = CreateRelativeLayoutParams();
            lps.AddRule(LayoutRules.Below, topColorStripe.Id);
            symTV.LayoutParameters = lps;
            symTV.Id = CARDVIEW_SYMBOL_TEXT_VIEW_ID;
            rl.AddView(symTV);

            ImageView iv = new ImageView(cardView.Context);

            RelativeLayout.LayoutParams lpi = CreateRelativeLayoutParams();
            lpi.AddRule(LayoutRules.RightOf, symTV.Id);
            lpi.AddRule(LayoutRules.AlignTop, symTV.Id);
            lpi.TopMargin       = DpToPixels(5);
            iv.LayoutParameters = lpi;
            iv.SetImageResource(changeIcon);
            iv.Id = CARDVIEW_IMAGE_UP_DOWN_ID;
            rl.AddView(iv);

            TextView descTV = CreateTextViewEx(description, Color.Gray, 12, TypefaceStyle.Normal, cardView.Context);

            RelativeLayout.LayoutParams lpd = CreateRelativeLayoutParams();
            lpd.AddRule(LayoutRules.Below, symTV.Id);
            lpd.LeftMargin          = DpToPixels(2);
            lpd.TopMargin           = DpToPixels(-10);
            descTV.LayoutParameters = lpd;
            descTV.Id = CARDVIEW_DESCRIPTION_TEXT_VIEW_ID;
            rl.AddView(descTV);

            TextView chgTV = CreateTextViewEx(chgText, chgColor, 12, TypefaceStyle.Normal, cardView.Context);

            RelativeLayout.LayoutParams lpc = CreateRelativeLayoutParams();
            lpc.AddRule(LayoutRules.RightOf, iv.Id);
            lpc.AddRule(LayoutRules.AlignTop, iv.Id);
            lpc.TopMargin          = DpToPixels(2);
            chgTV.LayoutParameters = lpc;
            chgTV.Id = CARDVIEW_CHANGE_TEXT_VIEW_ID;
            rl.AddView(chgTV);

            TextView timeTV = CreateTextViewEx(timeText, Color.Gray, 8, TypefaceStyle.Normal, cardView.Context);

            RelativeLayout.LayoutParams lpt = CreateRelativeLayoutParams();
            lpt.AddRule(LayoutRules.Below, chgTV.Id);
            lpt.AddRule(LayoutRules.AlignLeft, chgTV.Id);
            timeTV.LayoutParameters = lpt;
            timeTV.Id = CARDVIEW_LAST_UPDATE_TEXT_VIEW_ID;
            rl.AddView(timeTV);

            TextView valueLabelTV = CreateTextViewEx("Value", Color.Gray, 10, TypefaceStyle.Normal, cardView.Context);

            RelativeLayout.LayoutParams lpvl = CreateRelativeLayoutParams();
            lpvl.AddRule(LayoutRules.Below, descTV.Id);
            lpvl.LeftMargin = DpToPixels(2);
            lpvl.TopMargin  = DpToPixels(17);
            valueLabelTV.LayoutParameters = lpvl;
            valueLabelTV.Id = CARDVIEW_VALUE_LABEL_TEXT_VIEW_ID;
            rl.AddView(valueLabelTV);

            TextView valueTV = CreateTextViewEx(valueText, Color.ParseColor("#EFCC00"), 22, TypefaceStyle.Bold, cardView.Context);

            RelativeLayout.LayoutParams lpv = CreateRelativeLayoutParams();
            lpv.AddRule(LayoutRules.Below, valueLabelTV.Id);
            lpv.LeftMargin           = DpToPixels(2);
            lpv.TopMargin            = DpToPixels(-3);
            valueTV.LayoutParameters = lpv;
            valueTV.Id = CARDVIEW_VALUE_TEXT_VIEW_ID;
            rl.AddView(valueTV);

            TextView coinsLabelTV = CreateTextViewEx("Number of coins", Color.Gray, 10, TypefaceStyle.Normal, cardView.Context);

            RelativeLayout.LayoutParams lpnc = CreateRelativeLayoutParams();
            lpnc.AddRule(LayoutRules.Below, valueTV.Id);
            lpnc.LeftMargin = DpToPixels(2);
            lpnc.TopMargin  = DpToPixels(2);
            coinsLabelTV.LayoutParameters = lpnc;
            coinsLabelTV.Id = CARDVIEW_NUMBER_OF_COINS_LABEL_TEXT_VIEW_ID;
            rl.AddView(coinsLabelTV);

            TextView coinsTV = CreateTextViewEx(numberOfCoinsText, Color.Black, 12, TypefaceStyle.Normal, cardView.Context);

            RelativeLayout.LayoutParams lpcv = CreateRelativeLayoutParams();
            lpcv.AddRule(LayoutRules.Below, coinsLabelTV.Id);
            lpcv.LeftMargin          = DpToPixels(2);
            lpnc.TopMargin           = DpToPixels(-1);
            coinsTV.LayoutParameters = lpcv;
            coinsTV.Id = CARDVIEW_NUMBER_OF_COINS_TEXT_VIEW_ID;
            rl.AddView(coinsTV);

            TextView priceTV = CreateTextViewEx(priceText, chgColor, 14, TypefaceStyle.Bold, cardView.Context);

            RelativeLayout.LayoutParams lpp = CreateRelativeLayoutParams();
            lpp.AddRule(LayoutRules.Below, descTV.Id);
            lpp.LeftMargin           = DpToPixels(2);
            lpp.TopMargin            = DpToPixels(-5);
            priceTV.LayoutParameters = lpp;
            priceTV.Id = CARDVIEW_PRICE_TEXT_VIEW_ID;
            rl.AddView(priceTV);

            Android.Widget.Toolbar      tb  = new Android.Widget.Toolbar(cardView.Context);
            RelativeLayout.LayoutParams lpb = CreateRelativeLayoutParams();
            lpb.AddRule(LayoutRules.Below, coinsTV.Id);
            lpb.TopMargin = -15;
            tb.Tag        = new Identifier(symbol);
            tb.InflateMenu(Resource.Menu.CardToolbarMenu);

            tb.MenuItemClick += (sender, e) => {
                Android.Widget.Toolbar tbx = sender as Android.Widget.Toolbar;
                string sym      = ((Identifier)tb.Tag).Name;
                var    activity = (MainActivity)this.Activity;

                switch (e.Item.ItemId)
                {
                case (Resource.Id.cardmenu_qrcode):
                    activity.ShowCryptoCurrencyAddressFragment(sym);
                    break;

                case (Resource.Id.cardmenu_chart):
                    activity.ShowCandleFragment(sym);
                    break;

                case (Resource.Id.cardmenu_transactions):
                    activity.ShowTransactionFragment(sym);
                    break;

                case (Resource.Id.cardmenu_send):
                    activity.ShowSendFragment(sym);
                    break;

                case (Resource.Id.cardmenu_receive):
                    activity.ShowReceiveFragment(sym);
                    break;

                default:
                    break;
                }
            };

            tb.LayoutParameters = lpb;
            tb.Id = 11;
            rl.AddView(tb);

            cardView.LayoutParameters = gridLayoutParams;

            return(cardView);
        }
コード例 #8
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //var toolbar = FindViewById<Toolbar>(Resource.Id.BarAction);
            //SetActionBar(toolbar);
            //ActionBar.Title = "My Toolbar";
            SetContentView(Resource.Layout.Reserver);


            ISharedPreferences sharedPreferences = PreferenceManager.GetDefaultSharedPreferences(this);

            ISharedPreferencesEditor editor = sharedPreferences.Edit();
            string da = sharedPreferences.GetString("datearrivee", "00");
            string dd = sharedPreferences.GetString("datedepart", "00");


            var btnvalder  = FindViewById <Button>(Resource.Id.Valider);
            var datearrive = FindViewById <TextView>(Resource.Id.textViewarrivée);
            var datedepart = FindViewById <TextView>(Resource.Id.textViewdepart);
            var nom        = FindViewById <EditText>(Resource.Id.textInputEditTextNom);
            var prnom      = FindViewById <EditText>(Resource.Id.textInputEditTextPrenom);
            var email      = FindViewById <EditText>(Resource.Id.email);

            datearrive.Text = da;
            datedepart.Text = dd;



            Android.Widget.Toolbar editToolbar = FindViewById <Android.Widget.Toolbar>(Resource.Id.toolbarMenuRE);
            editToolbar.InflateMenu(Resource.Menu.BarMenu);
            editToolbar.MenuItemClick += (sender, e) =>
            {
                switch (e.Item.Order)
                {
                case 0:
                    Intent intentprofil = new Intent(this, typeof(Profil));

                    StartActivity(intentprofil);


                    break;

                case 1:

                    Intent intentMessage = new Intent(this, typeof(Messages));

                    StartActivity(intentMessage);

                    break;

                case 2:
                    Intent intentMesreservation = new Intent(this, typeof(VosHebergement));

                    StartActivity(intentMesreservation);

                    break;

                case 3:
                    Intent intentrecherche = new Intent(this, typeof(VosHebergement));

                    StartActivity(intentrecherche);

                    break;
                }
            };

            var barrating  = FindViewById <RatingBar>(Resource.Id.ratingBarAvis);
            var btnvalider = FindViewById <Button>(Resource.Id.Valider);

            barrating.NumStars      = 5;
            barrating.ScrollBarSize = 2;

            try
            {
                btnvalider.Click += delegate
                {
                    Toast.MakeText(this, "hello", ToastLength.Long).Show();
                };
            }
            catch (Exception ex)
            {
                Toast.MakeText(this, ex.Message.ToString(), ToastLength.Long).Show();
            }
        }
コード例 #9
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Modifierprofil);
            Android.Widget.Toolbar editToolbar = FindViewById <Android.Widget.Toolbar>(Resource.Id.toolbarMenuRE);
            editToolbar.InflateMenu(Resource.Menu.BarMenu);
            editToolbar.MenuItemClick += (sender, e) =>
            {
                switch (e.Item.Order)
                {
                case 0:
                    Intent intentprofil = new Intent(this, typeof(Profil));

                    StartActivity(intentprofil);


                    break;

                case 1:

                    Intent intentMessage = new Intent(this, typeof(Messages));

                    StartActivity(intentMessage);

                    break;

                case 2:
                    Intent intentMesreservation = new Intent(this, typeof(VosHebergement));

                    StartActivity(intentMesreservation);

                    break;

                case 3:
                    Intent intentrecherche = new Intent(this, typeof(VosHebergement));

                    StartActivity(intentrecherche);

                    break;
                }
            };

            var nom = FindViewById <EditText>(Resource.Id.textInputEditTextNomModifier);

            var prenom = FindViewById <EditText>(Resource.Id.textInputEditTextPrenomModifier);

            var email = FindViewById <EditText>(Resource.Id.textInputEditTextEmailModifier);

            var tel = FindViewById <EditText>(Resource.Id.textInputEditTexttelemodifier);

            var adresse = FindViewById <EditText>(Resource.Id.textInputEditTextAdressemodifier);

            var btn = FindViewById <Button>(Resource.Id.buttonValidermodification);


            btn.Click += delegate {
                Toast.MakeText(this, "", ToastLength.Long).Show();


                Intent intentpageprofil = new Intent(this, typeof(Profil));

                StartActivity(intentpageprofil);
            };
        }
コード例 #10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            //recuper la list des logements en format JSON
            ISharedPreferences sharedPreferences = PreferenceManager.GetDefaultSharedPreferences(this);

            var s = sharedPreferences.GetString("list", null);

            // traduire la list en objet C#
            recherchedatas = JsonConvert.DeserializeObject <List <Recherchedata> >(s);


            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.Listdeslogement);

            //la deuxieme barre
            Android.Widget.Toolbar editToolbar = FindViewById <Android.Widget.Toolbar>(Resource.Id.toolbarMenuRE);
            editToolbar.InflateMenu(Resource.Menu.BarMenu);
            editToolbar.MenuItemClick += (sender, e) =>
            {
                switch (e.Item.Order)
                {
                case 0:
                    Intent intentprofil = new Intent(this, typeof(Profil));

                    StartActivity(intentprofil);


                    break;

                case 1:

                    Intent intentMessage = new Intent(this, typeof(Messages));

                    StartActivity(intentMessage);

                    break;

                case 2:
                    Intent intentMesreservation = new Intent(this, typeof(VosHebergement));

                    StartActivity(intentMesreservation);

                    break;

                case 3:
                    Intent intentrecherche = new Intent(this, typeof(VosHebergement));

                    StartActivity(intentrecherche);

                    break;
                }
            };

            //difiner une liste

            ListView listView = FindViewById <ListView>(Resource.Id.listViewdeslogement);

            listView.Adapter = new HomeScreenAdapter(this, recherchedatas);

            // lorsque en click sur un item de la liste
            listView.ItemClick += OnListItemClick;

            // le contenu de la liste
            ISharedPreferencesEditor editor = sharedPreferences.Edit();

            for (int i = 0; i < recherchedatas.Count; i++)
            {
                editor.PutString("id", recherchedatas[i].id);
                editor.PutString("idtype", recherchedatas[i].id_type_id);
                editor.PutString("idproprio", recherchedatas[i].id_proprietaire_id);
                editor.PutString("villeid", recherchedatas[i].ville_id);
                editor.PutString("Nom", recherchedatas[i].nom);
                editor.PutString("description", recherchedatas[i].description);
                editor.PutString("Prix", recherchedatas[i].prix);
                editor.PutString("adresse", recherchedatas[i].code_postal);
                editor.PutString("nbpersonne", recherchedatas[i].nb_personne);
                editor.PutString("Etat", recherchedatas[i].etat);
                editor.PutString("nbcouchage", recherchedatas[i].nb_couchage);
                editor.PutString("commidite", recherchedatas[i].commodites);
                editor.PutString("reglement", recherchedatas[i].reglement);
                editor.Apply();
            }
        }