Ejemplo n.º 1
0
        public Point GetPoint()
        {
            ITarget target = null;

            SetUp();

            switch (mType)
            {
            case Type.SPINNER:
                target = new ViewTarget(mActionBarWrapper.GetSpinnerView());
                break;

            case Type.HOME:
                target = new ViewTarget(mReflector.GetHomeButton());
                break;

            case Type.OVERFLOW:
                target = new ViewTarget(mActionBarWrapper.GetOverflowView());
                break;

            case Type.TITLE:
                target = new ViewTarget(mActionBarWrapper.GetTitleView());
                break;
            }

            return(target == null ? null : target.GetPoint());
        }
Ejemplo n.º 2
0
        public void SetShowcaseItem(int itemType, int actionItemId, Activity activity)
        {
            Post(() =>
            {
                var reflector = BaseReflector.GetReflectorForActivity(activity);
                IViewParent p = reflector.GetActionBarView(); //ActionBarView
                var wrapper   = new ActionBarViewWrapper((View)p);

                switch (itemType)
                {
                case ITEMACTIONHOME:
                    SetShowcaseView(reflector.GetHomeButton());
                    break;

                case ITEMSPINNER:
                    SetShowcaseView(wrapper.GetSpinnerView());
                    break;

                case ITEMTITLE:
                    SetShowcaseView(wrapper.GetTitleView());
                    break;

                case ITEMACTIONITEM:
                    SetShowcaseView(wrapper.GetActionItem(actionItemId));
                    break;

                case ITEMACTIONOVERFLOW:
                    View overflow = wrapper.GetOverflowView();

                    // This check essentially checks if we are on a device with a legacy menu key
                    if (overflow != null)
                    {
                        SetShowcaseView(wrapper.GetOverflowView());
                    }
                    else
                    {
                        SetShowcasePosition(GetLegacyOverflowPoint());
                    }
                    break;

                default:
                    Log.Error("TAG", "Unknown item type");
                    break;
                }
            });
        }