本文整理匯總了C#中Android.Inflate方法的典型用法代碼示例。如果您正苦於以下問題:C# Android.Inflate方法的具體用法?C# Android.Inflate怎麽用?C# Android.Inflate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Android
的用法示例。
在下文中一共展示了Android.Inflate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnCreateView
public override Android.Views.View OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState)
{
var ignored = base.OnCreateView (inflater,container,savedInstanceState);
var view = (ViewGroup)inflater.Inflate (Resource.Layout.layout_news, null);
var viewGroup = (ViewGroup)inflater.Inflate (Resource.Layout.layout_group, null);
string string_key = "41f579fc-1445-4065-ab10-c06d50e724d3";
//NewsDetail = new NewsFragmentDetail ();
//var mFragmentItemContainer = viewGroup.FindViewById<FrameLayout> (Resource.Id.fragment4Container);
Button button = viewGroup.FindViewById<Button> (Resource.Id.btnDetalle);
mFrameLayoutContainer = view.FindViewById<FrameLayout> (Resource.Id.RelativeLay);
var trans = Activity.SupportFragmentManager.BeginTransaction ();
//trans.Add (mFragmentItemContainer.Id, new NewsFragmentDetail (), "Detail");
//trans.Add (Resource.Id.layout_content, NewsDetail);
//trans.Hide (NewsDetail);
mCurrentFragment = this;
trans.Commit ();
mRecyclerView = view.FindViewById<RecyclerView> (Resource.Id.RecyclerViewer);
//Pruebas
//cocoservices.tinnova.mx.COCOService cliente = new Navigation_View.cocoservices.tinnova.mx.COCOService ();
//Navigation_View.cocoservices.tinnova.mx.PublicationDTO[] mPublicacion = new Navigation_View.cocoservices.tinnova.mx.PublicationDTO[5];
//Produccion
services_911consumidor_com.COCOService cliente = new Navigation_View.services_911consumidor_com.COCOService();
Navigation_View.services_911consumidor_com.PublicationDTO[] mPublicacion = new Navigation_View.services_911consumidor_com.PublicationDTO[5];
mPublicacion = cliente.GetActivePublications (string_key);
mPublicaciones = new List<Publicaciones> ();
foreach (PublicationDTO value in mPublicacion) {
mPublicaciones.Add (new Publicaciones {
Titulo = value.Tittle,
FechaPublicacion = value.PublicationDate,
Subtitulo = value.SubTittle,
Imagen = value.ImageUrl,
IdPublicacion = value.Id,
Contenido = value.Content
});
}
mLayoutManager = new LinearLayoutManager (view.Context);
mRecyclerView.SetLayoutManager (mLayoutManager);
mAdapter = new adapter_listview (mPublicaciones, mRecyclerView, view.Context);
mRecyclerView.SetAdapter (mAdapter);
return view;
// Create your fragment here
}
示例2: OnCreateView
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState)
{
var activity = Activity;
List<string> list = new List<string>();
list.Add ("http://myshop.pi1m.my/productImage/large/1444533960_17.jpg");
list.Add ("http://myshop.pi1m.my/productImage/large/1444534057_11212641_1609266135987591_2834759448456854827_o.jpg");
list.Add ("http://myshop.pi1m.my/productImage/large/1444533716_serunding%20pantang%202.jpg");
list.Add ("http://myshop.pi1m.my/productImage/large/1444531420_ikan%20bilis.jpg");
list.Add ("http://myshop.pi1m.my/productImage/large/1444446507_11703093_710210295781033_4275767256610608265_n.jpg");
list.Add ("http://myshop.pi1m.my/productImage/large/1444445559_12039569_968112303227019_8292818094866461492_n.jpg");
list.Add ("http://myshop.pi1m.my/productImage/large/1444385557_dnars.jpg");
list.Add ("http://myshop.pi1m.my/productImage/large/1444385805_SET%20JIHAN.jpg");
list.Add ("http://myshop.pi1m.my/productImage/large/1444384474_KAWAII.jpg");
list.Add ("http://myshop.pi1m.my/productImage/large/1444323034_Karpet-01-300x225.jpg");
list.Add ("http://myshop.pi1m.my/productImage/large/1444323034_Karpet-01-300x225.jpg");
var root = inflater.Inflate(Resource.Layout.fragment_card, container, false);
ImageView iv = root.FindViewById<ImageView> (Resource.Id.imageview);
Picasso.With(activity)
.Load(list[position])
.Into(iv);
//iv.SetImageResource (Resource.Drawable.ic_launcher);
iv.Click += (object sender, System.EventArgs e) => popup(list[position]);
ViewCompat.SetElevation(root, 50);
return root;
}
示例3: OnCreateView
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
{
var view = inflater.Inflate(Resource.Layout.DialogRating, null);
Button buttonEasy = view.FindViewById<Button>(Resource.Id.buttonEasy);
Button buttonYester = view.FindViewById<Button>(Resource.Id.buttonYester);
Button buttonNo = view.FindViewById<Button>(Resource.Id.buttonNo);
var preferences = Activity.GetPreferences(FileCreationMode.Private);
_editor = preferences.Edit();
buttonEasy.Click += (object sender, EventArgs e) => {
var url = Android.Net.Uri.Parse("https://itunes.apple.com/ua/app/ers/id604886527?mt=8");
var intent = new Intent(Intent.ActionView, url);
StartActivity(intent);
_editor.PutBoolean("isShow", false);
this.Dismiss();
};
buttonYester.Click += (object sender, EventArgs e) => {
_editor.PutBoolean("isShow", true);
this.Dismiss();
};
buttonNo.Click += (object sender, EventArgs e) => {
_editor.PutBoolean("isShow", false);
this.Dismiss();
};
return view;
}
示例4: OnCreateView
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
{
// Console.WriteLine("[{0}] OnCreateView Called: {1}", TAG, DateTime.Now.ToLongTimeString());
View v = inflater.Inflate(Resource.Layout.fragment_photo, container, false);
mImageView = v.FindViewById<ImageView>(Resource.Id.photoView);
photoUrl = Activity.Intent.GetStringExtra(PhotoGalleryFragment.PHOTO_URL_EXTRA);
photoUrl = photoUrl.Substring(0, photoUrl.Length-6) + ".jpg";
photoFilename = new FlickrFetchr().GetFilenameFromUrl(photoUrl);
ProgressDialog pg = new ProgressDialog(Activity);
pg.SetMessage(Resources.GetString(Resource.String.loading_photo_message));
pg.SetTitle(Resources.GetString(Resource.String.loading_photo_title));
pg.SetCancelable(false);
pg.Show();
Task.Run(async () => {
Bitmap image = await new FlickrFetchr().GetImageBitmapAsync(photoUrl, 0, new CancellationTokenSource().Token, photoFilename).ConfigureAwait(false);
Activity.RunOnUiThread(() => {
mImageView.SetImageBitmap(image);
//Console.WriteLine("[{0}] File created: {1}", TAG, photoUrl);
pg.Dismiss();
});
});
return v;
}
示例5: OnCreateView
public override Android.Views.View OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
{
var view = inflater.Inflate (Resource.Layout.fragment_cart_detail, container, false);
var itemInfo = Constants.ITEMS_FOR_SALE[mItemId];
var itemName = view.FindViewById<TextView> (Resource.Id.text_item_name);
itemName.Text = itemInfo.Name;
var itemImage = Resources.GetDrawable (itemInfo.ImageResourceId);
int imageSize = Resources.GetDimensionPixelSize (Resource.Dimension.image_thumbnail_size);
int actualWidth = itemImage.IntrinsicWidth;
int actualHeight = itemImage.IntrinsicHeight;
int scaledHeight = imageSize;
int scaledWidth = (int) (((float) actualWidth / actualHeight) * scaledHeight);
itemImage.SetBounds (0, 0, scaledWidth, scaledHeight);
itemName.SetCompoundDrawables (itemImage, null, null, null);
var itemPrice = view.FindViewById<TextView> (Resource.Id.text_item_price);
itemPrice.Text = Util.FormatPrice (Activity, itemInfo.PriceMicros);
var shippingCost = view.FindViewById<TextView> (Resource.Id.text_shipping_price);
var tax = view.FindViewById<TextView> (Resource.Id.text_tax_price);
var total = view.FindViewById<TextView> (Resource.Id.text_total_price);
if ((mItemId == Constants.PROMOTION_ITEM) && ((BikestoreApplication)this.Activity.Application).IsAddressValidForPromo) {
shippingCost.Text = Util.FormatPrice (Activity, 0L);
} else {
shippingCost.Text = Util.FormatPrice (Activity, itemInfo.ShippingPriceMicros);
}
tax.Text = Util.FormatPrice (Activity, itemInfo.TaxMicros);
total.Text = Util.FormatPrice (Activity, itemInfo.TotalPrice);
return view;
}
示例6: OnCreateView
public override Android.Views.View OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState)
{
base.OnCreateView (inflater, container, savedInstanceState);
_view = inflater.Inflate (Resource.Layout.FragmentTab, null);
TabText.Text = "Welcome To Tab 2";
return _view;
}
示例7: OnCreateView
public override Android.Views.View OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState)
{
var root = inflater.Inflate(Resource.Layout.fragment_card, container, false);
var text = root.FindViewById<TextView> (Resource.Id.textView);
text.Text = "Card: " + position;
ViewCompat.SetElevation(root, 50);
return root;
}
開發者ID:snowmoun,項目名稱:PagerSlidingTabStrip-for-Xamarin.Android,代碼行數:8,代碼來源:SuperAwesomeCardFragment.cs
示例8: OnCreateView
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
Dialog.Window.RequestFeature(WindowFeatures.NoTitle);
var view = inflater.Inflate(Resource.Layout.custom_dialog, container, true);
ImageView ivImage = view.FindViewById<ImageView> (Resource.Id.ivImage);
var rotateAboutCornerAnimation = AnimationUtils.LoadAnimation(Activity, Resource.Animation.Rotate);
ivImage.StartAnimation(rotateAboutCornerAnimation);
return view;
}
示例9: OnCreateView
// public override void OnCreate (Android.OS.Bundle savedInstanceState)
// {
// base.OnCreate (savedInstanceState);
// this.SetStyle (DialogFragmentStyle.NoTitle, Resource.Style.Theme_WithoutActionBar);
// }
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
{
var view = inflater.Inflate (Resource.Layout.Bonus, null);
view.Background.SetColorFilter (Activity.Resources.GetColor (Resource.Color.bonus_bg),PorterDuff.Mode.SrcAtop);
view.FindViewById<TextView> (Resource.Id.congrats).SetTypeface (Activity.MyriadProFont (MyriadPro.SemiboldCondensed), TypefaceStyle.Normal);
view.FindViewById<TextView> (Resource.Id.youHaveBonus).SetTypeface (Activity.MyriadProFont (MyriadPro.SemiboldCondensed), TypefaceStyle.Normal);
view.FindViewById<TextView> (Resource.Id.bonusText).SetTypeface (Activity.MyriadProFont (MyriadPro.Condensed), TypefaceStyle.Normal);
view.FindViewById<ImageButton> (Resource.Id.continueButton).Click += (sender, e) => Dismiss();
return view;
}
示例10: OnCreateView
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
{
Dialog.Window.RequestFeature(WindowFeatures.NoTitle);
base.OnCreateView (inflater, container, savedInstanceState);
View view = inflater.Inflate (Resource.Layout.dialog_fragment, container, true);
tvCancel = view.FindViewById<TextView> (Resource.Id.tvCancel);
tvYesFlag = view.FindViewById<TextView> (Resource.Id.tvYesFlag);
tvCancel.Click += TvCancel_Click;
tvYesFlag.Click += TvYesFlag_Click;
return view;
}
示例11: OnCreateView
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState)
{
var view = inflater.Inflate(Resource.Layout.PlainActivityLayout, null);
this.label1 = view.FindViewById<TextView>(Resource.Id.textView1);
this.field1 = view.FindViewById<EditText>(Resource.Id.editText1);
this.button1 = view.FindViewById<Button>(Resource.Id.button1);
this.button2 = view.FindViewById<Button>(Resource.Id.button2);
return view;
}
示例12: OnCreateView
public override Android.Views.View OnCreateView (Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState)
{
var root = inflater.Inflate (Resource.Layout.fragment_welcome, container, false);
var buttonSignup = root.FindViewById<Button> (Resource.Id.signup);
blue = root.FindViewById<RadioButton> (Resource.Id.blue);
buttonSignup.Click += (sender, e) => {
Settings.AppTheme = blue.Checked ? AppTheme.Blue : AppTheme.Red;
((WelcomeActivity)Activity).GoToGetStarted ();
};
return root;
}
示例13: OnCreateView
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState)
{
var view = inflater.Inflate(Resource.Layout.WidgetSample, null);
var button1 = view.FindViewById<Button>(Resource.Id.button1);
button1.Click += (object sender, EventArgs e) => {
messageDisplay.DisplayMessage("title", "this is a message", Actions.Null);
};
return view;
}
示例14: OnCreateView
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState)
{
var view = inflater.Inflate(Resource.Layout.UserBadgeActivity, container, false);
usernameTextView = (TextView)view.FindViewById(Resource.Id.username);
topTimeTextView = (TextView)view.FindViewById(Resource.Id.toptime);
userImage = (WebImage)view.FindViewById(Resource.Id.userimage);
progress = (ProgressBar)view.FindViewById(Resource.Id.progress);
return view;
}
示例15: OnCreateView
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Android.OS.Bundle savedInstanceState)
{
var ignored = base.OnCreateView(inflater, container, savedInstanceState);
var view = inflater.Inflate(Resource.Layout.fragment_browse, null);
var grid = view.FindViewById<GridView>(Resource.Id.grid);
_friends = Util.GenerateFriends();
grid.Adapter = new MonkeyAdapter(Activity, _friends);
grid.ItemClick += GridOnItemClick;
return view;
}