Esempio n. 1
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;
                }
            });
        }