private void _hrEnumerator_DeviceScanUpdate(object sender, string e)
        {
            listAdapter.Add(e);
            MyListView1 myList1 = new MyListView1(this, listAdapter, Color.White);

            _listDevices.Adapter = myList1;
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.my_sensors);
            Titlenew         = FindViewById <TextView>(Resource.Id.title_my_sensors);
            linearLayout     = FindViewById <LinearLayout>(Resource.Id.my_sensors_layout);
            my_sensors       = FindViewById <ListView>(Resource.Id.my_sensors_listView);
            barLayout        = FindViewById <BarLayout>(Resource.Id.appBarLayout);
            pref             = GetSharedPreferences("sensors", FileCreationMode.Private);
            background_color = GetSharedPreferences("backgroundColor_textColor", FileCreationMode.Private);
            text_color       = background_color.GetString("textColor", "Black");
            background       = background_color.GetString("background", "White");

            objects = pref.GetStringSet("sensor", null);
            if (objects != null)
            {
                result = objects.ToList();
                MyListView1 mylist = new MyListView1(this, result, Color.ParseColor(text_color));
                my_sensors.Adapter        = mylist;
                my_sensors.ItemLongClick += My_sensors_ItemLongClick;
            }
            else
            {
                Titlenew.Text = "Нет подключённых устройств";
            }
            linearLayout.SetBackgroundColor(Color.ParseColor(background));
            my_sensors.SetBackgroundColor(Color.ParseColor(background));
            Titlenew.SetTextColor(Color.ParseColor(text_color));
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.Settings_Page);
            pref     = Application.GetSharedPreferences("backgroundColor_textColor", FileCreationMode.Private);
            result   = new string[] { pref.GetString("background", "White"), pref.GetString("textColor", "Black") };
            listView = FindViewById <ListView>(Resource.Id.listView1);
            Strings  = new List <string>();
            Strings.Add("Внешний вид");
            Strings.Add("Экраны данных");
            Strings.Add("Подключить датчик ЧП");
            mylist1 = new MyListView1(this, Strings, Color.ParseColor(result[1]));
            text    = FindViewById <TextView>(Resource.Id.title_settings);


            listView.Adapter = mylist1;
            listView.SetBackgroundColor(Color.White);

            labels[0]              = FindViewById <TextView>(Resource.Id.background_value);
            labels[0].Text         = result[0];
            labels[0].TextChanged += Settings_Activity_TextChanged;



            layout              = FindViewById <LinearLayout>(Resource.Id.linearLayout1);
            listView.ItemClick += ListView_ItemClick;
            layout.SetBackgroundColor(Color.ParseColor(result[0]));
            text.SetTextColor(Color.ParseColor(result[1]));
            Task.Run(async() => await Update_Screen());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Handles the Click event of the btnSearch control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void btnSearch_Click(object sender, EventArgs e)
        {
            _StartRowIndex = 0;
            InitDataSource(_StartRowIndex, GetMaximumRows(), true);
            MyListView1.ResetPageNumber();
            DataBind();
            MyListView1.MainUpdatePanel.Update();

            btnSearch.Enabled = true;
            upSearchButton.Update();
        }
Ejemplo n.º 5
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            var id = item.ItemId;

            if (id == Resource.Id.my_sensors_layout)
            {
                result.Remove(selected);
                MyListView1 myListView1 = new MyListView1(this, result, Color.ParseColor(text_color));
                my_sensors.Adapter = myListView1;
                barLayout.RemoveAllViews();
            }
            return(true);
        }
        private void FButton_Click(object sender, System.EventArgs e)
        {
            if (_hrEnumerator == null)
            {
                listAdapter.Clear();
                MyListView1 listView1 = new MyListView1(this, listAdapter, Color.White);
                _listDevices.Adapter             = listView1;
                _hrEnumerator                    = new HeartRateEnumeratorForAndroid();
                _hrEnumerator.DeviceScanUpdate  += _hrEnumerator_DeviceScanUpdate;
                _hrEnumerator.DeviceScanTimeout += _hrEnumerator_DeviceScanTimeout;
                _hrEnumerator.StartDeviceScan();

                Toast.MakeText(this, "Сканирование началось", ToastLength.Short).Show();
            }
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.Connect_sensor);

            //Create a color;
            colors     = GetSharedPreferences("backgroundColor_textColor", FileCreationMode.Private);
            background = colors.GetString("background", "White");
            textColor  = colors.GetString("textColor", "Black");

            relLayout = FindViewById <RelativeLayout>(Resource.Id.rel);
            Toast.MakeText(this, $"{background},{textColor}", ToastLength.Short).Show();
            textView1         = FindViewById <TextView>(Resource.Id.t);
            fButton           = FindViewById <FloatingActionButton>(Resource.Id.FloatingButton);
            favorites_sensors = new List <string>();
            _listDevices      = FindViewById <ListView>(Resource.Id.ScanDevicesListView);
            fButton.SetColorFilter(Color.White);
            toolBar = FindViewById <V7ToolBar>(Resource.Id.toolbar);


            //Events
            _listDevices.ItemClick += ListView_ItemClick;
            fButton.Click          += FButton_Click;

            SetSupportActionBar(toolBar);
            SetTitle(Resource.String.title2);
            listAdapter = new List <string>();
            MyListView1 myList1 = new MyListView1(this, listAdapter, Color.ParseColor(textColor));

            _listDevices.Adapter = myList1;
            textView1.SetTextColor(Color.ParseColor(textColor));
            fButton.SetColorFilter(Color.ParseColor(background));
            fButton.SetBackgroundColor(Color.ParseColor(textColor));
            relLayout.SetBackgroundColor(Color.ParseColor(background));
        }