public override void OnShowCustomView(Android.Views.View view, ICustomViewCallback callback) { customView = view; view.LayoutParameters = matchParentLayout; parent.AddView(view); content.Visibility = ViewStates.Gone; }
private static void Add(this ViewGroup viewGroup, IAdapter adapter, int insertionIndex, int count) { for (var i = 0; i < count; i++) { viewGroup.AddView(adapter.GetView(insertionIndex + i, null, viewGroup), insertionIndex + i); } }
public override Object InstantiateItem(ViewGroup container, int position) { var view = _viewList[position]; container.AddView(view.Value); return(view.Value); }
public override Java.Lang.Object InstantiateItem(ViewGroup container, int position) { _container = container; View view = LayoutInflater.From(container.Context).Inflate(Resource.Layout.VacationDetail, container, false); var packageName = Application.Context.PackageName.ToString(); view.Id = _container.Context.Resources.GetIdentifier("view_" + position, "id", packageName); container.AddView(view); TextView ItemType = view.FindViewById <TextView>(Resource.Id.ItemType); Button ItemStartDateBtn = view.FindViewById <Button>(Resource.Id.ItemStartDateBtn); Button ItemEndDateBtn = view.FindViewById <Button>(Resource.Id.ItemEndDateBtn); Button ItemPickImageFromGallery = view.FindViewById <Button>(Resource.Id.ItemPickImageFromGallery); Button ItemPickImageFromCamera = view.FindViewById <Button>(Resource.Id.ItemPickImageFromCamera); ItemStartDateBtn.Click += delegate { ShowDialog(0); }; ItemEndDateBtn.Click += delegate { ShowDialog(1); }; ItemStartDateBtn.Text = DateTime.Now.ToLocalTime().ToString("d"); ItemEndDateBtn.Text = DateTime.Now.ToLocalTime().ToString("d"); ItemPickImageFromGallery.Click += onItemPickImageFromGalleryButtonClicked; ItemPickImageFromCamera.Click += onItemPickImageFromCameraButtonClicked; int pos = position; ItemType.Text = items[pos]; view.FindViewById <TextView>(Resource.Id.ItemError).Text = string.Empty; FillData(view); return(view); }
private void SetPluginField(string key, string value, bool isProtected) { //update or add the string view: IStringView existingField; if (_stringViews.TryGetValue(key, out existingField)) { existingField.Text = value; } else { ViewGroup extraGroup = (ViewGroup)FindViewById(Resource.Id.extra_strings); var view = CreateExtraSection(key, value, isProtected); extraGroup.AddView(view.View); } //update the Entry output in the App database and notify the CopyToClipboard service App.Kp2a.GetDb().LastOpenedEntry.OutputStrings.Set(key, new ProtectedString(isProtected, value)); Intent updateKeyboardIntent = new Intent(this, typeof(CopyToClipboardService)); updateKeyboardIntent.SetAction(Intents.UpdateKeyboard); updateKeyboardIntent.PutExtra(KeyEntry, Entry.Uuid.ToHexString()); StartService(updateKeyboardIntent); //notify plugins NotifyPluginsOnModification(Strings.PrefixString + key); }
public override Java.Lang.Object InstantiateItem(ViewGroup container, int position) { var reusePosition = position % CachedPagesCount; if (_photoHolders[reusePosition] == null) { var photoCard = new CardView(Context) { LayoutParameters = _layoutParams }; if (Build.VERSION.SdkInt >= Build.VERSION_CODES.Lollipop) { photoCard.Elevation = 0; } var photo = new ImageView(Context) { LayoutParameters = _layoutParams }; photo.SetImageDrawable(null); photo.SetScaleType(ImageView.ScaleType.CenterCrop); photo.Click += PhotoOnClick; photoCard.AddView(photo); _photoHolders[reusePosition] = photoCard; container.AddView(photoCard); LoadPhoto(_photo, photoCard); } return(_photoHolders[reusePosition]); }
public override Object InstantiateItem(ViewGroup container, int position) { var inflater = LayoutInflater.FromContext(context); var inflatedView = inflater.Inflate(Resource.Layout.ReportsCalendarFragmentPage, container, false); var calendarRecyclerView = (ReportsCalendarRecyclerView)inflatedView; calendarRecyclerView.SetRecycledViewPool(recyclerviewPool); calendarRecyclerView.SetLayoutManager(new ReportsCalendarLayoutManager(context)); var adapter = new ReportsCalendarRecyclerAdapter(currentDateRange) { Items = currentMonths[position].Days }; calendarRecyclerView.SetAdapter(adapter); adapter.ItemTapObservable .Subscribe(dayTaps.OnNext) .DisposedBy(disposeBag); selectionChanges .ObserveOn(SynchronizationContext.Current) .Subscribe(adapter.UpdateDateRangeParameter) .DisposedBy(disposeBag); container.AddView(inflatedView); return(inflatedView); }
public override Object InstantiateItem(ViewGroup view, int position) { try { //ImageView var layout = Inflater.Inflate(Resource.Layout.Style_MultiImageCoursalVeiw, view, false); Image = layout.FindViewById <ImageViewTouch>(Resource.Id.image); // set the default image display type //Image.SetDisplayType(ImageViewTouchBase.DisplayType.FitIfBigger); //var bit = drawable_from_url(new System.Uri(ImagesList[position].Image)); //image.SetImageBitmap(bit); Glide.With(ActivityContext).Load(ImagesList[position].Image).Apply(new RequestOptions()).Into(Image); view.AddView(layout); return(layout); } catch (Exception e) { Methods.DisplayReportResultTrack(e); return(null !); } }
public WebViewExt RequestWebView( ViewGroup container, Action onPageLoaded = null, Action <string, string, float, float, float, float> onGetSelectedText = null, Action <Hyperlink> onLoadUrl = null, Action <int, float> onWebOverScroll = null, Action <string> onScrollLoadPageCompleted = null, Action <string, string> onScrollToPage = null) { RequestWebView( container.Context, onPageLoaded, onGetSelectedText, onLoadUrl, onWebOverScroll, onScrollLoadPageCompleted, onScrollToPage); parentView = container; container.AddView( webView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)); webView.RequestLayout(); return(webView); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootLayout = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_dataform_grouping, null); RadDataForm dataForm = new RadDataForm(this.Activity); dataForm.LayoutManager = new DataFormLinearLayoutManager(this.Activity); Person person = new Person(); person.Name = "Joe"; dataForm.SetEntity(person); EntityPropertyEditor nameEditor = Android.Runtime.Extensions.JavaCast <EntityPropertyEditor>(dataForm.GetExistingEditorForProperty("Name")); nameEditor.Property().Validator = new NonEmptyValidator(); nameEditor.ValidationViewBehavior = new ValidationAnimationBehavior(this.Activity); EntityPropertyEditor mailEditor = Android.Runtime.Extensions.JavaCast <EntityPropertyEditor>(dataForm.GetExistingEditorForProperty("Mail")); mailEditor.ValidationViewBehavior = new BlinkValidationBehavior(this.Activity); rootLayout.AddView(dataForm); return(rootLayout); }
public override Java.Lang.Object InstantiateItem(ViewGroup container, int position) { View view = LayoutInflater.From(context).Inflate(Resource.Layout.item_cover, null); try { LinearLayout linMain = (LinearLayout)view.FindViewById(Resource.Id.linMain); ImageView imageCover = (ImageView)view.FindViewById(Resource.Id.imageCover); linMain.Tag = position; switch (adapterType) { case 1: linMain.SetBackgroundResource(Resource.Drawable.shadow); break; case 2: linMain.SetBackgroundResource(0); break; } Glide.With(context) .Load(listItems[position]) .Into(imageCover); container.AddView(view); } catch (Java.Lang.Exception e) { e.PrintStackTrace(); } return(view); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_chart_example, container, false); rootView.AddView(this.createChart()); return(rootView); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); if (savedInstanceState != null) { Flash = savedInstanceState.GetBoolean(FLASH_STATE, false); AutoFocus = savedInstanceState.GetBoolean(AUTO_FOCUS_STATE, true); SelectedIndices = savedInstanceState.GetIntegerArrayList(SELECTED_FORMATS); CameraId = savedInstanceState.GetInt(CAMERA_ID, -1); } else { Flash = false; AutoFocus = true; SelectedIndices = null; CameraId = -1; } SetContentView(Resource.Layout.activity_zbar); // Toolbar toolbar = findViewById(R.id.toolbar); // setSupportActionBar(toolbar); Android.Support.V7.App.ActionBar actionBar = SupportActionBar; if (actionBar != null) { actionBar.SetDisplayHomeAsUpEnabled(true); } ViewGroup contentFrame = FindViewById <ViewGroup>(Resource.Id.content_frame); ScannerView = new ZBarScannerView(this); SetupFormats(); contentFrame.AddView(ScannerView); }
public override Java.Lang.Object InstantiateItem(ViewGroup container, int position) { try { //SliderImageAdapterViewHolder holder = null; view = LayoutInflater.From(container.Context).Inflate(Resource.Layout.SliderImageRow, container, false); sliderImg = view.FindViewById <ImageView>(Resource.Id.sliderImg); //view.Tag = new SliderImageAdapterViewHolder() //{ Photo = sliderImg }; //if (view != null) // holder = (SliderImageAdapterViewHolder)view.Tag; byte[] decodedImageString = Base64.Decode(empImageList[position].imgUrl, Base64.Default); Bitmap imageByte = BitmapFactory.DecodeByteArray(decodedImageString, 0, decodedImageString.Length); sliderImg.SetImageBitmap(imageByte); container.AddView(view); } catch (System.Exception) { } return(view); }
private void applyTo(View target) { Android.Views.ViewGroup.LayoutParams lp = target.LayoutParameters; Android.Views.IViewParent parent = target.Parent; FrameLayout container = new FrameLayout(context); if (target is TabWidget) { // set target to the relevant tab child container target = ((TabWidget)target).GetChildTabViewAt(targetTabIndex); this.target = target; ((ViewGroup)target).AddView(container, new Android.Views.ViewGroup.LayoutParams(Android.Views.ViewGroup.LayoutParams.FillParent, Android.Views.ViewGroup.LayoutParams.FillParent)); this.Visibility = (ViewStates.Gone); container.AddView(this); } else { // TODO verify that parent is indeed a ViewGroup ViewGroup group = (ViewGroup)parent; int index = group.IndexOfChild(target); group.RemoveView(target); group.AddView(container, index, lp); container.AddView(target); this.Visibility = (ViewStates.Gone); container.AddView(this); group.Invalidate(); } }
/// <summary> /// Add view to parent. /// </summary> /// <param name="parent">Parent view</param> /// <param name="child">Child view to add</param> public static void AddChild(this ViewGroup parent, View child) { // Remove from existing parent (for compatibility with other platforms). (child.Parent as ViewGroup)?.RemoveView(child); parent.AddView(child); }
public override Java.Lang.Object InstantiateItem(ViewGroup container, int position) { TextForecastItem fctItem = new TextForecastItem(context); fctItem.SetForecast(txt_forecast[position]); container.AddView(fctItem); return(fctItem); }
public override Java.Lang.Object InstantiateItem(ViewGroup container, int position) { View view = LayoutInflater.From(container.Context).Inflate(Resource.Layout.Fragment1Layout, container, false); container.AddView(view); return(view); }
void StartEmiting(int particlesPerSecond) { mActivatedParticles = 0; mParticlesPerMilisecond = particlesPerSecond / 1000f; // Add a full size view to the parent view mDrawingView = new ParticleField(mRootView.Context); mRootView.AddView(mDrawingView); mEmitingTime = -1; // Meaning infinite mDrawingView.Particles = mActiveParticles; UpdateParticlesBeforeStartTime(particlesPerSecond); //mTimer = new Timer(); mHandler = new Handler(); mHandler.PostDelayed(() => { OnUpdate(CurrentTime); CurrentTime += TIMERTASK_INTERVAL; }, TIMERTASK_INTERVAL); }
public override View AddContentView(LayoutInflater inflater, ViewGroup container) { result = (NfcPassportScanningResult)Arguments.GetParcelable(NFC_DATA); var view = new NfcAlertView(Context, result); container.AddView(view); return(view); }
private static void Replace(this ViewGroup viewGroup, IAdapter adapter, int startIndex, int count) { for (var i = 0; i < count; i++) { viewGroup.RemoveViewAt(startIndex + i); viewGroup.AddView(adapter.GetView(startIndex + i, null, viewGroup), startIndex + i); } }
private void ShowScrollDanmaku(ViewGroup parent, int duration) { int screenWidth = ScreenUtil.ScreenWidth; ScrollTo(-screenWidth, 0); parent.AddView(this); SmoothScrollTo(TextLength, 0, duration); }
public override Java.Lang.Object InstantiateItem(ViewGroup container, int position) { var view = this.GetView(position, null, this.ResolveItemTemplateId(position)); container.AddView(view); return(view); }
public override Java.Lang.Object InstantiateItem(ViewGroup container, int position) { var view = GetView(position, null, container, ItemTemplateId > 0 ? ItemTemplateId : 0); container.AddView(view); return(view); }
public override Java.Lang.Object InstantiateItem(ViewGroup container, int position) { BaseSliderView b = mImageContents[position]; View v = b.View; container.AddView(v); return(v); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup rootView = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_calendar_example, container, false); calendarView = new RadCalendarView(this.Activity); rootView.AddView(calendarView); return(rootView); }
private void UpdateLinksTab(ICursor cursor) { ViewGroup container = mRootView.FindViewById <ViewGroup> (Resource.Id.links_container); // Remove all views but the 'empty' view int childCount = container.ChildCount; if (childCount > 1) { container.RemoveViews(1, childCount - 1); } LayoutInflater inflater = GetLayoutInflater(null); bool hasLinks = false; for (int i = 0; i < SessionsQuery.LINKS_INDICES.Length; i++) { String url = cursor.GetString(SessionsQuery.LINKS_INDICES [i]); if (!TextUtils.IsEmpty(url)) { hasLinks = true; ViewGroup linkContainer = (ViewGroup)inflater.Inflate(Resource.Layout.list_item_session_link, container, false); linkContainer.FindViewById <TextView> (Resource.Id.link_text).SetText(SessionsQuery.LINKS_TITLES [i]); int linkTitleIndex = i; linkContainer.Click += (sender, e) => { FireLinkEvent(SessionsQuery.LINKS_TITLES [linkTitleIndex]); Intent intent = new Intent(Intent.ActionView, Android.Net.Uri.Parse(url)); intent.AddFlags(ActivityFlags.ClearWhenTaskReset); StartActivity(intent); }; container.AddView(linkContainer); // Create separator View separatorView = new ImageView(Activity); separatorView.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent); separatorView.SetBackgroundResource(Android.Resource.Drawable.DividerHorizontalBright); container.AddView(separatorView); } } container.FindViewById(Resource.Id.empty_links).Visibility = (hasLinks ? ViewStates.Gone : ViewStates.Visible); }
// this InstantiateItem depending on the position it desides witch layout to use. // a case statement on the poition and just load the layout to the view. public override Java.Lang.Object InstantiateItem(ViewGroup container, int position) { //position 1 Movies owned layout axml ListView movie lenght format, Load from json file.. if (position == 0) { View view = LayoutInflater.From(container.Context).Inflate(Resource.Layout.MovieMainList, container, false); container.AddView(view); ListView mMovieList = view.FindViewById <ListView>(Resource.Id.mylistviewmovie); List <backend.movie> mov = new List <backend.movie>(); backend.Movie_Json_Services service = new backend.Movie_Json_Services(); mov = service.GetMovieLocalCopy().ToList(); Movie_ListView_Adapter adapter = new Movie_ListView_Adapter(view.Context, mov); mMovieList.Adapter = adapter; return(view); } else if (position == 2) { View view = LayoutInflater.From(container.Context).Inflate(Resource.Layout.layout_Server_config, container, false); container.AddView(view); TxtServerId = (EditText)view.FindViewById(Resource.Id.txtServerId); Button BtnServer = view.FindViewById <Button>(Resource.Id.btnServer); BtnServer.Click += BtnServer_Click; return(view); } else { //position 2 Movies To buy layout axml = movie,lenght,format Load form jsonfile //position 3 a EditText and a button will do and a TextView with instructions. View view = LayoutInflater.From(container.Context).Inflate(Resource.Layout.pager_item, container, false); container.AddView(view); TextView txtTitle = view.FindViewById <TextView>(Resource.Id.item_title); int pos = position + 1; txtTitle.Text = pos.ToString(); return(view); } }
void AddToolbar(ViewGroup parent) { Toolbar toolbar = new Toolbar(this); var appbarLayout = new AppBarLayout(this); appbarLayout.AddView(toolbar, new ViewGroup.LayoutParams(AppBarLayout.LayoutParams.MatchParent, global::Android.Resource.Attribute.ActionBarSize)); SetSupportActionBar(toolbar); parent.AddView(appbarLayout, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent)); }
public void OnInflateFinished(View view, int resId, ViewGroup parent) { PostTopSectionViewHolder.Username = view.FindViewById <TextViewWithImages>(Resource.Id.username); PostTopSectionViewHolder.TimeText = view.FindViewById <AppCompatTextView>(Resource.Id.time_text); PostTopSectionViewHolder.PrivacyPostIcon = view.FindViewById <ImageView>(Resource.Id.privacyPost); PostTopSectionViewHolder.UserAvatar = view.FindViewById <ImageView>(Resource.Id.userAvatar); parent.AddView(view); }