예제 #1
0
 void OnLongClick(object sender, View.LongClickEventArgs args, int position)
 {
     mActionMode             = new MyActionMode(mActivity, this, position);
     mode                    = mActivity.StartActionMode(mActionMode);
     ((View)sender).Selected = true;
     return;
 }
예제 #2
0
 //record voices ( Permissions is 102 )
 private void BtnVoiceOnLongClick(object sender, View.LongClickEventArgs e)
 {
     try
     {
         if ((int)Build.VERSION.SdkInt < 23)
         {
             StartRecording();
         }
         else
         {
             //Check to see if any permission in our group is available, if one, then all are
             if (Activity.CheckSelfPermission(Manifest.Permission.RecordAudio) == Permission.Granted)
             {
                 StartRecording();
             }
             else
             {
                 new PermissionsController(Activity).RequestPermission(102);
             }
         }
     }
     catch (Exception exception)
     {
         Methods.DisplayReportResultTrack(exception);
     }
 }
        private void ImageView_LongClick(object sender, View.LongClickEventArgs e)
        {
            var intent = new Intent(Context, typeof(ScaleImageActivity));

            intent.PutExtra("image_resourceId", imageResourceId);
            StartActivity(intent);
        }
예제 #4
0
        public void ListView_ItemLongClick(object sender, View.LongClickEventArgs longClickEventArgs)
        {
            var senderView = ((View)sender);
            var position   = (int)senderView.GetTag(_TAG_INDEX);

            _dialogAdapter.ListView_ItemLongClick(sender, new AdapterView.ItemLongClickEventArgs(false, null, senderView, position, senderView.Id));
        }
예제 #5
0
        } //OnCreate

        private void StartButton_LongClick(object sender, View.LongClickEventArgs e)
        {
            if (startButton.Text == "Start Trip")
            {
                startlat    = lat;
                startlng    = lng;
                startLatLng = new LatLng(startlat, startlng);

                tripDurationStart = DateTime.Now.TimeOfDay;
                startTime         = DateTime.Now.ToString("HH:mm");
                startDate         = DateTime.Now.ToString("dd-MMM-yyy");
                stopTimeThen      = TimeSpan.Zero;
                tripOnScreen      = true;
                tripstarted       = true;

                startMarker = new MarkerOptions()
                              .SetPosition(startLatLng)
                              .SetTitle("Trip Start")
                              .SetIcon(BitmapDescriptorFactory.DefaultMarker(BitmapDescriptorFactory.HueGreen));

                nMap.AddMarker(startMarker);
                startButton.Enabled = false;

                SetInvisibleMarker();
            }
        }//StartButton_LongClick()
예제 #6
0
        private void View_LongClick(object sender, View.LongClickEventArgs e)
        {
            var builder = new AlertDialog.Builder(Utilities.MainActivityContext, Resource.Style.LightDialogTheme);

            builder.SetTitle("آیتم حذف شود؟");
            var id = int.Parse((string)elementRoot.Tag);

            var table = DataAccessLayer.Data.GetTable();

            var item = table.Where(x => x.ID == id).SingleOrDefault();

            builder.SetPositiveButton("حذف", (obj, args) =>
            {
                var connection = DataAccessLayer.Data.GetConnection();
                connection.Delete(item);
                if (Utilities.MainActivity != null)
                {
                    Utilities.MainActivity.ItemAdapter.NotifyDataSetChanged();
                }
            });
            builder.SetNegativeButton("بیخیال", (obj, args) =>
            {
            });

            builder.Create().Show();
        }
예제 #7
0
 private void Txt1_LongClick(object sender, View.LongClickEventArgs e)
 {
     if (lektorON)
     {
         lektor.say_(txt1.Text.ToString());
     }
 }
예제 #8
0
#pragma warning disable CS0618
        private void rowLongClick(object sender, View.LongClickEventArgs e)
        {
            ClipData data = ClipData.NewPlainText("", "");

            View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(((View)sender));
            ((View)sender).StartDrag(data, shadowBuilder, (View)sender, 0);
        }
예제 #9
0
        private void AchievementList_LongClick(object sender, View.LongClickEventArgs e)
        {
            try
            {
                if (_selectedItemIndex == -1 && GlobalData.AchievementChartItems.Count > 0)
                {
                    Toast.MakeText(this, Resource.String.AchievementChartActivitySelectNoEdit, ToastLength.Short).Show();
                    return;
                }
                if (GlobalData.AchievementChartItems.Count == 0)
                {
                    Toast.MakeText(this, Resource.String.AchievementChartActivityEditNoItems, ToastLength.Short).Show();
                    return;
                }

                int achievementID = GlobalData.AchievementChartItems[_selectedItemIndex].AchievementId;
                AchievementChartDialogFragment chartFragment = new AchievementChartDialogFragment(this, "Enter an Achievement", achievementID);
                var transaction = FragmentManager.BeginTransaction();
                chartFragment.Show(transaction, chartFragment.Tag);
            }
            catch (Exception ex)
            {
                Log.Error(TAG, "AchievementList_LongClick: Exception - " + ex.Message);
                if (GlobalData.ShowErrorDialog)
                {
                    ErrorDisplay.ShowErrorAlert(this, ex, GetString(Resource.String.ErrorCreatingAchievementChartFragment), "AchievementChartActivity.AchievementList_LongClick");
                }
            }
        }
예제 #10
0
 //record voices ( Permissions is 102 )
 private void BtnVoiceOnLongClick(object sender, View.LongClickEventArgs e)
 {
     try
     {
         if ((int)Build.VERSION.SdkInt < 23)
         {
             StartRecording();
         }
         else
         {
             //Check to see if any permission in our group is available, if one, then all are
             if (CheckSelfPermission(Manifest.Permission.RecordAudio) == Permission.Granted)
             {
                 StartRecording();
             }
             else
             {
                 new PermissionsController(this).RequestPermission(102);
             }
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
 private void OwnPictureOnLongClick(object sender, View.LongClickEventArgs e)
 {
     if (ownPictureView.IsImageSet)
     {
         Presenter.OnUserSelectPictureRequest();
     }
 }
예제 #12
0
        private static void ViewOnLongClick(object sender, View.LongClickEventArgs longClickEventArgs)
        {
            var view    = (View)sender;
            var context = view.Context;

            var name = view.FindViewById <TextView>(Resource.Id.NameText);
            var id   = view.FindViewById <TextView>(Resource.Id.IdText);

            var builder = new AlertDialog.Builder(context);

            builder.SetTitle("Alert !");
            builder.SetMessage($"Are you sure to kill the {name.Text} processus ?");
            builder.SetNegativeButton("No", (o, args) => { });
            builder.SetPositiveButton("Yes", (o, args) =>
            {
                Toast t;
                try
                {
                    ProcessusManager.StopProcessus(int.Parse(id.Text));
                    t = Toast.MakeText(context, "You killed the process !", ToastLength.Long);
                }
                catch (Exception)
                {
                    t = Toast.MakeText(context, "Failed to kill the process !", ToastLength.Long);
                }
                t.Show();
            });

            builder.Show();
        }
예제 #13
0
        void _list_LongClick(object sender, View.LongClickEventArgs e)
        {
            //var list = sender as ListView;
            //Data.Remove(keys[e.]);
            //Settings.DataList = parent.Data;

            //parent.Inits();
        }
 private void Weatherandclockcontainer_LongClick(object sender, View.LongClickEventArgs e)
 {
     using (var fragmentTransaction = FragmentManager.BeginTransaction())
     {
         fragmentTransaction.Replace(Resource.Id.weatherandcLockplaceholder, weatherFragment);
         fragmentTransaction.Commit();
     }
 }
예제 #15
0
        private void IV_LongClick(object sender, View.LongClickEventArgs e)
        {
            var    intent = new Intent(this, typeof(Image));
            String uri    = lines[((ImageView)sender).Id].Remove(0, 3);

            intent.PutExtra("img", path + uri);
            StartActivity(intent);
        }
예제 #16
0
        private void FinishWildMagic(object sender, View.LongClickEventArgs e)
        {
            var button = sender as ImageButton;

            button.Visibility = ViewStates.Invisible;
            button.Click     -= WildMagic;
            button.LongClick -= FinishWildMagic;
        }
예제 #17
0
        void Button1_LongClick(object sender, View.LongClickEventArgs e)
        {
            // Generate clip data package to attach it to the drag
            var data = ClipData.NewPlainText("name", "Element 1");

            // Start dragging and pass data
            ((sender) as Button).StartDrag(data, new View.DragShadowBuilder(((sender) as Button)), null, 0);
        }
예제 #18
0
        protected void RowLongClick(object sender, View.LongClickEventArgs longClickEventArgs)
        {
            var senderView = sender as View;
            var position   = (int)senderView.GetTag(Resource.Id.Object_Position);
            var viewModel  = Items[position];

            LongClickAction?.Invoke(viewModel, position);
        }
예제 #19
0
        void rowView_HandleLongClick(object sender, View.LongClickEventArgs e)
        {
            View   rowView  = sender as View;
            int    position = ((ViewHolder)rowView.Tag).position;
            string question = string.Format(context.Resources.GetText(Resource.String.delete_detail_question), dataSource[position].ItemDesc);

            new DialogDeleteDetail(question, position, this).Show(context.SupportFragmentManager, "dialog");
        }
예제 #20
0
        private void TV_LongClick(object sender, View.LongClickEventArgs e)
        {
            String           str         = ((TextView)sender).Text;
            ClipboardManager myClipboard = (ClipboardManager)GetSystemService(ClipboardService);
            ClipData         myClip      = ClipData.NewPlainText("text", str);

            myClipboard.PrimaryClip = myClip;
            Toast.MakeText(Application.Context, "Текст скопирован", ToastLength.Short).Show();
        }
예제 #21
0
        private void OnContactUsLongClicked(object sender, View.LongClickEventArgs e)
        {
            Android.Content.ClipboardManager clipboard = (Android.Content.ClipboardManager)GetSystemService(ClipboardService);
            ClipData clip = ClipData.NewPlainText("label", "*****@*****.**");

            clipboard.PrimaryClip = clip;

            Toast.MakeText(this, Resources.GetString(Resource.String.EmailCopiedLabel), ToastLength.Short).Show();
        }
        /// <summary>Allows dragging on long click.</summary>
        void PieceLongClick(object sender, View.LongClickEventArgs e)
        {
            // Generate clip data package to attach it to the drag
            View v    = (View)sender;
            var  data = ClipData.NewPlainText("pos", Resources.GetResourceEntryName(v.Id));

            // Start dragging and pass data
            ((sender) as ImageView).StartDrag(data, new View.DragShadowBuilder(((sender) as ImageView)), null, 0);
        }
        private void ModeButtonLongClicked
        (
            object sender,
            View.LongClickEventArgs arguments
        )
        {
            ShowModeButtonHint(sender);

            arguments.Handled = true;
        }
예제 #24
0
 private void MusicImage_LongClick(object sender, View.LongClickEventArgs e)
 {
     if (_selectedTrackIndex != -1)
     {
         Intent intent = new Intent(this, typeof(MusicPlayListTracksActivity));
         intent.PutExtra("playListID", _playListID);
         intent.PutExtra("selectedIndex", _selectedTrackIndex);
         StartActivity(intent);
     }
 }
예제 #25
0
        protected void ButtonLongClick(object sender, View.LongClickEventArgs longClickEventArgs)
        {
            var senderView = sender as View;
            var position   = (int)senderView.GetTag(Resource.Id.Object_Position);
            var viewModel  = Items[position];

            senderView.Enabled = false;

            ButtonLongClickAction?.Invoke(viewModel, position, () => senderView.Enabled = true);
        }
 private void ItemView_LongClick(object sender, View.LongClickEventArgs e)
 {
     if (OptionsLayout.Visibility != ViewStates.Gone)
     {
         OptionsLayout.Visibility = ViewStates.Gone;
     }
     else
     {
         OptionsLayout.Visibility = ViewStates.Visible;
     }
 }
예제 #27
0
 private void MusicPlayerContainer_LongClick(object sender, View.LongClickEventArgs e)
 {
     if (skbSeekSongTime.Visibility == ViewStates.Gone || skbSeekSongTime.Visibility == ViewStates.Invisible)
     {
         skbSeekSongTime.Visibility = ViewStates.Visible;
     }
     else
     {
         skbSeekSongTime.Visibility = ViewStates.Gone;
     }
 }
        void OnDeleteImageButtonLongClick(object sender, View.LongClickEventArgs e)
        {
            if (!enabled)
            {
                return;
            }

            newDuration   = Duration.Zero;
            digitsEntered = 0;
            Rebind();
        }
 //Copy
 private void TxtLinkOnLongClick(object sender, View.LongClickEventArgs e)
 {
     try
     {
         Methods.CopyToClipboard(this, TxtLink.Text);
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
 //Copy
 private void TxtLinkOnLongClick(object sender, View.LongClickEventArgs e)
 {
     try
     {
         Methods.CopyToClipboard(this, TxtLink.Text);
     }
     catch (Exception exception)
     {
         Methods.DisplayReportResultTrack(exception);
     }
 }