示例#1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_banner_programmatic);

            adStatusTextView = FindViewById <TextView>(Resource.Id.status_label);

            adView = new AppLovinAdView(AppLovinAdSize.Banner, "YOUR_ZONE_ID", this);

            adView.Id = ViewCompat.GenerateViewId();

            var loadButton = FindViewById <Button>(Resource.Id.load_button);

            loadButton.Click += LoadButton_Click;

            adView.SetAdLoadListener(this);
            adView.SetAdDisplayListener(this);
            adView.SetAdClickListener(this);
            adView.SetAdViewEventListener(this);

            // Add programmatically created banner into our container
            var bannerProgrammaticContentLayout = FindViewById <ConstraintLayout>(Resource.Id.banner_programmatic_layout);

            bannerProgrammaticContentLayout.AddView(adView, new ConstraintLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, AppLovinSdkUtils.DpToPx(this, 50)));

            var constraintSet = new ConstraintSet();

            constraintSet.Clone(bannerProgrammaticContentLayout);
            constraintSet.Connect(adView.Id, ConstraintSet.Bottom, Resource.Id.banner_programmatic_layout, ConstraintSet.Bottom, 0);
            constraintSet.ApplyTo(bannerProgrammaticContentLayout);

            // Load an ad!
            adView.LoadNextAd();
        }
示例#2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_mrec_programmatic);

            adStatusTextView = FindViewById <TextView>(Resource.Id.status_label);

            // Create MRec
            adView    = new AppLovinAdView(AppLovinAdSize.Mrec, this);
            adView.Id = ViewCompat.GenerateViewId();

            var mrecConstraintLayout = FindViewById <ConstraintLayout>(Resource.Id.mrec_programmatic_constraint_layout);
            var layoutParams         = new ConstraintLayout.LayoutParams(AppLovinSdkUtils.DpToPx(this, AppLovinAdSize.Mrec.Width), AppLovinSdkUtils.DpToPx(this, AppLovinAdSize.Mrec.Height));

            mrecConstraintLayout.AddView(adView, layoutParams);

            var set = new ConstraintSet();

            set.Clone(mrecConstraintLayout);
            set.Connect(adView.Id, ConstraintSet.Top, mrecConstraintLayout.Id, ConstraintSet.Top, AppLovinSdkUtils.DpToPx(this, 80));
            set.CenterHorizontally(adView.Id, mrecConstraintLayout.Id);
            set.ApplyTo(mrecConstraintLayout);

            var loadButton = FindViewById <Button>(Resource.Id.load_button);

            loadButton.Click += LoadButton_Click;

            adView.SetAdLoadListener(this);
            adView.SetAdDisplayListener(this);
            adView.SetAdClickListener(this);
            adView.SetAdViewEventListener(this);
        }
        private void InitLayout()
        {
            _constraintLayoutRoot = this.BindingInflate(LayoutId, null) as ConstraintLayout;

            ConstraintLayout.LayoutParams layoutParams = new ConstraintLayout.LayoutParams(ConstraintLayout.LayoutParams.MatchConstraint, ConstraintLayout.LayoutParams.MatchConstraint);
            _constraintLayoutRoot.LayoutParameters = layoutParams;

            BaseMainConstraintLayout.RemoveView(BaseScrollView);
            BaseScrollView.RemoveView(BaseElementsConstraintLayout);
            BaseMainConstraintLayout.AddView(BaseElementsConstraintLayout);

            BaseMainConstraintLayout.BringChildToFront(BasePreLoaderConstraintLayout);

            var rootElementSet = new ConstraintSet();

            rootElementSet.Clone(BaseMainConstraintLayout);
            rootElementSet.Connect(BaseElementsConstraintLayout.Id, ConstraintSet.Top, BaseMainConstraintLayout.Id, ConstraintSet.Top);
            rootElementSet.Connect(BaseElementsConstraintLayout.Id, ConstraintSet.Bottom, BaseMainConstraintLayout.Id, ConstraintSet.Bottom);
            rootElementSet.Connect(BaseElementsConstraintLayout.Id, ConstraintSet.Left, BaseMainConstraintLayout.Id, ConstraintSet.Left);
            rootElementSet.Connect(BaseElementsConstraintLayout.Id, ConstraintSet.Right, BaseMainConstraintLayout.Id, ConstraintSet.Right);
            rootElementSet.ApplyTo(BaseMainConstraintLayout);

            BaseElementsConstraintLayout.AddView(_constraintLayoutRoot);

            ConstraintSet elementsSet = new ConstraintSet();

            elementsSet.Clone(BaseElementsConstraintLayout);

            elementsSet.Connect(_constraintLayoutRoot.Id, ConstraintSet.Top, _toolbar.Id, ConstraintSet.Bottom);
            elementsSet.Connect(_constraintLayoutRoot.Id, ConstraintSet.Bottom, BaseElementsConstraintLayout.Id, ConstraintSet.Bottom);
            elementsSet.Connect(_constraintLayoutRoot.Id, ConstraintSet.Left, BaseElementsConstraintLayout.Id, ConstraintSet.Left);
            elementsSet.Connect(_constraintLayoutRoot.Id, ConstraintSet.Right, BaseElementsConstraintLayout.Id, ConstraintSet.Right);

            elementsSet.ApplyTo(BaseElementsConstraintLayout);
        }
示例#4
0
        private void CreateMainConstraintSet()
        {
            var constraintSet = new ConstraintSet();

            constraintSet.Clone(BaseMainConstraintLayout);

            constraintSet.ApplyTo(BaseMainConstraintLayout);
        }
示例#5
0
        private void CreateBasePreLoaderConstraintSet()
        {
            ConstraintSet BasePreLoaderConstraintSet = new ConstraintSet();

            BasePreLoaderConstraintSet.Clone(BasePreLoaderConstraintLayout);

            BasePreLoaderConstraintSet.Connect(BaseProgressBar.Id, ConstraintSet.Top, BasePreLoaderConstraintLayout.Id, ConstraintSet.Top, PixelsConverter.DpToPx(300));
            BasePreLoaderConstraintSet.Connect(BaseProgressBar.Id, ConstraintSet.Left, BasePreLoaderConstraintLayout.Id, ConstraintSet.Left, PixelsConverter.DpToPx(23));
            BasePreLoaderConstraintSet.Connect(BaseProgressBar.Id, ConstraintSet.Right, BasePreLoaderConstraintLayout.Id, ConstraintSet.Right, PixelsConverter.DpToPx(23));

            BasePreLoaderConstraintSet.ApplyTo(BasePreLoaderConstraintLayout);
        }
        private void CreateMainConstraintSet()
        {
            var constraintSet = new ConstraintSet();

            constraintSet.Clone(BaseMainConstraintLayout);

            constraintSet.Connect(_toolbar.Id, ConstraintSet.Top, BaseElementsConstraintLayout.Id, ConstraintSet.Top);
            constraintSet.Connect(_toolbar.Id, ConstraintSet.Left, BaseElementsConstraintLayout.Id, ConstraintSet.Left);
            constraintSet.Connect(_toolbar.Id, ConstraintSet.Right, BaseElementsConstraintLayout.Id, ConstraintSet.Right);

            constraintSet.ApplyTo(BaseMainConstraintLayout);
        }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            SetTheme(Resource.Style.Theme_AppCompat_NoActionBar);
            base.OnCreate(savedInstanceState);

            callback = new DualNavigationLocationCallback(this);

            InitializeViews(savedInstanceState);
            navigationView.Initialize(this);
            navigationMapConstraint = new ConstraintSet();
            navigationMapConstraint.Clone(dualNavigationMap);
            navigationMapExpandedConstraint = new ConstraintSet();
            navigationMapExpandedConstraint.Clone(this, Resource.Layout.activity_dual_navigation_map_expanded);

            constraintChanged = new bool[] { false };
            launchNavigationFab.SetOnClickListener(new LaunchNavigationFabClickListener((v) =>
            {
                ExpandCollapse();
                LaunchNavigation();
            }));
        }
示例#8
0
        private void LaunchNavigation()
        {
            launchNavigationFab.Hide();
            DrawPaella();
            navigationView.Visibility = ViewStates.Visible;
            int height = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 80, Resources.DisplayMetrics);

            message.LayoutParameters.Height = height;
            ConstraintSet constraintSet = new ConstraintSet();

            constraintSet.Clone(endNavigationLayout);
            constraintSet.Connect(Resource.Id.message, ConstraintSet.Bottom, ConstraintSet.ParentId, ConstraintSet.Bottom, 0);
            constraintSet.Connect(Resource.Id.message, ConstraintSet.End, ConstraintSet.ParentId, ConstraintSet.End, 0);
            constraintSet.Connect(Resource.Id.message, ConstraintSet.Start, ConstraintSet.ParentId, ConstraintSet.Start, 0);
            constraintSet.ApplyTo(endNavigationLayout);
            NavigationViewOptions.Builder options = NavigationViewOptions.InvokeBuilder()
                                                    .NavigationListener(this)
                                                    .ProgressChangeListener(this)
                                                    .DirectionsRoute(route)
                                                    .ShouldSimulateRoute(true);
            navigationView.StartNavigation(options.Build());
            UpdateUiPickingUp();
        }
示例#9
0
        private void InitializeImpl()
        {
            if (DesignTime.IsDesignMode)
            {
                // Add placeholder text
                SetBackgroundColor(Color.LightGray);
                var designTimePlaceholderText = new TextView(Context)
                {
                    Text     = "Time Slider",
                    TextSize = 16,
                    Id       = 123456789
                };
                designTimePlaceholderText.SetTextColor(Color.Black);
                AddView(designTimePlaceholderText);

                // Center text by constraining it to the edges of the parent view
                var constraintSet = new ConstraintSet();
                constraintSet.Clone(this);
                constraintSet.Connect(designTimePlaceholderText.Id, ConstraintSet.Start, ConstraintSet.ParentId, ConstraintSet.Start);
                constraintSet.Connect(designTimePlaceholderText.Id, ConstraintSet.End, ConstraintSet.ParentId, ConstraintSet.End);
                constraintSet.Connect(designTimePlaceholderText.Id, ConstraintSet.Top, ConstraintSet.ParentId, ConstraintSet.Top, 15);
                constraintSet.Connect(designTimePlaceholderText.Id, ConstraintSet.Bottom, ConstraintSet.ParentId, ConstraintSet.Bottom, 15);
                constraintSet.ApplyTo(this);

                return;
            }

            var inflater = LayoutInflater.FromContext(Context);

            inflater.Inflate(Resource.Layout.TimeSlider, this, true);

            SliderTrack              = FindViewById <View>(Resource.Id.SliderTrack);
            SliderTrackOutline       = FindViewById <View>(Resource.Id.SliderTrackOutline);
            FullExtentStartTimeLabel = FindViewById <TextView>(Resource.Id.FullExtentStartTimeLabel);
            FullExtentEndTimeLabel   = FindViewById <TextView>(Resource.Id.FullExtentEndTimeLabel);
            MinimumThumb             = FindViewById <View>(Resource.Id.MinThumb);
            MaximumThumb             = FindViewById <View>(Resource.Id.MaxThumb);
            MinimumThumbLabel        = FindViewById <TextView>(Resource.Id.CurrentExtentStartTimeLabel);
            MaximumThumbLabel        = FindViewById <TextView>(Resource.Id.CurrentExtentEndTimeLabel);
            PinnedMinimumThumb       = FindViewById <View>(Resource.Id.PinnedMinThumb);
            PinnedMaximumThumb       = FindViewById <View>(Resource.Id.PinnedMaxThumb);
            HorizontalTrackThumb     = FindViewById <View>(Resource.Id.CurrentExtentFill);
            Tickmarks             = FindViewById <Tickbar>(Resource.Id.Tickmarks);
            PlayPauseButton       = FindViewById <ToggleButton>(Resource.Id.PlayPauseButton);
            PlayButtonOutline     = FindViewById <View>(Resource.Id.PlayButtonOutline);
            PauseButtonOutline    = FindViewById <View>(Resource.Id.PauseButtonOutline);
            NextButton            = FindViewById <Button>(Resource.Id.NextButton);
            PreviousButton        = FindViewById <Button>(Resource.Id.PreviousButton);
            NextButtonOutline     = FindViewById <View>(Resource.Id.NextButtonOutline);
            PreviousButtonOutline = FindViewById <View>(Resource.Id.PreviousButtonOutline);
            _startTimeTickmark    = FindViewById <View>(Resource.Id.FullExtentStartTimeTickmark);
            _endTimeTickmark      = FindViewById <View>(Resource.Id.FullExtentEndTimeTickmark);

            PositionTickmarks();
            ApplyLabelMode(LabelMode);

            PlayPauseButton.CheckedChange += (o, e) =>
            {
                IsPlaying = PlayPauseButton.Checked;
                PlayButtonOutline.Visibility  = IsPlaying ? ViewStates.Gone : ViewStates.Visible;
                PauseButtonOutline.Visibility = IsPlaying ? ViewStates.Visible : ViewStates.Gone;
            };
            NextButton.Click     += (o, e) => OnNextButtonClick();
            PreviousButton.Click += (o, e) => OnPreviousButtonClick();

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

            AnalyticsService.TrackEvent(AnalyticsService.Event.ResultsPageViewed);

            // Load XML layout
            SetContentView(Resource.Layout.activity_results);

            // Setup toolbar
            SupportWidget.Toolbar toolbar = FindViewById <SupportWidget.Toolbar>(Resource.Id.toolbar);
            toolbar.Title = ""; // We don't want to show the title in the toolbar, but we need it as the Activity label for accessibility
            SetSupportActionBar(toolbar);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);

            // Load strings and colors
            conditionNames   = Resources.GetStringArray(Resource.Array.ai_chest_conditions);
            likelihoodLabels = Resources.GetStringArray(Resource.Array.ai_likelihood_labels);
            conditionColors  = new SKColor[]
            {
                LoadColor(Resource.Color.purple),
                LoadColor(Resource.Color.pink),
                LoadColor(Resource.Color.blue),
                LoadColor(Resource.Color.turquoise)
            };

            // Obtain UI references
            xRayDisplayView         = FindViewById <XRayDisplayView>(Resource.Id.img_xray);
            xRayDisplayViewOriginal = FindViewById <XRayDisplayView>(Resource.Id.img_xray_original);
            conditionListPrimary    = FindViewById <RecyclerView>(Resource.Id.condition_list_primary);
            conditionListSecondary  = FindViewById <RecyclerView>(Resource.Id.condition_list_secondary);
            seeMoreHideButton       = FindViewById <Button>(Resource.Id.button_see_more_hide);

            // Set up for constraint transitions to/from see more
            seeMoreModeEnabled = false;
            root = FindViewById <ConstraintLayout>(Resource.Id.root);
            resultsConstraints = new ConstraintSet();
            resultsConstraints.Clone(this, Resource.Layout.activity_results);
            seeMoreConstraints = new ConstraintSet();
            seeMoreConstraints.Clone(this, Resource.Layout.activity_see_more);

            // See more and hide click listener
            seeMoreHideButton.Click += delegate
            {
                PageTransition();
            };

            // Load analysis results
            ExtractResultsFromIntent();

            // Load and display the original X-Ray
            croppedImageUri  = (AndroidUri)this.Intent.GetParcelableExtra(ExtraCroppedImageUri);
            originalImageUri = (AndroidUri)this.Intent.GetParcelableExtra(ExtraOriginalImageUri);

            originalXRay = ImageHelper.GetBitmapFromUri(
                this.ContentResolver,
                croppedImageUri,
                LoadImageWidth,
                LoadImageHeight
                );
            xRayDisplayView.SetXRayImageResetZoom(originalXRay);
            xRayDisplayViewOriginal.SetXRayImageResetZoom(originalXRay);

            // Load and display filename
            string filename = ImageHelper.ExtractFilename(originalImageUri, this.ContentResolver);

            xRayDisplayView.Filename         = filename;
            xRayDisplayViewOriginal.Filename = filename;

            // Load and display the image date
            string date = ImageHelper.ExtractDate(originalImageUri, this.ContentResolver, this);

            xRayDisplayView.Date         = date;
            xRayDisplayViewOriginal.Date = date;

            // Retrieve the shared AI Client that was loaded by the MainApplication class
            aiClient = ((MainApplication)this.Application).AIClient;

            // Fill in data and attach listeners
            SetupConditionResultViews();
        }