Esempio n. 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            //string micId = savedInstanceState.GetString("mic_id");
            //string micId = base.GetString("mic_id");
            string micId = Intent.GetStringExtra("mic_id");

            string micName = MicsManager.GetMicsFromPreferences().FirstOrDefault(e => e.WavioId == micId).Name;



            SetContentView(Resource.Layout.page_settings);

            var toolbar = FindViewById <V7Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            toolbar.Title = micName;

            MicSettingsFragment fragment = new MicSettingsFragment(micId, this);

            SupportFragmentManager.BeginTransaction()
            .Replace(Resource.Id.content_frame, fragment)
            .Commit();
        }
Esempio n. 2
0
 public void OnResume()
 {
     base.OnResume(); // Always call the superclass first.
     mics = new List <SavedMic>();
     mics = MicsManager.GetMicsFromPreferences();
     //refresh listview?
 }
Esempio n. 3
0
        private void OnListItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            //Toast.MakeText(this, "Item " + e.Position, ToastLength.Short).Show();
            //throw new NotImplementedException();
            var intent = new Intent(this, typeof(MicSettingsActivity));

            intent.PutExtra("mic_id", MicsManager.GetMicsFromPreferences()[(int)e.Id].WavioId);
            StartActivity(intent);
        }
        void SetupTabs()
        {
            var micNames = MicsManager.GetMicsFromPreferences().Select(e => e.Name).ToList();

            micNames.Insert(0, "All");
            var micIds = MicsManager.GetMicsFromPreferences().Select(e => e.WavioId).ToList();

            micIds.Insert(0, "All");


            adapter           = new TabbedNotifsAdapter(home, ChildFragmentManager, micNames.ToArray(), micIds.ToArray());
            viewPager.Adapter = adapter;

            tabs.SetupWithViewPager(viewPager);
        }
        private void UpdateMics()
        {
            var micNames = MicsManager.GetMicsFromPreferences().Select(e => e.Name).ToList();

            micNames.Insert(0, "All");
            var micIds = MicsManager.GetMicsFromPreferences().Select(e => e.WavioId).ToList();

            micIds.Insert(0, "All");

            var same = micIds.SequenceEqual(mics);

            if (!same)
            {
                mics = micIds;
                adapter.SetTabs(micNames.ToArray(), micIds.ToArray());
                adapter.NotifyDataSetChanged();
            }
        }
Esempio n. 6
0
        protected override void OnCreate(Android.OS.Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.page_mics);
            imageLoader = ImageLoader.Instance;

            var toolbar = FindViewById <V7Toolbar>(Resource.Id.toolbar);

            SetSupportActionBar(toolbar);

            SupportActionBar.SetDisplayHomeAsUpEnabled(true);

            mics = MicsManager.GetMicsFromPreferences();



            mRegistrationBroadcastReceiver          = new Shared.BroadcastReceiver();
            mRegistrationBroadcastReceiver.Receive += (sender, e) =>
            {
                //progressDialog.Dismiss();
                var result = e.Intent.GetBooleanExtra("gcm_success", false);
                if (result)
                {
                    if (waitingForGCM)
                    {
                        waitingForGCM = false;
                        RequestAddMic();
                    }
                }
            };

            LocalBroadcastManager.GetInstance(this).RegisterReceiver(mRegistrationBroadcastReceiver,
                                                                     new IntentFilter("registrationComplete"));

            listView            = FindViewById <ListView>(Resource.Id.micsListView);
            listView.ItemClick += OnListItemClick;
            listView.Adapter    = new MicAdapter(this, mics);

            //var grid = FindViewById<GridView>(Resource.Id.grid);
            //grid.Adapter = new MonkeyAdapter(this, friends);
            //grid.ItemClick += GridOnItemClick;
        }