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); }
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) { 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); }
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(); }
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(); }
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); }