本文整理汇总了C#中LinearLayout.SetY方法的典型用法代码示例。如果您正苦于以下问题:C# LinearLayout.SetY方法的具体用法?C# LinearLayout.SetY怎么用?C# LinearLayout.SetY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinearLayout
的用法示例。
在下文中一共展示了LinearLayout.SetY方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: showAd
void showAd(int idAd)
{
adOpen = true;
_adLayout = new LinearLayout (context);
_adLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (255));
Drawable dr = new BitmapDrawable (getBitmapFromAsset (adsImagesPath[idAd]));
_adLayout.SetBackgroundDrawable (dr);
_adLayout.SetY (Configuration.getHeight(1136-85-255));
_mainLayout.AddView (_adLayout);
_adLayout.Click += delegate {
context.StartActivity(Configuration.getOpenFacebookIntent(context,"fb://page/114091405281757","http://www.hi-tec.com/pe/"));
};
}
示例2: iniMenu
//.........这里部分代码省略.........
linearTxtValorBarra.SetGravity (GravityFlags.Center);
txtValorBarra.Gravity = GravityFlags.Center;
linearCurse.Orientation = Orientation.Horizontal;
linearCurse.SetGravity (GravityFlags.CenterVertical);
linearTask.Orientation = Orientation.Horizontal;
linearTask.SetGravity (GravityFlags.CenterVertical);
linearSchool.Orientation = Orientation.Horizontal;
//linearSchool.SetGravity (GravityFlags.CenterVer);
linearUserData.Orientation = Orientation.Vertical;
linearUserData.SetGravity (GravityFlags.Center);
linearUser.Orientation = Orientation.Vertical;
linearUser.SetGravity (GravityFlags.CenterHorizontal);
linearListCurso.Orientation = Orientation.Vertical;
linearListTask.Orientation = Orientation.Vertical;
linearList.Orientation = Orientation.Vertical;
linearPendiente.Orientation = Orientation.Horizontal;
linearPendiente.SetGravity (GravityFlags.Center);
//linearList.SetGravity (GravityFlags.CenterVertical);
progressBar = new ProgressBar (this,null,Android.Resource.Attribute.ProgressBarStyleHorizontal);
progressBar.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (274), Configuration.getHeight (32));
progressBar.ProgressDrawable = Resources.GetDrawable (Resource.Drawable.progressBackground);
progressBar.Progress = 60;
txtValorBarra.Text = "60%";
//progressBar.text
txtValorBarra.SetY(13);
txtCurse.Text = "Cursos del 2015";
txtCurse.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
// txtUserName.Text ="David Spencer";
txtUserName.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtUserRol.Text ="Alumno";
txtUserRol.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtSchoolName.Text ="Colegio Sagrados Corazones";
txtSchoolName.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtPorcentaje.Text = "60%";
txtPorcentaje.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtCurseTitle.Text = "CURSOS";
txtCurseTitle.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtTaskTitle.Text = "TAREAS";
txtTaskTitle.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtPendiente.Text = "1";
txtPendiente.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtPendiente.SetY (-10);
txtPendiente.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30));
txtUserName.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (35));
txtUserRol.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30));
示例3: initUi
private void initUi()
{
_mainLayout = new RelativeLayout (context);
_mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);
_scrollItems = new VerticalScrollView (context);
_scrollItems.LayoutParameters = new VerticalScrollView.LayoutParams (-1, Configuration.getHeight(965));
_scrollItems.SetY (Configuration.getHeight (125));
initItems ();
_scrollItems.AddView (_linearContentLayout);
_mainLayout.AddView (_scrollItems);
_publicidadLayout = new LinearLayout (context);
_publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85));
Drawable dr = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg"));
_publicidadLayout.SetBackgroundDrawable (dr);
_publicidadLayout.SetY (Configuration.getHeight(1136-85));
_mainLayout.AddView (_publicidadLayout);
_publicidadLayout.Click += delegate {
if (adOpen) {
hideAd ();
} else {
Random rnd = new Random();
showAd (rnd.Next(adsImagesPath.Count));
}
};
}
示例4: ini
public void ini(){
Drawable dr = new BitmapDrawable (getBitmapFromAsset("images/1header.png"));
header = new LinearLayout(context);
header.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(125));
header.Orientation = Orientation.Horizontal;
header.SetGravity (GravityFlags.Center);
header.SetBackgroundDrawable (dr);
titulo_header = new TextView (context);
titulo_header.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(550), -1);
titulo_header.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(38));
titulo_header.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
titulo_header.SetTextColor (Color.White);
titulo_header.Gravity = GravityFlags.Center;
//titulo_header.TextAlignment = TextAlignment.Center;
placesInfoLayout = new LinearLayout (context);
placesInfoLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
int space = Configuration.getWidth (30);
placesInfoLayout.SetPadding(space,space,space,space);
placesInfoLayout.Orientation = Orientation.Vertical;
_mainLayout = new RelativeLayout (context);
_mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
_mainLayout.AddView (header);
mapImage = new ScaleImageView (context, null);
mapImage.LayoutParameters = new LinearLayout.LayoutParams (-1, -1);
mapSpace = new LinearLayout (context);
mapSpace.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(640), Configuration.getWidth(640));
mapSpace.SetY (Configuration.getHeight (125));
mapSpace.SetGravity (GravityFlags.Left);
mapSpace.SetBackgroundColor (Color.ParseColor ("#DFC6BB"));
//HUILLCA-----------------------------------------
mapSpaceMarker = new RelativeLayout (context);
mapSpaceMarker.LayoutParameters = new RelativeLayout.LayoutParams (Configuration.getWidth(640), Configuration.getWidth(640));
mapSpaceMarker.SetY (Configuration.getHeight (125));
mapSpaceMarker.SetGravity (GravityFlags.Left);
mapSpaceMarker.SetBackgroundColor (Color.Transparent);
iconMarker = new ImageIconMap (context);
iconMarker.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (60), Configuration.getWidth (60));
int w = Configuration.getWidth (70);
int h = Configuration.getWidth (70);
iconMarker.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/iconmap12.png"), w, h, true));
iconMarker.SetX (-100);
iconMarker.SetY (-100);
mapSpaceMarker.AddView (iconMarker);
var fadeIn = new AlphaAnimation(0, 1);
fadeIn.Interpolator = new AccelerateInterpolator();
fadeIn.Duration = 1000;
fadeOut = new AlphaAnimation(1, 0);
fadeOut.Interpolator = new DecelerateInterpolator();
fadeOut.Duration = 3000;
fadeOut.AnimationEnd += (s, e) =>
{
/*ThreadPool.QueueUserWorkItem(state =>
{
Thread.Sleep(2000); //wait 2 sec
//RunOnUiThread(() => iconMarker.StartAnimation(fadeOut));
});*/
iconMarker.StartAnimation(fadeIn);
iconMarker.Visibility = ViewStates.Invisible;
};
//-------------------------------------------------------
mapSpace.AddView (mapImage);
placeSpace = new VerticalScrollView (context);
placeSpace.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(375-85));
placeSpace.SetY (Configuration.getHeight (125)+Configuration.getWidth(640));
placeSpace.SetBackgroundColor (Color.White);
placesContainer = new LinearLayout (context);
placesContainer.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(375-85));
placesContainer.Orientation = Orientation.Vertical;
_mainLayout.AddView (mapSpace);
_mainLayout.AddView (mapSpaceMarker);//HUILLCA
_mainLayout.AddView (placeSpace);
_publicidadLayout = new LinearLayout (context);
_publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85));
Drawable drp = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg"));
_publicidadLayout.SetBackgroundDrawable (drp);
_publicidadLayout.SetY (Configuration.getHeight(1136-85));
_mainLayout.AddView (_publicidadLayout);
_publicidadLayout.Click += delegate {
if (adOpen) {
hideAd ();
} else {
//.........这里部分代码省略.........
示例5: ini
//.........这里部分代码省略.........
linearImageLO.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(372));
linearTextLO.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(250));
linearLike.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(120), Configuration.getHeight(80));
linearUsers.LayoutParameters = new LinearLayout.LayoutParams (-1,-2);
linearTextLO.Orientation = Orientation.Vertical;
linearTextLO.SetGravity(GravityFlags.Right);
linearLike.Orientation = Orientation.Vertical;
linearLike.SetGravity (GravityFlags.Center);
linearUsers.Orientation = Orientation.Horizontal;
linearUsers.SetGravity (GravityFlags.Center);
linearContainer.Orientation = Orientation.Vertical;
//linearContainer.SetGravity (GravityFlags.Center);
//Drawable d = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/fondounidad.png"), 480, 640, true));
//linearImageLO.SetBackgroundDrawable (d);
imgHeart.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/like.png"), Configuration.getWidth(43), Configuration.getHeight(43), true));
txtAuthor.Text = "Author : David Spencer";
txtChapter.Text = "Flora y Fauna";
txtNameLO.Text = "Camino Inca";
txtLike.Text = "10";
//txtChapter.SetMaxWidth (Configuration.getWidth (580));
//txtChapter.Ellipsize = TextUtils.TruncateAt.End;
//txtChapter.SetMaxLines(1);
txtAuthor.SetTextColor (Color.ParseColor("#ffffff"));
txtChapter.SetTextColor (Color.ParseColor("#ffffff"));
txtNameLO.SetTextColor (Color.ParseColor("#ffffff"));
txtLike.SetTextColor (Color.ParseColor("#ffffff"));
txtNameLO.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30));
txtChapter.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (50));
txtAuthor.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30));
txtNameLO.Typeface = Typeface.DefaultBold;
txtAuthor.Gravity = GravityFlags.Right;
txtChapter.Gravity = GravityFlags.Right;
txtNameLO.Gravity = GravityFlags.Right;
txtLike.Gravity = GravityFlags.Center;
linearTextLO.AddView (txtNameLO);
linearTextLO.AddView (txtChapter);
linearTextLO.AddView (txtAuthor);
linearTextLO.SetPadding (0, 0, Configuration.getWidth (30), 0);
linearLike.AddView (imgHeart);
linearLike.AddView (txtLike);
_mCommentData = new List<CommentDataRow> ();
/*
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
_mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" });
*/
// commentList.Adapter = new CommentListViewAdapter (context, _mCommentData);
commentList.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(654));
commentList.SetX (0);commentList.SetY (Configuration.getHeight (530));
linearTextLO.SetX (0); linearTextLO.SetY (Configuration.getHeight(200));
//linearImageLO.SetX (0); linearImageLO.SetY (0);
linearLike.SetX (0); linearLike.SetY (Configuration.getHeight(256));
linearContainer.SetX (0); linearContainer.SetY (0);
linearContainer.AddView (linearImageLO);
linearContainer.AddView (linearUsers);
mainLayout.AddView (linearContainer);
//mainLayout.AddView (linearImageLO);
mainLayout.AddView (linearTextLO);
mainLayout.AddView (linearLike);
mainLayout.AddView (commentList);
this.AddView (mainLayout);
/*linearImageLO.Click += delegate {
var com = ((LOViewModel)context.DataContext).SignUpCommand;
com.Execute(null);
};
*/
}
示例6: init
//.........这里部分代码省略.........
linearLicencia.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearLicencia.Orientation = Orientation.Horizontal;
linearLicencia.SetGravity (GravityFlags.Center);
linearLogin.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearLogin.Orientation = Orientation.Horizontal;
linearLogin.SetGravity (GravityFlags.Right);
linearSingup.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearSingup.Orientation = Orientation.Vertical;
linearSingup.SetGravity (GravityFlags.Center);
linearLogo.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearLogo.Orientation = Orientation.Vertical;
linearLogo.SetGravity (GravityFlags.Center);
txtLicencia_a.Text = "TO REGISTER, ACCEPT THE";
txtLicencia_a.SetTextSize(textFormat,Configuration.getHeight(25));
txtLicencia_a.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtLicencia_a.SetTextColor (Color.ParseColor ("#ffffff"));
txtLicencia_b.Text = " TERMS OF USE";
txtLicencia_b.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtLicencia_b.SetTextSize(textFormat,Configuration.getHeight(25));
txtLicencia_b.SetTextColor (Color.ParseColor ("#00c6ff"));
chkLogin.Checked = false;
chkLogin.SetBackgroundColor(Color.ParseColor("#ffffff"));
imgLogo.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/logo.png"), Configuration.getWidth(360), Configuration.getHeight(230),true));
btnLogin.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/login.png"), Configuration.getWidth(210), Configuration.getHeight(60),true));
btnFacebook.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/signupface.png"), Configuration.getWidth(507), Configuration.getHeight(80),true));
btnSingUp.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/signupnolisto.png"), Configuration.getWidth(507), Configuration.getHeight(80),true));
Drawable dc = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/toregister.png"), Configuration.getWidth(47), Configuration.getHeight(47), true));
chkLogin.SetBackgroundDrawable (dc);
initButtonColor (btnLogin);
initButtonColor (btnFacebook);
initButtonColor (btnSingUp);
linearLicencia.AddView (chkLogin);
linearLicencia.AddView (txtLicencia_a);
linearLicencia.AddView (txtLicencia_b);
linearLogin.AddView (btnLogin);
linearSingup.AddView (linearLicencia);
linearSingup.AddView (btnSingUp);
linearSingup.AddView (btnFacebook);
linearLogo.AddView (imgLogo);
linearLogo.SetX (0); linearLogo.SetY (Configuration.getHeight(373));
linearContentText.SetX (0); linearContentText.SetY (Configuration.getHeight(557));
linearLogin.SetX (0); linearLogin.SetY (Configuration.getHeight(30));
linearSingup.SetX (0); linearSingup.SetY (Configuration.getHeight(785));
relSingup.AddView (linearLogo);
relSingup.AddView (linearContentText);
relSingup.AddView (linearLogin);
relSingup.AddView (linearSingup);
mainLayout.AddView (relSingup);
btnSingUp.Click+= delegate {
if(chkLogin.Checked==true){
var com = ((LoginViewModel)this.DataContext).SignUpCommand;
com.Execute(null);
}
};
btnLogin.Click+= BtnLogin_Click;
btnFacebook.Click += async delegate {
await Authenticate(MobileServiceAuthenticationProvider.Facebook);
/*var com = ((LoginViewModel)this.DataContext).FacebookLoginCommand;
com.Execute(null);
*/
};
chkLogin.CheckedChange += delegate {
if(chkLogin.Checked==true){
btnSingUp.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/signuplisto.png"), Configuration.getWidth(507), Configuration.getHeight(80),true));
}
if(chkLogin.Checked==false){
btnSingUp.SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/signupnolisto.png"), Configuration.getWidth(507), Configuration.getHeight(80),true));
}
};
}
示例7: ini
public void ini(){
var textFormat = Android.Util.ComplexUnitType.Px;
mainLayout = new RelativeLayout (context);
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1);
Drawable d = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/fondo.png"), 1024, 768, true));
mainLayout.SetBackgroundDrawable (d);
title = new TextView (context);
imgLinea = new ImageView (context);
listNotification = new ListView (context);
linearList = new LinearLayout (context);
imgPoint = new ImageView (context);
title.Text = "Notificaciones";
title.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf");
title.SetTextColor (Color.ParseColor ("#ffffff"));
title.SetTextSize (textFormat, Configuration.getHeight (48));
title.SetX (Configuration.getHeight (35));
title.SetY (Configuration.getWidth (142));
linearList.SetBackgroundColor (Color.ParseColor ("#ffffff"));
linearList.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (886));
linearList.SetX (Configuration.getWidth (0)); linearList.SetY (Configuration.getHeight(250));
listNotification.SetX (Configuration.getWidth (0)); listNotification.SetY (Configuration.getHeight(250));
listNotification.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight (886));
imgLinea.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/lineanotificaciones.png"), 4,2000 , true));
imgLinea.SetX (Configuration.getWidth (61)); imgLinea.SetY (Configuration.getHeight(240));
imgPoint.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/circblanco.png"), 30,30 , true));
imgPoint.SetX (Configuration.getWidth (52)); imgPoint.SetY (Configuration.getHeight(228));
//linearList.AddView (listNotification);
mainLayout.AddView (title);
mainLayout.AddView(linearList);
mainLayout.AddView (listNotification);
mainLayout.AddView (imgLinea);
mainLayout.AddView (imgPoint);
}
示例8: initUnidades
//.........这里部分代码省略.........
//descriptionUnidad.SetTextIsSelectable (true);
LinearLayout linearContenidoIn = new LinearLayout (context);
linearContenidoIn.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
linearContenidoIn.Orientation = Orientation.Vertical;
//linearContenidoIn.SetGravity (Android.Views.GravityFlags.Center);
linearContenidoIn.AddView (titleUnidad);
linearContenidoIn.AddView (descriptionUnidad);
linearContenido.AddView (linearContenidoIn);
if (indexCurso == 2) {
linearContenidoIn.RemoveView (descriptionUnidad);
ImageView imgUnidad = new ImageView (context);
Picasso.With (context).Load (_listUnidades[i].ImageUrl).Resize(Configuration.getWidth(440),Configuration.getHeight(440)).Placeholder(context.Resources.GetDrawable (Resource.Drawable.progress_animation)).CenterInside().Into (imgUnidad);
linearContenidoIn.AddView (imgUnidad);
linearContenidoIn.SetGravity (Android.Views.GravityFlags.Center);
linearUnidad.SetPadding (0, Configuration.getWidth (25),0, Configuration.getWidth (25));
}
linearUnidad.AddView (linearContenido);
if (indexCurso == 0) {
if (indexUnidad != 3) {
ImageView info = new ImageView (context);
info.Tag = i;
info.SetImageBitmap (iconInfo);
info.SetX (Configuration.getWidth(450));
info.SetY (Configuration.getHeight (10));
linearContenido.AddView (info);
if (indexUnidad == 2 && i > 1 ) {
} else {
LinearLayout test = new LinearLayout (context);
//test.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
test.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(100));
test.SetGravity (Android.Views.GravityFlags.Center);
test.Tag = i;
test.SetX( Configuration.getWidth (0));
test.SetY( Configuration.getWidth (-40));
//test.SetPadding (Configuration.getWidth(30), Configuration.getWidth (25), Configuration.getWidth(30), Configuration.getWidth (25));
test.SetGravity (GravityFlags.Left | GravityFlags.Center);
TextView verMapa = new TextView (context);
verMapa.Text = Resources.GetText(Resource.String.See_maps_and_photos);
verMapa.Typeface = Typeface.CreateFromAsset (context.Assets, "fonts/ArcherMediumPro.otf");
verMapa.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight (35));
verMapa.SetTextColor (Color.ParseColor (Configuration.ListaColores [i % 6]));
test.AddView (verMapa);
linearUnidad.AddView (test);
_listIconVerMap.Add (test);
}
} else {
titleUnidad.SetTextSize (textFormat,Configuration.getHeight(55));
}
}
if (indexCurso == 1 && indexUnidad==7) {
linearContenidoIn.RemoveView (titleUnidad);
linearContenidoIn.RemoveView (descriptionUnidad);
//linearContenidoIn.LayoutParameters = new LinearLayout.LayoutParams (-2, -2);
linearContenidoIn.SetX(Configuration.getWidth (0));
ImageView imgUnidad = new ImageView (context);
Picasso.With (context).Load (_listUnidades[i].ImageUrl).Resize(Configuration.getWidth(640),Configuration.getHeight(2362)).Placeholder(context.Resources.GetDrawable (Resource.Drawable.progress_animation)).CenterInside().Into (imgUnidad);
linearContenidoIn.AddView (imgUnidad);
linearUnidad.SetPadding (0, 0, 0, 0);
linearUnidad.SetX(Configuration.getWidth (0));
}
_listLinearUnidades.Add (linearUnidad);
LinearLayout separationLinear = new LinearLayout (context);
separationLinear.LayoutParameters = new LinearLayout.LayoutParams (-1, 5);
separationLinear.SetBackgroundColor (Color.ParseColor ("#D8D8D8"));
separationLinear.Orientation = Orientation.Horizontal;
//linearUnidad.AddView (separationLinear);
_spaceUnidades.AddView (linearUnidad);
_spaceUnidades.AddView (separationLinear);
}
}
示例9: init
public void init(){
mainLayout = new RelativeLayout (this);
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);
linearButtons = new LinearLayout (this);
linearImageCamera = new LinearLayout (this);
LinearImageText = new LinearLayout (this);
LinearTextCamera = new LinearLayout (this);
linearButtons.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearImageCamera.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
LinearImageText.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
LinearTextCamera.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent);
linearButtons.Orientation = Orientation.Horizontal;
linearImageCamera.Orientation = Orientation.Horizontal;
LinearImageText.Orientation = Orientation.Horizontal;
LinearTextCamera.Orientation = Orientation.Vertical;
//linearButtons.SetGravity (GravityFlags.Center);
linearImageCamera.SetGravity (GravityFlags.Center);
LinearImageText.SetGravity (GravityFlags.Center);
LinearTextCamera.SetGravity (GravityFlags.Center);
Drawable dr = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/bfondo.png"), 1024, 768, true));
mainLayout.SetBackgroundDrawable (dr);
imgCamera = new ImageView (this);
imgLineal = new ImageView (this);
btnCamera = new ImageButton (this);
btnRepository = new ImageButton (this);
btnDone = new ImageButton (this);
txtCamera = new TextView (this);
txtCamera.Text = "CHOOSE A PICTURE AND \n SELECT A COLOUR";
txtCamera.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
txtCamera.SetTextSize(Android.Util.ComplexUnitType.Px,Configuration.getHeight(30));
txtCamera.SetTextColor (Color.ParseColor ("#ffffff"));
Button bt = new Button (this);
imgCamera.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/camara.png"), Configuration.getWidth(164),Configuration.getHeight(164),true));
imgLineal.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/colores.png"), Configuration.getWidth(542), 5,true));
btnCamera.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/loadcamara.png"), Configuration.getWidth(58),Configuration.getHeight(50),true));
btnRepository.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/loadbiblioteca.png"), Configuration.getWidth(58),Configuration.getHeight(50),true));
btnDone.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/adelante.png"), Configuration.getWidth(20),Configuration.getWidth(30),true));
imgCamera.Click += delegate {
var com = ((CameraViewModel)this.DataContext).TakePictureCommand;
com.Execute (null);
};
linearButtons.AddView (btnCamera);
linearButtons.AddView (btnRepository);
btnCamera.SetPadding (Configuration.getWidth(122),0,0,0);
btnRepository.SetPadding (Configuration.getWidth(300),0,0,0);
linearImageCamera.AddView (imgCamera);
txtCamera.SetPadding (0, Configuration.getHeight(70), 0, 0);
LinearImageText.AddView (txtCamera);
LinearTextCamera.AddView (linearImageCamera);
LinearTextCamera.AddView (LinearImageText);
LinearTextCamera.SetX (0); LinearTextCamera.SetY (Configuration.getHeight(295));
linearButtons.SetX (0); linearButtons.SetY (Configuration.getHeight(926));
imgLineal.SetX (Configuration.getWidth(61)); imgLineal.SetY (Configuration.getHeight(1019));
btnDone.SetX (Configuration.getWidth(550)); btnDone.SetY (Configuration.getHeight(40));
mainLayout.AddView (btnDone);
mainLayout.AddView (LinearTextCamera);
mainLayout.AddView (linearButtons);
mainLayout.AddView (imgLineal);
initButtonColor (btnCamera);
initButtonColor (btnRepository);
initButtonColor (btnDone);
btnCamera.Click += delegate {
var com = ((CameraViewModel)this.DataContext).TakePictureCommand;
com.Execute(null);
};
btnRepository.Click += delegate {
var com = ((CameraViewModel)this.DataContext).ChoosePictureCommand;
com.Execute(null);
};
Bitmap bm;
var vm = this.ViewModel as CameraViewModel;
if (vm.Bytes != null)
{
bm= BitmapFactory.DecodeByteArray(vm.Bytes, 0, vm.Bytes.Length);
imgCamera.SetImageBitmap (bm);
}
//.........这里部分代码省略.........
示例10: init
public void init(){
mainLayout = new RelativeLayout (this);
txtRegister = new TextView (this);
etxtEmail = new EditText (this);
etxtUser = new EditText (this);
etxtPassword = new EditText (this);
btnCreateAccount = new ImageButton (this);
linearButtonRegister = new LinearLayout (this);
linearRegister = new LinearLayout (this);
linearButtonRegister.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
linearRegister.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent);
linearButtonRegister.Orientation = Orientation.Horizontal;
linearRegister.Orientation = Orientation.Vertical;
linearButtonRegister.SetGravity (GravityFlags.Center);
linearRegister.SetGravity (GravityFlags.Center);
etxtUser.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
etxtPassword.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
etxtEmail.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78));
mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);
Drawable drawableBackground = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/cfondo.png"), 768, 1024, true));
mainLayout.SetBackgroundDrawable (drawableBackground);
txtRegister.Text = "Registro";
txtRegister.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtUser.Hint =" Nombre de usuario";
etxtUser.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtEmail.Hint = " Dirección de correo";
etxtEmail.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
etxtPassword.Hint =" Contraseña";
etxtPassword.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf");
Drawable drawableEditText = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/cajatexto.png"), Configuration.getWidth (507), Configuration.getHeight (80), true));
etxtUser.SetBackgroundDrawable (drawableEditText);
etxtPassword.SetBackgroundDrawable (drawableEditText);
etxtEmail.SetBackgroundDrawable (drawableEditText);
etxtUser.SetTextColor (Color.ParseColor ("#ffffff"));
etxtUser.SetSingleLine (true);
etxtPassword.SetTextColor (Color.ParseColor ("#ffffff"));
etxtPassword.SetSingleLine (true);
etxtEmail.SetTextColor (Color.ParseColor ("#ffffff"));
etxtEmail.SetSingleLine (true);
txtRegister.SetTextColor (Color.ParseColor("#ffffff"));
txtRegister.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (40));
etxtPassword.InputType = InputTypes.TextVariationVisiblePassword;
etxtPassword.TransformationMethod = Android.Text.Method.PasswordTransformationMethod.Instance;
btnCreateAccount.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/crearcuenta.png"), Configuration.getWidth (507), Configuration.getHeight (80), true));
btnCreateAccount.Alpha = 255;
//btn.SetAlpha(255);
btnCreateAccount.SetBackgroundColor(Color.Transparent);
LinearLayout space = new LinearLayout (this);
space.LayoutParameters = new LinearLayout.LayoutParams (-1, 20);
LinearLayout space2 = new LinearLayout (this);
space2.LayoutParameters = new LinearLayout.LayoutParams (-1, 20);
linearRegister.AddView (etxtUser);
linearRegister.AddView (space);
linearRegister.AddView (etxtEmail);
linearRegister.AddView (space2);
linearRegister.AddView (etxtPassword);
linearButtonRegister.AddView (btnCreateAccount);
txtRegister.SetX (Configuration.getWidth(72)); txtRegister.SetY (Configuration.getHeight(535));
linearRegister.SetX (0); linearRegister.SetY (Configuration.getHeight(592));
linearButtonRegister.SetX (0); linearButtonRegister.SetY (Configuration.getHeight(975));
mainLayout.AddView (txtRegister);
mainLayout.AddView (linearRegister);
mainLayout.AddView (linearButtonRegister);
//string ndef = "None" ;
//string foto = "http://www.clinicatorielli.com/img/icons/no-user.png";
EditText lastName = new EditText (this);
lastName.Text = "None";
EditText url = new EditText (this);
url.Text = "http://www.clinicatorielli.com/img/icons/no-user.png";
//.........这里部分代码省略.........
示例11: ini
public void ini(){
_txtCursoN = new TextView (context);
_txtCursoN.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
_txtUnidadN = new TextView (context);
_mainLayout = new RelativeLayout (context);
linearGradiente = new LinearLayout (context);
linearGradiente.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (310));
linearGradiente.SetBackgroundResource (Resource.Drawable.gradiente);
var textFormat = Android.Util.ComplexUnitType.Px;
_mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);
_scrollSpace = new VerticalScrollView (context);
_scrollSpace.LayoutParameters = new VerticalScrollView.LayoutParams (-1, Configuration.getHeight(1015-85));
_scrollSpace.SetY (Configuration.getHeight (125));
//_scrollSpace.SetBackgroundColor (Color.ParseColor ("#FF0000"));
_mainLayout.AddView (_scrollSpace);
_publicidadLayout = new LinearLayout (context);
_publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85));
Drawable dr = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg"));
_publicidadLayout.SetBackgroundDrawable (dr);
_publicidadLayout.SetY (Configuration.getHeight(1136-85));
_mainLayout.AddView (_publicidadLayout);
_publicidadLayout.Click += delegate {
if (adOpen) {
hideAd ();
} else {
Random rnd = new Random();
showAd (rnd.Next(adsImagesPath.Count));
}
};
_mapSpace = new LinearLayout (context);
_mapSpace.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (1015));
_mapSpace.SetY(Configuration.getHeight (125));
_mainLayout.AddView (_mapSpace);
_mainSpace = new LinearLayout (context);
_mainSpace.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
_mainSpace.Orientation = Orientation.Vertical;
_scrollSpace.AddView (_mainSpace);
_fondo2 = new RelativeLayout (context);
_fondo2.LayoutParameters = new RelativeLayout.LayoutParams (-1, Configuration.getWidth (640));
_fondo2.SetY (Configuration.getHeight (0));
Drawable dr1 = new BitmapDrawable (getBitmapFromAsset("icons/fondoselec.png"));
_fondo2.SetBackgroundDrawable (dr1);
dr1 = null;
_mainSpace.AddView (_fondo2);
infoCursoUnidad = new LinearLayout (context);
infoCursoUnidad.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(250));
infoCursoUnidad.Orientation = Orientation.Vertical;
infoCursoUnidad.SetGravity(Android.Views.GravityFlags.Right);
infoCursoUnidad.SetPadding (Configuration.getWidth(30), Configuration.getWidth (25), Configuration.getWidth(30), Configuration.getWidth (25));
infoCursoUnidad.SetBackgroundColor (Color.ParseColor ("#40000000"));
TextView _txtCurso = new TextView (context);
_txtCurso.Text = Resource.String.THE_ROUTES.ToString ();;
_txtCurso.SetY (-100);
//section1-----------------------------------------------
_contentRLayout_S1 = new RelativeLayout(context);
_txtTitle_S1 = new TextView (context);
_txtAuthor_S1 = new TextView (context);
_imAuthor_S1 = new ImageView (context);
_txtChapter_S1 = new TextView (context);
_itemsLayout_S1 = new LinearLayout (context);//not used
_imItem_S1 = new List<ImageView> ();
_txtItem_S1 = new List<TextView>();
_contentRLayout_S1.LayoutParameters = new RelativeLayout.LayoutParams (-1, Configuration.getHeight (480));
LinearLayout _linearTitle = new LinearLayout (context);
_linearTitle.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
_linearTitle.SetGravity (Android.Views.GravityFlags.Center);
_linearTitle.AddView (_txtTitle_S1);
_linearTitle.SetY (Configuration.getHeight (60));
linearGradiente.SetX (0); linearGradiente.SetY (Configuration.getHeight(860));
//_mainLayout.AddView (linearGradiente);
//_mainLayout.AddView (_linearTitle);
//_txtTitle_S1.SetX (Configuration.getWidth (245));_txtTitle_S1.SetY (Configuration.getHeight (60));
//.........这里部分代码省略.........
示例12: ini
//.........这里部分代码省略.........
linearImageLO = new LinearLayout (context);
linearTaskComplete.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(84));
linearTaskIncomplete.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(84));
linearImageLO.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(372));
linearTextLO.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(250));
linearContentTask.LayoutParameters = new LinearLayout.LayoutParams(-1,-2);
linearListTaskC.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(255));
linearListTaskI.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(255));
linearTaskComplete.Orientation = Orientation.Horizontal;
linearTaskComplete.SetGravity(GravityFlags.Center);
linearTaskIncomplete.Orientation = Orientation.Horizontal;
linearTaskIncomplete.SetGravity(GravityFlags.Center);
linearTextLO.Orientation = Orientation.Vertical;
linearTextLO.SetGravity(GravityFlags.Right);
linearListTaskC.Orientation = Orientation.Vertical;
linearListTaskI.Orientation = Orientation.Vertical;
//linearListTaskC.SetGravity(Gravity
linearContentTask.Orientation = Orientation.Vertical;
txtAuthor.Text = "Author : David Spencer";
txtChapter.Text = "Flora y Fauna";
txtNameLO.Text = "Camino Inca";
txtAuthor.SetPadding (0, 0, Configuration.getWidth (30), 0);
txtChapter.SetPadding (0, 0, Configuration.getWidth (30), 0);
txtNameLO.SetPadding (0, 0, Configuration.getWidth (30), 0);
txtTaskComplete.Text = "Tareas Completadas";
txtTaskIncomplete.Text = "Tareas por completar";
txtAuthor.SetTextColor (Color.ParseColor("#ffffff"));
txtChapter.SetTextColor (Color.ParseColor("#ffffff"));
txtNameLO.SetTextColor (Color.ParseColor("#ffffff"));
txtNameLO.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30));
txtChapter.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (50));
txtAuthor.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30));
txtNameLO.Typeface = Typeface.DefaultBold;
txtAuthor.Gravity = GravityFlags.Right;
txtChapter.Gravity = GravityFlags.Right;
txtNameLO.Gravity = GravityFlags.Right;
txtTaskComplete.SetTextColor (Color.ParseColor ("#999999"));
txtTaskIncomplete.SetTextColor (Color.ParseColor ("#999999"));
linearTaskComplete.SetBackgroundColor (Color.ParseColor ("#eeeeee"));
linearTaskIncomplete.SetBackgroundColor (Color.ParseColor ("#eeeeee"));
//Drawable d = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/desert.jpg"), 480, 640, true));
//linearImageLO.SetBackgroundDrawable (d);
//imgLinea.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/lineatareas.png"), 4,2000 , true));
linearTaskComplete.AddView (txtTaskComplete);
linearTaskIncomplete.AddView (txtTaskIncomplete);
linearTextLO.AddView (txtNameLO);
linearTextLO.AddView (txtChapter);
linearTextLO.AddView (txtAuthor);
linearListTaskC.AddView (listTaskComplete);
linearListTaskI.AddView (listTaskIncomplete);
linearContentTask.AddView (linearImageLO);
linearContentTask.AddView (linearTaskComplete);
linearContentTask.AddView (linearListTaskC);
linearContentTask.AddView (linearTaskIncomplete);
linearContentTask.AddView (linearListTaskI);
linearTextLO.SetX (0); linearTextLO.SetY (Configuration.getHeight(200));
//linearImageLO.SetX (0); linearImageLO.SetY (0);
linearContentTask.SetX(0); linearContentTask.SetY(0);
imgLinea.SetX (Configuration.getWidth(75)); imgLinea.SetY (Configuration.getHeight(350));
mainLayout.AddView (imgLinea);
mainLayout.AddView (linearContentTask);
mainLayout.AddView (linearTextLO);
}
示例13: ini
public void ini(){
//creating comment List
commentLayout = new LinearLayout(context);
commentLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (934));
commentList = new ListView (context);
//commentList.AddView (commentList);
//end comment List
_mainLayout = new RelativeLayout (context);
linearGradiente = new LinearLayout (context);
linearGradiente.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (541));
linearGradiente.SetBackgroundResource (Resource.Drawable.gradiente);
var textFormat = Android.Util.ComplexUnitType.Px;
_mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1);
_fondo2 = new LinearLayout (context);
_fondo2.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getWidth (640));
_fondo2.SetY (Configuration.getHeight (109));
Drawable dr1 = new BitmapDrawable (getBitmapFromAsset("icons/fondoselec.png"));
_fondo2.SetBackgroundDrawable (dr1);
dr1 = null;
_mainLayout.AddView (_fondo2);
//section1-----------------------------------------------
_contentRLayout_S1 = new RelativeLayout(context);
_txtTitle_S1 = new TextView (context);
_txtAuthor_S1 = new TextView (context);
_imAuthor_S1 = new ImageView (context);
_txtChapter_S1 = new TextView (context);
_itemsLayout_S1 = new LinearLayout (context);//not used
_imItem_S1 = new List<ImageView> ();
_txtItem_S1 = new List<TextView>();
//_mainLayout.AddView (_txtTitle_S1);
//_mainLayout.AddView (_txtAuthor_S1);
_mainLayout.AddView (_imAuthor_S1);
//_mainLayout.AddView (_txtChapter_S1);
_contentRLayout_S1.LayoutParameters = new RelativeLayout.LayoutParams (-1, Configuration.getHeight (480));
LinearLayout _linearTitle = new LinearLayout (context);
_linearTitle.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
_linearTitle.SetGravity (Android.Views.GravityFlags.Center);
_linearTitle.AddView (_txtTitle_S1);
_linearTitle.SetY (Configuration.getHeight (60));
linearGradiente.SetX (0); linearGradiente.SetY (Configuration.getHeight(502));
_mainLayout.AddView (linearGradiente);
_mainLayout.AddView (_linearTitle);
//_txtTitle_S1.SetX (Configuration.getWidth (245));_txtTitle_S1.SetY (Configuration.getHeight (60));
Bitmap newbm = Configuration.getRoundedShape(Bitmap.CreateScaledBitmap( getBitmapFromAsset("icons/imgautor.png"), Configuration.getWidth(170), Configuration.getWidth(170), true),Configuration.getWidth(170),Configuration.getHeight(170));
_imAuthor_S1.SetImageBitmap (newbm);
// newbm.Recycle ();
newbm = null;
_imAuthor_S1.SetX (Configuration.getWidth (240));_imAuthor_S1.SetY (Configuration.getHeight (189));
LinearLayout _linearAuthor = new LinearLayout (context);
_linearAuthor.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
_linearAuthor.SetGravity (Android.Views.GravityFlags.Center);
_linearAuthor.AddView (_txtAuthor_S1);
_linearAuthor.SetY (Configuration.getHeight (378));
_mainLayout.AddView (_linearAuthor);
//_txtAuthor_S1.SetX (Configuration.getWidth (228));_txtAuthor_S1.SetY (Configuration.getHeight (378));
LinearLayout _linearChapter = new LinearLayout (context);
_linearChapter.LayoutParameters = new LinearLayout.LayoutParams (-1, -2);
//.........这里部分代码省略.........
示例14: LoadPagesDataSource
//.........这里部分代码省略.........
slidesource.ColorS = Configuration.ListaColores [indice % 6];
slidesource.Type = slides [m].lotype;
if (slides [m].lotitle != null)
slidesource.Title = slides [m].lotitle;
if (slides [m].loparagraph != null)
slidesource.Paragraph = slides [m].loparagraph;
if (slides [m].loimage != null)
slidesource.ImageUrl = slides [m].loimage;
if (slides [m].lotext != null)
slidesource.Paragraph = slides [m].lotext;
if (slides [m].loauthor != null)
slidesource.Author = slides [m].loauthor;
if (slides [m].lovideo != null)
slidesource.VideoUrl = slides [m].lovideo;
var c_slide = slides [m];
if (c_slide.loitemize != null) {
slidesource.Itemize = new ObservableCollection<LOItemSource> ();
var items = c_slide.loitemize.loitem;
for (int n = 0; n < items.Count; n++) {
LOItemSource item = new LOItemSource ();
if (items [n].loimage != null)
item.ImageUrl = items [n].loimage;
if (items [n].lotext != null)
item.Text = items [n].lotext;
var c_item_ize = items [n];
slidesource.Itemize.Add (item);
}
}
linearScroll.AddView (slidesource.getViewSlide ());
}
//linearScroll.SetPadding (padW,padH,padW,padH);
scrollPager.VerticalScrollBarEnabled = false;
if (k == 0) {
scrollPager.AddView (linearScroll);
listaScroll.Add (scrollPager);
indice++;
}
}
}
} else {
Console.WriteLine ("ERROR");
}
// }
mainLayoutPages.RemoveAllViews ();
//_progresD.Hide ();
mainLayoutPages.AddView (viewPager);
mainLayoutPages.SetX (0);
mainLayoutPages.SetY (0);
_mainLayout.AddView (mainLayoutPages);
_publicidadLayout = new LinearLayout (this);
_publicidadLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (85));
Drawable drp = new BitmapDrawable (getBitmapFromAsset ("images/footerad.jpg"));
_publicidadLayout.SetBackgroundDrawable (drp);
_publicidadLayout.SetY (Configuration.getHeight(1136-85));
_mainLayout.AddView (_publicidadLayout);
_publicidadLayout.Click += delegate {
if (adOpen) {
hideAd ();
} else {
Random rnd = new Random();
showAd (rnd.Next(adsImagesPath.Count));
}
};
LOViewAdapter adapter = new LOViewAdapter (this, listaScroll);
viewPager.Adapter = adapter;
//viewPager.CurrentItem = IndiceSection;
viewPager.SetCurrentItem (vm._currentSection, true);
}
示例15: Initialize
void Initialize ()
{
var metrics = Resources.DisplayMetrics;
widthInDp = ((int)metrics.WidthPixels);
heightInDp = ((int)metrics.HeightPixels);
Configuration.setWidthPixel (widthInDp);
Configuration.setHeigthPixel (heightInDp);
this.SetBackgroundColor (Color.ParseColor ("#000000"));
linearContainerFisrst = new LinearLayout (context);
//linearContainer = new LinearLayout (context);
linearImageLO = new LinearLayout (context);
linearTextLO = new LinearLayout (context);
linearLike = new LinearLayout (context);
txtAuthor = new TextView (context);
txtChapter= new TextView (context);
txtNameLO = new TextView (context);
txtLike = new TextView (context);
imgHeart= new ImageView (context);
this.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(637));
linearContainerFisrst.LayoutParameters = new LinearLayout.LayoutParams (-1, -1);
linearImageLO.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(637));
linearTextLO.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(250));
linearLike.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(120), Configuration.getHeight(80));
//Drawable drBack =new BitmapDrawable(Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/fondocondiagonalm.png"), 640, 1136, true));
//linearContainerFisrst.SetBackgroundDrawable (drBack);
//drBack = null;
linearTextLO.Orientation = Orientation.Vertical;
linearTextLO.SetGravity(GravityFlags.Right);
linearLike.Orientation = Orientation.Vertical;
linearLike.SetGravity (GravityFlags.Center);
linearContainerFisrst.Orientation = Orientation.Vertical;
//Drawable d = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/fondounidad.png"), 480, 640, true));
//linearImageLO.SetBackgroundDrawable (d);
//imgHeart.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/like.png"), Configuration.getWidth(43), Configuration.getHeight(43), true));
txtNameLO.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30));
txtChapter.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (50));
txtAuthor.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (30));
txtNameLO.Typeface = Typeface.DefaultBold;
txtAuthor.SetTextColor (Color.ParseColor("#ffffff"));
txtChapter.SetTextColor (Color.ParseColor("#ffffff"));
txtNameLO.SetTextColor (Color.ParseColor("#ffffff"));
txtLike.SetTextColor (Color.ParseColor("#ffffff"));
txtAuthor.Gravity = GravityFlags.Right;
txtChapter.Gravity = GravityFlags.Right;
txtNameLO.Gravity = GravityFlags.Right;
txtLike.Gravity = GravityFlags.Center;
linearTextLO.AddView (txtNameLO);
linearTextLO.AddView (txtChapter);
linearTextLO.AddView (txtAuthor);
linearLike.AddView (imgHeart);
linearLike.AddView (txtLike);
linearTextLO.SetX (0); linearTextLO.SetY (Configuration.getHeight(398));
linearLike.SetX (0); linearLike.SetY (Configuration.getHeight(438));
linearContainerFisrst.SetX (0); linearContainerFisrst.SetY (0);
linearImageLO.SetX (0); linearImageLO.SetY (0);
linearTextLO.SetPadding (0, 0, Configuration.getWidth (35), 0);
this.AddView (linearImageLO);
this.AddView (linearTextLO);
this.AddView (linearLike);
this.AddView (linearContainerFisrst);
}