public override View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View rowView = inflater.inflate(mResource, parent, false); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final com.opentok.android.Subscriber subscriber = mSubscribers.get(position); Subscriber subscriber = outerInstance.mSubscribers[position]; // Set name //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.widget.TextView name = (android.widget.TextView) rowView.findViewById(R.id.subscribername); TextView name = (TextView) rowView.findViewById(R.id.subscribername); name.Text = subscriber.Stream.Name; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final android.widget.ImageView picture = (android.widget.ImageView) rowView.findViewById(R.id.subscriberpicture); ImageView picture = (ImageView) rowView.findViewById(R.id.subscriberpicture); // Initialize meter view //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final com.opentok.android.demo.ui.MeterView meterView = (com.opentok.android.demo.ui.MeterView) rowView.findViewById(R.id.volume); MeterView meterView = (MeterView) rowView.findViewById(R.id.volume); meterView.setIcons(BitmapFactory.decodeResource(Resources, R.drawable.unmute_sub), BitmapFactory.decodeResource(Resources, R.drawable.mute_sub)); subscriber.AudioLevelListener = new AudioLevelListenerAnonymousInnerClassHelper(this, subscriber, meterView); meterView.setOnClickListener(new OnClickListenerAnonymousInnerClassHelper(this, subscriber, name, picture)); return rowView; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } RelativeLayout view = inflater.Inflate(Resource.Layout.TaskWebView, container, false) as RelativeLayout; view.SetOnTouchListener( this ); WebLayout = new WebLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context ); WebLayout.LayoutParameters = new ViewGroup.LayoutParams( ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent ); WebLayout.SetBackgroundColor( Android.Graphics.Color.Black ); view.AddView( WebLayout ); ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), delegate { ResultView.Hide( ); if ( string.IsNullOrEmpty( Url ) == false ) { WebLayout.LoadUrl( Url, PageLoaded ); } } ); return view; }
public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Perform the internal wiring to be able to make use of the BrightcovePlayerFragment. View view = inflater.inflate(R.layout.basic_cast_fragment, container, false); brightcoveVideoView = (BrightcoveVideoView) view.findViewById(R.id.brightcove_video_view); eventEmitter = brightcoveVideoView.EventEmitter; base.onCreateView(inflater, container, savedInstanceState); // Initialize the android_cast_plugin which requires the application id of your Cast // receiver application. string applicationId = Resources.getString([email protected]_id); googleCastComponent = new GoogleCastComponent(eventEmitter, applicationId, Activity); // Initialize the MiniController widget which will allow control of remote media playback. miniController = (MiniController) view.findViewById(R.id.miniController1); IDictionary<string, object> properties = new Dictionary<string, object>(); properties[GoogleCastComponent.CAST_MINICONTROLLER] = miniController; eventEmitter.emit(GoogleCastEventType.SET_MINI_CONTROLLER, properties); // Send the location of the media (url) and its metadata information for remote playback. Resources resources = Resources; string title = resources.getString([email protected]_title); string studio = resources.getString([email protected]_studio); string url = resources.getString([email protected]_url); string thumbnailUrl = resources.getString([email protected]_thumbnail); string imageUrl = resources.getString([email protected]_image); eventEmitter.emit(GoogleCastEventType.SET_MEDIA_METADATA, buildMetadataProperties("subTitle", title, studio, thumbnailUrl, imageUrl, url)); brightcoveVideoView.VideoPath = url; return view; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } JoinGroupView = new UIJoinGroup(); View view = inflater.Inflate(Resource.Layout.JoinGroup, container, false); view.SetOnTouchListener( this ); view.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BG_Layer_Color ) ); RelativeLayout backgroundView = view.FindViewById<RelativeLayout>( Resource.Id.view_background ); JoinGroupView.Create( backgroundView, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ) ); // get the native object types so we can hook in necessary support pointers ((View)JoinGroupView.View.PlatformNativeObject).SetOnTouchListener( this ); ((EditText)JoinGroupView.CellPhone.PlatformNativeObject).AddTextChangedListener(new PhoneNumberFormattingTextWatcher()); return view; }
public override View getView(int i, View convertView, ViewGroup viewGroup) { int direction = getItemViewType(i); if (convertView == null) { int res = 0; if (direction == DIRECTION_INCOMING) { res = R.layout.message_right; } else if (direction == DIRECTION_OUTGOING) { res = R.layout.message_left; } convertView = mInflater.inflate(res, viewGroup, false); } Message message = mMessages[i].first; string name = message.SenderId; TextView txtSender = (TextView) convertView.findViewById(R.id.txtSender); TextView txtMessage = (TextView) convertView.findViewById(R.id.txtMessage); TextView txtDate = (TextView) convertView.findViewById(R.id.txtDate); txtSender.Text = name; txtMessage.Text = message.TextBody; txtDate.Text = mFormatter.format(message.Timestamp); return convertView; }
ListItemView GetPrimaryView( View convertView, ViewGroup parent ) { PrimaryListItem primaryItem = convertView as PrimaryListItem; if ( primaryItem == null ) { primaryItem = new PrimaryListItem( Rock.Mobile.PlatformSpecific.Android.Core.Context ); int height = (int)System.Math.Ceiling( NavbarFragment.GetContainerDisplayWidth( ) * PrivateConnectConfig.MainPageHeaderAspectRatio ); primaryItem.Billboard.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.MatchParent, height ); primaryItem.HasImage = false; } if ( ParentFragment.Billboard != null ) { if ( primaryItem.HasImage == false ) { primaryItem.HasImage = true; Rock.Mobile.PlatformSpecific.Android.UI.Util.FadeView( primaryItem.Billboard, true, null ); } primaryItem.Billboard.SetImageBitmap( ParentFragment.Billboard ); } return primaryItem; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } View view = inflater.Inflate(Resource.Layout.Prayer_Post, container, false); view.SetOnTouchListener( this ); view.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) ); ResultView = new UIResultView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ), delegate { if( Success == true ) { // leave ParentTask.OnClick( this, 0 ); } else { // retry SubmitPrayerRequest( ); } } ); BlockerView = new UIBlockerView( view, new System.Drawing.RectangleF( 0, 0, NavbarFragment.GetContainerDisplayWidth( ), this.Resources.DisplayMetrics.HeightPixels ) ); return view; }
public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_async_query, container, false); rootView.findViewById(R.id.translate_button).OnClickListener = this; ListView listView = (ListView) rootView.findViewById(android.R.id.list); dotAdapter = new DotAdapter(Activity); listView.Adapter = dotAdapter; return rootView; }
public override View GetView(int position, View convertView, ViewGroup parent) { if ( convertView as TextView == null ) { convertView = ( Context as Activity ).LayoutInflater.Inflate( ResourceId, parent, false ); ControlStyling.StyleUILabel( (convertView as TextView), ControlStylingConfig.Font_Regular, ControlStylingConfig.Medium_FontSize ); } ( convertView as TextView ).Text = this.GetItem( position ).ToString( ); return convertView; }
public override View GetView(int position, View convertView, ViewGroup parent) { ListItemView returnedView = null; if ( position == 0 ) { returnedView = GetPrimaryView( convertView, parent ); } else { returnedView = GetStandardView( position - 1, convertView, parent ); } return base.AddView( returnedView ); }
public override View GetView(int position, View convertView, ViewGroup parent) { ListItemView newItem = null; if ( position == 0 ) { newItem = GetPrimaryView( convertView, parent ); } else { newItem = GetStandardView( position - 1, convertView, parent ); } return AddView( newItem ); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override public android.view.View onCreateView(android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup container, @Nullable android.os.Bundle savedInstanceState) public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_device_category_list, container, false); IList<IDictionary<string, string>> groupData = new List<IDictionary<string, string>>(); IList<IList<IDictionary<string, string>>> childData = new List<IList<IDictionary<string, string>>>(); string[] deviceCategory = Resources.getStringArray(R.array.device_categories); string[] posPrinterChildren = Resources.getStringArray(R.array.pos_printer_children); for (int i = 0; i < deviceCategory.Length; i++) { IDictionary<string, string> groupMap = new Dictionary<string, string>(); groupData.Add(groupMap); groupMap[KEY_TITLE] = deviceCategory[i]; groupMap[KEY_SUBTITLE] = ""; if (deviceCategory[i].Equals(getString([email protected]_printer))) { IList<IDictionary<string, string>> children = new List<IDictionary<string, string>>(); for (int j = 0; j < posPrinterChildren.Length; j++) { IDictionary<string, string> childMap = new Dictionary<string, string>(); children.Add(childMap); childMap[KEY_TITLE] = posPrinterChildren[j]; childMap[KEY_SUBTITLE] = ""; } childData.Add(children); } else { IList<IDictionary<string, string>> children = new List<IDictionary<string, string>>(); childData.Add(children); } } string[] from = new string[] {KEY_TITLE, KEY_SUBTITLE}; int[] to = new int[] {android.R.id.text1, android.R.id.text2}; ExpandableListAdapter adapter = new SimpleExpandableListAdapter(Activity, groupData, android.R.layout.simple_expandable_list_item_1, from, to, childData, android.R.layout.simple_expandable_list_item_2, from, to); expandableListView = (ExpandableListView) view; expandableListView.OnGroupClickListener = this; expandableListView.OnChildClickListener = this; expandableListView.Adapter = adapter; return view; }
public override View getView(int position, View currentView, ViewGroup parent) { if (currentView == null) { currentView = inflater.inflate(R.layout.city_listitem, parent, false); } City city = cities[position]; if (city != null) { ((TextView) currentView.findViewById(R.id.name)).Text = city.Name; ((TextView) currentView.findViewById(R.id.votes)).Text = Convert.ToString(city.Votes); } return currentView; }
public override View GetView(int position, View convertView, ViewGroup parent) { SingleNewsListItem listItem = convertView as SingleNewsListItem; if ( listItem == null ) { listItem = new SingleNewsListItem( Rock.Mobile.PlatformSpecific.Android.Core.Context ); int height = (int)System.Math.Ceiling( NavbarFragment.GetContainerDisplayWidth( ) * PrivateNewsConfig.NewsMainAspectRatio ); listItem.LayoutParameters = new AbsListView.LayoutParams( ViewGroup.LayoutParams.WrapContent, height ); listItem.HasImage = false; } // if we have a valid item if ( position < ParentFragment.News.Count ) { // is our image ready? if ( ParentFragment.News[ position ].Image != null ) { if ( listItem.HasImage == false ) { listItem.HasImage = true; Rock.Mobile.PlatformSpecific.Android.UI.Util.FadeView( listItem.Billboard, true, null ); } listItem.Billboard.SetImageBitmap( ParentFragment.News[ position ].Image ); } // only show the "Loading..." if the image isn't actually downloaded. else if ( ParentFragment.Placeholder != null && ParentFragment.News[ position ].ImageIsDownloaded == false ) { listItem.Billboard.SetImageBitmap( ParentFragment.Placeholder ); } else { listItem.Billboard.SetImageBitmap( null ); } } else { listItem.Billboard.SetImageBitmap( null ); } return base.AddView( listItem ); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override public android.view.View onCreateView(android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup container, @Nullable android.os.Bundle savedInstanceState) public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_pos_printer_bitmap, container, false); bitmapPathTextView = (TextView) view.findViewById(R.id.textViewBitmapPath); widthEditText = (EditText) view.findViewById(R.id.editTextWidth); alignmentSpinner = (Spinner) view.findViewById(R.id.spinnerAlignment); view.findViewById(R.id.buttonGallery).OnClickListener = this; view.findViewById(R.id.buttonPrintBitmap).OnClickListener = this; deviceMessagesTextView = (TextView) view.findViewById(R.id.textViewDeviceMessages); deviceMessagesTextView.MovementMethod = new ScrollingMovementMethod(); deviceMessagesTextView.VerticalScrollBarEnabled = true; brightnessTextView = (TextView) view.findViewById(R.id.textViewBrightness); brightnessSeekBar = (SeekBar) view.findViewById(R.id.seekBarBrightness); brightnessSeekBar.OnSeekBarChangeListener = this; return view; }
public override void setPrimaryItem(ViewGroup container, int position, object @object) { foreach (MySubscriber p in outerInstance.mSubscribers) { if (p == @object) { if (!p.SubscribeToVideo) { p.SubscribeToVideo = true; } } else { if (p.SubscribeToVideo) { p.SubscribeToVideo = false; } } } }
ListItemView GetPrimaryView( View convertView, ViewGroup parent ) { MessagePrimaryListItem messageItem = convertView as MessagePrimaryListItem; if ( messageItem == null ) { messageItem = new MessagePrimaryListItem( ParentFragment.Activity.BaseContext ); int height = (int)System.Math.Ceiling( NavbarFragment.GetContainerDisplayWidth( ) * PrivateNoteConfig.NotesMainPlaceholderAspectRatio ); messageItem.Thumbnail.LayoutParameters = new LinearLayout.LayoutParams( ViewGroup.LayoutParams.WrapContent, height ); messageItem.HasImage = false; } messageItem.ParentAdapter = this; if ( ParentFragment.SeriesBillboard != null ) { if ( messageItem.HasImage == false ) { messageItem.HasImage = true; Rock.Mobile.PlatformSpecific.Android.UI.Util.FadeView( messageItem.Thumbnail, true, null ); } messageItem.Thumbnail.SetImageBitmap( ParentFragment.SeriesBillboard ); messageItem.Thumbnail.SetScaleType( ImageView.ScaleType.CenterCrop ); } else if ( ParentFragment.PlaceholderImage != null ) { messageItem.Thumbnail.SetImageBitmap( ParentFragment.PlaceholderImage ); messageItem.Thumbnail.SetScaleType( ImageView.ScaleType.CenterCrop ); } messageItem.Title.Text = ParentFragment.Series.Name; messageItem.DateRange.Text = ParentFragment.Series.DateRanges; messageItem.Desc.Text = ParentFragment.Series.Description; return messageItem; }
public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.textchat_fragment_layout, container, false); mListView = (ListView) rootView.findViewById(R.id.msgs_list); mSendButton = (Button) rootView.findViewById(R.id.send_button); mMsgCharsView = (TextView) rootView.findViewById(R.id.characteres_msg); mMsgCharsView.Text = maxTextLength.ToString(); mMsgNotificationView = (TextView) rootView.findViewById(R.id.new_msg_notification); mMsgEditText = (EditText) rootView.findViewById(R.id.edit_msg); mMsgDividerView = (View) rootView.findViewById(R.id.divider_notification); mMsgEditText.addTextChangedListener(mTextEditorWatcher); mSendButton.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this); mMessageAdapter = new MessageAdapter(Activity, R.layout.sent_msg_row_layout, mMsgsList); mListView.Adapter = mMessageAdapter; mMsgNotificationView.OnTouchListener = new OnTouchListenerAnonymousInnerClassHelper(this); return rootView; }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Override public android.view.View onCreateView(android.view.LayoutInflater inflater, @Nullable android.view.ViewGroup container, @Nullable android.os.Bundle savedInstanceState) public override View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_msr, container, false); SharedPreferences settings = Activity.getSharedPreferences(MainActivity.PREFS_NAME, Context.MODE_PRIVATE); logicalNameEditText = (EditText) view.findViewById(R.id.editTextLogicalName); logicalNameEditText.Text = settings.getString(MainActivity.KEY_LOGICAL_NAME_MSR, getString([email protected])); view.findViewById(R.id.buttonOpen).OnClickListener = this; view.findViewById(R.id.buttonClaim).OnClickListener = this; view.findViewById(R.id.buttonRelease).OnClickListener = this; view.findViewById(R.id.buttonClose).OnClickListener = this; view.findViewById(R.id.buttonInfo).OnClickListener = this; view.findViewById(R.id.buttonCheckHealth).OnClickListener = this; view.findViewById(R.id.buttonClearFields).OnClickListener = this; view.findViewById(R.id.buttonRefreshFields).OnClickListener = this; deviceEnabledCheckBox = (CheckBox) view.findViewById(R.id.checkBoxDeviceEnabled); deviceEnabledCheckBox.OnCheckedChangeListener = this; autoDisableCheckBox = (CheckBox) view.findViewById(R.id.checkBoxAutoDisable); autoDisableCheckBox.OnCheckedChangeListener = this; dataEventEnabledCheckBox = (CheckBox) view.findViewById(R.id.checkBoxDataEventEnabled); dataEventEnabledCheckBox.OnCheckedChangeListener = this; RadioGroup radioGroup = (RadioGroup) view.findViewById(R.id.radioGroupDataEncryptionAlgorithm); radioGroup.OnCheckedChangeListener = this; track1DataLengthTextView = (TextView) view.findViewById(R.id.textViewTrack1DataLength); track1DataTextView = (TextView) view.findViewById(R.id.textViewTrack1Data); track2DataLengthTextView = (TextView) view.findViewById(R.id.textViewTrack2DataLength); track2DataTextView = (TextView) view.findViewById(R.id.textViewTrack2Data); track3DataLengthTextView = (TextView) view.findViewById(R.id.textViewTrack3DataLength); track3DataTextView = (TextView) view.findViewById(R.id.textViewTrack3Data); stateTextView = (TextView) view.findViewById(R.id.textViewState); return view; }
public override View GetView(int position, View convertView, ViewGroup parent) { ListAdapter.ListItemView item = null; if ( position == 0 ) { item = GetPrimaryView( position, convertView, parent ); } else { // for standard views, subtract one from the position so we // can more easily convert from row index to correct left index image. item = GetStandardView( position - 1, convertView, parent ); } return AddView( item ); }
public override View getChildView(int nodePosition, int progressPosition, bool isLastProgress, View view, ViewGroup parent) { View v = view; if (null == v) { mProgressViewHolder = new ProgressViewHolder(this, this); v = mInflater.inflate(R.layout.progress_list_item, null); mProgressViewHolder.loadingicon_imageView = (ImageView) v.findViewById(R.id.loadingicon_imageView); mProgressViewHolder.fileCancel_btn = (Button) v.findViewById(R.id.fileCancel_btn); mProgressViewHolder.progressbar = (ProgressBar) v.findViewById(R.id.progressBar); mProgressViewHolder.fileCnt_textView = (TextView) v.findViewById(R.id.fileCnt_textView); v.Tag = mProgressViewHolder; } else { mProgressViewHolder = (ProgressViewHolder) v.Tag; } //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final NodeInfo nodeInfo = mNodeInfoList.get(nodePosition); NodeInfo nodeInfo = mNodeInfoList[nodePosition]; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final ProgressInfo progressInfo = nodeInfo.progressInfoList.get(progressPosition); ProgressInfo progressInfo = nodeInfo.progressInfoList[progressPosition]; // Set the progressBar's icon to distinguish between sending and // receiving the file transfer. if (progressInfo.bSend) { mProgressViewHolder.loadingicon_imageView.BackgroundResource = R.drawable.ic_file_sending; } else { mProgressViewHolder.loadingicon_imageView.BackgroundResource = R.drawable.ic_file_receiving; } // Set the the percentage of the file transfer and count of files. mProgressViewHolder.progressbar.Progress = progressInfo.progress; mProgressViewHolder.fileCnt_textView.Text = "(" + progressInfo.fileIndex + "/" + fileCntHashMap[progressInfo.trId] + ")"; // When you click a button of the file transfer .. mProgressViewHolder.fileCancel_btn.OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this, v, nodeInfo, progressInfo); return v; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { this.EnsureBindingContextIsSet(savedInstanceState); return(this.BindingInflate(Resource.Layout.TasksFragment, null)); }
public override View GetView(int position, View convertView, ViewGroup parent) { var context = parent.Context; var item = list.ToList <TabData>()[position]; var mainLayout = new GridLayout(context); var nameLabel = new TextView(context); nameLabel.TextSize = 20; nameLabel.SetLines(2); nameLabel.LayoutParameters = new ViewGroup.LayoutParams(((context.Resources.DisplayMetrics.WidthPixels / 2 - 85) / 3) * 2, 170); nameLabel.Text = item.Name; if (IsTabletDevice(context)) { nameLabel.TextSize = 30; nameLabel.SetLines(1); nameLabel.LayoutParameters = new ViewGroup.LayoutParams(360, 120); } var imageView = new ImageView(context); var imageID = Application.Context.Resources.GetIdentifier(item.ImagePath.Replace(".jpeg", "").Replace(".jpg", ""), "drawable", Application.Context.PackageName); imageView.SetImageResource(imageID); imageView.SetPadding(10, 40, 20, 20); imageView.LayoutParameters = new ViewGroup.LayoutParams(640, 540); imageView.SetScaleType(ImageView.ScaleType.FitXy); if (IsTabletDevice(context)) { imageView.LayoutParameters = new ViewGroup.LayoutParams(500, 500); } var priceLabel = new TextView(context); priceLabel.LayoutParameters = new ViewGroup.LayoutParams(170, 90); priceLabel.SetTextColor(Color.Rgb(128, 207, 53)); priceLabel.TextSize = 15; priceLabel.Text = "$" + item.Price; if (IsTabletDevice(context)) { priceLabel.LayoutParameters = new ViewGroup.LayoutParams(150, 120); priceLabel.TextSize = 20; } var description = new TextView(context); description.LayoutParameters = new ViewGroup.LayoutParams(context.Resources.DisplayMetrics.WidthPixels / 2 - 130, 300); if (!IsTabletDevice(context)) { description.SetPadding(0, -8, 10, 0); } description.SetTextColor(Color.Rgb(134, 134, 134)); description.TextSize = 10; if (!IsTabletDevice(context)) { description.SetLines(10); } description.Text = item.Description; if (IsTabletDevice(context)) { description.SetLines(10); description.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 300); description.SetPadding(0, 0, 10, 0); description.TextSize = 15; } var offerLabel = new TextView(context); offerLabel.SetTextColor(Color.Rgb(128, 207, 53)); offerLabel.TextSize = 15; offerLabel.Text = item.Offer + "% Offer"; offerLabel.LayoutParameters = new ViewGroup.LayoutParams(200, 90); if (IsTabletDevice(context)) { offerLabel.TextSize = 20; offerLabel.LayoutParameters = new ViewGroup.LayoutParams(250, 120); } var ratingLabel = new TextView(context); ratingLabel.SetBackgroundColor(Color.Rgb(77, 146, 223)); ratingLabel.Text = "*" + item.Rating; ratingLabel.TextSize = 13; ratingLabel.TextAlignment = TextAlignment.TextEnd; ratingLabel.Gravity = GravityFlags.Right; ratingLabel.SetTextColor(Color.White); if (IsTabletDevice(context)) { ratingLabel.TextSize = 20; ratingLabel.Gravity = GravityFlags.Center; ratingLabel.LayoutParameters = new ViewGroup.LayoutParams(60, 50); } var detailsLayout = new GridLayout(context); detailsLayout.ColumnCount = 2; detailsLayout.LayoutParameters = new ViewGroup.LayoutParams(context.Resources.DisplayMetrics.WidthPixels / 2 - 100, 90); detailsLayout.SetPadding(0, 10, 10, 10); detailsLayout.AddView(priceLabel); detailsLayout.AddView(offerLabel); detailsLayout.SetBackgroundColor(Color.White); if (IsTabletDevice(context)) { detailsLayout.LayoutParameters = new ViewGroup.LayoutParams(context.Resources.DisplayMetrics.WidthPixels / 2 - 100, 100); } var headerGrid = new GridLayout(context); headerGrid.LayoutParameters = new ViewGroup.LayoutParams(context.Resources.DisplayMetrics.WidthPixels / 2 - 100, 170); headerGrid.SetPadding(0, 10, 10, 10); headerGrid.ColumnCount = 2; headerGrid.RowCount = 1; headerGrid.AddView(nameLabel); headerGrid.AddView(ratingLabel); if (IsTabletDevice(context)) { headerGrid.LayoutParameters = new ViewGroup.LayoutParams(800, 100); } var subGrid = new GridLayout(context); subGrid.LayoutParameters = new ViewGroup.LayoutParams(context.Resources.DisplayMetrics.WidthPixels / 2 - 100, 600); subGrid.SetPadding(10, 0, 10, 0); subGrid.ColumnCount = 1; subGrid.RowCount = 3; if (IsTabletDevice(context)) { subGrid.LayoutParameters = new ViewGroup.LayoutParams(500, 500); subGrid.SetPadding(10, 30, 10, 0); } subGrid.AddView(headerGrid); subGrid.AddView(detailsLayout); subGrid.AddView(description); if (currentApiVersion <= 19) { mainLayout.LayoutParameters = new AbsListView.LayoutParams(context.Resources.DisplayMetrics.WidthPixels, 600); } else { mainLayout.LayoutParameters = new ViewGroup.LayoutParams(context.Resources.DisplayMetrics.WidthPixels, 600); } if (IsTabletDevice(context)) { mainLayout.LayoutParameters = new ViewGroup.LayoutParams(context.Resources.DisplayMetrics.WidthPixels, 500); } mainLayout.SetPadding(20, 20, 20, 0); mainLayout.ColumnCount = 2; mainLayout.RowCount = 1; mainLayout.AddView(imageView); mainLayout.AddView(subGrid); mainLayout.SetBackgroundColor(Color.White); return(mainLayout); }
protected override Android.Views.View GetCellCore(Cell item, Android.Views.View convertView, ViewGroup parent, Context context) { _cellCore = base.GetCellCore(item, convertView, parent, context); return(_cellCore); }
public FullScreenClient(ViewGroup parent, ViewGroup content) { this.parent = parent; this.content = content; }
/// <summary> /// Gets the view. /// </summary> /// <param name="position">The position.</param> /// <param name="convertView">The convert view.</param> /// <param name="parent">The parent.</param> /// <returns>Android.Views.View.</returns> public override global::Android.Views.View GetView(int position, global::Android.Views.View convertView, ViewGroup parent) { return(_onGetCell(position, convertView, parent)); }
// // Methods // /// <summary> /// Gets the cell core. /// </summary> /// <param name="item">The item.</param> /// <param name="convertView">The convert view.</param> /// <param name="parent">The parent.</param> /// <param name="context">The context.</param> /// <returns>Android.Views.View.</returns> protected override global::Android.Views.View GetCellCore(Cell item, global::Android.Views.View convertView, ViewGroup parent, Context context) { ViewCell viewCell = (ViewCell)item; GridViewCellRenderer.ViewCellContainer viewCellContainer = convertView as GridViewCellRenderer.ViewCellContainer; if (viewCellContainer != null) { viewCellContainer.Update(viewCell); return(viewCellContainer); } IVisualElementRenderer renderer = RendererFactory.GetRenderer(viewCell.View); // Platform.SetRenderer (viewCell.View, renderer); // viewCell.View.IsPlatformEnabled = true; return(new GridViewCellRenderer.ViewCellContainer(context, renderer, viewCell, parent)); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return(inflater.Inflate(Resource.Layout.fragment_camera2_basic, container, false)); }
/// <summary> /// Gets the cell. /// </summary> /// <param name="position">The position.</param> /// <param name="convertView">The convert view.</param> /// <param name="parent">The parent.</param> /// <returns>Android.Views.View.</returns> public global::Android.Views.View GetCell(int position, global::Android.Views.View convertView, ViewGroup parent) { var item = this.Element.ItemsSource.Cast <object>().ElementAt(position); var viewCellBinded = (Element.ItemTemplate.CreateContent() as ViewCell); viewCellBinded.BindingContext = item; var view = RendererFactory.GetRenderer(viewCellBinded.View); // Platform.SetRenderer (viewCellBinded.View, view); view.ViewGroup.LayoutParameters = new Android.Widget.GridView.LayoutParams(Convert.ToInt32(this.Element.ItemWidth), Convert.ToInt32(this.Element.ItemHeight)); view.ViewGroup.SetBackgroundColor(global::Android.Graphics.Color.Blue); return(view.ViewGroup); // this.AddView (this.view.ViewGroup); // GridViewCellRenderer render = new GridViewCellRenderer (); // // return render.GetCell (viewCellBinded, convertView, parent, this.Context);; // // view.LayoutParameters = new GridView.LayoutParams (this.Element.ItemWidth,this.Element.ItemHeight); // return view; // ImageView imageView; // // if (convertView == null) { // if it's not recycled, initialize some attributes // imageView = new ImageView (Forms.Context); // imageView.LayoutParameters = new GridView.LayoutParams (85, 85); // imageView.SetScaleType (ImageView.ScaleType.CenterCrop); // imageView.SetPadding (8, 8, 8, 8); // } else { // imageView = (ImageView)convertView; // } // var imageBitmap = GetImageBitmapFromUrl("http://xamarin.com/resources/design/home/devices.png"); // imageView.SetImageBitmap(imageBitmap); // return imageView; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Android.OS.Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); return(CreateView(Resource.Layout.providerlistview)); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return(base.OnCreateView(inflater, container, savedInstanceState)); }
public override AView OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var shellSection = ShellSection; if (shellSection == null) { return(null); } if (shellSection.CurrentItem == null) { throw new InvalidOperationException($"Content not found for active {shellSection}. Title: {shellSection.Title}. Route: {shellSection.Route}."); } var root = inflater.Inflate(Resource.Layout.RootLayout, null).JavaCast <CoordinatorLayout>(); _toolbar = root.FindViewById <Toolbar>(Resource.Id.main_toolbar); _viewPager = root.FindViewById <FormsViewPager>(Resource.Id.main_viewpager); _tablayout = root.FindViewById <TabLayout>(Resource.Id.main_tablayout); _viewPager.EnableGesture = false; _viewPager.AddOnPageChangeListener(this); _viewPager.Id = AppCompat.Platform.GenerateViewId(); _viewPager.Adapter = new ShellFragmentPagerAdapter(shellSection, ChildFragmentManager); _viewPager.OverScrollMode = OverScrollMode.Never; _tablayout.SetupWithViewPager(_viewPager); Page currentPage = null; int currentIndex = -1; var currentItem = ShellSection.CurrentItem; while (currentIndex < 0 && SectionController.GetItems().Count > 0 && ShellSection.CurrentItem != null) { currentItem = ShellSection.CurrentItem; currentPage = ((IShellContentController)shellSection.CurrentItem).GetOrCreateContent(); // current item hasn't changed if (currentItem == shellSection.CurrentItem) { currentIndex = SectionController.GetItems().IndexOf(currentItem); } } _toolbarTracker = _shellContext.CreateTrackerForToolbar(_toolbar); _toolbarTracker.Page = currentPage; _viewPager.CurrentItem = currentIndex; if (SectionController.GetItems().Count == 1) { _tablayout.Visibility = ViewStates.Gone; } _tabLayoutAppearanceTracker = _shellContext.CreateTabLayoutAppearanceTracker(ShellSection); _toolbarAppearanceTracker = _shellContext.CreateToolbarAppearanceTracker(); HookEvents(); return(_rootView = root); }
ListAdapter.ListItemView GetStandardView( int rowIndex, View convertView, ViewGroup parent ) { // convert the position to the appropriate image index. int leftImageIndex = 1 + ( rowIndex * 2 ); // create the item if needed DoubleNewsListItem seriesItem = convertView as DoubleNewsListItem; if ( seriesItem == null ) { seriesItem = new DoubleNewsListItem( Rock.Mobile.PlatformSpecific.Android.Core.Context ); seriesItem.ParentAdapter = this; int height = (int)System.Math.Ceiling( (NavbarFragment.GetContainerDisplayWidth( ) / 2) * PrivateNewsConfig.NewsMainAspectRatio ); seriesItem.LayoutParameters = new AbsListView.LayoutParams( ViewGroup.LayoutParams.WrapContent, height ); seriesItem.LeftHasImage = false; seriesItem.RightHasImage = false; } seriesItem.LeftImageIndex = leftImageIndex; // first set the left item if ( leftImageIndex < ParentFragment.News.Count ) { // is there an image ready? if ( ParentFragment.News[ leftImageIndex ].Image != null ) { if ( seriesItem.LeftHasImage == false ) { seriesItem.LeftHasImage = true; Rock.Mobile.PlatformSpecific.Android.UI.Util.FadeView( seriesItem.LeftImage, true, null ); } seriesItem.LeftImage.SetImageBitmap( ParentFragment.News[ leftImageIndex ].Image ); } // should we use the placeholder instead? else if ( ParentFragment.Placeholder != null && ParentFragment.News[ leftImageIndex ].ImageIsDownloaded == false ) { seriesItem.LeftImage.SetImageBitmap( ParentFragment.Placeholder ); } else { // then just clear it out seriesItem.LeftImage.SetImageBitmap( null ); } } else { seriesItem.LeftImage.SetImageBitmap( null ); } // now if there's a right item, set it int rightImageIndex = leftImageIndex + 1; if ( rightImageIndex < ParentFragment.News.Count ) { // is there an image ready? if ( ParentFragment.News[ rightImageIndex ].Image != null ) { if ( seriesItem.RightHasImage == false ) { seriesItem.RightHasImage = true; Rock.Mobile.PlatformSpecific.Android.UI.Util.FadeView( seriesItem.RightImage, true, null ); } seriesItem.RightImage.SetImageBitmap( ParentFragment.News[ rightImageIndex ].Image ); } // should we use the placeholder instead? else if ( ParentFragment.Placeholder != null && ParentFragment.News[ rightImageIndex ].ImageIsDownloaded == false ) { seriesItem.RightImage.SetImageBitmap( ParentFragment.Placeholder ); } else { // then just clear it out seriesItem.RightImage.SetImageBitmap( null ); } } else { seriesItem.RightImage.SetImageBitmap( null ); } return seriesItem; }
public override View InflateView(LayoutInflater layoutInflater, ViewGroup parent) { return(layoutInflater.Inflate(Resource.Layout.server_control_audio_item, parent, false)); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { this.EnsureBindingContextIsSet(inflater); return(this.BindingInflate(Attribute.FragmentContentId, container, false)); }
public override View GetView(int position, View convertView, ViewGroup parent) { ViewHolderClass holder; if (convertView == null) { holder = new ViewHolderClass(); int layout = Resource.Layout.Contact_FriendItem; LayoutInflater inflater = LayoutInflater.From(context); convertView = inflater.Inflate(layout, parent, false); holder.name = convertView.FindViewById <TextView>(Resource.Id.tvContactFriendName); holder.number = convertView.FindViewById <TextView>(Resource.Id.tvContactFriendNumber); holder.photo = convertView.FindViewById <ImageView>(Resource.Id.ivContactFriendImage); holder.btn = convertView.FindViewById <Button>(Resource.Id.btnContactFriendInvite); convertView.Tag = (holder); convertView.SetTag(Resource.Id.tvContactFriendName, holder.name); convertView.SetTag(Resource.Id.tvContactFriendNumber, holder.number); convertView.SetTag(Resource.Id.ivContactFriendImage, holder.photo); convertView.SetTag(Resource.Id.btnContactFriendInvite, holder.btn); } else { holder = (ViewHolderClass)convertView.Tag; } holder.btn.Tag = position; holder.btn.SetOnClickListener(new btnInviteClick(contactList[position], context, eventID, this)); holder.btn.SetBackgroundResource(Resource.Drawable.btn_round_green_border_padding); holder.btn.SetTextColor(Color.ParseColor("#04c285")); if (contactList[position].IsContact == true) { if (contactList[position].Picture == null || contactList[position].Picture == "") { holder.photo.SetImageResource(Resource.Drawable.contact_withoutphoto); } else { var contactUri = ContentUris.WithAppendedId( ContactsContract.Contacts.ContentUri, contactList[position].PhoneContactId); var contactPhotoUri = Android.Net.Uri.WithAppendedPath(contactUri, ContactsContract.Contacts.Photo.ContentDirectory); Picasso.With(context).Load(contactPhotoUri).Placeholder(Resource.Drawable.contact_withoutphoto) .Resize(150, 150).Transform(new CircleTransformation()).Into(holder.photo); } if (contactList[position].InvitedContact == "1") { holder.btn.Text = "Invited"; holder.btn.SetBackgroundResource(Resource.Drawable.btn_round_green_border_fill_padding); holder.btn.SetTextColor(Color.ParseColor("#ffffff")); } else { holder.btn.SetBackgroundResource(Resource.Drawable.btn_round_green_border_padding); holder.btn.SetTextColor(Color.ParseColor("#04c285")); holder.btn.Text = "Invite"; } } else { if (contactList[position].Picture == null || contactList[position].Picture == "") { holder.photo.SetImageResource(Resource.Drawable.contact_withoutphoto); } else { Picasso.With(context).Load(contactList[position].Picture).Placeholder(Resource.Drawable.contact_withoutphoto) .Resize(150, 150).Transform(new CircleTransformation()).Into(holder.photo); } if (contactList[position].isInvitedFriend == "1") { holder.btn.Text = "Invited"; holder.btn.SetBackgroundResource(Resource.Drawable.btn_round_green_border_fill_padding); holder.btn.SetTextColor(Color.ParseColor("#ffffff")); } else { holder.btn.SetBackgroundResource(Resource.Drawable.btn_round_green_border_padding); holder.btn.SetTextColor(Color.ParseColor("#04c285")); holder.btn.Text = "Invite"; } } if (contactList[position].ResponseText != null && contactList[position].ResponseText != "" && contactList[position].isInvitedFriend != "") { holder.btn.SetBackgroundResource(Resource.Drawable.btn_round_green_border_fill_padding); holder.btn.SetTextColor(Color.ParseColor("#ffffff")); holder.btn.Text = contactList[position].ResponseText; } holder.name.Text = contactList[position].FriendName; holder.number.Text = contactList[position].PhoneNumber; return(convertView); }
public override Android.Support.V7.Widget.RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { return(new WearableListView.ViewHolder(mInflater.Inflate(Resource.Layout.timer_list_item, null))); }
ToolStripItem NewChooseViewItem(ViewGroup viewGroup, ViewSpec viewSpec) { var viewInfo = ViewContext.GetViewInfo(new ViewName(viewGroup.Id, viewSpec.Name)); if (null == viewInfo) { return null; } Image image = null; int imageIndex = ViewContext.GetImageIndex(viewSpec); if (imageIndex >= 0) { image = ViewContext.GetImageList()[imageIndex]; } ToolStripMenuItem item = new ToolStripMenuItem(viewSpec.Name, image) { ImageTransparentColor = Color.Magenta}; item.Click += (sender, args) => ApplyView(viewGroup, viewSpec); var currentView = BindingListSource.ViewInfo; var fontStyle = FontStyle.Regular; if (null != currentView && Equals(viewGroup, currentView.ViewGroup) && Equals(viewSpec.Name, currentView.Name)) { fontStyle |= FontStyle.Bold; item.Checked = true; } if (!ViewGroup.BUILT_IN.Equals(viewGroup)) { fontStyle |= FontStyle.Italic; } item.Font = new Font(item.Font, fontStyle); return item; }
/// <summary> /// Find the first child of a specific type. /// </summary> /// <typeparam name="T">Expected type of the searched child</typeparam> /// <param name="view"></param> /// <param name="childLevelLimit">Defines the max depth, null if not limit (Should never be used)</param> /// <param name="includeCurrent">Indicates if the current view should also be tested or not.</param> /// <returns></returns> public static T FindFirstChild <T>(this ViewGroup view, int?childLevelLimit = null, bool includeCurrent = true) where T : View { return(view.FindFirstChild <T>(null, childLevelLimit, includeCurrent)); }
protected virtual View InflateViewForHolder(ViewGroup parent, int viewType, IMvxAndroidBindingContext bindingContext) { return(bindingContext.BindingInflate(this.ItemTemplateId, parent, false)); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment base.OnCreateView(inflater, container, savedInstanceState); return(inflater.Inflate(Resource.Layout.fragment_recyclerview, container, false)); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.Inflate(Resource.Layout.Profile, container, false); return(view); }
public override View getView(int i, View view, ViewGroup viewGroup) { if (view == null) { view = inflater.inflate(android.R.layout.simple_list_item_1, viewGroup, false); ViewHolder viewHolder = new ViewHolder(this, view); view.Tag = viewHolder; } ViewHolder vh = (ViewHolder) view.Tag; vh.text.Text = "[X= " + getItem(i).X + " Y= " + getItem(i).Y + "]"; return view; }
/** * Returns the Animators to apply to the views. In addition to the returned Animators, an alpha transition will be applied to the view. * * @param parent The parent of the view * @param view The view that will be animated, as retrieved by getView(). */ //@NonNull public abstract Animator[] getAnimators(ViewGroup parent, View view);
public override void DestroyItem(ViewGroup container, int position, Java.Lang.Object objectValue) { container.RemoveView((View)objectValue); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment mainView = inflater.Inflate(Resource.Layout.transactionfragment, container, false); SetHasOptionsMenu(true); FrameLayout fl = mainView.FindViewById <FrameLayout>(Resource.Id.transDataGridFrame); filterText = mainView.FindViewById <SearchView>(Resource.Id.searchView1); filterText.SetPadding(0, 20, 0, 0); filterText.SetQueryHint("Enter To, Amount, etc. to filter"); filterText.QueryTextChange += FilterText_QueryTextChange; dataRepository = new DataRepository(); dataRepository.filtertextchanged = OnFilterChanged; dataGrid = new SfDataGrid(Context) { RowHeight = 30, HeaderRowHeight = 30, AllowResizingColumn = true, GridStyle = new SyncFusionUtilities.CustomGridStyle(), ResizingMode = ResizingMode.OnMoved, ItemsSource = dataRepository.TransactionDataCollection, FrozenColumnsCount = 2, AutoGenerateColumns = false, ColumnSizer = ColumnSizer.None, AllowSorting = true, SelectionMode = SelectionMode.Single, EnableDataVirtualization = true }; dataGrid.GridTapped += DataGrid_GridTapped; SyncFusionUtilities.DataGridUtilities.context = Context; GridTextColumn dateColumn = SyncFusionUtilities.DataGridUtilities.CreateTextColumn("Date", "Date", "", 120); SyncFusionUtilities.StatusCell.checkIcon = Resource.Drawable.ic_check_green_dark_18dp; SyncFusionUtilities.StatusCell.circleIcon = Resource.Drawable.ic_rotate_left_blue_dark_18dp; dateColumn.UserCellType = typeof(SyncFusionUtilities.StatusCell); dateColumn.LoadUIView = true; dateColumn.AllowSorting = false; dataGrid.Columns.Add(dateColumn); dataGrid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("Type", "Type", "", 120, true)); dataGrid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("To", "To", "", 180, true)); dataGrid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("Status", "Status", "", 180, true)); dataGrid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("Address", "Address", "", -1, true)); dataGrid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("Currency", "Currency", "", -1, true)); dataGrid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("Coins", "Coins", "", 180)); dataGrid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("Amount", "Amount", "", 180)); dataGrid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("Debit", "Debit", "", -1, true)); dataGrid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("TransactionFee", "TransactionFee", "", -1, true)); dataGrid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("TransactionId", "TransactionId", "", -1, true)); dataGrid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("TransactionSizeUnit", "TransactionSizeUnit", "", -1, true)); dataGrid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("TransactionSize", "TransactionSize", "", -1, true)); dataGrid.Columns.Add(SyncFusionUtilities.DataGridUtilities.CreateTextColumn("OutputSize", "OutputSize", "", -1, true)); fl.AddView(dataGrid); CreateTransactionChart(mainView); return(mainView); }
public override View getGroupView(int position, bool isExpanded, View view, ViewGroup parent) { View v = view; if (null == v) { mNodeViewHolder = new NodeViewHolder(this, this); v = mInflater.inflate(R.layout.node_list_item, parent, false); mNodeViewHolder.mNodename_textView = (TextView) v.findViewById(R.id.nodeName_textview); mNodeViewHolder.mbSend_checkbox = (CheckBox) v.findViewById(R.id.bSend_checkbox); v.Tag = mNodeViewHolder; } else { mNodeViewHolder = (NodeViewHolder) v.Tag; } if (mIsSecureChannelFrag) { LinearLayout mNodeListItem = (LinearLayout) v.findViewById(R.id.nodeListItem_layout); mNodeListItem.setPadding(20, 15, 15, 15); } // set a name of the node. //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final NodeInfo nodeInfo = mNodeInfoList.get(position); NodeInfo nodeInfo = mNodeInfoList[position]; mNodeViewHolder.mNodename_textView.Text = "Node" + nodeInfo.nodeNumber + " : " + nodeInfo.nodeName + " [" + nodeInfo.interfaceName + "]"; if (bCheckMode) { mNodeViewHolder.mbSend_checkbox.Visibility = View.VISIBLE; mNodeViewHolder.mbSend_checkbox.OnCheckedChangeListener = new OnCheckedChangeListenerAnonymousInnerClassHelper(this, nodeInfo); } else { mNodeViewHolder.mbSend_checkbox.Visibility = View.GONE; } // set the checkBox if (nodeInfo.bChecked) { mNodeViewHolder.mbSend_checkbox.Checked = true; } else { mNodeViewHolder.mbSend_checkbox.Checked = false; } return v; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ShowHamburgerMenu = true; return(base.OnCreateView(inflater, container, savedInstanceState)); }
ListAdapter.ListItemView GetPrimaryView( int position, View convertView, ViewGroup parent ) { SingleNewsListItem listItem = convertView as SingleNewsListItem; if ( listItem == null ) { listItem = new SingleNewsListItem( Rock.Mobile.PlatformSpecific.Android.Core.Context ); int height = (int)System.Math.Ceiling( NavbarFragment.GetContainerDisplayWidth( ) * PrivateNewsConfig.NewsMainAspectRatio ); listItem.LayoutParameters = new AbsListView.LayoutParams( ViewGroup.LayoutParams.WrapContent, height ); listItem.HasImage = false; } // if we have a valid item if ( position < ParentFragment.News.Count ) { // is the image valid? if ( ParentFragment.News[ position ].Image != null ) { if ( listItem.HasImage == false ) { listItem.HasImage = true; Rock.Mobile.PlatformSpecific.Android.UI.Util.FadeView( listItem.Billboard, true, null ); } listItem.Billboard.SetImageBitmap( ParentFragment.News[ position ].Image ); } // then should we use the placeholder? else if ( ParentFragment.Placeholder != null && ParentFragment.News[ position ].ImageIsDownloaded == false ) { listItem.Billboard.SetImageBitmap( ParentFragment.Placeholder ); } else { listItem.Billboard.SetImageBitmap( null ); } } else { listItem.Billboard.SetImageBitmap( null ); } return listItem; }
public View CreatePage4(LayoutInflater inflater, ViewGroup container) { View v = inflater.Inflate(Resource.Layout.fragment_page_4, container, false); var btnShareSong = v.FindViewById <Button>(Resource.Id.btnShareSong); btnShareSong.Click += BtnShareSong_Click; var btnShareApp = v.FindViewById <Button>(Resource.Id.btnShareApp); btnShareApp.Click += BtnShareApp_Click; var btnMyBible = v.FindViewById <Button>(Resource.Id.btnMyBible); btnMyBible.Click += BtnMyBible_Click; var btnRadio = v.FindViewById <Button>(Resource.Id.btnRadio); btnRadio.Click += BtnRadio_Click; var btnSpiewajPanu = v.FindViewById <Button>(Resource.Id.btnSpiewajPanu); btnSpiewajPanu.Click += BtnSpiewajPanu_Click; //TextView textView = v.FindViewById<TextView>(Resource.Id.tvGitHub); //textView.Clickable = true; //textView.MovementMethod = LinkMovementMethod.Instance; //string text = "<a href='https://github.com/gabzdyl/test_songbook'>GitHub</a>"; //textView.SetText("GitHub", TextView.BufferType.Normal); //na zrušení //var sw = v.FindViewById<Switch>(Resource.Id.switch1); //sw.CheckedChange += Sw_CheckedChange; //var sw1 = v.FindViewById<Switch>(Resource.Id.switch2); //sw1.CheckedChange += Sw_CheckedChange1; //var btn = v.FindViewById<Button>(Resource.Id.button1); //btn.Click += Btn_Click; var swChorusMany = v.FindViewById <Switch>(Resource.Id.swChorusMany); if (Nastaveni.ChorusMany) { swChorusMany.Checked = true; } swChorusMany.CheckedChange += SwChorusMany_CheckedChange; var swBigFont = v.FindViewById <Switch>(Resource.Id.swBigFont); if (Nastaveni.BigFont) { swBigFont.Checked = true; } swBigFont.CheckedChange += SwBigFont_CheckedChange; var swCenter = v.FindViewById <Switch>(Resource.Id.swCenter); if (Nastaveni.Center) { swCenter.Checked = true; } swCenter.CheckedChange += SwCenter_CheckedChange; var swLineBreaks = v.FindViewById <Switch>(Resource.Id.swLineBreaks); if (Nastaveni.NoLineBreaks) { swLineBreaks.Checked = true; } swLineBreaks.CheckedChange += SwLineBreaks_CheckedChange; var swHideHeader = v.FindViewById <Switch>(Resource.Id.swHideHeader); if (Nastaveni.HideHeader) { swHideHeader.Checked = true; } swHideHeader.CheckedChange += SwHideHeader_CheckedChange; var swStatusBar = v.FindViewById <Switch>(Resource.Id.swHideStatusBar); if (Nastaveni.HideStatusBar) { swStatusBar.Checked = true; } swStatusBar.CheckedChange += SwStatusBar_CheckedChange; var swLockPortrait = v.FindViewById <Switch>(Resource.Id.swLockPortrait); if (Nastaveni.NoRotate) { swLockPortrait.Checked = true; } swLockPortrait.CheckedChange += SwLockPortrait_CheckedChange; return(v); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (container == null) { // Currently in a layout without a container, so no reason to create our view. return null; } View view = inflater.Inflate(Resource.Layout.News_Primary, container, false); view.SetOnTouchListener( this ); view.SetBackgroundColor( Rock.Mobile.UI.Util.GetUIColor( ControlStylingConfig.BackgroundColor ) ); return view; }
public override View GetChildView(int groupPosition, int childPosition, bool isLastChild, View convertView, ViewGroup parent) { // Recycle a previous view if provided: var view = convertView; // If no recycled view, inflate a new view as a simple expandable list item 2: if (view == null) { var inflater = _context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater; view = inflater.Inflate(Android.Resource.Layout.SimpleExpandableListItem2, null); } // Grab the produce object at the group position: var grouprow = _grouprow[groupPosition]; // Extract the produce item object at the child position: var rowItem = grouprow.RowItems[childPosition]; // Get the built-in first text view and insert the child name TextView textView = view.FindViewById<TextView>(Android.Resource.Id.Text1); textView.Text = rowItem.Name; return view; }
public override object instantiateItem(ViewGroup container, int position) { MySubscriber p = outerInstance.mSubscribers[position]; container.addView(p.View); return p; }
protected virtual Object InstantiateItemInternal(ViewGroup container, object item) { return((Object)AndroidToolkitExtensions .GetContentView(container, container.Context, item, _itemTemplateProvider.GetTemplateId(), _itemTemplateProvider.GetDataTemplateSelector())); }
public override void destroyItem(ViewGroup container, int position, object @object) { MySubscriber p = (MySubscriber) @object; container.removeView(p.View); }
/// <summary> /// Displays all the visual descendants of <paramref name="viewGroup"/> for diagnostic purposes. /// </summary> public static string ShowDescendants(this ViewGroup viewGroup, StringBuilder sb = null, string spacing = "", ViewGroup viewOfInterest = null) { sb ??= new StringBuilder(); Inner(viewGroup, spacing); return(sb.ToString()); void Inner(ViewGroup vg, string s) { AppendView(vg, s); s += " "; for (var i = 0; i < vg.ChildCount; i++) { var child = vg.GetChildAt(i); if (child is ViewGroup childViewGroup) { Inner(childViewGroup, s); } else { AppendView(child, s); } } } void AppendView(View innerView, string s) { var name = (innerView as IFrameworkElement)?.Name; var namePart = string.IsNullOrEmpty(name) ? "" : $"-'{name}'"; var fe = innerView as IFrameworkElement; var u = innerView as UIElement; var vg = innerView as ViewGroup; sb .Append(s) .Append(innerView == viewOfInterest ? "*>" : ">") .Append(innerView.ToString() + namePart) .Append($"-({ViewHelper.PhysicalToLogicalPixels(innerView.Width):F1}x{ViewHelper.PhysicalToLogicalPixels(innerView.Height):F1})@({ViewHelper.PhysicalToLogicalPixels(innerView.Left):F1},{ViewHelper.PhysicalToLogicalPixels(innerView.Top):F1})") .Append($" {innerView.Visibility}") .Append(fe != null ? $" HA={fe.HorizontalAlignment},VA={fe.VerticalAlignment}" : "") .Append(fe != null && fe.Margin != default ? $" Margin={fe.Margin}" : "") .Append(fe != null && fe.TryGetBorderThickness(out var b) && b != default ? $" Border={b}" : "") .Append(fe != null && fe.TryGetPadding(out var p) && p != default ? $" Padding={p}" : "") .Append(u != null ? $" DesiredSize={u.DesiredSize.ToString("F1")}" : "") .Append(u != null && u.NeedsClipToSlot ? " CLIPPED_TO_SLOT" : "") .Append(u?.Clip != null ? $" Clip={u.Clip.Rect}" : "") .Append(u == null && vg != null ? $" ClipChildren={vg.ClipChildren}" : "") .Append(fe?.Background != null ? $" Background={fe.Background}" : "") .Append(u?.GetElementSpecificDetails()) .Append(u?.GetElementGridOrCanvasDetails()) .Append(u?.RenderTransform.GetTransformDetails()) .Append($" IsLayoutRequested={innerView.IsLayoutRequested}") .Append(innerView is TextBlock textBlock ? $" Text=\"{textBlock.Text}\"" : "") .AppendLine(); } }
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { var layout = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.CheckSubCategoryRow, parent, false); return(new CheckSubCategoryViewHolder(layout, OnItemClick, CheckBoxClicked)); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { base.OnCreateView(inflater, container, savedInstanceState); return(inflater.Inflate(Resource.Layout.fragment_articles, container, false)); }
public void ApplyView(ViewGroup viewGroup, ViewSpec viewSpec) { var viewInfo = ViewContext.GetViewInfo(viewGroup, viewSpec); BindingListSource.SetViewContext(ViewContext, viewInfo); RefreshUi(); }
public override Android.Support.V7.Widget.RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { var itemBindingContext = new MvxAndroidBindingContext(parent.Context, _bindingContext.LayoutInflaterHolder); return(new MvxRecyclerViewHolder(InflateViewForHolder(parent, viewType, itemBindingContext), itemBindingContext) { Click = ItemClick, LongClick = ItemLongClick }); }