protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            var fragmentTransaction = SupportFragmentManager.BeginTransaction();

            CurrentHostFragment = HostFragment.NewInstance(new PreSearchFragment(true));
            CurrentHostFragment.UserVisibleHint = true;
            fragmentTransaction.Add(Android.Resource.Id.Content, CurrentHostFragment);
            fragmentTransaction.Commit();
        }
Beispiel #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            RequestWindowFeature(WindowFeatures.NoTitle);
            Window.SetFlags(WindowManagerFlags.Fullscreen, WindowManagerFlags.Fullscreen);
            Window.AddFlags(WindowManagerFlags.KeepScreenOn);
            base.OnCreate(savedInstanceState);

            var fragmentTransaction = SupportFragmentManager.BeginTransaction();

            CurrentHostFragment = HostFragment.NewInstance(new OldCameraFragment());
            fragmentTransaction.Add(Android.Resource.Id.Content, CurrentHostFragment);
            fragmentTransaction.Commit();
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            AppDomain.CurrentDomain.UnhandledException  -= OnCurrentDomainOnUnhandledException;
            TaskScheduler.UnobservedTaskException       -= OnTaskSchedulerOnUnobservedTaskException;
            AndroidEnvironment.UnhandledExceptionRaiser -= OnUnhandledExceptionRaiser;

            AppDomain.CurrentDomain.UnhandledException  += OnCurrentDomainOnUnhandledException;
            TaskScheduler.UnobservedTaskException       += OnTaskSchedulerOnUnobservedTaskException;
            AndroidEnvironment.UnhandledExceptionRaiser += OnUnhandledExceptionRaiser;

            GAService.Instance.InitializeGAService(this);
            InitPushes();

            switch (Intent.Action)
            {
            case Intent.ActionSend:
            {
                if (AppSettings.User.IsAuthenticated)
                {
                    var uri = (Android.Net.Uri)Intent.GetParcelableExtra(Intent.ExtraStream);
                    var fragmentTransaction = SupportFragmentManager.BeginTransaction();
                    var galleryModel        = new GalleryMediaModel
                    {
                        Path = BitmapUtils.GetUriRealPath(this, uri)
                    };
                    CurrentHostFragment = HostFragment.NewInstance(new PostCreateFragment(galleryModel));
                    fragmentTransaction.Add(Android.Resource.Id.Content, CurrentHostFragment);
                    fragmentTransaction.Commit();
                }
                else
                {
                    StartActivity(typeof(PreSignInActivity));
                }
                return;
            }

            case Intent.ActionView:
            {
                var intent = new Intent(this, AppSettings.User.IsAuthenticated ? typeof(RootActivity) : typeof(GuestActivity));
                intent.PutExtra(AppLinkingExtra, Intent?.Data?.Path);
                StartActivity(intent);
                return;
            }
            }
            StartActivity(AppSettings.User.IsAuthenticated ? typeof(RootActivity) : typeof(GuestActivity));
        }
Beispiel #4
0
        private void InitializeTabs()
        {
            var isFirstLoad = !BasePresenter.User.UserInfo.Navigation.TabSettings.Any();

            for (var i = 0; i < TabIconsInactive.Length; i++)
            {
                HostFragment frag;
                switch (i)
                {
                case 0:
                    frag = HostFragment.NewInstance(new FeedFragment());
                    break;

                case 1:
                    if (isFirstLoad)
                    {
                        BasePresenter.User.SetTabSettings(nameof(FeedFragment), new TabSettings());
                    }
                    frag = HostFragment.NewInstance(new PreSearchFragment());
                    break;

                case 2:
                    frag = new HostFragment();
                    break;

                case 3:
                    if (isFirstLoad)
                    {
                        BasePresenter.User.SetTabSettings(nameof(ProfileFragment), new TabSettings());
                        BasePresenter.User.SetTabSettings($"User_{nameof(ProfileFragment)}", new TabSettings {
                            IsGridView = true
                        });
                    }
                    frag = HostFragment.NewInstance(new ProfileFragment(BasePresenter.User.Login));
                    break;

                default:
                    frag = null;
                    break;
                }
                if (frag != null)
                {
                    _tabs.Add(frag);
                }
            }
        }