private void Control_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            // Control.SetBackgroundColor(Android.Graphics.Color.Black);
            var command = Models.LongPressEffect.GetCommand(Element);

            command?.Execute(Models.LongPressEffect.GetCommandParameter(Element));
        }
Exemplo n.º 2
0
        //Calls BuildDialog(object sender)
        private void BuildExerciseActivity_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            CurrMyButton = (MyButton)sender;
            var data = ClipData.NewPlainText("name", CurrMyButton.Text);

            CurrMyButton.StartDrag(data, new View.DragShadowBuilder(CurrMyButton), null, 0);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Invoke the command if there is one
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        private void Control_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            var command = LongPressedEffect.GetCommand(Element);

            LongPressedEffect.SetCommandParameter(Element, LongPressedEffect.EffectType.LongPress);
            command?.Execute(LongPressedEffect.GetCommandParameter(Element));
        }
        /// <summary>
        /// Invoke the command if there is one
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">E.</param>
        private void Control_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            Console.WriteLine("Invoking long click command");
            var command = LongPressedEffect.GetCommand(Element);

            command?.Execute(LongPressedEffect.GetCommandParameter(Element));
        }
Exemplo n.º 5
0
        private void Btn_dev_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            if (mqttClient != null && mqttClient.IsConnected)
            {
                AlertDialog.Builder alert = new AlertDialog.Builder(this);
                alert.SetTitle(Resource.String.question);

                alert.SetItems(new string[] { GetString(Resource.String.qyes), GetString(Resource.String.qno), GetString(Resource.String.qdelete), GetString(Resource.String.qcancel) }, (senderAlert, args) => {
                    if (args.Which == 0)
                    {
                        mqttClient.Publish(((DevInfo)(((Button)sender).Tag)).ID + "/control/", System.Text.Encoding.UTF8.GetBytes("RESET"));
                    }
                    if (args.Which == 1)
                    {
                        mqttClient.Publish(((DevInfo)(((Button)sender).Tag)).ID + "/control/", System.Text.Encoding.UTF8.GetBytes("UPDATE"));
                    }
                    if (args.Which == 2)
                    {
                        List <DevInfo> dev_list_saved;
                        var prefs = Application.Context.GetSharedPreferences("SmartHomeApp", FileCreationMode.Private);
                        string dev_list_saved_json = prefs.GetString("DEVINFO", null);
                        if (dev_list_saved_json == null)
                        {
                            dev_list_saved = new List <DevInfo>();
                        }
                        else
                        {
                            dev_list_saved = JsonConvert.DeserializeObject <List <DevInfo> >(dev_list_saved_json);
                        }

                        foreach (DevInfo s in dev_list_saved.ToList())
                        {
                            if (s.ID == ((DevInfo)((Button)sender).Tag).ID)
                            {
                                dev_list_saved.Remove(s);
                            }
                        }



                        string stringjson = JsonConvert.SerializeObject(dev_list_saved);
                        var prefEditor    = prefs.Edit();

                        prefEditor.PutString("DEVINFO", stringjson);
                        prefEditor.Commit();
                        AddModules();
                    }
                    if (args.Which == 3)
                    {
                        Toast.MakeText(this, "Cancelled!", ToastLength.Short).Show();
                    }
                });
                Dialog dialog = alert.Create();
                dialog.Show();
            }
        }
Exemplo n.º 6
0
        private void ShowEasterEgg(object sender, Android.Views.View.LongClickEventArgs e)
        {
            mToast          = new Toast(this);
            mToast.Duration = ToastLength.Short;
            mToast.SetGravity(GravityFlags.Center | GravityFlags.Bottom, 0, ConvertDPToPixels(10));

            toastView.Visibility = ViewStates.Visible;
            mToast.View          = toastView;
            mToast.Show();
        }
Exemplo n.º 7
0
        void OnLongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            if (_longCommand == null) {
                e.Handled = false;
                return;
            }

            _longCommand?.Execute(_longCommandParameter ?? Element);

            e.Handled = true;
        }
Exemplo n.º 8
0
        private void Tv_devolped_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            AlertDialog alerta = new AlertDialog.Builder(this).Create();

            alerta.SetTitle("Information");
            // alerta.SetIcon(Resource.Drawable.gato);
            alerta.SetMessage("JS CODE VERSION: " + GetCodeVersion() + " GUI VERSION: 0.87 -B COMPATIBLE ");

            alerta.SetButton2("ok", (a, b) =>
            {
                ;
            });
            alerta.Show();
        }
Exemplo n.º 9
0
        private void textTowersFoundsCountLongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            HashSet <int> towers = Settings.GetValidCellTowerIDs(this);
            string        tooltip;

            if (towers.Any())
            {
                tooltip = "Found tower IDS: " + string.Join(", ", towers);
            }
            else
            {
                tooltip = "No towers found";
            }

            Toast.MakeText(this, tooltip, ToastLength.Long).Show();
        }
Exemplo n.º 10
0
        //дл¤ теста
        private void M_frame_bottom_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            AlertDialog.Builder alert = new AlertDialog.Builder(this);
            alert.SetTitle(Resource.String.question);

            alert.SetItems(new string[] { "broker_ok", "broker_fail" }, (senderAlert, args) =>
            {
                if (args.Which == 0)
                {
                    m_mqtt_broker = "test.mosca.io";
                }
                if (args.Which == 1)
                {
                    m_mqtt_broker = "test.mosca123.io";
                }
            });
            Dialog dialog = alert.Create();

            dialog.Show();
        }
Exemplo n.º 11
0
        void OnLongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            if (_longCommand == null)
            {
                e.Handled = false;
                return;
            }

            if (_longCommand == null)
            {
                return;
            }

            if (_isSoundEffect)
            {
                _audioManager?.PlaySoundEffect(SoundEffect.KeyClick);
            }

            _longCommand.Execute(_longCommandParameter ?? Element);

            e.Handled = true;
        }
Exemplo n.º 12
0
        // Button LongClick Event
        private void CLK_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            // 상태 전환
            studentCount = !studentCount;

            if (studentCount)               // 학생일 경우
            {
                intraNetUrl = strIntraNetUrl;
                extraNetUrl = strExtraNetUrl;

                FindViewById <TextView>(Resource.Id.statusInfo).Text = "# Logo를 길게 클릭하면 교사/교직원으로 변경됩니다.";
                FindViewById <TextView>(Resource.Id.status).Text     = "[학생]";
            }
            else                    // 교사/교직원인 경우
            {
                intraNetUrl = tcrIntraNetUrl;
                extraNetUrl = tcrExtraNetUrl;

                FindViewById <TextView>(Resource.Id.statusInfo).Text = "# Logo를 길게 클릭하면 학생으로 변경됩니다.";
                FindViewById <TextView>(Resource.Id.status).Text     = "[교사/교직원]";
            }
        }
Exemplo n.º 13
0
 /// <summary>
 /// Invoke the command if there is one
 /// </summary>
 /// <param name="sender">Sender.</param>
 /// <param name="e">E.</param>
 private void Control_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
 {
 }
Exemplo n.º 14
0
        private void RtvTest_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            MyDragShadowBuilder myShadow = new MyDragShadowBuilder(rtvTest);

            (sender as View).StartDrag(null, myShadow, null, 0);
        }
Exemplo n.º 15
0
 private void GenerateCode(object sender, Android.Views.View.LongClickEventArgs e)
 {
     lblCode.Text = __Secrets.UnlockCode();
     btnCodeGen.SetImageResource(Resource.Drawable.finger2);
 }
Exemplo n.º 16
0
        private void Control_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            var command = DCMS.Client.Effects.LongPressEffect.GetCommand(Element);

            command?.Execute(DCMS.Client.Effects.LongPressEffect.GetCommandParameter(Element));
        }
        private void Control_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
        {
            var command = PressedEffect.GetLongTapCommand(Element);

            command?.Execute(PressedEffect.GetLongParameter(Element));
        }
 void Control_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
 {
     BaseElement.OnLongPress();
     //UpdateBorderColor();
 }
 private void View_LongClick(object sender, Android.Views.View.LongClickEventArgs e)
 {
     OnLongTouchAction?.Invoke();
 }