Ejemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.Alarm_Main);

            listview = FindViewById<ListView> (Resource.Id.AlarmList);

            var prefsDict = Application.Context.GetSharedPreferences("MySharedPrefs", FileCreationMode.Private);
            String dictString = prefsDict.GetString("MyAktivniAlarmiPrefs", "");
            try{
            AlarmiDictionary = dictString.Split(',').Select(p => p.Trim()
                .Split(':'))
                .ToDictionary(p => p[0], p => p[1]);
            }catch(Exception){
            }

            foreach (KeyValuePair<string,string>pair in AlarmiDictionary) {
                String[] ureditAlarme = pair.Value.Split ('&');
                listaAlarma.Add("Zona: "+ureditAlarme[2]+" : "+ureditAlarme[0]+":"+ureditAlarme[1]);
            }

            BaseAdapter alarms=new BaseAdapterKlasa(this,listaAlarma.ToArray ());

            AlarmAdapter sectionAdapter = new AlarmAdapter(this);
            sectionAdapter.AddSection ("Uključeni alarmi",alarms);

            listview.Adapter = sectionAdapter;
            listview.ItemClick += OnListItemClick;
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.Settings_Main);

            listview = FindViewById<ListView> (Resource.Id.SettingsList);

            String[] map=new String[2];
            map[0]="Brzina osvježavanja lokacije.";
            map[1]="Brzina prebacivanja postavki.";

            String[] pay=new String[4];
            pay[0]="Promijeni sliku registracije";
            pay[1]="Odaberi registraciju";
            pay[2]="Poruke iz inboxa";
            pay[3]="Cijene parkiranja";

            String[] alarm=new String[1];
            alarm[0]="Omogući/Onemogući alarm";
            /*
            alarm[1]="Odaberi zvuk podsjetnika";
            alarm[2]="Odaberi vrijeme podsjetnika";
            alarm[3]="Odaberi zvuk alarma";*/

            String[] about=new String[1];
            about[0]="O autorima";

            BaseAdapter mapB = new BaseAdapterKlasa (this, map);
            BaseAdapter payB = new BaseAdapterKlasa (this, pay);
            BaseAdapter alarmB = new BaseAdapterKlasa (this, alarm);
            BaseAdapter aboutB = new BaseAdapterKlasa (this, about);

            //			ImageView ivM=FindViewById<ImageView> (Resource.Id.SettingsImage);
            //			ivM.SetImageResource (Resource.Drawable.ociscena_rega);
            //			ImageView ivP=FindViewById<ImageView> (Resource.Id.SettingsImage);
            //			ivP.SetImageResource (Resource.Drawable.main_icon);
            //
            //			ImageView ivA=FindViewById<ImageView> (Resource.Id.SettingsImage);
            //			ivA.SetImageResource (Resource.Drawable.Icon);

            SettingsAdapter sectionAdapter = new SettingsAdapter(this);
            sectionAdapter.AddSection("Mapa", mapB);
            sectionAdapter.AddSection("Plaćanje",payB);
            sectionAdapter.AddSection("Alarm", alarmB);
            sectionAdapter.AddSection("Ostalo", aboutB);

            listview.Adapter = sectionAdapter;
            listview.ItemClick += OnListItemClick;
        }