Example #1
0
        private void ShowDialogWithSuggestionToConfigureApplication()
        {
            CustomAlertDialog dialog = new CustomAlertDialog(this)
                                       .SetPositiveButton(Resource.String.configureActionTitle, StartPreferencesActivity)
                                       .SetMessage(Resource.String.configureApplicationMessage, false)
                                       .SetCancelable(false);

            dialog.Show();

            FeatureDiscoveryState state = _application.Preferences.FeatureDiscoveryState;

            if (!state.HasFlag(FeatureDiscoveryState.ApplicationSettings))
            {
                TapTargetViewListener listener = new TapTargetViewListener();
                listener.Clicked += () => _application.Preferences.SetFeatureDiscoveryState(
                    state | FeatureDiscoveryState.ApplicationSettings
                    );

                Button    positiveButton = dialog.GetButton(DialogButtonType.Positive);
                TapTarget settingsTarget = TapTarget.ForView(
                    positiveButton,
                    Resources.GetString(Resource.String.applicationSettingsFeatureDiscoveryTitle),
                    Resources.GetString(Resource.String.applicationSettingsFeatureDiscoveryMessage)
                    )
                                           .Stylize();

                TapTargetView.ShowFor(dialog, settingsTarget, listener);
            }
        }
Example #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById <Button>(Resource.Id.MyButton);

            button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };


            var target = TapTarget.ForView(button, "Test", "Description");

            TapTargetView.ShowFor(this, target);
        }
Example #3
0
        public void OnGlobalLayout()
        {
            _toolbar.ViewTreeObserver.RemoveOnGlobalLayoutListener(this);

            Display display = WindowManager.DefaultDisplay;
            Rect    bounds  = new Rect(0, 0, display.Width, display.Height / 4);

            TapTargetView.ShowFor(this,
                                  TapTarget.ForToolbarMenuItem(_toolbar, Resource.Id.menu_search, "Title", "Description")
                                  .OuterCircleColor(Resource.Color.blue)      // Specify a color for the outer circle
                                  .OuterCircleAlpha(.94f)
                                  .TargetCircleColor(Resource.Color.inner_blue)
                                  .TitleTextSize(20)                                                         // Specify the size (in sp) of the title text
                                  .DescriptionTextSize(10)                                                   // Specify the size (in sp) of the description text
                                  .TextColor(Resource.Color.white)                                           // Specify a color for both the title and description text
                                  .DrawShadow(true)                                                          // Whether to draw a drop shadow or not
                                  .Icon(ContextCompat.GetDrawable(this, Resource.Drawable.ic_action_search)) // Whether tapping outside the outer circle dismisses the view
                                  .TransparentTarget(false)                                                  // Specify whether the target is transparent (displays the content underneath)
                                  .TargetRadius(60));
        }
 public override void OnTargetClick(TapTargetView view)
 {
     base.OnTargetClick(view);
     Clicked?.Invoke();
 }