示例#1
0
        internal Platform(Context context, bool embedded = false)
        {
            _embedded = embedded;
            _context  = context;

            if (!embedded)
            {
                _defaultActionBarTitleTextColor = SetDefaultActionBarTitleTextColor();
            }

            _renderer = new PlatformRenderer(context, this);

            if (embedded)
            {
                // Set up handling of DisplayAlert/DisplayActionSheet/UpdateProgressBarVisibility
                var activity = context as Activity;
                if (activity == null)
                {
                    // Can't show dialogs if it's not an activity
                    return;
                }

                PopupManager.Subscribe(activity);
                return;
            }

            FormsApplicationActivity.BackPressed += HandleBackPressed;

            _toolbarTracker.CollectionChanged += ToolbarTrackerOnCollectionChanged;
        }
示例#2
0
        internal Platform(Context context)
        {
            _context = context;

            _defaultActionBarTitleTextColor = SetDefaultActionBarTitleTextColor();

            _renderer = new PlatformRenderer(context, this);

            FormsApplicationActivity.BackPressed += HandleBackPressed;

            _toolbarTracker.CollectionChanged += ToolbarTrackerOnCollectionChanged;
        }