protected override void OnStop()
 {
     base.OnStop();
     selectProjectToolbarButton.LayoutChange -= onSelectProjectToolbarButtonLayoutChanged;
     onboardingPopupWindow?.Dismiss();
     onboardingPopupWindow = null;
 }
示例#2
0
文件: Programs.cs 项目: szitus2/Locsi
 private void Cb_Click(object sender, EventArgs e)
 {
     if (popupWindow != null)
     {
         popupWindow.Dismiss();
     }
 }
 void mWindow_TouchIntercepted(object sender, View.TouchEventArgs e)
 {
     if (e.Event.Action == MotionEventActions.Outside)
     {
         mWindow.Dismiss();
     }
 }
示例#4
0
        public void Onclick(Android.Views.View v)
        {
            {
                LayoutInflater     inflater = (LayoutInflater)this.GetSystemService(Context.LayoutInflaterService);
                Android.Views.View popup    = inflater.Inflate(Resource.Drawable.PopupAlertTypeChoice, null);

#pragma warning disable CS0618 // Le type ou le membre est obsolète
                PopupWindow window = new PopupWindow(popup, ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent, true);
#pragma warning restore CS0618 // Le type ou le membre est obsolète

                popup.FindViewById <Button>(Resource.Id.alert_smsChoice).Click += (sender, e) =>
                {
                    App.Locator.ListAlert.GoToAlert(Enum.AlertDefinitionEnum.SMS);
                };

                popup.FindViewById <Button>(Resource.Id.alert_emailChoice).Click += (sender, e) =>
                {
                    window.Dismiss();
                    App.Locator.ListAlert.GoToAlert(Enum.AlertDefinitionEnum.Email);
                };

                popup.FindViewById <Button>(Resource.Id.alert_vocalCallChoice).Click += (sender, e) =>
                {
                    window.Dismiss();
                    App.Locator.ListAlert.GoToAlert(Enum.AlertDefinitionEnum.VocalCall);
                };

                popup.FindViewById <RelativeLayout>(Resource.Id.mainLayout).Click += (sender, e) =>
                {
                    window.Dismiss();
                };

                window.ShowAtLocation(popup, GravityFlags.Center, 0, 100);
            }
        }
示例#5
0
        private void Confirm_Click(object sender, EventArgs e)
        {
            if (_activityText != null)
            {
                if (!string.IsNullOrEmpty(_activityText.Text.Trim()))
                {
                    ActivityText = _activityText.Text.Trim();
                }
                else
                {
                    Toast.MakeText(_activity, Resource.String.PopupConfirmNoSelectionToast, ToastLength.Short).Show();
                    return;
                }
                if (_achievement != null)
                {
                    ActivityAchievement = _achievement.Progress;
                }
                if (_intimacy != null)
                {
                    ActivityIntimacy = _intimacy.Progress;
                }
                if (_pleasure != null)
                {
                    ActivityPleasure = _pleasure.Progress;
                }

                Cancelled = false;

                _popupWindow.Dismiss();
            }
        }
 public void Dismiss()
 {
     if (popup != null)
     {
         popup.Dismiss();
     }
 }
        public void OnClick(View v)
        {
            ImageButton flashButton = owner.FlashButton;

            switch (v.Id)
            {
            case Resource.Id.off:
                owner.FlashMode = owner.Flash_off;
                flashButton.SetBackgroundResource(Resource.Drawable.flash_off);
                flashMenuPopUp.Dismiss();
                break;

            case Resource.Id.on:
                owner.FlashMode = owner.Flash_on;
                flashButton.SetBackgroundResource(Resource.Drawable.flash_on);
                flashMenuPopUp.Dismiss();
                break;

            case Resource.Id.auto:
                owner.FlashMode = owner.Flash_auto;
                flashButton.SetBackgroundResource(Resource.Drawable.flash_auto);
                flashMenuPopUp.Dismiss();
                break;
            }
        }
        private void Adapter_QuantitySelected(object sender, Events.QuantitySelectedEventArgs e)
        {
            currentQuantity   = e.Position + 1;
            quantityText.Text = (e.Position + 1).ToString();

            popupWindow.Dismiss();
            popupWindow = null;
        }
 public override void OnStop()
 {
     base.OnStop();
     playButtonTooltipPopupWindow?.Dismiss();
     stopButtonTooltipPopupWindow?.Dismiss();
     tapToEditPopup?.Dismiss();
     playButtonTooltipPopupWindow = null;
     stopButtonTooltipPopupWindow = null;
     tapToEditPopup = null;
 }
示例#10
0
 void HandleTouchIntercepted(object sender, View.TouchEventArgs e)
 {
     if (e.Event.Action == MotionEventActions.Outside)
     {
         _window.Dismiss();
         e.Handled = true;
     }
     else
     {
         e.Handled = false;
     }
 }
示例#11
0
        //Query Huawei Health authorization result.
        private async void QueryHealthAuthorization()
        {
            Log.Debug(TAG, "Begin to QueryHealthAuthorization");
            // 1. Build a PopupWindow as progress dialog for time-consuming operation
            popupWindow = InitPopupWindow();

            // 2. Calling SettingController to query HUAWEI Health authorization status.
            // This method is asynchronous.
            var QueryTask = MySettingController.GetHealthAppAuthorizationAsync();

            try
            {
                await QueryTask;

                if (QueryTask.IsCompleted)
                {
                    if (QueryTask.Exception == null)
                    {
                        popupWindow.Dismiss();

                        Log.Info(TAG, "QueryHealthAuthorization result is" + QueryTask.Result);

                        // Show authorization result in view.
                        if (QueryTask.Result)
                        {
                            BuildSuccessView();
                        }
                        else
                        {
                            BuildFailView(null);
                        }
                    }
                    else
                    {
                        popupWindow.Dismiss();

                        // The method has encountered an exception. Show exception tips in the View.
                        Log.Info(TAG, "QueryHealthAuthorization has exception");
                        BuildFailView(QueryTask.Exception.Message);
                    }
                }
            }
            catch (System.Exception ex)
            {
                popupWindow.Dismiss();

                Log.Info(TAG, "QueryHealthAuthorization has exception");
                BuildFailView(ex.Message);
            }
        }
示例#12
0
 public void DismissToolTip()
 {
     if (tipWindow != null && tipWindow.IsShowing)
     {
         tipWindow.Dismiss();
     }
 }
        public void showMatchingTitlesPopup(RelativeLayout rootLayout, List <BoardGameSelectPopup> boardGamesList)
        {
            LayoutInflater inflater  = (LayoutInflater)GetSystemService(Context.LayoutInflaterService);
            View           popupView = inflater.Inflate(Resource.Layout.popup_select_board_game_from_list, null);

            ListView selectBoardGamesListView = popupView.FindViewById <ListView>(Resource.Id.listView);
            PopupSelectBoardGameAdapter popupSelectBoardGameAdapter = new PopupSelectBoardGameAdapter(Application.Context, boardGamesList);

            selectBoardGamesListView.Adapter = popupSelectBoardGameAdapter;

            PopupWindow selectBoardGamePopup = new PopupWindow(popupView, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, true);

            selectBoardGamePopup.ShowAtLocation(rootLayout, GravityFlags.Center, 0, 0);

            Button okButton = popupView.FindViewById <Button>(Resource.Id.ok);

            okButton.Click += delegate(object sender, EventArgs e) { boardGameMatchingTitlesPPopupOkButtonClick(selectBoardGamePopup, selectBoardGamesListView); };

            Button cancelButton = popupView.FindViewById <Button>(Resource.Id.cancel);

            cancelButton.Click += (sender, args) =>
            {
                selectBoardGamePopup.Dismiss();
            };

            selectBoardGamesListView.ItemClick += delegate(object sender, AdapterView.ItemClickEventArgs ItemClickEventArgs) { onPopupListViewItemClick(sender, ItemClickEventArgs, selectBoardGamesListView); };
        }
示例#14
0
        private void updateSwipeLeftOnboardingStep(MainLogCellViewHolder lastTimeEntry)
        {
            swipeLeftPopup?.Dismiss();

            if (lastTimeEntry == null)
            {
                return;
            }

            if (swipeLeftOnboardingStepDisposable != null)
            {
                swipeLeftOnboardingStepDisposable.Dispose();
                swipeLeftOnboardingStepDisposable = null;
            }

            swipeLeftOnboardingStepDisposable = swipeLeftOnboardingStep
                                                .ManageVisibilityOf(
                visibilityChanged,
                swipeLeftPopup,
                lastTimeEntry.ItemView,
                (window, view) => window.BottomRightOffsetsTo(view, -16, -4));

            if (swipeLeftOnboardingAnimationStepDisposable != null)
            {
                swipeLeftOnboardingAnimationStepDisposable.Dispose();
                swipeLeftOnboardingAnimationStepDisposable = null;
            }

            swipeLeftOnboardingAnimationStepDisposable = swipeLeftOnboardingStep
                                                         .ManageSwipeActionAnimationOf(mainRecyclerView, lastTimeEntry, AnimationSide.Left);
        }
 void badgeInactiveBackgroundButton_Click(object sender, EventArgs e)
 {
     if (_badgePopupWindow.IsShowing)
     {
         _badgePopupWindow.Dismiss();
     }
 }
示例#16
0
 public void Hide()
 {
     if (_popup.IsShowing)
     {
         _popup.Dismiss();
     }
 }
示例#17
0
        public static IDisposable ManageVisibilityOf(
            this IOnboardingStep step,
            IObservable <bool> componentIsVisible,
            PopupWindow tooltip,
            View anchor,
            Func <PopupWindow, View, PopupOffsets> popupOffsetsGenerator)
        {
            Ensure.Argument.IsNotNull(anchor, nameof(anchor));

            void toggleVisibilityOnMainThread(bool shouldBeVisible)
            {
                if (shouldBeVisible)
                {
                    showPopupTooltip(tooltip, anchor, popupOffsetsGenerator);
                }
                else
                {
                    tooltip?.Dismiss();
                }
            }

            return(step.ShouldBeVisible
                   .CombineLatest(componentIsVisible, CommonFunctions.And)
                   .ObserveOn(AndroidDependencyContainer.Instance.SchedulerProvider.MainScheduler)
                   .combineWithWindowTokenAvailabilityFrom(anchor)
                   .Subscribe(toggleVisibilityOnMainThread));
        }
        public void boardGameCategoryPopupButtonClick(String selectedCategory, PopupWindow popupView)
        {
            RadioButton categoryRadioButton = FindViewById <RadioButton>(Resource.Id.categoryButton);

            categoryRadioButton.Text = selectedCategory;
            popupView.Dismiss();
        }
        private void updateSwipeRightOnboardingStep(MainLogCellViewHolder lastTimeEntry)
        {
            swipeRightPopup?.Dismiss();

            if (lastTimeEntry == null)
            {
                return;
            }

            if (swipeRightOnboardingStepDisposable != null)
            {
                swipeRightOnboardingStepDisposable.Dispose();
                swipeRightOnboardingStepDisposable = null;
            }

            swipeRightOnboardingStepDisposable = swipeRightOnboardingStep
                                                 .ManageVisibilityOf(
                swipeRightPopup,
                lastTimeEntry.ItemView,
                (window, view) => PopupOffsets.FromDp(16, -4, this));

            if (swipeRightOnboardingAnimationStepDisposable != null)
            {
                swipeRightOnboardingAnimationStepDisposable.Dispose();
                swipeRightOnboardingAnimationStepDisposable = null;
            }

            swipeRightOnboardingAnimationStepDisposable = swipeRightOnboardingStep
                                                          .ManageSwipeActionAnimationOf(mainRecyclerView, lastTimeEntry, AnimationSide.Right);
        }
示例#20
0
        public void ShowCourse(View v)
        {
            if (courseList != null && courseList.Any())
            {
                if (popCourse == null)
                {
                    View                popViwe3  = LayoutInflater.Inflate(Resource.Layout.popup_select1, null);
                    ListView            listview3 = popViwe3.FindViewById <ListView>(Resource.Id.lv);
                    CourseSelectAdapter adaptera  = new CourseSelectAdapter(CurrActivity, courseList);
                    adaptera.SetSelectedValue(searchCourse);
                    listview3.Adapter = adaptera;

                    popCourse                  = new PopupWindow(popViwe3, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
                    popCourse.Touchable        = true;
                    popCourse.Focusable        = true;
                    popCourse.OutsideTouchable = true;;
                    popCourse.SetBackgroundDrawable(new BitmapDrawable());

                    popCourse.DismissEvent += (sender, e) =>
                    {
                        tv_course.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorPrimary)));
                        var arrowDown = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down);
                        arrowDown.SetBounds(0, 0, arrowDown.MinimumWidth, arrowDown.MinimumHeight);
                        tv_course.SetCompoundDrawables(null, null, arrowDown, null);
                    };

                    listview3.ItemClick += (sender, e) =>
                    {
                        searchCourse   = this.courseList[e.Position];
                        tv_course.Text = searchCourse;

                        popCourse.Dismiss();

                        adaptera.SetSelectedValue(searchCourse);
                        adaptera.NotifyDataSetChanged();

                        BindData();
                    };
                }
                if (!popCourse.IsShowing)
                {
                    tv_course.SetTextColor(new Color(ContextCompat.GetColor(CurrActivity, Resource.Color.textColorHigh)));
                    var arrowDownOn = AppUtils.GetDrawable(CurrActivity, Resource.Drawable.arrow_down_on);
                    arrowDownOn.SetBounds(0, 0, arrowDownOn.MinimumWidth, arrowDownOn.MinimumHeight);
                    tv_course.SetCompoundDrawables(null, null, arrowDownOn, null);

                    if ((int)(Build.VERSION.SdkInt) >= 24)
                    {
                        int[] a = new int[2];
                        v.GetLocationInWindow(a);
                        popCourse.ShowAtLocation(Window.DecorView, GravityFlags.NoGravity, 0, a[1] + v.Height + AppUtils.dip2px(CurrActivity, 11));
                    }
                    else
                    {
                        popCourse.ShowAsDropDown(v, 0, AppUtils.dip2px(CurrActivity, 11));
                    }
                }
            }
        }
        private void Adapter_CustomerTypeSelected(object sender, Events.CustomerTypeSelectedEventArgs e)
        {
            currentOrder.CustomerType = e.Model.Id;
            customerTypeText.Text     = e.Model.Description;

            popupWindow.Dismiss();
            popupWindow = null;
        }
        private void ShowFilterPopUp()
        {
            PopupWindow window      = new PopupWindow(popUpFilterWindow, 1000, 500, true);
            Button      applyButton = popUpFilterWindow.FindViewById <Button>(Resource.Id.popupFilterApplyButton);

            applyButton.Click += (args0, arg1) => window.Dismiss();
            window.ShowAtLocation(popUpFilterWindow, GravityFlags.Center, 0, 0);
        }
示例#23
0
 void OnMenuItemClicked(object sender, EventArgs e)
 {
     mainMenu.Dismiss();
     if (menuItemClicked != null)
     {
         menuItemClicked.Invoke(((View)sender).Id);
     }
 }
示例#24
0
        PopupWindow CreateActionsPopup(Contact contactActions, AdapterView.ItemClickEventArgs e)
        {
            PopupWindow popup = new PopupWindow(Activity.CurrentFocus);

            popup.ContentView = popupView;
            popup.Focusable   = true;
            popup.Update();
            popup.OutsideTouchable = true;
            popup.SetBackgroundDrawable(new ColorDrawable(Color.LightGray));
            popup.AnimationStyle = Resource.Style.Animation_AppCompat_Dialog;
            popup.Width          = ViewGroup.LayoutParams.WrapContent;
            popup.Height         = ViewGroup.LayoutParams.WrapContent;
            ListView actionsListView = popupView.FindViewById <ListView>(Resource.Id.actionsListView);

            actionsListView.Adapter    = new AddressBookListAdapter(Activity, RequestContactData(contactActions));
            actionsListView.ItemClick += (sender, eArgs) =>
            {
                List <string> a = RequestContactData(contactActions);
                if (a[eArgs.Position].StartsWith("Call"))
                {
                    popup.Dismiss();
                    var callIntent = new Intent(Intent.ActionCall,
                                                Android.Net.Uri.Parse(string.Format("tel:{0}",
                                                                                    a[eArgs.Position].Substring(5).Trim(' ', '+', '-')))); //definitely not the best optimization concept, but still works
                    StartActivity(callIntent);
                }
                else
                {
                    PopupWindow mailPopup = new PopupWindow(Activity.CurrentFocus); //creating nested popup, if user choses sending email
                    mailPopup.ContentView = emailView;
                    mailPopup.Focusable   = true;
                    mailPopup.Update();
                    mailPopup.OutsideTouchable = true;
                    mailPopup.SetBackgroundDrawable(new ColorDrawable(Color.LightGray));
                    mailPopup.AnimationStyle = Resource.Style.Animation_AppCompat_Dialog;
                    mailPopup.Width          = ViewGroup.LayoutParams.WrapContent;
                    mailPopup.Height         = ViewGroup.LayoutParams.WrapContent;
                    EditText editTitle   = emailView.FindViewById <EditText>(Resource.Id.editMailTitle);
                    EditText editMessage = emailView.FindViewById <EditText>(Resource.Id.editMailMessage);
                    editTitle.Text   = string.Format("Hello, {0}", contactActions.Name); //template for title
                    editMessage.Text = string.Format("Dear {0}, ", contactActions.Name); // and message of email
                    Button buttonSend = emailView.FindViewById <Button>(Resource.Id.buttonSend);
                    buttonSend.Click += (_sender, _e) =>
                    {
                        var email = new Intent(Intent.ActionSend);
                        email.PutExtra(Intent.ExtraEmail, a[eArgs.Position]);
                        email.PutExtra(Intent.ExtraSubject, string.Format("Hello, {0}, ", contactActions.Name));
                        email.PutExtra(Intent.ExtraText, string.Format("Dear {0}, ", contactActions.Name));
                        email.SetType("message/rfc822");
                        StartActivity(email); //starting the mail app with given data
                    };
                    emailView.FindViewById <TextView>(Resource.Id.textViewMailHeader).Text = string.Format("Email to {0}", contactActions.Name);
                    mailPopup.ShowAtLocation(view, GravityFlags.Center, 0, 0);
                }
            };
            return(popup);
        }
 public bool OnTouch(View v, MotionEvent e)
 {
     if (e.Action == MotionEventActions.Outside)
     {
         window.Dismiss();
         return(true);
     }
     return(false);
 }
 private void CloseDriverInfoPopupWindow()
 {
     if (_driverInfoPopup != null)
     {
         _driverInfoPopup.Dismiss();
         _driverInfoPopup.Dispose();
         _driverInfoPopup     = null;
         _model.CheckedDriver = null;
     }
 }
示例#27
0
        void ListView_OnItemLongClick(object sender, AdapterView.ItemLongClickEventArgs e)
        {
            LocalBox clickedItem = foundLocalBoxes [e.Position];

            LayoutInflater inflater = (LayoutInflater)Activity.GetSystemService(Context.LayoutInflaterService);
            View           popupView;

            popupView = inflater.Inflate(Resource.Layout.custom_popup_root, null);

            PopupWindow popupWindow = new PopupWindow(popupView, e.View.Width, e.View.Height);

            //Hide popup window when clicking outside its view
            popupWindow.Focusable = true;
            popupWindow.Update();
            popupWindow.SetBackgroundDrawable(new BitmapDrawable());

            popupWindow.ShowAsDropDown(e.View, 0, -e.View.Height);

            ImageButton buttonDelete = (ImageButton)popupView.FindViewById(Resource.Id.button_popup_root_delete);

            buttonDelete.Click += delegate {
                popupWindow.Dismiss();

                var alertDialogConfirmDelete = new Android.App.AlertDialog.Builder(Activity);
                alertDialogConfirmDelete.SetTitle("Waarschuwing");
                alertDialogConfirmDelete.SetMessage("Weet u zeker dat u deze Pleiobox wilt verwijderen? \nDeze actie is niet terug te draaien.");

                alertDialogConfirmDelete.SetPositiveButton("Verwijderen", async delegate {
                    try{
                        DataLayer.Instance.DeleteLocalBox(clickedItem.Id);
                        ResetUIToBeginState(true);
                        UpdateLocalBoxes();

                        List <LocalBox> registeredLocalBoxes = await DataLayer.Instance.GetLocalBoxes();
                        if (registeredLocalBoxes.Count == 0)
                        {
                            HomeActivity homeActivity = (HomeActivity)Activity;
                            homeActivity.ShowLoginDialog();
                        }
                        //Reset logo
                        //imageViewLogo.SetImageResource (Resource.Drawable.beeldmerk_belastingdienst);
                    }catch (Exception ex) {
                        Insights.Report(ex);
                        Toast.MakeText(Android.App.Application.Context, "Het verwijderen van de Pleiobox is mislukt", ToastLength.Short).Show();
                    }
                });
                alertDialogConfirmDelete.SetNegativeButton("Annuleren", delegate {
                    alertDialogConfirmDelete.Dispose();
                });
                alertDialogConfirmDelete.Create().Show();
            };
        }
        private void InitPopupWindow()
        {
            LayoutInflater inflater = LayoutInflater.From(Activity);
            //var popView = inflater.inflate(R.layout.popupwindow_content, null);
            var popView = inflater.Inflate(Resource.Layout.GuardianPopupWindowLayout, null);

            var ll_bindGuardian  = popView.FindViewById <LinearLayout> (Resource.Id.ll_bindGuardian);
            var ll_applyGuardian = popView.FindViewById <LinearLayout> (Resource.Id.ll_ApplyGuardian);

            //guardianPopupWindow = new PopupWindow (popView,Android.Widget.LinearLayout.LayoutParams.WrapContent,Android.Widget.LinearLayout.LayoutParams.WrapContent);
            guardianPopupWindow = new PopupWindow(popView, 600, 290);
            var m = Resources.DisplayMetrics.Density;

            guardianPopupWindow.OutsideTouchable = true;
            guardianPopupWindow.Focusable        = true;
            guardianPopupWindow.SetBackgroundDrawable(new ColorDrawable());

            guardianPopupWindow.AnimationStyle = Resource.Style.AnimationPreview;

            guardianPopupWindow.ShowAsDropDown(ll_actionBar, -30, 1, GravityFlags.Right | GravityFlags.Top);

            guardianPopupWindow.DismissEvent += (sender, e) =>
            {
                BackgroundAlpha(1f);
            };

            ll_bindGuardian.Click += (sender, e) =>
            {
                //绑定监护人
                guardianPopupWindow.Dismiss();
                Activity.StartActivity(typeof(BindGuardianActivity));
            };
            ll_applyGuardian.Click += (sender, e) =>
            {
                //监护人申请
                guardianPopupWindow.Dismiss();
                Activity.StartActivity(typeof(GuardianApplyActivity));
            };
        }
        private void ClosePedestrianInfoPopupWindow(PedestrianRequestModel request)
        {
            if (!_pedestrianInfoPopups.ContainsKey(request))
            {
                return;
            }
            PopupWindow pedestrianInfoPopup = _pedestrianInfoPopups[request];

            UnhookModelFromDetailsPopupWindow(pedestrianInfoPopup, request);
            _pedestrianInfoPopups.Remove(request);
            pedestrianInfoPopup.Dismiss();
            pedestrianInfoPopup.Dispose();
        }
示例#30
0
        public static void DismissByTapping(this IDismissable step, PopupWindow popupWindow, Action cleanup = null)
        {
            Ensure.Argument.IsNotNull(popupWindow, nameof(popupWindow));

            void OnDismiss(object sender, EventArgs args)
            {
                popupWindow.Dismiss();
                step.Dismiss();
                cleanup();
            }

            popupWindow.ContentView.Click += OnDismiss;
        }