public void setItemLogin(){ var txtFormat = Android.Util.ComplexUnitType.Px; linearButtonLogin = new LinearLayout (this); linearEditTextLogin = new LinearLayout (this); linearTextLogin = new LinearLayout (this); etxtUser = new EditText (this); etxtPassword = new EditText (this); btnLoginInto = new ImageButton (this); txtLogin_a = new TextView (this); txtLogin_b = new TextView (this); txtInicioSesion = new TextView (this); linearButtonLogin.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent); linearEditTextLogin.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent); linearTextLogin.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent); etxtUser.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78)); etxtPassword.LayoutParameters = new ViewGroup.LayoutParams (Configuration.getWidth (507), Configuration.getHeight (78)); linearButtonLogin.Orientation = Orientation.Horizontal; linearButtonLogin.SetGravity (GravityFlags.Center); linearEditTextLogin.Orientation = Orientation.Vertical; linearEditTextLogin.SetGravity (GravityFlags.Center); linearTextLogin.Orientation = Orientation.Vertical; linearTextLogin.SetGravity (GravityFlags.Center); etxtUser.Hint = " Usuario"; etxtUser.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); etxtPassword.Hint = " Contraseña"; etxtPassword.InputType = Android.Text.InputTypes.TextVariationPassword | Android.Text.InputTypes.ClassText; etxtPassword.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); etxtPassword.InputType = InputTypes.TextVariationVisiblePassword; txtLogin_a.Text = "FORGOT PASSWORD?"; txtLogin_a.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); txtLogin_b.Text = " CHANGE"; txtLogin_b.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); txtLogin_a.SetTextSize (txtFormat,Configuration.getHeight(30)); txtLogin_b.SetTextSize (txtFormat, Configuration.getHeight (30)); txtInicioSesion.Text = "Iniciar Sesión"; txtInicioSesion.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); txtInicioSesion.SetTextColor (Color.ParseColor("#ffffff")); txtInicioSesion.SetTextSize (Android.Util.ComplexUnitType.Px, Configuration.getHeight (36)); btnLoginInto.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/otherlogin.png"),Configuration.getWidth (242), Configuration.getHeight (78),true)); etxtUser.SetTextColor (Color.ParseColor ("#ffffff")); etxtPassword.SetTextColor (Color.ParseColor ("#ffffff")); btnLoginInto.Click += delegate { _dialog.Show(); var com = ((LoginViewModel)this.DataContext).LoginCommand; com.Execute(null); //AlertDialog.Builder popupBuilder = new AlertDialog.Builder(this); }; initButtonColor (btnLoginInto); etxtPassword.InputType = InputTypes.TextVariationVisiblePassword; etxtPassword.TransformationMethod = Android.Text.Method.PasswordTransformationMethod.Instance; txtLogin_a.SetTextColor (Color.ParseColor ("#ffffff")); txtLogin_b.SetTextColor (Color.ParseColor ("#00c6ff")); Drawable drawableEditText = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/cajatexto.png"), Configuration.getWidth(507), Configuration.getHeight(80), true)); etxtUser.SetBackgroundDrawable (drawableEditText); etxtPassword.SetBackgroundDrawable (drawableEditText); etxtUser.SetSingleLine (true); etxtPassword.SetSingleLine (true); LinearLayout space = new LinearLayout (this); space.LayoutParameters = new LinearLayout.LayoutParams (-1, 20); linearTextLogin.AddView (txtLogin_a); linearTextLogin.AddView (txtLogin_b); //linearButtonLogin.AddView (btnLoginInto); //linearButtonLogin.AddView (linearTextLogin); linearEditTextLogin.AddView (etxtUser); linearEditTextLogin.AddView (space); linearEditTextLogin.AddView (etxtPassword); txtInicioSesion.SetX (Configuration.getWidth(75)); txtInicioSesion.SetY (Configuration.getHeight(680)); linearEditTextLogin.SetX (0); linearEditTextLogin.SetY (Configuration.getHeight(741)); //linearButtonLogin.SetX (0); linearButtonLogin.SetY (Configuration.getHeight(978)); btnLoginInto.SetX (Configuration.getWidth (45));btnLoginInto.SetY (Configuration.getHeight (980)); linearTextLogin.SetX (Configuration.getWidth (345));linearTextLogin.SetY (Configuration.getHeight(995)); relLogin.AddView (txtInicioSesion); relLogin.AddView (linearEditTextLogin); //relLogin.AddView (linearButtonLogin); relLogin.AddView(btnLoginInto); relLogin.AddView (linearTextLogin); ((LoginViewModel)this.ViewModel).PropertyChanged += Login_propertyChanged;; var set = this.CreateBindingSet<LoginView, LoginViewModel>(); set.Bind(etxtUser).To(vm => vm.Username); set.Bind(etxtPassword).To(vm => vm.Password); set.Apply(); mainLayout.AddView (relLogin); }
private void iniMenu(){ mainLayout = new RelativeLayout (this); _foro = new LOContainerView (this); _dialogDownload = new ProgressDialog (this); _dialogDownload.SetCancelable (false); _dialogDownload.SetMessage ("Downloading..."); txtUserName = new TextView (this); txtCurse = new TextView (this); txtSchoolName = new TextView (this); txtUserRol = new TextView (this); txtPorcentaje = new TextView (this); txtCurseTitle = new TextView (this); txtTaskTitle = new TextView (this); txtPendiente = new TextView (this); txtValorBarra = new TextView (this); imgChat = new ImageView (this); imgUser = new ImageView (this); imgSchool = new ImageView (this); imgNotificacion = new ImageView (this); imgCurse = new ImageView (this); imgTask = new ImageView (this); linearBarraCurso = new LinearLayout (this); linearCurse= new LinearLayout (this); linearSchool= new LinearLayout (this); linearTask= new LinearLayout (this); linearUserData= new LinearLayout (this); linearUser = new LinearLayout (this); linearListCurso = new LinearLayout (this); linearListTask = new LinearLayout (this); linearList = new LinearLayout (this); linearPendiente = new LinearLayout (this); linearTxtValorBarra = new LinearLayout (this); listCursos = new ListView (this); listTasks = new ListView (this); mItemsChat = new List<ChatDataRow> (); mainLayout.LayoutParameters = new RelativeLayout.LayoutParams (-1,-1); Drawable d = new BitmapDrawable (getBitmapFromAsset ("icons/fondo.png")); mainLayout.SetBackgroundDrawable (d); d = null; linearBarraCurso.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent); linearCurse.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(50)); linearTask.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(50)); linearSchool.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent); linearUserData.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent); linearUser.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent); linearListCurso.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(250)); linearListTask.LayoutParameters = new LinearLayout.LayoutParams (-1,LinearLayout.LayoutParams.WrapContent); linearList.LayoutParameters = new LinearLayout.LayoutParams (-1, LinearLayout.LayoutParams.WrapContent); linearPendiente.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (30), Configuration.getWidth (30)); linearTxtValorBarra.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); linearBarraCurso.Orientation = Orientation.Vertical; linearBarraCurso.SetGravity (GravityFlags.Center); linearTxtValorBarra.Orientation = Orientation.Vertical; 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)); txtCurseTitle.SetPadding (Configuration.getWidth (48), 0, 0, 0); txtTaskTitle.SetPadding (Configuration.getWidth (48), 0, 0, 0); txtCurse.SetTextColor (Color.ParseColor ("#ffffff")); txtUserName.SetTextColor (Color.ParseColor ("#ffffff")); txtUserRol.SetTextColor (Color.ParseColor ("#999999")); txtSchoolName.SetTextColor (Color.ParseColor ("#ffffff")); txtPorcentaje.SetTextColor (Color.ParseColor ("#ffffff")); txtPendiente.SetTextColor (Color.ParseColor ("#ffffff")); txtTaskTitle.SetTextColor (Color.ParseColor ("#ffffff")); txtCurseTitle.SetTextColor (Color.ParseColor ("#ffffff")); txtValorBarra.SetTextColor (Color.ParseColor ("#ffffff")); txtUserName.Gravity = GravityFlags.CenterHorizontal; txtUserRol.Gravity = GravityFlags.CenterHorizontal; txtCurse.Gravity = GravityFlags.CenterHorizontal; imgChat.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/chat.png"),Configuration.getWidth (45), Configuration.getWidth (40),true)); imgUser.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/user.png"),Configuration.getWidth (154), Configuration.getHeight (154),true)); imgSchool.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/colegio.png"),Configuration.getWidth (29), Configuration.getHeight (29),true)); imgNotificacion.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/notif.png"),Configuration.getWidth (35), Configuration.getWidth (40),true)); imgCurse.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/curso.png"),Configuration.getWidth (23), Configuration.getHeight (28),true)); imgTask.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset("icons/vertareas.png"),Configuration.getWidth (23), Configuration.getHeight (28),true)); Drawable drPendiente = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/pendiente.png"), Configuration.getWidth(30), Configuration.getWidth(30), true)); linearPendiente.SetBackgroundDrawable (drPendiente); drPendiente = null; imgCurse.SetPadding (Configuration.getWidth (68), 0, 0, 0); imgTask.SetPadding(Configuration.getWidth(68),0,0,0); linearCurse.SetBackgroundColor(Color.ParseColor("#0d1216")); linearTask.SetBackgroundColor (Color.ParseColor ("#0d1216")); linearBarraCurso.AddView (txtCurse); linearBarraCurso.AddView (progressBar); linearTxtValorBarra.AddView (txtValorBarra); linearCurse.AddView (imgCurse); linearCurse.AddView (txtCurseTitle); linearTask.AddView (imgTask); linearTask.AddView (txtTaskTitle); linearPendiente.AddView (txtPendiente); imgSchool.SetPadding (Configuration.getWidth(68),0,0,0); txtSchoolName.SetPadding (Configuration.getWidth(40),0,0,0); linearSchool.AddView (imgSchool); linearSchool.AddView (txtSchoolName); linearUser.AddView (txtUserName); linearUser.AddView (txtUserRol); linearUserData.AddView (imgUser); linearUserData.AddView (linearUser); linearListCurso.AddView (listCursos); linearListTask.AddView (listTasks); linearList.AddView (linearCurse); linearList.AddView (linearListCurso); linearList.AddView (linearTask); linearList.AddView (linearListTask); imgChat.SetX (Configuration.getWidth(59)); imgChat.SetY (Configuration.getHeight(145)); imgChat.Click += delegate { mDrawerLayout.CloseDrawer (mLeftDrawer); mDrawerLayout.OpenDrawer (mRightDrawer); }; imgNotificacion.SetX (Configuration.getWidth(59)); imgNotificacion.SetY (Configuration.getHeight(233)); imgNotificacion.Click += delegate { mDrawerLayout.CloseDrawer (mLeftDrawer); main_ContentView.RemoveAllViews (); main_ContentView.AddView(new NotificationView(this)); }; linearPendiente.SetX (Configuration.getWidth(94)); linearPendiente.SetY (Configuration.getHeight(217)); linearUserData.SetX (0); linearUserData.SetY (Configuration.getHeight(130)); linearBarraCurso.SetX (0); linearBarraCurso.SetY (Configuration.getHeight(412)); linearTxtValorBarra.SetX (0); linearTxtValorBarra.SetY (Configuration.getHeight(443)); linearSchool.SetX (0); linearSchool.SetY (Configuration.getHeight(532)); linearList.SetX (0); linearList.SetY (Configuration.getHeight(583)); Bitmap bm; txtUserName.Text = vm.UserFirstName + " "+ vm.UserLastName; if (vm.UserImage != null) { bm = BitmapFactory.DecodeByteArray (vm.UserImage, 0, vm.UserImage.Length); Bitmap newbm = Configuration.GetRoundedCornerBitmap (Bitmap.CreateScaledBitmap (bm,Configuration.getWidth (154), Configuration.getHeight (154),true)); imgUser.SetImageBitmap (newbm); newbm = null; } bm = null; mainLayout.AddView (imgChat); mainLayout.AddView (imgNotificacion); mainLayout.AddView (linearPendiente); mainLayout.AddView (linearUserData); mainLayout.AddView (linearBarraCurso); mainLayout.AddView (linearTxtValorBarra); mainLayout.AddView (linearSchool); mainLayout.AddView (linearList); imgChat = null; imgNotificacion = null; imgCurse = null; imgTask = null; imgSchool = null; imgUser = null; }
protected override void OnCreate(Bundle bundle) { this.Window.AddFlags(WindowManagerFlags.Fullscreen); base.OnCreate(bundle); SetContentView(Resource.Layout.MainView); vm = this.ViewModel as MainViewModel; vm.PropertyChanged += Vm_PropertyChanged; loWallView = new WallView(this); currentIndexLO = 0; LinearLayout linearMainLayout = FindViewById<LinearLayout>(Resource.Id.left_drawer); /*scrollIndice = new ScrollView (this); scrollIndice.LayoutParameters = new ScrollView.LayoutParams (-1,400); linearContentIndice = new LinearLayout (this); linearContentIndice.LayoutParameters = new LinearLayout.LayoutParams (-1, 800); linearContentIndice.Orientation = Orientation.Vertical; linearContentIndice.SetBackgroundColor (Color.Red); scrollIndice.AddView (linearContentIndice); */ var metrics = Resources.DisplayMetrics; widthInDp = ((int)metrics.WidthPixels); heightInDp = ((int)metrics.HeightPixels); Configuration.setWidthPixel (widthInDp); Configuration.setHeigthPixel (heightInDp); task = new TaskView (this); iniMenu (); mToolbar = FindViewById<SupportToolbar>(Resource.Id.toolbar); SetSupportActionBar(mToolbar); mToolbar.SetNavigationIcon (Resource.Drawable.hamburger); mDrawerLayout = FindViewById<DrawerLayout>(Resource.Id.drawer_layout); mLeftDrawer = FindViewById<LinearLayout>(Resource.Id.left_drawer); mRightDrawer = FindViewById<LinearLayout>(Resource.Id.right_drawer); mLeftDrawer.Tag = 0; mRightDrawer.Tag = 1; frameLayout = FindViewById<FrameLayout> (Resource.Id.content_frame); main_ContentView = new RelativeLayout (this); main_ContentView.LayoutParameters = new RelativeLayout.LayoutParams (-1, -1); // main_ContentView.AddView (scrollIndice); //main_ContentView.AddView(linearContentIndice); LOContainerView LOContainer = new LOContainerView (this); //main_ContentView.AddView (LOContainer); //WallView wallview = new WallView(this); //wallview.OpenLO.Click += Lo_ImagenLO_Click; //lo.OpenTasks.Click += ListTasks_ItemClick; //wallview.OpenChat.Click += imBtn_Chat_Click; //wallview.OpenUnits.Click += imBtn_Units_Click; loWallView.OpenChat.Click += imBtn_Chat_Click; loWallView.OpenUnits.Click += imBtn_Units_Click; main_ContentView.AddView (loWallView); frameLayout.AddView (main_ContentView); RelativeLayout RL = FindViewById<RelativeLayout> (Resource.Id.main_view_relativeLayoutCL); Drawable dr = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/nubeactivity.png"), 768, 1024, true)); RL.SetBackgroundDrawable (dr); dr = null; //seting up chat view content title_view = FindViewById<TextView> (Resource.Id.chat_view_title); info1= FindViewById<TextView> (Resource.Id.chat_view_info1); info2 = FindViewById<TextView> (Resource.Id.chat_view_info2); title_list = FindViewById<TextView> (Resource.Id.chat_list_title); mListViewChat = FindViewById<ListView> (Resource.Id.chat_list_view); title_view.SetX (Configuration.getWidth(74)); title_view.SetY (Configuration.getHeight (202)); title_view.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); title_view.SetTypeface (null, TypefaceStyle.Bold); info1.SetX (Configuration.getWidth (76)); info1.SetY (Configuration.getHeight (250)); info1.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); info2.SetX (Configuration.getWidth (76)); info2.SetY (Configuration.getHeight (285)); info2.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); title_list.SetX (Configuration.getWidth (76)); title_list.SetY (Configuration.getHeight (391)); title_list.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/HelveticaNeue.ttf"); title_list.SetTypeface (null, TypefaceStyle.Bold); mListViewChat.SetX (0); mListViewChat.SetY (Configuration.getHeight (440)); //end setting linearMainLayout.AddView (mainLayout); vm.PropertyChanged += new PropertyChangedEventHandler(logout_propertyChanged); RegisterWithGCM(); mDrawerToggle = new MyActionBarDrawerToggle( this, //Host Activity mDrawerLayout, //DrawerLayout Resource.String.openDrawer, //Opened Message Resource.String.closeDrawer //Closed Message ); mDrawerLayout.SetDrawerListener(mDrawerToggle); SupportActionBar.SetHomeButtonEnabled (true); SupportActionBar.SetDisplayShowTitleEnabled(false); mDrawerToggle.SyncState(); if (bundle != null) { if (bundle.GetString("DrawerState") == "Opened") { SupportActionBar.SetTitle(Resource.String.openDrawer); } else { SupportActionBar.SetTitle(Resource.String.closeDrawer); } } else { SupportActionBar.SetTitle(Resource.String.closeDrawer); } initListCursos (); iniPeoples (); initListTasks (); //main_ContentView.AddView (scrollIndice); }
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)); //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); _linearChapter.SetGravity (Android.Views.GravityFlags.Center); //_linearChapter.AddView (_txtChapter_S1); _linearChapter.SetY (Configuration.getHeight (502)); //_mainLayout.AddView (_linearChapter); //_txtChapter_S1.SetX (Configuration.getWidth (191));_txtChapter_S1.SetY (Configuration.getHeight (502)); _txtTitle_S1.Text = "Camino Inca"; _txtTitle_S1.SetTextColor (Color.White); _txtTitle_S1.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtTitle_S1.SetTextSize (textFormat,Configuration.getHeight(30)); _txtAuthor_S1.Text = "David Spencer"; _txtAuthor_S1.SetTextColor (Color.White); _txtAuthor_S1.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtAuthor_S1.SetTextSize (textFormat,Configuration.getHeight(30)); //_txtAuthor_S1.SetBackgroundColor (Color.ParseColor ("#60000000")); _txtAuthor_S1.SetShadowLayer (50.8f, 0.0f, 0.0f, Color.ParseColor ("#000000")); _txtChapter_S1.Text = "FLORA Y FAUNA"; _txtChapter_S1.SetTextColor (Color.White); _txtChapter_S1.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtChapter_S1.SetTextSize (textFormat,Configuration.getHeight(35)); List<string> item_path = new List<string> (); item_path.Add ("icons/icona.png"); item_path.Add ("icons/iconb.png"); item_path.Add ("icons/iconc.png"); item_path.Add ("icons/icond.png"); item_path.Add ("icons/icone.png"); item_path.Add ("icons/iconf.png"); item_path.Add ("icons/icong.png"); int inixItemIM = Configuration.getWidth (33); int crecIM = Configuration.getWidth (90); int inixItemTXT = Configuration.getWidth (42); int crecTXT = Configuration.getWidth (90); int inixLinea = Configuration.getWidth (93); for (int i = 0; i < item_path.Count; i++) { _imItem_S1.Add(new ImageView(context)); //_imItem_S1[i].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(item_path[i]), Configuration.getWidth (30), Configuration.getWidth (30), true)); //_mainLayout.AddView (_imItem_S1 [i]); _imItem_S1 [i].SetX (inixItemIM+(i*crecIM));_imItem_S1 [i].SetY (Configuration.getHeight(602)); if (i != item_path.Count - 1) { ImageView linea = new ImageView (context); //linea.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("icons/lineatareas.png"), 1, Configuration.getHeight (68), true)); //_mainLayout.AddView (linea); linea.SetX (inixLinea + (i * crecIM)); linea.SetY (Configuration.getHeight (605)); linea = null; } _txtItem_S1.Add (new TextView (context)); _txtItem_S1 [i].Text = "0"; _txtItem_S1 [i].SetTextColor (Color.ParseColor ("#2E9AFE")); _txtItem_S1[i].Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtItem_S1[i].SetTextSize (textFormat,Configuration.getHeight(30)); //_mainLayout.AddView (_txtItem_S1 [i]); _txtItem_S1 [i].SetX (inixItemTXT+(i*crecTXT));_txtItem_S1 [i].SetY (Configuration.getHeight(640)); _imItem_S1 [i] = null; } _imItem_S1 = null; //------------------------------------------------------- //section2------------------------------------------------ _contentScrollView_S2 = new HorizontalScrollView (context); _contentScrollView_S2.LayoutParameters = new HorizontalScrollView.LayoutParams (-1, Configuration.getWidth(160)); _contentScrollView_S2.HorizontalScrollBarEnabled = false; _images_S2 = new LinearLayout (context); _images_S2.Orientation = Orientation.Horizontal; _images_S2.LayoutParameters = new LinearLayout.LayoutParams(-2,-1); _contentScrollView_S2.SetX (0); _contentScrollView_S2.AddView (_images_S2); //---------------------------------------------------------- //section3------------------------------------------------ _contentLLayout_S3 = new LinearLayout (context); _contentLLayout_S3.Orientation = Orientation.Vertical; _contentLLayout_S3.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight (160)); _contentLLayout_S3.SetX (0);_contentLLayout_S3.SetY (Configuration.getHeight(875)); _contentLLayout_S3.SetGravity (Android.Views.GravityFlags.Center); _txtInfo1_S3 = new TextView (context); _txtInfo2_S3 = new TextView (context); _txtInfo3_S3 = new TextView (context); _txtInfo1_S3.Text = "Duración: 05 dias / 04 noches "; _txtInfo2_S3.Text = "Distancia: 65km"; _txtInfo3_S3.Text = "Punto mas elevado: 4,6386 msnm (Salkantay)"; _txtInfo1_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal; _txtInfo2_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal; _txtInfo3_S3.Gravity = Android.Views.GravityFlags.CenterHorizontal; _txtInfo1_S3.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtInfo2_S3.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtInfo3_S3.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); _txtInfo1_S3.SetTextSize (textFormat,Configuration.getHeight(30)); _txtInfo2_S3.SetTextSize (textFormat,Configuration.getHeight(30)); _txtInfo3_S3.SetTextSize (textFormat,Configuration.getHeight(30)); _txtInfo1_S3.SetTextColor (Color.White); _txtInfo2_S3.SetTextColor (Color.White); _txtInfo3_S3.SetTextColor (Color.White); _contentLLayout_S3.AddView (_txtInfo1_S3); _contentLLayout_S3.AddView (_txtInfo2_S3); _contentLLayout_S3.AddView (_txtInfo3_S3); //Drawable dr3 = new BitmapDrawable (getBitmapFromAsset("icons/fondonotif.png")); //_contentLLayout_S3.SetBackgroundDrawable(dr3); //_contentLLayout_S3.SetBackgroundColor(Color.ParseColor("#80000000")); //_mainLayout.AddView (_contentLLayout_S3); //_mainLayout.AddView (_contentScrollView_S2); _mainSpace.AddView (_contentScrollView_S2); //---------------------------------------------------------- /* _listUnidades.Add(new UnidadItem{ Title = "Dia 1", Description = "Piscacucho-Wayllabamba" }); _listUnidades.Add(new UnidadItem{ Title = "Dia 2", Description = "Wayllabamba-Pacaymayo" }); _listUnidades.Add(new UnidadItem{ Title = "Dia 3", Description = "Pacaymayo-Wiñay Wayna" }); _listUnidades.Add(new UnidadItem{ Title = "Dia 4", Description = "WIñay Wayna-Machu PIcchu"}); */ /* _listViewUnidades = new ListView(context); _listViewUnidades.Adapter = new UnidadAdapter (context, _listUnidades); _mainSpace.AddView (_listViewUnidades); */ _spaceUnidades = new LinearLayout (context); _spaceUnidades.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); _spaceUnidades.Orientation = Orientation.Vertical; _spaceUnidades.SetBackgroundColor (Color.White); _mainSpace.AddView (_spaceUnidades); //section4------------------------------------------------ _imItems_S4 = new List<ImageView>(); List<string> botton_icon_path = new List<string> (); botton_icon_path.Add ("icons/btnhome.png"); botton_icon_path.Add ("icons/btncomentariosazul.png"); botton_icon_path.Add ("icons/btncontenido.png"); botton_icon_path.Add ("icons/btnchatazul.png"); botton_icon_path.Add ("icons/btnmap.png"); _imItems_S4.Add (new ImageView (context)); //_imItems_S4[0].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[0]), Configuration.getWidth (40), Configuration.getWidth (40), true)); //_mainLayout.AddView (_imItems_S4[0]); _imItems_S4[0].SetX (Configuration.getWidth(58));_imItems_S4[0].SetY (Configuration.getHeight(1069)); _imItems_S4 [0].Visibility = Android.Views.ViewStates.Invisible; _imItems_S4.Add (new ImageView (context)); //_imItems_S4[1].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[1]), Configuration.getWidth (78), Configuration.getWidth (55), true)); //_mainLayout.AddView (_imItems_S4[1]); _imItems_S4[1].SetX (Configuration.getWidth(169));_imItems_S4[1].SetY (Configuration.getHeight(1069)); _imItems_S4 [1].Visibility = Android.Views.ViewStates.Invisible; _imItems_S4.Add (new ImageView (context)); //_imItems_S4[2].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[2]), Configuration.getWidth (80), Configuration.getWidth (80), true)); //_mainLayout.AddView (_imItems_S4 [2]); _imItems_S4[2].SetX (Configuration.getWidth(297));_imItems_S4[2].SetY (Configuration.getHeight(1050)); _imItems_S4 [2].Visibility = Android.Views.ViewStates.Invisible; _imItems_S4.Add (new ImageView (context)); //_imItems_S4[3].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[3]), Configuration.getWidth (30), Configuration.getWidth (51), true)); //_mainLayout.AddView (_imItems_S4[3]); _imItems_S4[3].SetX (Configuration.getWidth(421));_imItems_S4[3].SetY (Configuration.getHeight(1069)); _imItems_S4 [3].Visibility = Android.Views.ViewStates.Invisible; _imItems_S4.Add (new ImageView (context)); //_imItems_S4[4].SetImageBitmap(Bitmap.CreateScaledBitmap (getBitmapFromAsset(botton_icon_path[4]), Configuration.getWidth (30), Configuration.getWidth (40), true)); //_mainLayout.AddView (_imItems_S4 [4]); _imItems_S4[4].SetX (Configuration.getWidth(540));_imItems_S4[4].SetY (Configuration.getHeight(1069)); _imItems_S4 [4].Visibility = Android.Views.ViewStates.Invisible; //---------------------------------------------------------- //Drawable dr = new BitmapDrawable (getBitmapFromAsset("images/header1.png")); header = new LinearLayout(context); header.LayoutParameters = new LinearLayout.LayoutParams (-1,Configuration.getHeight(125)); header.Orientation = Orientation.Vertical; //header.SetBackgroundDrawable (dr); //_mainLayout.SetBackgroundDrawable (dr); _mainLayout.AddView(header); //dr = null; _workspace = new LinearLayout (context); _workspace.LayoutParameters = new LinearLayout.LayoutParams (-1, -1); //_workspace.SetBackgroundColor (Color.ParseColor ("#ffffff")); //_workspace.SetY (Configuration.getHeight (110)); _mainLayout.AddView (_workspace); //_mainLayout.SetBackgroundColor (Color.ParseColor ("#ffffff")); //_workspace.AddView (_foro); //_workspace.Visibility = Android.Views.ViewStates.Invisible; }
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"; var set = this.CreateBindingSet<RegisterView, RegisterViewModel>(); set.Bind(etxtUser).To(vm=>vm.RegUsername); set.Bind(etxtEmail).To(vm=>vm.Email); set.Bind(etxtPassword).To(vm=>vm.RegPassword); set.Bind(etxtUser).To(vm=>vm.Name); set.Apply (); btnCreateAccount.Click += delegate { var com = ((RegisterViewModel)this.DataContext).RegisterCommand; com.Execute (null); }; }
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); }