protected override View OnCreateDialogView() { var layout = new LinearLayout(_context) {Orientation = Orientation.Vertical}; layout.SetPadding(10, 10, 10, 10); layout.SetBackgroundColor(Color.Black); _serverUrl = new TextView(_context) {Text = "Server url:"}; _serverUrl.SetTextColor(Color.White); _serverUrl.SetPadding(0, 8, 0, 3); _serverUrlBox = new EditText(_context); _serverUrlBox.SetSingleLine(true); _userKey = new TextView(_context) {Text = "User key:"}; _userKey.SetTextColor(Color.White); _userKeyBox = new EditText(_context); _userKeyBox.SetSingleLine(true); layout.AddView(_serverUrl); layout.AddView(_serverUrlBox); layout.AddView(_userKey); layout.AddView(_userKeyBox); return layout; }
void Initialize () { this.LayoutParameters = new RelativeLayout.LayoutParams(-1,Configuration.getHeight (412));// LinearLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394)); this.SetGravity(GravityFlags.Center); image = new RelativeLayout(context); txtDescription = new TextView (context); txtTitle = new TextView (context); background = new LinearLayout (context); image.SetGravity (GravityFlags.Center); background.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (530), Configuration.getHeight (356)); background.Orientation = Orientation.Vertical; background.SetBackgroundColor (Color.ParseColor ("#50000000")); image.LayoutParameters = new RelativeLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394)); txtTitle.SetTextColor (Color.ParseColor("#ffffff")); txtDescription.SetTextColor(Color.ParseColor("#ffffff")); txtTitle.SetTextSize (ComplexUnitType.Px, Configuration.getHeight (40)); txtDescription.SetTextSize (ComplexUnitType.Px, Configuration.getHeight (30)); background.AddView (txtTitle); background.AddView (txtDescription); image.AddView (background); this.AddView (image); //this.AddView (background); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment // return inflater.Inflate(Resource.Layout.YourFragment, container, false); //return base.OnCreateView (inflater, container, savedInstanceState); linLayout = viewResource.LinLayout (this.Activity); //linLayout.Id = 1; txtViewTitle = viewResource.TextViewTitle (this.Activity); txtViewTitle.SetPadding (10, 10, 10, 10); button = viewResource.BtnOne (this.Activity); button.Click += OnButtonClick; button.Text = "Click me!"; buttonTwo = viewResource.BtnTwo (this.Activity); txtViewTwo = viewResource.TextViewOne(this.Activity); txtViewTwo.Text = "Click the button!"; subLayout = viewResource.SubLinLayout (this.Activity); subLayout.AddView (txtViewTwo); subLayout.AddView (button); subLayout.AddView (buttonTwo); linLayout.AddView (subLayout); linLayout.SetBackgroundColor (Android.Graphics.Color.BlueViolet); return linLayout; }
void Initialize () { this.LayoutParameters = new RelativeLayout.LayoutParams(-1,Configuration.getHeight (412));// LinearLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394)); this.SetGravity(GravityFlags.Center); image = new RelativeLayout(context); txtTitle = new TextView (context); background = new LinearLayout (context); linearTitle = new LinearLayout (context); linearButton = new LinearLayout (context); imgPlay = new ImageButton (context); video = new VideoView (context); image.SetGravity (GravityFlags.Bottom); background.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (111)); background.Orientation = Orientation.Horizontal; background.SetBackgroundColor (Color.ParseColor ("#50000000")); linearTitle.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (482), Configuration.getHeight (111)); linearTitle.Orientation = Orientation.Horizontal; linearTitle.SetGravity (GravityFlags.Center); linearButton.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (100), Configuration.getHeight (111)); linearButton.Orientation = Orientation.Horizontal; linearButton.SetGravity (GravityFlags.Center); image.LayoutParameters = new RelativeLayout.LayoutParams (Configuration.getWidth (582), Configuration.getHeight (394)); //image.SetGravity (GravityFlags.Bottom); video.LayoutParameters = new ViewGroup.LayoutParams(Configuration.getWidth(582),Configuration.getHeight(394)); imgPlay.Alpha = 255.0f; imgPlay.SetBackgroundColor (Color.Transparent); txtTitle.SetTextColor (Color.ParseColor("#ffffff")); txtTitle.SetPadding (Configuration.getWidth (20), 0, 0, 0); txtTitle.SetTextSize (ComplexUnitType.Px, Configuration.getHeight (40)); txtTitle.Ellipsize = Android.Text.TextUtils.TruncateAt.End; txtTitle.SetMaxLines (2); //imgPlay.SetImageBitmap (Bitmap.CreateStxtcaledBitmap (getBitmapFromAsset ("icons/"), Configuration.getWidth (83), Configuration.getHeight (83), true)); linearTitle.AddView (txtTitle); linearButton.AddView (imgPlay); background.AddView (linearTitle); background.AddView (linearButton); image.AddView (background); this.AddView (image); //this.AddView (background); }
public MyTooltip(FlexPie pie, Context context) : base(pie) { txtLabel = new TextView(context); LinearLayout layout = new LinearLayout(context); layout.Orientation = Orientation.Vertical; layout.SetBackgroundColor(Android.Graphics.Color.Gray); layout.SetPadding(5, 5, 5, 5); layout.AddView(txtLabel); AddView(layout); }
public override View GetSampleContent (Context con) { LinearLayout linear = new LinearLayout(con); linear.SetBackgroundColor(Color.White); linear.Orientation = Orientation.Vertical; linear.SetPadding(10, 10, 10, 10); TextView text1 = new TextView(con); text1.TextSize = 16; text1.SetTextColor(Color.ParseColor("#262626")); text1.Typeface = Typeface.DefaultBold; text1.Text = "Allowed Characters"; text1.SetPadding(5, 10, 10, 5); linear.AddView(text1); TextView text2 = new TextView(con); text2.TextSize = 14; text2.SetTextColor(Color.ParseColor("#3F3F3F")); text2.Text = "All 128 ASCII Characters"; text2.SetPadding(5, 5, 5, 5); LinearLayout text2Layout = new LinearLayout(con); LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent); text2Layout.LayoutParameters = parms; text2Layout.AddView(text2); linear.AddView(text2Layout); LinearLayout barcodeLayout = new LinearLayout(con); barcodeLayout.SetPadding(0, 10, 0, 5); LinearLayout.LayoutParams parms1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent); barcodeLayout.LayoutParameters = parms1; barcode = new SfBarcode(con); barcode.Text = "G71C0453"; Typeface fontFamily = Typeface.Create("helvetica", TypefaceStyle.Bold); barcode.TextFont = fontFamily; barcode.SetBackgroundColor(Color.ParseColor("#F2F2F2")); barcode.Symbology = BarcodeSymbolType.Code39Extended; barcode.TextSize = 20; Code39ExtendedSettings setting = new Code39ExtendedSettings(); setting.BarHeight = 120; setting.NarrowBarWidth = 3; barcode.SymbologySettings = setting; barcodeLayout.AddView(barcode); linear.AddView(barcodeLayout); return linear; }
public override View GetSampleContent (Context con) { LinearLayout linear = new LinearLayout(con); linear.SetBackgroundColor(Color.White); linear.Orientation = Orientation.Vertical; linear.SetPadding(10, 10, 10, 10); TextView text1 = new TextView(con); text1.TextSize = 16; text1.SetTextColor(Color.ParseColor("#262626")); text1.Typeface = Typeface.DefaultBold; text1.Text = "Allowed Characters"; text1.SetPadding(5, 10, 10, 5); linear.AddView(text1); TextView text2 = new TextView(con); text2.TextSize = 14; text2.SetTextColor(Color.ParseColor("#3F3F3F")); text2.Text = "ASCII values from 32 to 127\nSPACE ! \" # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\ ]^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ DEL"; text2.SetPadding(5, 5, 5, 5); LinearLayout text2Layout = new LinearLayout(con); LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent); text2Layout.LayoutParameters = parms; text2Layout.AddView(text2); linear.AddView(text2Layout); LinearLayout barcodeLayout = new LinearLayout(con); barcodeLayout.SetPadding(0, 10, 0, 5); LinearLayout.LayoutParams parms1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent); barcodeLayout.LayoutParameters = parms1; barcode = new SfBarcode(con); barcode.Text = "ISBN-678504"; Typeface fontFamily = Typeface.Create("helvetica", TypefaceStyle.Bold); barcode.TextFont = fontFamily; barcode.SetBackgroundColor(Color.ParseColor("#F2F2F2")); barcode.Symbology = BarcodeSymbolType.Code128B; barcode.TextSize = 20; Code128BSettings setting = new Code128BSettings(); setting.BarHeight = 120; setting.NarrowBarWidth = 3; barcode.SymbologySettings = setting; barcodeLayout.AddView(barcode); linear.AddView(barcodeLayout); return linear; }
public override View GetSampleContent (Context con) { LinearLayout linear = new LinearLayout(con); linear.SetBackgroundColor(Color.White); linear.Orientation = Orientation.Vertical; linear.SetPadding(10, 10, 10, 10); TextView text1 = new TextView(con); text1.TextSize = 16; text1.SetTextColor(Color.ParseColor("#262626")); text1.Typeface = Typeface.DefaultBold; text1.Text = "Allowed Characters"; text1.SetPadding(5, 10, 10, 5); linear.AddView(text1); TextView text2 = new TextView(con); text2.TextSize = 14; text2.SetTextColor(Color.ParseColor("#3F3F3F")); text2.Text = "ASCII values from 0 to 95\nNUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US SPACE ! \" # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \\ ]^ _"; text2.SetPadding(5, 5, 5, 5); LinearLayout text2Layout = new LinearLayout(con); LinearLayout.LayoutParams parms = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent); text2Layout.LayoutParameters = parms; text2Layout.AddView(text2); linear.AddView(text2Layout); LinearLayout barcodeLayout = new LinearLayout(con); barcodeLayout.SetPadding(0, 10, 0, 5); LinearLayout.LayoutParams parms1 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent); barcodeLayout.LayoutParameters = parms1; barcode = new SfBarcode(con); barcode.Text = "ACL32 SF-D8"; Typeface fontFamily = Typeface.Create("helvetica", TypefaceStyle.Bold); barcode.TextFont = fontFamily; barcode.SetBackgroundColor(Color.ParseColor("#F2F2F2")); barcode.Symbology = BarcodeSymbolType.Code128A; barcode.TextSize = 20; Code128ASettings setting = new Code128ASettings(); setting.BarHeight = 120; setting.NarrowBarWidth = 3; barcode.SymbologySettings = setting; barcodeLayout.AddView(barcode); linear.AddView(barcodeLayout); return linear; }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.PublicAcivity); ColorDrawable colorDrawable = new ColorDrawable (Color.ParseColor (Helpers.ColorHeader)); ActionBar.SetBackgroundDrawable (colorDrawable); WebView = FindViewById<WebView> (Resource.Id.Webview); ProGWebview = FindViewById<ProgressBar> (Resource.Id.ProGWebview); PrgBViews = FindViewById<ProgressBar> (Resource.Id.PrgBViews); LnYNext = FindViewById<LinearLayout> (Resource.Id.LnYNext); LnYNext.SetBackgroundColor (Color.ParseColor (Helpers.ColorHeader)); imageButton1 = FindViewById<ImageButton> (Resource.Id.imageButton1); imageButton2 = FindViewById<ImageButton> (Resource.Id.imageButton2); imageButton3 = FindViewById<ImageButton> (Resource.Id.imageButton3); imageButton4 = FindViewById<ImageButton> (Resource.Id.imageButton4); imageButton5 = FindViewById<ImageButton> (Resource.Id.imageButton5); TxtPuntosR=FindViewById<TextView>(Resource.Id.TxtPuntosR); TxtPuntosRR=FindViewById<TextView>(Resource.Id.TxtPuntosRR); PrgBViews.Max = 6; WebView.Settings.JavaScriptEnabled = true; WebView.Settings.LoadsImagesAutomatically = true; WebView.SetWebViewClient (new BulletinWebViewClient (this, ProGWebview)); imageButton1.Click+= (sender, e) => ValidaControl((ImageButton)sender); imageButton2.Click+= (sender, e) => ValidaControl((ImageButton)sender); imageButton3.Click+= (sender, e) => ValidaControl((ImageButton)sender); imageButton4.Click+= (sender, e) => ValidaControl((ImageButton)sender); imageButton5.Click+= (sender, e) => ValidaControl((ImageButton)sender); var telephonyManager = (TelephonyManager) GetSystemService(TelephonyService); Imei = telephonyManager.DeviceId; DatoUser = GetUserDatos (); }
public override View GetSampleContent (Context con) { int height = con.Resources.DisplayMetrics.HeightPixels/2; LinearLayout linearLayout = new LinearLayout(con); linearLayout.SetGravity (Android.Views.GravityFlags.CenterHorizontal); linearLayout.Orientation = Android.Widget.Orientation.Vertical; linearLayout.SetBackgroundColor(Color.White); img = new ImageView(con); img.SetImageResource (Resource.Drawable.mount); linearLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); linearLayout.SetPadding(20, 20, 20, 20); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(height+(height/3.5)),GravityFlags.Center); img.SetPadding(12, 0, 10, 0); img.LayoutParameters = (layoutParams); range=new SfRangeSlider(con); range.Minimum = 0;range.Maximum = 100; range.Value = 100; range.ShowRange = false; range.SnapsTo = SnapsTo.None; range.Orientation = Com.Syncfusion.Sfrangeslider.Orientation.Horizontal; range.TickPlacement = TickPlacement.BottomRight; range.ShowValueLabel = true; range.TickFrequency = 20; range.ValuePlacement = ValuePlacement.BottomRight; range.LayoutParameters = (new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 150)); range.ValueChanged += ValueChanged ; linearLayout.AddView(img); TextView text1 = new TextView(con); text1.Text = " Opacity"; text1.TextSize=20; text1.Gravity = GravityFlags.Left; range.SetY(-30); linearLayout.AddView(text1); linearLayout.AddView(range); FrameLayout frame = new FrameLayout(con); frame.SetBackgroundColor (Color.White); frame.LayoutParameters = ( new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent,GravityFlags.Center)); frame.AddView(linearLayout); return frame; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Use this to return your custom view for this Fragment //return base.OnCreateView (inflater, container, savedInstanceState); lLayout = viewResource.LinLayout(this.Activity); txtViewTitle = viewResource.TextViewTitle (this.Activity); txtViewTitle.Text = "Welcome to my Clicking App"; txtViewCountMsg = viewResource.TextViewOne (this.Activity); txtViewCountMsg.Text = String.Format ("You have clicked {0} many times", _count); lLayout.AddView (txtViewTitle); lLayout.AddView (txtViewCountMsg); lLayout.SetBackgroundColor (Android.Graphics.Color.Aquamarine); return lLayout; }
private LinearLayout initHeaderBar(string title) { LinearLayout barlayout = new LinearLayout (this.context); LinearLayout.LayoutParams blp = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.WrapContent, 0.0F); barlayout.LayoutParameters = blp; barlayout.SetGravity (GravityFlags.CenterHorizontal | GravityFlags.CenterVertical); barlayout.SetBackgroundColor (Color.Black); TextView text = new TextView (this.context); if (!title.Equals ("undefined")) { text.Text = title; } text.SetTextColor (Color.White); text.Gravity = GravityFlags.CenterHorizontal | GravityFlags.CenterVertical; text.TextSize = 20F; text.LayoutParameters = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent, 1.0F); barlayout.AddView (text); return barlayout; }
public BaseMapSectionMenuItem(Context context) : base(context) { Orientation = Orientation.Vertical; this.context = context; int width = (int)(Metrics.WidthPixels * 0.9); headerContainer = new LinearLayout(context); headerContainer.SetBackgroundColor(Colors.ActionBar); headerContainer.Orientation = Orientation.Horizontal; AddView(headerContainer); contentContainer = new RelativeLayout(context); contentContainer.LayoutParameters = new RelativeLayout.LayoutParams(width, 100); //contentContainer.Orientation = Orientation.Horizontal; AddView(contentContainer); osmLabel = GetHeaderItem(TypefaceStyle.Bold); separatorLabel = GetHeaderItem(TypefaceStyle.Bold); separatorLabel.Gravity = Android.Views.GravityFlags.Center; tileTypeLabel = GetHeaderItem(TypefaceStyle.Normal); headerContainer.AddView(osmLabel); headerContainer.AddView(separatorLabel); headerContainer.AddView(tileTypeLabel); var parameters = new LinearLayout.LayoutParams(width, LayoutParams.WrapContent, 0.8f); parameters.LeftMargin = Padding; parameters.RightMargin = Padding; parameters.TopMargin = Padding; LayoutParameters = parameters; }
protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.Steady); //set level int currentlevel = GetPrefs ("currentlevel"); //display level TextView levelText = (TextView)FindViewById(Resource.Id.level); levelText.Text = "Level " + Java.Lang.String.ValueOf (currentlevel); //set up accelerometer _sensorManager = (SensorManager) GetSystemService(Context.SensorService); _sensorTextView = FindViewById<TextView>(Resource.Id.data); mainLayout = (LinearLayout)FindViewById(Resource.Id.linearLayout1); mainLayout.SetBackgroundColor(Android.Graphics.Color.Red); green = false; checkPass (); }
void ChangeLayout(LinearLayout newLayout) { this.RunOnUiThread(() => { _dashboardGeneralSettingsLinearLayout.SetBackgroundColor (Color.Rgb (240, 240, 240)); _dashboardBlacklistLinearLayout.SetBackgroundColor (Color.Rgb (240, 240, 240)); _dashboardTwitterLinearLayout.SetBackgroundColor (Color.Rgb (240, 240, 240)); _dashboardImagesLinearLayout.SetBackgroundColor (Color.Rgb (240, 240, 240)); _dashboardAlertsLinearLayout.SetBackgroundColor (Color.Rgb (240, 240, 240)); _dashboardAlertRulesLinearLayout.SetBackgroundColor (Color.Rgb (240, 240, 240)); newLayout.SetBackgroundColor (Color.Rgb (208, 208, 208)); _contentTableLayout.RemoveAllViewsInLayout(); _dashboardFlyOutContainer.SetOpened(false); }); }
public override View GetSampleContent (Android.Content.Context con) { dlgAlert = new AlertDialog.Builder(con); dlgAlert.SetTitle("Results"); dlgAlert.SetPositiveButton("OK", (object sender, DialogClickEventArgs e) => { }); dlgAlert.SetCancelable(true); Title.Add ("Software"); Title.Add ("Banking"); Title.Add ("Media"); Title.Add ("Medical"); spinners = new Spinner(con); spinners.DropDownWidth = 500; spinners.SetBackgroundColor(Color.Gray); ArrayAdapter<String> dataAdapter = new ArrayAdapter<String> (con, Android.Resource.Layout.SimpleSpinnerItem, Experience); dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinners.Adapter = dataAdapter; Country.Add ("UAE"); Country.Add ("Uruguay"); Country.Add ("United States"); Country.Add ("United Kingdom"); Country.Add ("Ukraine"); Experience.Add ("1"); Experience.Add ("2"); autoComplete1 = new SfAutoComplete(con); autoComplete2 = new SfAutoComplete(con); text1s = new TextView(con); text2s = new TextView(con); text3s = new TextView(con); text4s = new TextView(con); text6s = new TextView(con); text11 = new TextView(con); text22 = new TextView(con); text33 = new TextView(con); text44 = new TextView(con); text55 = new TextView(con); text66 = new TextView(con); text77 = new TextView(con); text88 = new TextView(con); buttons = new Button(con); buttons.SetWidth(ActionBar.LayoutParams.MatchParent); buttons.SetHeight(40); buttons.Text = "Search"; buttons.SetTextColor(Color.White); buttons.SetBackgroundColor(Color.Gray); buttons.Click += (object sender, EventArgs e) => { GetResult(); //dlgAlert.SetMessage(count + " Jobs Found"); dlgAlert.SetMessage (cc + " Jobs Found"); dlgAlert.Create ().Show (); }; text11.SetHeight(10); text22.SetHeight(30); text33.SetHeight(10); text44.SetHeight(30); text55.SetHeight(10); text66.SetHeight(30); text77.SetHeight(10); text88.SetHeight(30); text1s.Text = "Job Search"; text1s.TextSize = 30; text1s.Typeface = Typeface.DefaultBold; text2s.Text = "Country"; text2s.TextSize = 16; text3s.Text = "Job Field"; text3s.TextSize = 16; text4s.Text = "Experience"; text4s.TextSize = 16; text6s.SetHeight(40); ArrayAdapter<String> adapters = new ArrayAdapter<String>(con, Android.Resource.Layout.SimpleListItem1, new Countrylist().Country); autoComplete1.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 60); autoComplete1.SetAutoCompleteSource(adapters); autoComplete1.SuggestionMode = SuggestionMode.StartsWith; autoComplete1.MaximumDropDownHeight = 200; autoComplete1.Watermark = "Enter a country name"; ArrayAdapter<String> adapters1 = new ArrayAdapter<String>(con, Android.Resource.Layout.SimpleListItem1, Title); autoComplete2.SetAutoCompleteSource(adapters1); autoComplete2.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 60); autoComplete2.SuggestionMode = SuggestionMode.Contains; autoComplete2.MaximumDropDownHeight = 200; autoComplete2.Watermark = "Starts with ’S’, ‘M’ or ‘B’"; ArrayAdapter<String> adapters2 = new ArrayAdapter<String>(con, Android.Resource.Layout.SimpleListItem1, Experience); spinners.Adapter = adapters2; spinners.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 60); LinearLayout linearLayout = new LinearLayout(con); linearLayout.SetPadding(20, 20, 20, 30); linearLayout.SetBackgroundColor(Color.Rgb(236, 236, 236)); linearLayout.LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); linearLayout.Orientation = Orientation.Vertical; linearLayout.AddView(text1s); linearLayout.AddView(text6s); linearLayout.AddView(text2s); linearLayout.AddView(text11); linearLayout.AddView(autoComplete1); linearLayout.AddView(text22); linearLayout.AddView(text3s); linearLayout.AddView(text33); linearLayout.AddView(autoComplete2); linearLayout.AddView(text44); linearLayout.AddView(text4s); linearLayout.AddView(text55); linearLayout.AddView(spinners); linearLayout.AddView(text66); linearLayout.AddView(text88); linearLayout.AddView(buttons); linearLayout.Touch+= (object sender, View.TouchEventArgs e) => { //if(autoComplete1.IsFocused || autoComplete2.IsFocused ){ Rect outRect = new Rect(); autoComplete1.GetGlobalVisibleRect(outRect); autoComplete2.GetGlobalVisibleRect(outRect); if (!outRect.Contains((int)e.Event.RawX, (int)e.Event.RawY)) { autoComplete1.ClearFocus(); autoComplete2.ClearFocus(); } hideSoftKeyboard((Activity)con); //} }; return linearLayout; }
public void initUnidades(int indexCurso, int indexUnidad) { var textFormat = Android.Util.ComplexUnitType.Px; _spaceUnidades.RemoveAllViews (); _listLinearUnidades.Clear (); _listIconMap.Clear (); _listIconVerMap.Clear (); int numUnidades = _listUnidades.Count; for (int i = 0; i < numUnidades; i++) { LinearLayoutLO linearUnidad = new LinearLayoutLO (context); linearUnidad.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); linearUnidad.Orientation = Orientation.Vertical; linearUnidad.SetGravity (Android.Views.GravityFlags.CenterVertical); linearUnidad.index = i; linearUnidad.SetPadding (Configuration.getWidth(100), Configuration.getWidth (25),0, Configuration.getWidth (25)); //linearUnidad.SetX (100); if (indexCurso == 0) {//Para que solo afecte a las Rutas linearUnidad.SetPadding (Configuration.getWidth(100), Configuration.getWidth (25),0, Configuration.getWidth (-25)); } TextView titleUnidad = new TextView(context); titleUnidad.SetTextSize (textFormat,Configuration.getHeight(42)); titleUnidad.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (440), -2); if (indexCurso == 2) { if (indexUnidad == 3) { linearUnidad.Orientation = Orientation.Horizontal; ImageIconMap icon = new ImageIconMap (context); icon.index = i; icon.SetImageBitmap(iconPlay); icon.SetX (Configuration.getWidth (60)); linearUnidad.AddView (icon); _listIconMap.Add (icon); } } if (indexCurso == 3) { titleUnidad.SetTextSize (textFormat,Configuration.getHeight(55)); } RelativeLayout linearContenido = new RelativeLayout (context); linearContenido.LayoutParameters = new LinearLayout.LayoutParams (-1, -2); linearContenido.SetGravity (Android.Views.GravityFlags.Center); //TextView titleUnidad = new TextView(context); //titleUnidad.Text = _listUnidades [i].Title; titleUnidad.TextFormatted = Html.FromHtml (_listUnidades [i].Title); titleUnidad.SetTextColor(Color.ParseColor (Configuration.ListaColores [i % 6])); titleUnidad.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); TextView descriptionUnidad = new TextView(context); descriptionUnidad.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (440), -2); //descriptionUnidad.Text = _listUnidades [i].Description; descriptionUnidad.TextFormatted = Html.FromHtml (_listUnidades [i].Description); //descriptionUnidad.Text = _listUnidades [i].Description; descriptionUnidad.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); descriptionUnidad.SetTextSize (textFormat,Configuration.getHeight(28)); //Linkify.AddLinks (descriptionUnidad, MatchOptions.All); //Huillca if (indexCurso == 1 && indexUnidad!=6) {//Para que no afecte a las Rutas ni a los precios //Linkify.AddLinks(descriptionUnidad,Patterns.Phone,"tel:"); //(084) 21-1122 --------modelo de telefono //984-820715 ----modelo celular Linkify.AddLinks(descriptionUnidad,Java.Util.Regex.Pattern.Compile("\\W\\d+\\W\\s\\d+\\W\\d+"),"tel:"); Linkify.AddLinks(descriptionUnidad,Java.Util.Regex.Pattern.Compile("\\d+\\W\\d+"),"tel:"); Linkify.AddLinks(descriptionUnidad,Patterns.EmailAddress,"email:"); Linkify.AddLinks(descriptionUnidad,Patterns.WebUrl,"http://"); } //descriptionUnidad.MovementMethod = Android.Text.Method.LinkMovementMethod.Instance; //descriptionUnidad.LinksClickable = true; //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); } }
//DISPLAY ................................................................................. private void Display(int allormine) { List <BucketItem> show = new List <BucketItem>(); switch (allormine) { case 0: show = allitems; break; case 1: show = myitems; break; default: break; } //Slučaj novog korisnika if (show.Count == 0) { layout = new LinearLayout(this); layout.Orientation = Orientation.Vertical; LinearLayout.LayoutParams LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); LayoutParameters.SetMargins(0, 30, 0, 30); layout.LayoutParameters = LayoutParameters; layout.SetBackgroundColor(Color.White); layout.SetPadding(40, 40, 40, 40); var obavijest = new TextView(this); obavijest.TextSize = 20; obavijest.Text = "Dobrodošao! :)"; obavijest.SetTextColor(Color.LightSlateGray); obavijest.Gravity = GravityFlags.Center; obavijest.SetPadding(0, 0, 0, 30); layout.AddView(obavijest); var obavijest2 = new TextView(this); obavijest2.Text = "Nemaš još ništa na svojoj listi? Istraži ALL ili kreiraj novu ludu stvar koju želiš napraviti u svom životu pritiskom na CREATE :)"; obavijest2.SetTextColor(Color.LightSlateGray); obavijest2.SetPadding(40, 0, 40, 40); obavijest2.Gravity = GravityFlags.Center; layout.AddView(obavijest2); mainLayout.AddView(layout); } //Dodavanje na layout show.Reverse(); foreach (BucketItem item in show) { LinearLayout.LayoutParams LayoutParameters; //Kreiranje novog Layouta layout = new LinearLayout(this); layout.Orientation = Orientation.Vertical; LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); LayoutParameters.SetMargins(0, 30, 0, 30); layout.LayoutParameters = LayoutParameters; layout.SetBackgroundColor(Color.White); layout.SetPadding(40, 40, 40, 40); //Kreiranje imena var imeLabel = new TextView(this); imeLabel.SetTextSize(ComplexUnitType.Px, 80); imeLabel.Text = item.Ime; imeLabel.SetTextColor(Color.LightSlateGray); layout.AddView(imeLabel); //Kreiranje kategorije var kategorijaLabel = new TextView(this); kategorijaLabel.Text = "Kategorija: " + item.KategorijaNaziv; kategorijaLabel.SetTextColor(Color.LightGray); if (item.Slika == null) { kategorijaLabel.SetPadding(30, 0, 0, 30); } else { kategorijaLabel.SetPadding(30, 0, 0, 0); } layout.AddView(kategorijaLabel); //Kreiranje slike var slikaView = new ImageView(this); LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); slikaView.LayoutParameters = LayoutParameters; if (item.Slika != null) { DisplayMetrics mets = new DisplayMetrics(); WindowManager.DefaultDisplay.GetMetrics(mets); var bmp = BitmapFactory.DecodeByteArray(item.Slika, 0, item.Slika.Length); double viewWidthToBitmapWidthRatio = (double)mets.WidthPixels / (double)bmp.Width; slikaView.LayoutParameters.Height = (int)(bmp.Height * viewWidthToBitmapWidthRatio); slikaView.SetImageBitmap(bmp); slikaView.SetScaleType(ImageView.ScaleType.FitCenter); } layout.AddView(slikaView); //Kreiranje opisa var opisLabel = new TextView(this); opisLabel.Text = item.Opis; opisLabel.SetPadding(0, 20, 0, 20); opisLabel.SetTextColor(Color.LightSlateGray); layout.AddView(opisLabel); if (allormine == 0) { //Kreiranje ostvarenosti var ostvarenoSlika = new ImageView(this); bool imamNaSvojojListi = myitems.Any(e => e.Ime == item.Ime); if (imamNaSvojojListi) { ostvarenoSlika.SetImageResource(Resource.Drawable.ostvarenoTRUE); } else { ostvarenoSlika.SetImageResource(Resource.Drawable.ostvarenoFALSE); } LayoutParameters = new LinearLayout.LayoutParams(100, 100); ostvarenoSlika.LayoutParameters = LayoutParameters; var ostvarenoLabel = new TextView(this); ostvarenoLabel.SetTextColor(Color.LightGray); int broj = item.koliko - 1; if (imamNaSvojojListi) { ostvarenoLabel.Text = "Ti i još " + broj + " ljudi je ostvaruje ovo"; } else { ostvarenoLabel.Text = item.koliko + " ljudi ostvaruje ovo"; } ostvarenoLabel.SetPadding(10, 25, 0, 0); var grupa = new LinearLayout(this) { Orientation = Orientation.Horizontal, LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 100) }; grupa.AddView(ostvarenoSlika); grupa.AddView(ostvarenoLabel); layout.AddView(grupa); if (!imamNaSvojojListi) { //Kreiranje gumba za dodavanje var dodajButton = new Button(this); dodajButton.Text = "+ Dodaj"; dodajButton.SetTextColor(Color.White); dodajButton.SetTextSize(ComplexUnitType.Px, 40); dodajButton.Click += (sender, e) => { BucketItem bModel = new BucketItem(); bModel = item; bModel.Ostvareno = false; dodajButton.Text = "Dodano na listu"; dodajButton.Enabled = false; client = new HttpClient(); conn2(bModel, user.id); Toast.MakeText(this, "Dodano na bucket listu! Prilagodi na svom profilu." + item.Ime, ToastLength.Short).Show(); }; layout.AddView(dodajButton); } } if (allormine == 1) { var grupa1 = new LinearLayout(this) { Orientation = Orientation.Horizontal, LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 100) }; var ostvarenoSlika = new ImageView(this); if (item.Ostvareno) { ostvarenoSlika.SetImageResource(Resource.Drawable.ostvarenoTRUE); } else { ostvarenoSlika.SetImageResource(Resource.Drawable.ostvarenoFALSE); } LayoutParameters = new LinearLayout.LayoutParams(100, 100); ostvarenoSlika.LayoutParameters = LayoutParameters; grupa1.AddView(ostvarenoSlika); var ostvarenoLabel = new TextView(this); ostvarenoLabel.SetTextColor(Color.LightGray); int broj = item.koliko - 1; if (item.Ostvareno) { ostvarenoLabel.Text = "Ostvario si ovo"; } else { ostvarenoLabel.Text = "Nisi još ostvario"; } ostvarenoLabel.SetPadding(10, 25, 0, 0); grupa1.AddView(ostvarenoLabel); layout.AddView(grupa1); var grupa2 = new LinearLayout(this) { Orientation = Orientation.Horizontal, //LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ) }; var ostvarenobutton = new Button(this); if (item.Ostvareno) { ostvarenobutton.Text = "Vrati na neostvareno"; } else { ostvarenobutton.Text = "Ostvari"; } ostvarenobutton.SetTextColor(Color.White); ostvarenobutton.Click += (sender, e) => { if (item.Ostvareno) { ostvarenoLabel.Text = "Nisi još ostvario"; ostvarenoSlika.SetImageResource(Resource.Drawable.ostvarenoFALSE); ostvarenobutton.Text = "Ostvari"; item.Ostvareno = !item.Ostvareno; } else { ostvarenoLabel.Text = "Ostvario si ovo"; ostvarenoSlika.SetImageResource(Resource.Drawable.ostvarenoTRUE); ostvarenobutton.Text = "Vrati na neostvareno"; item.Ostvareno = !item.Ostvareno; } conn("http://bucketlist.ddns.net/api/items/ostvareno/" + user.id + "?bucketItemId=" + item.Id, 1); }; grupa2.AddView(ostvarenobutton); var uredibutton = new Button(this); uredibutton.Text = "Uredi"; uredibutton.SetTextColor(Color.White); uredibutton.Click += (sender, e) => { Intent activity2 = new Intent(this, typeof(UpdateItem)); activity2.PutExtra("ime", item.Ime); activity2.PutExtra("itemId", item.Id); activity2.PutExtra("kategorija", item.KategorijaNaziv); activity2.PutExtra("opis", item.Opis); activity2.PutExtra("slika", item.Slika); activity2.PutExtra("userId", user.id); activity2.PutExtra("koliko", item.koliko); StartActivity(activity2); }; grupa2.AddView(uredibutton); layout.AddView(grupa2); } //Dodavanje kreiranog layouta na glavni layout mainLayout.AddView(layout); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.layoutvideo); instancia = this; linkactual = Intent.GetStringExtra("link"); indiceactual = int.Parse(Intent.GetStringExtra("posactual")); clientesillo = new TcpClient("localhost", 1024); video = FindViewById <SurfaceView>(Resource.Id.videoView1); playpause = FindViewById <ImageView>(Resource.Id.imageView4); siguiente = FindViewById <ImageView>(Resource.Id.imageView3); var ll4 = FindViewById <LinearLayout>(Resource.Id.linearLayout9); var listviewlistareproduccion = FindViewById <ListView>(Resource.Id.listView5); listabuscador = FindViewById <ListView>(Resource.Id.listView2); var botonlistareproduccion = FindViewById <ImageView>(Resource.Id.imageView20); anterior = FindViewById <ImageView>(Resource.Id.imageView5); playpause.SetBackgroundResource(Resource.Drawable.pausebutton2); var botonmenu = FindViewById <ImageView>(Resource.Id.imageView7); var botonfastsearcher = FindViewById <ImageView>(Resource.Id.imageView13); var terminobuscarrapido = FindViewById <EditText>(Resource.Id.edittext2); var botonenfastsearcher = FindViewById <ImageView>(Resource.Id.imageView19); listaa = FindViewById <ListView>(Resource.Id.listView1); botonminimize = FindViewById <ImageView>(Resource.Id.botonminimize); var activarmenu = FindViewById <ImageView>(Resource.Id.imageView12); layoutmenues = FindViewById <LinearLayout>(Resource.Id.linearLayout8); var botonyoutube = FindViewById <ImageView>(Resource.Id.imageView11); ll1 = FindViewById <LinearLayout>(Resource.Id.linearLayout1); var ll3 = FindViewById <LinearLayout>(Resource.Id.laprra); textbox = FindViewById <EditText>(Resource.Id.editText1); adelantar = FindViewById <ImageView>(Resource.Id.imageView2); var layoutbuscador = FindViewById <LinearLayout>(Resource.Id.linearLayout6); atrazar = FindViewById <ImageView>(Resource.Id.imageView6); portada = FindViewById <ImageView>(Resource.Id.imageView8); titulo = FindViewById <TextView>(Resource.Id.textView1); barraprogreso = FindViewById <SeekBar>(Resource.Id.progressBar1); listaa.Visibility = ViewStates.Invisible; listviewlistareproduccion.Visibility = ViewStates.Invisible; holder = video.Holder; holder.AddCallback(this); string[] items = Directory.GetFiles(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + "/gr3playerplaylist/"); titulo.Selected = true; playlistas.Clear(); for (int i = 0; i < items.Length; i++) { playlistas.Add(System.IO.Path.GetFileNameWithoutExtension(items[i])); } var adaptadol = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, playlistas); var parcelable = listviewlistareproduccion.OnSaveInstanceState(); listviewlistareproduccion.Adapter = adaptadol; listviewlistareproduccion.OnRestoreInstanceState(parcelable); ll4.Visibility = ViewStates.Invisible; layoutbuscador.Visibility = ViewStates.Invisible; layoutmenues.Visibility = ViewStates.Invisible; ll1.SetBackgroundColor(Android.Graphics.Color.ParseColor("#323538")); ll3.SetBackgroundColor(Android.Graphics.Color.ParseColor("#323538")); ll4.SetBackgroundColor(Android.Graphics.Color.ParseColor("#323538")); layoutmenues.SetBackgroundColor(Android.Graphics.Color.ParseColor("#323538")); listviewlistareproduccion.SetBackgroundColor(Android.Graphics.Color.ParseColor("#323538")); layoutbuscador.SetBackgroundColor(Android.Graphics.Color.ParseColor("#323538")); listaa.SetBackgroundColor(Android.Graphics.Color.ParseColor("#323538")); mainmenu_Offline.gettearinstancia().envideo = true; botonminimize.Visibility = ViewStates.Gone; if (linkactual.Trim().Length > 1) { new Thread(() => { buscaryreproducir(); }).Start(); #pragma warning disable CS0618 // El tipo o el miembro están obsoletos dialogoprogreso = new ProgressDialog(this); #pragma warning restore CS0618 // El tipo o el miembro están obsoletos dialogoprogreso.SetCanceledOnTouchOutside(false); dialogoprogreso.SetCancelable(false); dialogoprogreso.SetTitle("Cargando..."); dialogoprogreso.SetMessage("Por favor espere"); dialogoprogreso.Show(); } else { primeravez = false; } ll1.BringToFront(); ll1.BringToFront(); ll1.BringToFront(); Thread proces = new Thread(new ThreadStart(cargardesdecache)); proces.Start(); layoutbuscador.Click += delegate { }; layoutmenues.Click += delegate { }; ll4.Click += delegate { }; ll1.Click += delegate { }; ll3.Click += delegate { }; textbox.KeyPress += (aaxx, e) => { if (e.Event.Action == KeyEventActions.Down && e.KeyCode == Keycode.Enter) { // Code executed when the enter key is pressed down if (buscando == false) { clasesettings.recogerbasura(); Thread process = new Thread(new ThreadStart(buscar)); process.Start(); } } else { e.Handled = false; } }; listviewlistareproduccion.ItemClick += (delegado, aasdsa) => { if (playlistas.Count > 0) { if (File.ReadAllText(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + "/gr3playerplaylist/" + playlistas[aasdsa.Position]).Split('$')[0].Split(';').ToList().Count >= 1 && File.ReadAllText(Android.OS.Environment.ExternalStorageDirectory.AbsolutePath + "/gr3playerplaylist/" + playlistas[aasdsa.Position]).Split('$')[0].Split(';')[0].Trim() != "") { Intent internado = new Intent(this, typeof(Reproducirlistadialog)); internado.PutExtra("ip", "localhost"); internado.PutExtra("nombrelista", playlistas[aasdsa.Position]); internado.PutExtra("index", aasdsa.Position.ToString()); StartActivity(internado); } else { Toast.MakeText(this, "La lista esta vacia", ToastLength.Long).Show(); } } }; botonlistareproduccion.Click += delegate { animar(botonlistareproduccion); if (listviewlistareproduccion.Visibility == ViewStates.Visible) { listviewlistareproduccion.Visibility = ViewStates.Invisible; } else { listviewlistareproduccion.BringToFront(); listviewlistareproduccion.Visibility = ViewStates.Visible; ll4.Visibility = ViewStates.Invisible; listaa.Visibility = ViewStates.Invisible; layoutbuscador.Visibility = ViewStates.Invisible; animar2(listviewlistareproduccion); } }; botonenfastsearcher.Click += delegate { animar(botonenfastsearcher); termino = terminobuscarrapido.Text; new Thread(() => { buscaryabrir(); }).Start(); Toast.MakeText(this, "Buscando resultados...", ToastLength.Long).Show(); }; botonfastsearcher.Click += delegate { animar(botonfastsearcher); if (ll4.Visibility == ViewStates.Visible) { ll4.Visibility = ViewStates.Invisible; } else { ll4.Visibility = ViewStates.Visible; listaa.Visibility = ViewStates.Invisible; layoutbuscador.Visibility = ViewStates.Invisible; listviewlistareproduccion.Visibility = ViewStates.Invisible; animar2(ll4); } }; listabuscador.ItemClick += (easter, sender) => { if (linkeses.Count > 0) { if (sender.Position >= 0) { Intent intentar = new Intent(this, typeof(customdialogact)); intentar.PutExtra("ipadress", "localhost"); intentar.PutExtra("imagen", @"https://i.ytimg.com/vi/" + linkeses[sender.Position].Split('=')[1] + "/hqdefault.jpg"); intentar.PutExtra("url", linkeses[sender.Position]); intentar.PutExtra("titulo", nombreses[sender.Position]); intentar.PutExtra("color", "DarkGray"); StartActivity(intentar); } } }; Clouding_service.gettearinstancia().musicaplayer.Completion += delegate { if (this != null) { playpause.SetBackgroundResource(Resource.Drawable.playbutton2); } mainmenu_Offline.gettearinstancia().siguiente(); /// clientesillo.Client.Send(Encoding.Default.GetBytes("next()")); }; Thread proc = new Thread(new ThreadStart(ponerporciento)); proc.Start(); Thread proc2 = new Thread(new ThreadStart(receptor)); proc2.Start(); activarmenu.Click += delegate { animar(activarmenu); if (layoutmenues.Visibility == ViewStates.Visible) { menuabierto = false; layoutbuscador.Visibility = ViewStates.Invisible; listaa.Visibility = ViewStates.Invisible; animar7(layoutmenues); ll4.Visibility = ViewStates.Invisible; listviewlistareproduccion.Visibility = ViewStates.Invisible; } else { menuabierto = true; layoutmenues.Visibility = ViewStates.Visible; animar3(layoutmenues); } }; botonyoutube.Click += delegate { animar(botonyoutube); if (layoutbuscador.Visibility == ViewStates.Visible) { layoutbuscador.Visibility = ViewStates.Invisible; } else { listviewlistareproduccion.Visibility = ViewStates.Invisible; ll4.Visibility = ViewStates.Invisible; listaa.Visibility = ViewStates.Invisible; layoutbuscador.Visibility = ViewStates.Visible; animar2(layoutbuscador); } }; listaa.ItemClick += (sender, easter) => { if (lapara.Count > 0) { Intent intentoo = new Intent(this, typeof(deletedialogact)); intentoo.PutExtra("index", easter.Position.ToString()); intentoo.PutExtra("color", "DarkGray"); intentoo.PutExtra("titulo", lapara[easter.Position]); intentoo.PutExtra("ipadress", "localhost"); intentoo.PutExtra("url", laparalink[easter.Position]); intentoo.PutExtra("imagen", @"https://i.ytimg.com/vi/" + laparalink[easter.Position].Split('=')[1] + "/hqdefault.jpg"); StartActivity(intentoo); } }; botonminimize.Click += delegate { if (menuabierto) { layoutmenues.Visibility = ViewStates.Visible; } else { layoutmenues.Visibility = ViewStates.Invisible; } botonminimize.Visibility = ViewStates.Gone; ll1.Visibility = ViewStates.Visible; ll3.Visibility = ViewStates.Visible; videofullscreen = false; }; siguiente.Click += delegate { animar(siguiente); clientesillo.Client.Send(Encoding.Default.GetBytes("next()")); }; anterior.Click += delegate { animar(anterior); clientesillo.Client.Send(Encoding.Default.GetBytes("back()")); }; atrazar.Click += delegate { animar(atrazar); Clouding_service.gettearinstancia().musicaplayer.SeekTo(Convert.ToInt32(Clouding_service.gettearinstancia().musicaplayer.CurrentPosition - Clouding_service.gettearinstancia().musicaplayer.Duration * 0.10)); }; adelantar.Click += delegate { animar(adelantar); Clouding_service.gettearinstancia().musicaplayer.SeekTo(Convert.ToInt32(Clouding_service.gettearinstancia().musicaplayer.CurrentPosition + Clouding_service.gettearinstancia().musicaplayer.Duration * 0.10)); }; botonmenu.Click += delegate { animar(botonmenu); listaa.BringToFront(); if (listaa.Visibility == ViewStates.Visible) { listaa.Visibility = ViewStates.Invisible; } else { listviewlistareproduccion.Visibility = ViewStates.Invisible; ll4.Visibility = ViewStates.Invisible; layoutbuscador.Visibility = ViewStates.Invisible; listaa.Visibility = ViewStates.Visible; animar2(listaa); } listaa.BringToFront(); }; barraprogreso.ProgressChanged += (aa, aaaa) => { if (aaaa.FromUser) { Clouding_service.gettearinstancia().musicaplayer.SeekTo(aaaa.Progress); } }; video.Touch += (aa, aaaa) => { if (aaaa.Event.Action == MotionEventActions.Up) { if (!videofullscreen) { ll1.Visibility = ViewStates.Invisible; listviewlistareproduccion.Visibility = ViewStates.Invisible; ll3.Visibility = ViewStates.Invisible; layoutbuscador.Visibility = ViewStates.Invisible; listaa.Visibility = ViewStates.Invisible; layoutmenues.Visibility = ViewStates.Invisible; ll4.Visibility = ViewStates.Invisible; botonminimize.Visibility = ViewStates.Visible; videofullscreen = true; } else { if (menuabierto) { layoutmenues.Visibility = ViewStates.Visible; } else { layoutmenues.Visibility = ViewStates.Invisible; } botonminimize.Visibility = ViewStates.Gone; ll1.Visibility = ViewStates.Visible; ll3.Visibility = ViewStates.Visible; videofullscreen = false; } } }; // Create your application here playpause.Click += delegate { animar(playpause); if (Clouding_service.gettearinstancia().musicaplayer.IsPlaying == true) { playpause.SetBackgroundResource(Resource.Drawable.playbutton2); Clouding_service.gettearinstancia().musicaplayer.Pause(); } else { playpause.SetBackgroundResource(Resource.Drawable.pausebutton2); Clouding_service.gettearinstancia().musicaplayer.Start(); } }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.AddCard); Button btnApply = FindViewById<Button>(Resource.Id.btnApply); Button btnCancel = FindViewById<Button>(Resource.Id.btnCancel); etCardName = FindViewById<EditText>(Resource.Id.etCardName); etShopName = FindViewById<EditText>(Resource.Id.etShopName); btnCancel.Click += (s, e) => this.Finish(); btnApply.Click += btnApply_Click; images = new List<ImageData>(); llNoImage = FindViewById<LinearLayout>(Resource.Id.rlNoImage); var imgNoImage = FindViewById<ImageView>(Resource.Id.ivNoImage); imgNoImage.SetImageResource(Resource.Drawable.NoCardImage); imgNoImage.LayoutParameters = new LinearLayout.LayoutParams( Constants.PreviewCard.ImageWidth, Constants.PreviewCard.ImageHeight); var p = Constants.PreviewCard.BorderSize; llNoImage.SetPadding(p, p, p, p); llNoImage.SetBackgroundColor(Constants.PreviewCard.NoImageColor); llImages = FindViewById<LinearLayout>(Resource.Id.llCardImages); btnAddImage = FindViewById<Button>(Resource.Id.btnAddImage); btnRemoveImage = FindViewById<Button>(Resource.Id.btnRemoveImage); btnMoveLeft = FindViewById<Button>(Resource.Id.btnMoveLeft); btnMoveRight = FindViewById<Button>(Resource.Id.btnMoveRight); btnAddImage.Click += (s, e) => MakePictureAndAdd(); btnRemoveImage.Click += btnRemoveImage_Click; btnMoveLeft.Click += btnMoveLeft_Click; btnMoveRight.Click += btnMoveRight_Click; CardData dt = null; if (this.Intent.HasExtra(Constants.EXTRA_CARD_NAME)) { var cname = this.Intent.GetStringExtra(Constants.EXTRA_CARD_NAME); if (!string.IsNullOrEmpty(cname)) dt = CardManager.Instance.GetCard(cname); } if (dt != null) ShowData(dt); else ShowData(null); SetButtonsEnabled(); CheckShowNoImage(); }
public override View GetSampleContent(Context con) { LinearLayout linear = new LinearLayout(con); linear.SetBackgroundColor(Color.White); linear.Orientation = Orientation.Vertical; linear.SetPadding(10, 10, 10, 10); TextView text2 = new TextView(con); text2.TextSize = 17; text2.TextAlignment = TextAlignment.Center; text2.Text = "This sample demonstrates how to convert the PowerPoint slide to an image."; text2.SetTextColor(Color.ParseColor("#262626")); text2.SetPadding(5, 5, 5, 5); linear.AddView(text2); TextView space1 = new TextView(con); space1.TextSize = 10; linear.AddView(space1); m_context = con; LinearLayout radioLinearLayout = new LinearLayout(con); radioLinearLayout.Orientation = Orientation.Horizontal; TextView imageType = new TextView(con); imageType.Text = "Image Format : "; imageType.TextSize = 19; radioLinearLayout.AddView(imageType); radioGroup = new RadioGroup(con); radioGroup.TextAlignment = TextAlignment.Center; radioGroup.Orientation = Orientation.Horizontal; pngButton = new RadioButton(con); pngButton.Text = "PNG"; radioGroup.AddView(pngButton); jpegButton = new RadioButton(con); jpegButton.Text = "JPEG"; radioGroup.AddView(jpegButton); radioGroup.Check(1); radioLinearLayout.AddView(radioGroup); linear.AddView(radioLinearLayout); pngButton.Checked = true; TextView space2 = new TextView(con); space2.TextSize = 10; linear.AddView(space2); Button templateButton = new Button(con); templateButton.Text = "Input Template"; templateButton.Click += OnButtonClicked; linear.AddView(templateButton); Button convertButton = new Button(con); convertButton.Text = "Convert"; convertButton.Click += OnConvertButtonClicked; linear.AddView(convertButton); return(linear); }
public LegacyBar(Context context, IAttributeSet attrs) : base(context, attrs) { ResourceIdManager.UpdateIdValues(); _inflater = LayoutInflater.From(Context); //_inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService); _barView = (RelativeLayout)_inflater.Inflate(Resource.Layout.actionbar, null); AddView(_barView); _logoView = _barView.FindViewById(Resource.Id.actionbar_home_logo) as ImageView; _homeLayout = _barView.FindViewById<RelativeLayout>(Resource.Id.actionbar_home_bg); _homeBtn = _barView.FindViewById<ImageButton>(Resource.Id.actionbar_home_btn); _backIndicator = _barView.FindViewById(Resource.Id.actionbar_home_is_back); _titleView = _barView.FindViewById<TextView>(Resource.Id.actionbar_title); _actionsView = _barView.FindViewById<LinearLayout>(Resource.Id.actionbar_actions); _progress = _barView.FindViewById<ProgressBar>(Resource.Id.actionbar_progress); _titleLayout = _barView.FindViewById<RelativeLayout>(Resource.Id.actionbar_title_layout); _titleDropdown = _barView.FindViewById<Spinner>(Resource.Id.actionbar_spinner); _overflowLegacyBarAction = new OverflowLegacyBarAction(Context); //Custom Attributes (defined in Attrs.xml) var a = Context.ObtainStyledAttributes(attrs, Resource.Styleable.actionbar); //grab theme attributes Theme = (LegacyBarTheme)a.GetInt(Resource.Styleable.actionbar_theme, 0); IsBottom = a.GetBoolean(Resource.Styleable.actionbar_is_bottom, false); LightIcons = a.GetBoolean(Resource.Styleable.actionbar_light_icons, false); //if we are not custom don't let them set it. if (Theme != LegacyBarTheme.Custom) { LightIcons = Theme == LegacyBarTheme.HoloLight; } _overflowLegacyBarAction.SetIconColor(LightIcons); var title = a.GetString(Resource.Styleable.actionbar_title); if (null != title) Title = title; var titleColor = a.GetColor(Resource.Styleable.actionbar_title_color, Resources.GetColor(Resource.Color.actionbar_title)); TitleColor = titleColor; var separatorColor = a.GetColor(Resource.Styleable.actionbar_separator, Resources.GetColor(Resource.Color.actionbar_separator)); _actionsView.SetBackgroundColor(separatorColor); _homeLayout.SetBackgroundColor(separatorColor); using (var background = a.GetDrawable(Resource.Styleable.actionbar_background)) //recycling the drawable immediately { if (null != background) BackgroundDrawable = background; } var backgroundItem = a.GetDrawable(Resource.Styleable.actionbar_background_item); if (null != backgroundItem) ItemBackgroundDrawable = backgroundItem; if (IsBottom) { LegacyBarUtils.SetBottomLegacyBarTheme(this, Theme); } else { LegacyBarUtils.SetLegacyBarTheme(this, Theme); } a.Recycle(); _titleView.Click += (s, e) => { if (null != TitleClick) TitleClick(s, e); }; _titleView.LongClick += (s, e) => { if (null != TitleLongClick) TitleLongClick(s, e); }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); //Initialisation RtGraphicsLayouts RtGraphicsLayouts = new RtGraphicsLayouts(this); RtGraphicsLayouts.SetColourStatusBar(Window, RtGraphicsColours.Orange); //Root RelativeLayout AbsoluteRootLayout = new RelativeLayout(this); AbsoluteRootLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND); SetContentView(AbsoluteRootLayout); //Root Layout LinearLayout RootLayout = new LinearLayout(this); RootLayout.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND); RootLayout.Orientation = Orientation.Vertical; AbsoluteRootLayout.AddView(RootLayout); //Station Selector Dialog (after screen contents, so it overlays) StationSearchDialog = new RtStationSearchDialog(this, this, Window); StationSearchDialog.StationSelected += StationSearchDialog_StationSelected; AbsoluteRootLayout.AddView(StationSearchDialog); //Navbar Root LinearLayout NavBarSearchBack = new LinearLayout(this); NavBarSearchBack.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, NAVBARHEIGHT); NavBarSearchBack.SetBackgroundColor(RtGraphicsColours.Orange); RootLayout.AddView(NavBarSearchBack); //Left Image ImageView NavbarSearchLeft = new ImageView(this); NavbarSearchLeft.LayoutParameters = RtGraphicsLayouts.LayoutParameters(100, NAVBARHEIGHT); NavbarSearchLeft.SetImageResource(Resource.Drawable.Icon_SelectRouteLeft); NavBarSearchBack.AddView(NavbarSearchLeft); //Centre LinearLayout NavBarSearchCentre = new LinearLayout(this); NavBarSearchCentre.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-200, NAVBARHEIGHT); NavBarSearchCentre.Orientation = Orientation.Vertical; NavBarSearchBack.AddView(NavBarSearchCentre); //Right Image ImageView NavbarSearchRight = new ImageView(this); NavbarSearchRight.LayoutParameters = RtGraphicsLayouts.LayoutParameters(100, NAVBARHEIGHT); NavbarSearchRight.SetImageResource(Resource.Drawable.Icon_SelectRouteRight); NavBarSearchBack.AddView(NavbarSearchRight); //Right Event NavbarSearchRight.Click += delegate { SwapFromTo(); }; //From Search Box Back LinearLayout FromSearchBack = new LinearLayout(this); FromSearchBack.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-200, NAVBARHEIGHT / 2); FromSearchBack.SetDpPadding(RtGraphicsLayouts, 0, 35, 0, 10); NavBarSearchCentre.AddView(FromSearchBack); //From Search Box RelativeLayout FromSearchBox = new RelativeLayout(this); FromSearchBox.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND); FromSearchBox.SetDpPadding(RtGraphicsLayouts, NAVBARPADDING, 0, NAVBARPADDING, 0); FromSearchBox.SetBackgroundResource(Resource.Drawable.StyleRoundShaded); FromSearchBack.AddView(FromSearchBox); //From Search Hint FromSearchHint = new TextView(this); FromSearchHint.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND); FromSearchHint.Format(RtGraphicsExt.TextFormats.Heading1); FromSearchHint.SetTextColor(RtGraphicsColours.Salmon); FromSearchHint.Gravity = GravityFlags.CenterVertical; FromSearchHint.Text = "From"; FromSearchBox.AddView(FromSearchHint); //From Search Text FromSearchText = new TextView(this); FromSearchText.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND); FromSearchText.Format(RtGraphicsExt.TextFormats.Heading1); FromSearchText.Gravity = GravityFlags.CenterVertical; FromSearchText.SetMaxLines(1); FromSearchBox.AddView(FromSearchText); //From Events FromSearchBox.Click += delegate { StationSearchDialog.ShowDialog(FromSearchText.Text); }; //To Search Box Back LinearLayout ToSearchBack = new LinearLayout(this); ToSearchBack.LayoutParameters = RtGraphicsLayouts.LayoutParameters(-200, NAVBARHEIGHT / 2); ToSearchBack.SetDpPadding(RtGraphicsLayouts, 0, 10, 0, 35); NavBarSearchCentre.AddView(ToSearchBack); //To Search Box RelativeLayout ToSearchBox = new RelativeLayout(this); ToSearchBox.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND); ToSearchBox.SetDpPadding(RtGraphicsLayouts, NAVBARPADDING, 0, NAVBARPADDING, 0); ToSearchBox.SetBackgroundResource(Resource.Drawable.StyleRoundShaded); ToSearchBack.AddView(ToSearchBox); //To Search Hint ToSearchHint = new TextView(this); ToSearchHint.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND); ToSearchHint.Format(RtGraphicsExt.TextFormats.Heading1); ToSearchHint.SetTextColor(RtGraphicsColours.Salmon); ToSearchHint.Gravity = GravityFlags.CenterVertical; ToSearchHint.Text = "To"; ToSearchBox.AddView(ToSearchHint); //To Search Text ToSearchText = new TextView(this); ToSearchText.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND); ToSearchText.Format(RtGraphicsExt.TextFormats.Heading1); ToSearchText.Gravity = GravityFlags.CenterVertical; ToSearchText.SetMaxLines(1); ToSearchBox.AddView(ToSearchText); //To Events ToSearchBox.Click += delegate { StationSearchDialog.ShowDialog(ToSearchText.Text, 1); }; //Screen Content Scroller ScrollView ContentScrollerRoot = new ScrollView(this); ContentScrollerRoot.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.EXPAND); RootLayout.AddView(ContentScrollerRoot); //Screen Content LinearLayout ContentScrollRoot = new LinearLayout(this); ContentScrollRoot.LayoutParameters = RtGraphicsLayouts.LayoutParameters(RtGraphicsLayouts.EXPAND, RtGraphicsLayouts.CONTAIN); ContentScrollRoot.Orientation = Orientation.Vertical; ContentScrollRoot.SetDpPadding(RtGraphicsLayouts, 25, 25, 25, 25); ContentScrollerRoot.AddView(ContentScrollRoot); //Train Results Box RtTrainDeparturesView = new RtTrainDeparturesView(this, this); RtTrainDeparturesView.Callback += RtTrainDeparturesView_Callback; ContentScrollRoot.AddView(RtTrainDeparturesView); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { container.RemoveAllViews(); this.container = (ViewGroup)container.Parent.Parent; LinearLayout layout = new LinearLayout(container.Context); layout.Orientation = Android.Widget.Orientation.Vertical; variationsList = new BorderedList(container.Context); variationsList.Id = 3; variationsList.ItemClick += VariationsList_ItemClick; variationsList.Adapter = listAdapter; Resources res = container.Context.Resources; #pragma warning disable CS0618 // Type or member is obsolete Drawable shape = res.GetDrawable(Resource.Drawable.VariationsListBorder); #pragma warning restore CS0618 // Type or member is obsolete //layout.AddView(variationsList); if (this.container is CurrentOrderLayout) { LinearLayout inOutLayout = new LinearLayout(container.Context); inOutLayout.SetPadding(0, 10, 0, 0); Button inOutButton = new Button(container.Context); inOutButton.Click += InOutButton_Click; inOutButton.Text = "Eat In / Out"; inOutButton.SetTextSize(ComplexUnitType.Sp, 23); inOutText = new TextView(container.Context); inOutText.SetTextSize(ComplexUnitType.Sp, 23); inOutText.SetTextColor(Color.Black); inOutText.SetPadding(10, 0, 0, 0); inOutText.Text = "Eat In"; inOutLayout.AddView(inOutButton); inOutLayout.AddView(inOutText); layout.AddView(inOutLayout); inOutButton.LayoutParameters.Width = 390; inOutButton.LayoutParameters.Height = 120; LinearLayout discountLayout = new LinearLayout(container.Context); discountButton = new Button(container.Context); discountButton.Click += DiscountButton_Click; discountButton.Text = "Set Discount"; discountButton.SetTextSize(ComplexUnitType.Sp, 23); discountText = new TextView(container.Context); discountText.SetTextSize(ComplexUnitType.Sp, 23); discountText.SetTextColor(Color.Black); discountText.SetPadding(10, 0, 0, 0); discountText.Text = "No Discount"; discountLayout.AddView(discountButton); discountLayout.AddView(discountText); discountText.LayoutParameters.Width = 470; layout.AddView(discountLayout); discountButton.LayoutParameters.Width = 390; discountButton.LayoutParameters.Height = 120; LinearLayout quantityLayout = new LinearLayout(container.Context); quantityButton = new Button(container.Context); quantityButton.Click += QuantityButton_Click; quantityButton.Text = "Set Quantity"; quantityButton.SetTextSize(ComplexUnitType.Sp, 23); quantityText = new TextView(container.Context); quantityText.SetTextSize(ComplexUnitType.Sp, 23); quantityText.SetTextColor(Color.Black); quantityText.SetPadding(10, 0, 0, 0); quantityText.Text = "1"; quantityLayout.AddView(quantityButton); quantityLayout.AddView(quantityText); layout.AddView(quantityLayout); quantityButton.LayoutParameters.Width = 390; quantityButton.LayoutParameters.Height = 120; } else { //variationsList.LayoutParameters.Height = 750; } layout.AddView(variationsList); variationsList.LayoutParameters.Height = 550; variationsList.LayoutParameters.Width = 750; LinearLayout buttonLayout = new LinearLayout(container.Context); buttonLayout.Orientation = Android.Widget.Orientation.Horizontal; buttonLayout.SetBackgroundColor(Color.White); backButton = new ImageView(container.Context); #pragma warning disable CS0618 // Type or member is obsolete backButton.SetImageDrawable(res.GetDrawable(Resource.Drawable.Back)); #pragma warning restore CS0618 // Type or member is obsolete backButton.Click += BackButton_Click; backButton.Visibility = ViewStates.Invisible; forwardButton = new ImageView(container.Context); #pragma warning disable CS0618 // Type or member is obsolete forwardButton.SetImageDrawable(res.GetDrawable(Resource.Drawable.Forward)); #pragma warning restore CS0618 // Type or member is obsolete forwardButton.Click += ForwardButton_Click; forwardButton.Visibility = ViewStates.Invisible; confirmButton = new ImageView(container.Context); #pragma warning disable CS0618 // Type or member is obsolete confirmButton.SetImageDrawable(res.GetDrawable(Resource.Drawable.Confirm)); #pragma warning restore CS0618 // Type or member is obsolete confirmButton.Click += ConfirmButton_Click; confirmButton.Visibility = ViewStates.Invisible; buttonLayout.AddView(backButton); buttonLayout.AddView(forwardButton); buttonLayout.AddView(confirmButton); buttonLayout.SetPadding(40, 0, 0, 0); layout.AddView(buttonLayout); container.AddView(layout); newOrderItemId = svc.GetNewOrderItemId(); return(base.OnCreateView(inflater, container, savedInstanceState)); }
private void CreateInfoLayout(object sender) { var header = (((sender as ImageView).Parent as LinearLayout).GetChildAt(0) as LinearLayout).GetChildAt(0) as TextView; LinearLayout bodyView = new LinearLayout(context); bodyView.Orientation = Android.Widget.Orientation.Vertical; bodyView.SetBackgroundColor(Color.White); TextView body = new TextView(context); body.Text = ((((sender as ImageView).Parent as LinearLayout).GetChildAt(0) as LinearLayout).GetChildAt(1) as TextView).Text + "421 E DRACHMAN TUCSON AZ 85705 - 7598 USA"; body.SetTextSize(ComplexUnitType.Dip, 14); body.SetPadding((int)(12 * density), (int)(10 * density), 0, 0); body.SetTextColor(Color.ParseColor("#007CEE")); TextView facilities = new TextView(context); facilities.Text = "Available Facilities"; facilities.Gravity = GravityFlags.CenterHorizontal; facilities.SetTextColor(Color.Black); facilities.SetTextSize(ComplexUnitType.Dip, 14); LinearLayout facilitiesLayout = new LinearLayout(context); facilitiesLayout.Orientation = Android.Widget.Orientation.Vertical; facilitiesLayout.SetPadding(0, (int)(10 * density), 0, 0); LinearLayout iconLayout = new LinearLayout(context); iconLayout.Orientation = Android.Widget.Orientation.Horizontal; iconLayout.SetHorizontalGravity(GravityFlags.CenterHorizontal); LinearLayout iconDescLayout = new LinearLayout(context); iconDescLayout.Orientation = Android.Widget.Orientation.Horizontal; iconDescLayout.SetHorizontalGravity(GravityFlags.CenterHorizontal); ImageView mticket = new ImageView(context); mticket.SetImageResource(Resource.Drawable.Popup_MTicket); ImageView parking = new ImageView(context); parking.SetImageResource(Resource.Drawable.Popup_Parking); ImageView foodCourt = new ImageView(context); foodCourt.SetImageResource(Resource.Drawable.Popup_FoodCourt); iconLayout.AddView(mticket, (int)(100 * density), (int)(30 * density)); iconLayout.AddView(parking, (int)(100 * density), (int)(30 * density)); iconLayout.AddView(foodCourt, (int)(100 * density), (int)(30 * density)); TextView mtick = new TextView(context); mtick.Text = "M-Ticket"; mtick.SetTextSize(ComplexUnitType.Dip, 10); mtick.SetTextColor(Color.Black); mtick.Gravity = GravityFlags.CenterHorizontal | GravityFlags.CenterVertical; TextView park = new TextView(context); park.Text = "Parking"; park.SetTextSize(ComplexUnitType.Dip, 10); park.SetTextColor(Color.Black); park.Gravity = GravityFlags.CenterHorizontal | GravityFlags.CenterVertical; TextView food = new TextView(context); food.Text = "Food Court"; food.SetTextSize(ComplexUnitType.Dip, 10); food.SetTextColor(Color.Black); food.Gravity = GravityFlags.CenterHorizontal | GravityFlags.CenterVertical; iconDescLayout.AddView(mtick, (int)(100 * density), (int)(30 * density)); iconDescLayout.AddView(park, (int)(100 * density), (int)(30 * density)); iconDescLayout.AddView(food, (int)(100 * density), (int)(30 * density)); facilitiesLayout.AddView(iconLayout); facilitiesLayout.AddView(iconDescLayout); bodyView.AddView(body, ViewGroup.LayoutParams.MatchParent, (int)(50 * density)); bodyView.AddView(facilities, ViewGroup.LayoutParams.MatchParent, (int)(30 * density)); bodyView.AddView(facilitiesLayout, ViewGroup.LayoutParams.MatchParent, (int)(70 * density)); DisplayInfoPopup(bodyView, header.Text); }
private LinearLayout CreateSeatSelectionPage() { LinearLayout seatSelectionMainLayout = new LinearLayout(context); seatSelectionMainLayout.Orientation = Android.Widget.Orientation.Vertical; seatSelectionMainLayout.SetBackgroundColor(Color.White); LinearLayout numberOfSeatsLayout = new LinearLayout(context); numberOfSeatsLayout.Orientation = Android.Widget.Orientation.Horizontal; if (MainActivity.IsTablet) { numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("1"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("2", 1), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("3"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("4"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("5"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("6"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("7"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("8"), (int)((450 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); } else { numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("1"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("2", 1), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("3"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("4"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("5"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("6"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("7"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); numberOfSeatsLayout.AddView(CreateSeatSelectionLayout("8"), (int)((300 * Resources.System.DisplayMetrics.Density) / 8), (int)(42 * Resources.System.DisplayMetrics.Density)); } TextView title2 = new TextView(context); title2.Text = "Select your seat class"; if(!MainActivity.IsTablet) title2.SetY(10); title2.SetTextColor(Color.Black); title2.SetTextSize(ComplexUnitType.Dip, 14); LinearLayout seatClassLayout = new LinearLayout(context); seatClassLayout.Orientation = Android.Widget.Orientation.Vertical; if (MainActivity.IsTablet) { seatClassLayout.SetPadding((int)(22 * density), 0, 0, 0); } else { seatClassLayout.SetPadding((int)(22 * density), (int)(15 * density), 0, 0); } seatClassLayout.AddView(CreateSeatClassLayoutTile("Silver"), (int)(300 * density), (int)(40 * density)); seatClassLayout.AddView(CreateSeatClassLayoutTile("Premier"), (int)(300 * density), (int)(40 * density)); if (MainActivity.IsTablet) { numberOfSeatsLayout.SetPadding(0, (int)(15 * density), 0, 0); title2.SetPadding((int)(10 * density), 0, 0, 0); seatSelectionMainLayout.AddView(numberOfSeatsLayout, ViewGroup.LayoutParams.MatchParent, (int)(84 * Resources.System.DisplayMetrics.Density)); seatSelectionMainLayout.AddView(title2, ViewGroup.LayoutParams.MatchParent, (int)(45 * density)); seatSelectionMainLayout.AddView(seatClassLayout, ViewGroup.LayoutParams.MatchParent, (int)(120 * density)); termsAndConditionsPopup.PopupView.FooterHeight = 60; } else { numberOfSeatsLayout.SetPadding(0, (int)(10 * density), 0, 0); title2.SetPadding((int)(10 * density), (int)(15 * density), 0, 0); seatSelectionMainLayout.AddView(numberOfSeatsLayout, ViewGroup.LayoutParams.MatchParent, (int)(52 * Resources.System.DisplayMetrics.Density)); seatSelectionMainLayout.AddView(title2, ViewGroup.LayoutParams.MatchParent, (int)(45 * density)); seatSelectionMainLayout.AddView(seatClassLayout, ViewGroup.LayoutParams.MatchParent, (int)(95 * density)); termsAndConditionsPopup.PopupView.FooterHeight = 40; } termsAndConditionsPopup.PopupView.HeaderTitle = "Select your seats"; termsAndConditionsPopup.PopupView.PopupStyle.HeaderTextColor = Color.Black; termsAndConditionsPopup.PopupView.PopupStyle.HeaderBackgroundColor = Color.White;// ParseColor("#007CEE"); termsAndConditionsPopup.PopupView.PopupStyle.BorderThickness = 1; termsAndConditionsPopup.PopupView.ShowFooter = true; termsAndConditionsPopup.PopupView.ShowHeader = true; if (MainActivity.IsTablet) termsAndConditionsPopup.PopupView.HeightRequest = 350; else termsAndConditionsPopup.PopupView.HeightRequest = 300; termsAndConditionsPopup.PopupView.AppearanceMode = AppearanceMode.TwoButton; (termsAndConditionsPopup.PopupView.FooterView as LinearLayout).RemoveAllViews(); proceed = new Button(context); proceed.Text = "Proceed"; proceed.SetTextSize(ComplexUnitType.Dip,14); proceed.SetTextColor(Color.White); proceed.SetBackgroundColor(Color.ParseColor("#007CEE")); proceed.SetMinimumWidth((int)(300 * density)); (termsAndConditionsPopup.PopupView.FooterView as LinearLayout).AddView(proceed, ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); proceed.Click += AcceptTerms_Click; termsAndConditionsPopup.PopupView.PopupStyle.FooterBackgroundColor = Color.White; return seatSelectionMainLayout; }
void LoadPagesDataSource() { bool is_main = true; int space = Configuration.getWidth(30); var s_listp = vm.LOsInCircle[vm._currentUnidad].stack.StacksList; int indice = 0; if (s_listp != null) { int j = vm._currentSection; // for (int j = 0; j < s_listp.Count; j++) { for (int k = 0; k < s_listp [j].PagesList.Count; k++) { // if (j == vm._currentSection) { VerticalScrollViewPager scrollPager = new VerticalScrollViewPager(this); scrollPager.setOnScrollViewListener(this); LinearLayout linearScroll = new LinearLayout(this); linearScroll.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); linearScroll.Orientation = Orientation.Vertical; var content = s_listp [j].PagesList [k].content; FrontContainerViewPager front = new FrontContainerViewPager(this); front.Tag = "pager"; front.ImageChapter = s_listp [j].PagesList [k].page.url_img; front.Title = s_listp [j].PagesList [k].page.title; front.Description = s_listp [j].PagesList [k].page.description; var slides = s_listp [j].PagesList [k].content.lopage.loslide; front.setBack(drBack); linearScroll.AddView(front); LinearLayout descriptionLayout = new LinearLayout(this); descriptionLayout.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); descriptionLayout.SetPadding(space, 0, space, space); descriptionLayout.Orientation = Orientation.Vertical; TextView titulo_detalle = new TextView(this); titulo_detalle.Text = "Descripción"; titulo_detalle.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/ArcherMediumPro.otf"); titulo_detalle.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(38)); titulo_detalle.SetTextColor(Color.ParseColor(Configuration.ListaColores [indice % 6])); titulo_detalle.SetPadding(0, 0, 0, space); descriptionLayout.AddView(titulo_detalle); TextView detalle = new TextView(this); detalle.TextFormatted = Html.FromHtml(slides [0].loparagraph); detalle.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/ArcherMediumPro.otf"); detalle.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(32)); descriptionLayout.AddView(detalle); ViewTreeObserver vto = detalle.ViewTreeObserver; int H = 0; vto.GlobalLayout += (sender, args) => { H = detalle.Height; Console.WriteLine("TAM:::1:" + H); detalle.LayoutParameters.Height = H - Configuration.getHeight(60); }; LinearLayout separationLinear = new LinearLayout(this); separationLinear.LayoutParameters = new LinearLayout.LayoutParams(-1, 5); separationLinear.SetBackgroundColor(Color.ParseColor("#D8D8D8")); separationLinear.Orientation = Orientation.Horizontal; //separationLinear.SetPadding (0,0,0,50); linearScroll.AddView(descriptionLayout); linearScroll.AddView(separationLinear); listFrontPager.Add(front); var currentpage = s_listp [j].PagesList [k]; for (int m = 1; m < slides.Count; m++) { LOSlideSource slidesource = new LOSlideSource(this); var _id_ = vm.LOsInCircle [vm._currentUnidad].lo.color_id; is_main = !is_main; 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); } } slidesource.title_page = front.Title; linearScroll.AddView(slidesource.getViewSlide()); } scrollPager.VerticalScrollBarEnabled = false; if (k == 0) { scrollPager.AddView(linearScroll); listaScroll.Add(scrollPager); indice++; } // } } //} } else { Console.WriteLine("ERROR"); } mainLayoutPages.RemoveAllViews(); 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); }
async Task DrawBoard(int tileCount) { await Task.Factory.StartNew(() => { try { for(var i = 0; i < tileCount; i++) { var tile = new LinearLayout(this); tile.SetBackgroundColor(Resources.GetColor(Resource.Color.white)); var p = new GridLayout.LayoutParams() { Height = 112, Width = 112 }; p.SetMargins(4, 4, 4, 4); tile.LayoutParameters = p; RunOnUiThread(() => { tile.Click += TileClick; tile.LongClick += TileLongClick; _grid.AddView(tile); _subViews[_grid.IndexOfChild(tile)] = tile; }); } } catch(Exception ex) { Console.WriteLine(ex); } }); }
public override View GetSampleContent(Context con) { SfCircularGauge sfCircularGauge = new SfCircularGauge(con); ObservableCollection <Header> headers = new ObservableCollection <Header>(); Header header = new Header(); header.Text = "0"; header.TextSize = 20; header.TextColor = Color.ParseColor("#F03E3E"); header.Position = new PointF((float)0.28, (float)0.86); headers.Add(header); Header header1 = new Header(); header1.Text = "100"; header1.TextSize = 20; header1.TextColor = Color.ParseColor("#30B32D"); header1.Position = new PointF((float)0.75, (float)0.86); headers.Add(header1); Header header2 = new Header(); header2.Text = "55%"; header2.TextSize = 20; header2.TextColor = Color.ParseColor("#F03E3E"); header2.Position = new PointF((float)0.5, (float)0.5); headers.Add(header2); sfCircularGauge.Headers = headers; ObservableCollection <CircularScale> circularScales = new ObservableCollection <CircularScale>(); CircularScale scale = new CircularScale(); scale.StartValue = 0; scale.EndValue = 100; scale.Interval = 10; scale.ShowRim = false; scale.ShowTicks = false; scale.ShowLabels = false; ObservableCollection <CircularRange> ranges = new ObservableCollection <CircularRange>(); CircularRange circularRange = new CircularRange(); circularRange.Offset = 0.8; circularRange.StartValue = 0; circularRange.EndValue = 100; circularRange.Width = 25; ObservableCollection <GaugeGradientStop> gradients = new ObservableCollection <GaugeGradientStop>(); GaugeGradientStop gaugeGradientStop = new GaugeGradientStop(); gaugeGradientStop.Value = 0; gaugeGradientStop.Color = Color.ParseColor("#F03E3E"); gradients.Add(gaugeGradientStop); GaugeGradientStop gaugeGradientStop1 = new GaugeGradientStop(); gaugeGradientStop1.Value = 35; gaugeGradientStop1.Color = Color.ParseColor("#FFDD00"); gradients.Add(gaugeGradientStop1); GaugeGradientStop gaugeGradientStop2 = new GaugeGradientStop(); gaugeGradientStop2.Value = 75; gaugeGradientStop2.Color = Color.ParseColor("#FFDD00"); gradients.Add(gaugeGradientStop2); GaugeGradientStop gaugeGradientStop3 = new GaugeGradientStop(); gaugeGradientStop3.Value = 100; gaugeGradientStop3.Color = Color.ParseColor("#30B32D"); gradients.Add(gaugeGradientStop3); circularRange.GradientStops = gradients; ranges.Add(circularRange); scale.CircularRanges = ranges; ObservableCollection <CircularPointer> pointers = new ObservableCollection <CircularPointer>(); MarkerPointer markerPointer = new MarkerPointer(); markerPointer.MarkerShape = Com.Syncfusion.Gauges.SfCircularGauge.Enums.MarkerShape.InvertedTriangle; markerPointer.Offset = 0.8; markerPointer.MarkerHeight = 15; markerPointer.MarkerWidth = 15; markerPointer.Value = 55; markerPointer.Color = Color.Red; pointers.Add(markerPointer); scale.CircularPointers = pointers; circularScales.Add(scale); sfCircularGauge.CircularScales = circularScales; sfCircularGauge.SetBackgroundColor(Color.White); LinearLayout linearLayout = new LinearLayout(con); linearLayout.AddView(sfCircularGauge); linearLayout.SetPadding(30, 30, 30, 30); linearLayout.SetBackgroundColor(Color.White); return(linearLayout); }
public override View GetSampleContent(Context context) { m_context = context; currentDensity = m_context.Resources.DisplayMetrics.Density; //Initialize the SfDiagram and set its background color. diagram = new SfDiagram(context); diagram.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); diagram.IsReadOnly = true; ObservableCollection <Employee> employees = new ObservableCollection <Employee>(); employees.Add(new Employee() { Name = "Elizabeth", EmpId = "1", ParentId = "", Designation = "CEO" }); employees.Add(new Employee() { Name = "Christina", EmpId = "2", ParentId = "1", Designation = "Manager" }); employees.Add(new Employee() { Name = "Yang", EmpId = "3", ParentId = "1", Designation = "Manager" }); employees.Add(new Employee() { Name = "Yoshi", EmpId = "4", ParentId = "2", Designation = "Team Lead" }); employees.Add(new Employee() { Name = "Yoshi", EmpId = "5", ParentId = "2", Designation = "Co-ordinator" }); employees.Add(new Employee() { Name = "Philip", EmpId = "6", ParentId = "4", Designation = "Developer" }); employees.Add(new Employee() { Name = "Philip", EmpId = "7", ParentId = "4", Designation = "Testing Engineer" }); employees.Add(new Employee() { Name = "Roland", EmpId = "8", ParentId = "3", Designation = "Team Lead" }); employees.Add(new Employee() { Name = "Yoshi", EmpId = "9", ParentId = "3", Designation = "Co-ordinator" }); employees.Add(new Employee() { Name = "Yuonne", EmpId = "10", ParentId = "8", Designation = "Developer" }); employees.Add(new Employee() { Name = "Philip", EmpId = "10", ParentId = "8", Designation = "Testing Engineer" }); //Initializes the DataSourceSettings diagram.DataSourceSettings = new DataSourceSettings() { DataSource = employees, Id = "EmpId", ParentId = "ParentId" }; //Initializes the Layout DirectedTreeLayout treelayout = new DirectedTreeLayout() { HorizontalSpacing = 80, VerticalSpacing = 50 * currentDensity, TreeOrientation = TreeOrientation.TopToBottom }; diagram.LayoutManager = new LayoutManager() { Layout = treelayout }; diagram.BeginNodeRender += Diagram_BeginNodeRender; diagram.Loaded += Diagram_Loaded; LinearLayout linearLayout = new LinearLayout(context) { Orientation = Android.Widget.Orientation.Vertical }; LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); layoutParams.TopMargin = 25 * (int)MainActivity.Factor; linearLayout.LayoutParameters = layoutParams; LinearLayout typesBar = new LinearLayout(context); typesBar.SetBackgroundColor(Color.Rgb(245, 245, 245)); layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); typesBar.SetMinimumHeight(200 * (int)MainActivity.Factor); typesBar.SetPadding(0, 10 * (int)MainActivity.Factor, 0, 10 * (int)MainActivity.Factor); TextView selectText = new TextView(context) { LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.MatchParent), Text = "Connector Types:", TextAlignment = TextAlignment.Gravity, Gravity = GravityFlags.Center | GravityFlags.CenterVertical, TextSize = 15 * MainActivity.Factor }; int width = (int)(context.Resources.DisplayMetrics.WidthPixels - context.Resources.DisplayMetrics.Density); selectText.SetMinimumWidth((int)(width * 0.4 * MainActivity.Factor)); ImageButtonView straightButton = new ImageButtonView(context); straightButton.Click += ButtonTouch; straightButton.ImageId = "DiagramStraight"; straightButton.LayoutParameters = new ViewGroup.LayoutParams(180 * (int)MainActivity.Factor, 180 * (int)MainActivity.Factor); ImageView straightImage = new ImageView(context); var imageId = straightButton.ImageId + ".png"; if (imageId != null) { var imageData = LoadResource(imageId).ToArray(); straightImage.SetImageBitmap(BitmapFactory.DecodeByteArray(imageData, 0, imageData.Length)); } straightImage.Layout((int)(40 * MainActivity.Factor), (int)(40 * MainActivity.Factor), (int)(110 * MainActivity.Factor), (int)(110 * MainActivity.Factor)); straightButton.AddView(straightImage); ImageButtonView curveButton = new ImageButtonView(context); curveButton.Click += ButtonTouch; curveButton.ImageId = "DiagramCurve"; curveButton.LayoutParameters = new ViewGroup.LayoutParams(180 * (int)MainActivity.Factor, 180 * (int)MainActivity.Factor); ImageView curveImage = new ImageView(context); imageId = curveButton.ImageId + ".png"; if (imageId != null) { var imageData = LoadResource(imageId).ToArray(); curveImage.SetImageBitmap(BitmapFactory.DecodeByteArray(imageData, 0, imageData.Length)); } curveImage.Layout((int)(40 * MainActivity.Factor), (int)(40 * MainActivity.Factor), (int)(110 * MainActivity.Factor), (int)(110 * MainActivity.Factor)); curveButton.AddView(curveImage); ImageButtonView edgeButton = new ImageButtonView(context); edgeButton.Click += ButtonTouch; edgeButton.LayoutParameters = new ViewGroup.LayoutParams(180 * (int)MainActivity.Factor, 180 * (int)MainActivity.Factor); edgeButton.ImageId = "DiagramEdge"; ImageView edgeImage = new ImageView(context); imageId = edgeButton.ImageId + ".png"; if (imageId != null) { var imageData = LoadResource(imageId).ToArray(); edgeImage.SetImageBitmap(BitmapFactory.DecodeByteArray(imageData, 0, imageData.Length)); } edgeImage.Layout((int)(40 * MainActivity.Factor), (int)(40 * MainActivity.Factor), (int)(110 * MainActivity.Factor), (int)(110 * MainActivity.Factor)); edgeButton.AddView(edgeImage); buttons = new LinearLayout(context); buttons.SetMinimumWidth((int)(width - width * 0.4 * MainActivity.Factor)); buttons.SetBackgroundColor(Color.Transparent); buttons.AddView(straightButton); TextView view = new TextView(context); view.SetWidth(30 * (int)MainActivity.Factor); view.SetBackgroundColor(Color.Transparent); buttons.AddView(view); buttons.AddView(curveButton); view = new TextView(context); view.SetWidth(30 * (int)MainActivity.Factor); view.SetBackgroundColor(Color.Transparent); buttons.AddView(view); buttons.AddView(edgeButton); typesBar.AddView(selectText); typesBar.AddView(buttons); linearLayout.AddView(typesBar); linearLayout.AddView(diagram); for (int i = 0; i < diagram.Connectors.Count; i++) { diagram.Connectors[i].TargetDecoratorType = DecoratorType.None; diagram.Connectors[i].Style.StrokeWidth = 1; } return(linearLayout); }
public override View GetSampleContent(Context con) { SfCircularGauge sfCircularGauge = new SfCircularGauge(con); ObservableCollection <CircularScale> circularScales = new ObservableCollection <CircularScale>(); CircularScale scale = new CircularScale(); scale.StartAngle = 270; scale.StartValue = 0; scale.EndValue = 16; scale.Interval = 2; scale.LabelOffset = 0.75; scale.SweepAngle = 360; scale.MinorTicksPerInterval = 1; scale.ShowLastLabel = false; scale.ScaleStartOffset = 0.99; scale.ScaleEndOffset = 0.9; scale.LabelCreated += Scale_LabelCreated; scale.RimColor = Color.ParseColor("#E0E0E0"); scale.LabelColor = Color.ParseColor("#4B4B4B"); scale.MajorTickSettings.StartOffset = 0.9; scale.MajorTickSettings.EndOffset = 0.83; scale.MajorTickSettings.Width = 2; scale.MajorTickSettings.Color = Color.ParseColor("#9E9E9E"); scale.MinorTickSettings.StartOffset = 0.9; scale.MinorTickSettings.EndOffset = 0.85; scale.MinorTickSettings.Width = 2; scale.MinorTickSettings.Color = Color.ParseColor("#9E9E9E"); ObservableCollection <CircularPointer> pointers = new ObservableCollection <CircularPointer>(); pointer = new NeedlePointer(); pointer.Value = 14; pointer.Color = Color.ParseColor("#f03e3e"); pointer.Type = Com.Syncfusion.Gauges.SfCircularGauge.Enums.NeedleType.Triangle; pointer.LengthFactor = 0.65; pointer.Width = 20; pointer.KnobRadiusFactor = 0; pointer.KnobColor = Color.White; pointer.KnobStrokeWidth = 3; pointer.KnobStrokeColor = Color.White; pointer.EnableAnimation = false; pointers.Add(pointer); NeedlePointer needlePointer = new NeedlePointer(); needlePointer.Value = 6; needlePointer.Type = Com.Syncfusion.Gauges.SfCircularGauge.Enums.NeedleType.Triangle; needlePointer.LengthFactor = 0.65; needlePointer.Width = 20; needlePointer.Color = Color.ParseColor("#9E9E9E"); needlePointer.KnobRadiusFactor = 0.11; needlePointer.KnobColor = Color.White; needlePointer.KnobStrokeWidth = 3; needlePointer.KnobStrokeColor = Color.White; needlePointer.EnableAnimation = false; pointers.Add(needlePointer); scale.CircularPointers = pointers; circularScales.Add(scale); sfCircularGauge.CircularScales = circularScales; sfCircularGauge.SetBackgroundColor(Color.White); LinearLayout linearLayout = new LinearLayout(con); linearLayout.AddView(sfCircularGauge); linearLayout.SetPadding(30, 30, 30, 30); linearLayout.SetBackgroundColor(Color.White); return(linearLayout); }
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; }
public ActionBar(Context context, IAttributeSet attrs) : base(context, attrs) { m_Context = context; m_Inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService); m_BarView = (RelativeLayout)m_Inflater.Inflate(Resource.Layout.ActionBar, null); AddView(m_BarView); m_LogoView = m_BarView.FindViewById <ImageView>(Resource.Id.actionbar_home_logo); m_HomeLayout = m_BarView.FindViewById <RelativeLayout>(Resource.Id.actionbar_home_bg); m_HomeBtn = m_BarView.FindViewById <ImageButton>(Resource.Id.actionbar_home_btn); m_BackIndicator = m_BarView.FindViewById(Resource.Id.actionbar_home_is_back); m_TitleView = m_BarView.FindViewById <TextView>(Resource.Id.actionbar_title); m_ActionsView = m_BarView.FindViewById <LinearLayout>(Resource.Id.actionbar_actions); m_Progress = m_BarView.FindViewById <ProgressBar>(Resource.Id.actionbar_progress); m_TitleLayout = m_BarView.FindViewById <RelativeLayout>(Resource.Id.actionbar_title_layout); //check if pre-honeycomb. Ideally here you would actually want to check if a menu button exists. //however on all pre-honeycomb phones they basically did. var currentapiVersion = (int)Build.VERSION.SdkInt; m_HasMenuButton = currentapiVersion <= 10; m_OverflowAction = new OverflowActionBarAction(context); //Custom Attributes (defined in Attrs.xml) var a = context.ObtainStyledAttributes(attrs, Resource.Styleable.ActionBar); var title = a.GetString(Resource.Styleable.ActionBar_title); if (null != title) { Title = title; } var titleColor = a.GetColor(Resource.Styleable.ActionBar_title_color, Resources.GetColor(Resource.Color.actionbar_title)); TitleColor = titleColor; var separatorColor = a.GetColor(Resource.Styleable.ActionBar_separator, Resources.GetColor(Resource.Color.actionbar_separator)); m_ActionsView.SetBackgroundColor(separatorColor); using (var background = a.GetDrawable(Resource.Styleable.ActionBar_background)) //recycling the drawable immediately { if (null != background) { BackgroundDrawable = background; } } var backgroundItem = a.GetDrawable(Resource.Styleable.ActionBar_background_item); if (null != backgroundItem) { ItemBackgroundDrawable = backgroundItem; } a.Recycle(); }
internal PickerInnerView(Context context, PickerAdapter adapter) : base(context) { LayoutParameters = new LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); var padding = (int)context.ToPixels(8); SetPadding(padding, padding, padding, padding); SetBackgroundColor(adapter.BackgroundColor); _Title = new TextView(context) { Id = GenerateViewId() }; _Title.SetBackgroundColor(adapter.BackgroundColor); _Title.SetTextColor(adapter.TextColor); _Title.SetTextSize(ComplexUnitType.Sp, (float)adapter.FontSize); _Description = new TextView(context) { Id = GenerateViewId() }; _Description.SetBackgroundColor(adapter.BackgroundColor); _Description.SetTextColor(adapter.DetailColor); _Description.SetTextSize(ComplexUnitType.Sp, (float)adapter.DetailFontSize); _CheckBox = new SimpleCheck(context, adapter.AccentColor) { Focusable = false, }; _CheckBox.SetBackgroundColor(adapter.BackgroundColor); _CheckBox.SetHighlightColor(adapter.AccentColor); _Container = new LinearLayout(context) { Orientation = Orientation.Vertical }; _Container.SetBackgroundColor(adapter.BackgroundColor); using (var param = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent)) { _Container.AddView(_Title, param); _Container.AddView(_Description, param); } using (var param = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent)) { param.AddRule(LayoutRules.AlignParentStart); param.AddRule(LayoutRules.CenterVertical); AddView(_Container, param); } using (var param = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.MatchParent) { Width = (int)context.ToPixels(30), Height = (int)context.ToPixels(30) }) { param.AddRule(LayoutRules.AlignParentEnd); param.AddRule(LayoutRules.CenterVertical); AddView(_CheckBox, param); } }
public override View GetSampleContent(Context context1) { context = context1; width = context1.Resources.DisplayMetrics.WidthPixels; height = context1.Resources.DisplayMetrics.HeightPixels; density = context1.Resources.DisplayMetrics.Density; carousel = new SfCarousel(context); carousel1 = new SfCarousel(context); carousel2 = new SfCarousel(context); carouselObj = new CarouselPropertyClass(); modelObj = new CarouselModel(); carousel.AllowLoadMore = true; carousel.LoadMoreItemsCount = 2; carousel1.AllowLoadMore = true; carousel1.LoadMoreItemsCount = 2; carousel2.AllowLoadMore = true; carousel2.LoadMoreItemsCount = 2; TextView text = new TextView(context1) { TextAlignment = TextAlignment.Center, Text = "Load More...", TextSize = 10, Typeface = Typeface.DefaultBold, Gravity = GravityFlags.Center }; text.SetBackgroundColor(Color.White); TextView text1 = new TextView(context1) { TextAlignment = TextAlignment.Center, Text = "Load More...", TextSize = 10, Typeface = Typeface.DefaultBold, Gravity = GravityFlags.Center }; text1.SetBackgroundColor(Color.White); TextView text2 = new TextView(context1) { TextAlignment = TextAlignment.Center, Text = "Load More...", TextSize = 10, Typeface = Typeface.DefaultBold, Gravity = GravityFlags.Center }; text2.SetBackgroundColor(Color.White); carousel.LoadMoreView = text; carousel1.LoadMoreView = text1; carousel2.LoadMoreView = text2; carousel.ItemsSource = modelObj.ApplicationCollection; carousel.ItemSpacing = 80; carousel1.ItemsSource = modelObj.TransportCollection; carousel1.ItemSpacing = 80; carousel2.ItemsSource = modelObj.OfficeCollection; carousel2.ItemSpacing = 80; carousel.ViewMode = ViewMode.Linear; carousel1.ViewMode = ViewMode.Linear; carousel2.ViewMode = ViewMode.Linear; if (context.Resources.DisplayMetrics.Density > 1.5) { carousel.ItemHeight = Convert.ToInt32(110 * context.Resources.DisplayMetrics.Density); carousel.ItemWidth = Convert.ToInt32(110 * context.Resources.DisplayMetrics.Density); carousel1.ItemHeight = Convert.ToInt32(110 * context.Resources.DisplayMetrics.Density); carousel1.ItemWidth = Convert.ToInt32(110 * context.Resources.DisplayMetrics.Density); carousel2.ItemHeight = Convert.ToInt32(110 * context.Resources.DisplayMetrics.Density); carousel2.ItemWidth = Convert.ToInt32(110 * context.Resources.DisplayMetrics.Density); } carousel.LayoutParameters = new LayoutParams(LinearLayout.LayoutParams.MatchParent, (int)(120 * density)); carousel1.LayoutParameters = new LayoutParams(LinearLayout.LayoutParams.MatchParent, (int)(120 * density)); carousel2.LayoutParameters = new LayoutParams(LinearLayout.LayoutParams.MatchParent, (int)(120 * density)); mainLayout = new LinearLayout(context); mainLayout.Orientation = Orientation.Vertical; mainLayout.SetGravity(GravityFlags.CenterHorizontal); mainLayout.SetBackgroundColor(Color.Rgb(249, 249, 249)); mainLayout.LayoutParameters = new LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent); carousel.Adapter = new CarouselAdapter(context1, modelObj.ApplicationCollection); carousel1.Adapter = new CarouselAdapter(context1, modelObj.TransportCollection); carousel2.Adapter = new CarouselAdapter(context1, modelObj.OfficeCollection); HeaderMethod(context); mainLayout.AddView(carousel); HeaderMethod1(context); mainLayout.AddView(carousel1); HeaderMethod2(context); mainLayout.AddView(carousel2); return(mainLayout); }
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 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 = "LAS RUTAS"; _txtCurso.SetY(-100); //_mainSpace.AddView (_txtCurso); //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); //_mainSpace.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(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; }
void CompleteActivation(ItsBeta.Core.Achieves.ParentCategory.ParentProject.Achieve activatedBadge) { _progressDialog.Dismiss(); GetCategoryView(); GetProjectsView(); LayoutInflater inflater = (LayoutInflater)this.GetSystemService(LayoutInflaterService); ViewGroup relativeAgedSummary = new RelativeLayout(this); View layout = inflater.Inflate(Resource.Layout.receivebadgelayount, relativeAgedSummary); ImageView badgeImage = (ImageView)layout.FindViewById(Resource.Id.recbadgewin_BadgeImageView); Button inactiveButton = (Button)layout.FindViewById(Resource.Id.recbadgewin_inactiveButton); ImageButton badgeReadyButton = (ImageButton)layout.FindViewById(Resource.Id.recbadgewin_CloseImageButton); ImageButton badgeReadyButtonFake = (ImageButton)layout.FindViewById(Resource.Id.recbadgewin_CloseImageButtonFake); TextView profileName = (TextView)layout.FindViewById(Resource.Id.recbadgewin_badgeTextView); TextView badgeDescr = (TextView)layout.FindViewById(Resource.Id.recbadgewin_wonderdescrTextView); TextView badgeHowGetted = (TextView)layout.FindViewById(Resource.Id.recbadgewin_howwonderTextView); profileName.SetTypeface(_font, TypefaceStyle.Normal); badgeDescr.SetTypeface(_font, TypefaceStyle.Normal); badgeHowGetted.SetTypeface(_font, TypefaceStyle.Normal); if (!AppInfo.IsLocaleRu) { badgeHowGetted.Text = "You got a new Badge"; } //recbadgewin_howwonderTextView profileName.Text = AppInfo._user.Fullname; badgeDescr.Text = activatedBadge.Description; AppInfo._badgesCount += 1; _badgesCountDisplay.Text = AppInfo._badgesCount.ToString(); Bitmap bitmap = BitmapFactory.DecodeFile(@"/data/data/ru.hintsolutions.itsbeta/cache/pictures/" + "achive" + activatedBadge.ApiName + ".PNG"); badgeImage.SetImageBitmap(bitmap); bitmap.Dispose(); LinearLayout bonusPaperListLinearLayout = (LinearLayout)layout.FindViewById(Resource.Id.bonuspaperlist_linearLayout); // bonusPaperListLinearLayout.RemoveAllViews(); if (activatedBadge.Bonuses.Count() == 0) { bonusPaperListLinearLayout.Visibility = ViewStates.Gone; } if (activatedBadge.Bonuses.Count() == 1) { var bonus = activatedBadge.Bonuses.First(); { LayoutInflater layoutInflater = (LayoutInflater)BaseContext.GetSystemService(LayoutInflaterService); View bonusView = layoutInflater.Inflate(Resource.Layout.bonusonlistrowlayout, null); bonusView.LayoutParameters = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FillParent, RelativeLayout.LayoutParams.FillParent); ImageView bonusLineImage = (ImageView)bonusView.FindViewById(Resource.Id.badgewin_GreenBonusImageView); ImageView discountLineImage = (ImageView)bonusView.FindViewById(Resource.Id.badgewin_BlueBonusImageView); ImageView giftLineImage = (ImageView)bonusView.FindViewById(Resource.Id.badgewin_VioletBonusImageView); ImageView bonusDescrBackgroundImage = (ImageView)bonusView.FindViewById(Resource.Id.badgewin_greendescbackgroundImageView); ImageView discountDescrBackgroundImage = (ImageView)bonusView.FindViewById(Resource.Id.badgewin_bluedescbackgroundImageView); ImageView giftDescrBackgroundImage = (ImageView)bonusView.FindViewById(Resource.Id.badgewin_violetdescbackgroundImageView); TextView bonusName = (TextView)bonusView.FindViewById(Resource.Id.badgewin_bonusTextView); TextView bonusDescr = (TextView)bonusView.FindViewById(Resource.Id.badgewin_bonusdescrTextView); bonusName.SetTypeface(_font, TypefaceStyle.Normal); bonusDescr.SetTypeface(_font, TypefaceStyle.Normal); bonusDescr.MovementMethod = Android.Text.Method.LinkMovementMethod.Instance; bonusLineImage.Visibility = ViewStates.Invisible; discountLineImage.Visibility = ViewStates.Invisible; giftLineImage.Visibility = ViewStates.Invisible; bonusDescrBackgroundImage.Visibility = ViewStates.Invisible; discountDescrBackgroundImage.Visibility = ViewStates.Invisible; giftDescrBackgroundImage.Visibility = ViewStates.Invisible; bonusDescr.Visibility = ViewStates.Invisible; bonusName.Visibility = ViewStates.Invisible; if (bonus.Type == "discount") { bonusLineImage.Visibility = ViewStates.Invisible; discountLineImage.Visibility = ViewStates.Visible; giftLineImage.Visibility = ViewStates.Invisible; bonusPaperListLinearLayout.SetBackgroundColor(new Color(201, 238, 255, 89)); bonusDescr.Visibility = ViewStates.Visible; bonusName.Visibility = ViewStates.Visible; bonusName.Text = "Скидка"; if (!AppInfo.IsLocaleRu) { bonusName.Text = "Discount"; } bonusDescr.SetText(Android.Text.Html.FromHtml(bonus.Description), TextView.BufferType.Spannable); bonusPaperListLinearLayout.AddView(bonusView); } if (bonus.Type == "bonus") { bonusLineImage.Visibility = ViewStates.Visible; discountLineImage.Visibility = ViewStates.Invisible; giftLineImage.Visibility = ViewStates.Invisible; bonusPaperListLinearLayout.SetBackgroundColor(new Color(189, 255, 185, 127)); bonusDescr.Visibility = ViewStates.Visible; bonusName.Visibility = ViewStates.Visible; bonusName.Text = "Бонус"; if (!AppInfo.IsLocaleRu) { bonusName.Text = "Bonus"; } bonusDescr.SetText(Android.Text.Html.FromHtml(bonus.Description), TextView.BufferType.Spannable); bonusPaperListLinearLayout.AddView(bonusView); } if (bonus.Type == "present") { bonusLineImage.Visibility = ViewStates.Invisible; discountLineImage.Visibility = ViewStates.Invisible; giftLineImage.Visibility = ViewStates.Visible; bonusPaperListLinearLayout.SetBackgroundColor(new Color(255, 185, 245, 127)); bonusDescr.Visibility = ViewStates.Visible; bonusName.Visibility = ViewStates.Visible; bonusName.Text = "Подарок"; if (!AppInfo.IsLocaleRu) { bonusName.Text = "Present"; } bonusDescr.SetText(Android.Text.Html.FromHtml(bonus.Description), TextView.BufferType.Spannable); bonusPaperListLinearLayout.AddView(bonusView); } } } if (activatedBadge.Bonuses.Count() > 1) { foreach (var bonus in activatedBadge.Bonuses) { LayoutInflater layoutInflater = (LayoutInflater)BaseContext.GetSystemService(LayoutInflaterService); View bonusView = layoutInflater.Inflate(Resource.Layout.bonusonlistrowlayout, null); bonusView.LayoutParameters = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FillParent, RelativeLayout.LayoutParams.FillParent); ImageView bonusLineImage = (ImageView)bonusView.FindViewById(Resource.Id.badgewin_GreenBonusImageView); ImageView discountLineImage = (ImageView)bonusView.FindViewById(Resource.Id.badgewin_BlueBonusImageView); ImageView giftLineImage = (ImageView)bonusView.FindViewById(Resource.Id.badgewin_VioletBonusImageView); ImageView bonusDescrBackgroundImage = (ImageView)bonusView.FindViewById(Resource.Id.badgewin_greendescbackgroundImageView); ImageView discountDescrBackgroundImage = (ImageView)bonusView.FindViewById(Resource.Id.badgewin_bluedescbackgroundImageView); ImageView giftDescrBackgroundImage = (ImageView)bonusView.FindViewById(Resource.Id.badgewin_violetdescbackgroundImageView); TextView bonusName = (TextView)bonusView.FindViewById(Resource.Id.badgewin_bonusTextView); TextView bonusDescr = (TextView)bonusView.FindViewById(Resource.Id.badgewin_bonusdescrTextView); bonusName.SetTypeface(_font, TypefaceStyle.Normal); bonusDescr.SetTypeface(_font, TypefaceStyle.Normal); bonusDescr.MovementMethod = Android.Text.Method.LinkMovementMethod.Instance; bonusLineImage.Visibility = ViewStates.Invisible; discountLineImage.Visibility = ViewStates.Invisible; giftLineImage.Visibility = ViewStates.Invisible; bonusDescrBackgroundImage.Visibility = ViewStates.Invisible; discountDescrBackgroundImage.Visibility = ViewStates.Invisible; giftDescrBackgroundImage.Visibility = ViewStates.Invisible; bonusDescr.Visibility = ViewStates.Invisible; bonusName.Visibility = ViewStates.Invisible; if (bonus.Type == "discount") { bonusLineImage.Visibility = ViewStates.Invisible; discountLineImage.Visibility = ViewStates.Visible; giftLineImage.Visibility = ViewStates.Invisible; bonusDescrBackgroundImage.Visibility = ViewStates.Invisible; discountDescrBackgroundImage.Visibility = ViewStates.Visible; giftDescrBackgroundImage.Visibility = ViewStates.Invisible; bonusDescr.Visibility = ViewStates.Visible; bonusName.Visibility = ViewStates.Visible; bonusName.Text = "Скидка"; if (!AppInfo.IsLocaleRu) { bonusName.Text = "Discount"; } bonusDescr.SetText(Android.Text.Html.FromHtml(bonus.Description), TextView.BufferType.Spannable); bonusPaperListLinearLayout.AddView(bonusView); } if (bonus.Type == "bonus") { bonusLineImage.Visibility = ViewStates.Visible; discountLineImage.Visibility = ViewStates.Invisible; giftLineImage.Visibility = ViewStates.Invisible; bonusDescrBackgroundImage.Visibility = ViewStates.Visible; discountDescrBackgroundImage.Visibility = ViewStates.Invisible; giftDescrBackgroundImage.Visibility = ViewStates.Invisible; bonusDescr.Visibility = ViewStates.Visible; bonusName.Visibility = ViewStates.Visible; bonusName.Text = "Бонус"; if (!AppInfo.IsLocaleRu) { bonusName.Text = "Bonus"; } bonusDescr.SetText(Android.Text.Html.FromHtml(bonus.Description), TextView.BufferType.Spannable); bonusPaperListLinearLayout.AddView(bonusView); } if (bonus.Type == "present") { bonusLineImage.Visibility = ViewStates.Invisible; discountLineImage.Visibility = ViewStates.Invisible; giftLineImage.Visibility = ViewStates.Visible; bonusDescrBackgroundImage.Visibility = ViewStates.Invisible; discountDescrBackgroundImage.Visibility = ViewStates.Invisible; giftDescrBackgroundImage.Visibility = ViewStates.Visible; bonusDescr.Visibility = ViewStates.Visible; bonusName.Visibility = ViewStates.Visible; bonusName.Text = "Подарок"; if (!AppInfo.IsLocaleRu) { bonusName.Text = "Present"; } bonusDescr.SetText(Android.Text.Html.FromHtml(bonus.Description), TextView.BufferType.Spannable); bonusPaperListLinearLayout.AddView(bonusView); } } } var badgePopupWindow = new PopupWindow(layout, LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent); badgePopupWindow.ShowAsDropDown(FindViewById <TextView>(Resource.Id.secaondscr_faketextView), 0, 0); badgeReadyButton.Click += delegate { _vibe.Vibrate(50); badgeReadyButtonFake.StartAnimation(_buttonClickAnimation); GetAchievementsView(); badgePopupWindow.Dismiss(); }; inactiveButton.Click += delegate { GetAchievementsView(); badgePopupWindow.Dismiss(); }; }
public void initUnidades(int indexCurso, int indexUnidad) { var textFormat = Android.Util.ComplexUnitType.Px; _spaceUnidades.RemoveAllViews(); _listLinearUnidades.Clear(); _listIconMap.Clear(); _listIconVerMap.Clear(); int numUnidades = _listUnidades.Count; _mainSpace.SetY(Configuration.getHeight(0)); if (isNotas) { _mainSpace.RemoveAllViews(); taskListView = new ListView(context); taskListView.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(850)); addTaskButton = new Button(context); addTaskButton.Text = "Añadir Nota"; addTaskButton.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); _mainSpace.SetY(Configuration.getHeight(20)); //addTaskButton.SetY (Configuration.getHeight (130)); //_mainLayout.AddView(addTaskButton); _mainSpace.AddView(addTaskButton); _mainSpace.AddView(taskListView); if (addTaskButton != null) { addTaskButton.Click += (sender, e) => { //layoutSave.Visibility = Android.Views.ViewStates.Visible; context.StartActivity(typeof(NotasItemScreen)); }; } // wire up task click handler if (taskListView != null) { taskListView.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => { var taskDetails = new Intent(context, typeof(NotasItemScreen)); taskDetails.PutExtra("TaskID", tasks[e.Position].ID); context.StartActivity(taskDetails); }; } return; } for (int i = 0; i < numUnidades; i++) { LinearLayoutLO linearUnidad = new LinearLayoutLO(context); linearUnidad.content = _listUnidades[i]; linearUnidad.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); linearUnidad.Orientation = Orientation.Vertical; linearUnidad.SetGravity(Android.Views.GravityFlags.CenterVertical); //linearUnidad.SetBackgroundColor (Color.Blue); linearUnidad.index = i; linearUnidad.SetPadding(Configuration.getWidth(100), Configuration.getWidth(25), 0, Configuration.getWidth(25)); //linearUnidad.SetX (100); TextView titleUnidad = new TextView(context); titleUnidad.SetTextSize(textFormat, Configuration.getHeight(42)); titleUnidad.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(440), -2); /*if (indexCurso == 2) { * if (indexUnidad == 3) { * linearUnidad.Orientation = Orientation.Horizontal; * ImageIconMap icon = new ImageIconMap (context); * icon.index = i; * icon.SetImageBitmap(iconPlay); * icon.SetX (Configuration.getWidth (60)); * linearUnidad.AddView (icon); * _listIconMap.Add (icon); * } * } */ if (indexCurso == 3) { titleUnidad.SetTextSize(textFormat, Configuration.getHeight(55)); } RelativeLayout linearContenido = new RelativeLayout(context); linearContenido.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); linearContenido.SetGravity(Android.Views.GravityFlags.Center); //TextView titleUnidad = new TextView(context); //titleUnidad.Text = _listUnidades [i].Title; titleUnidad.TextFormatted = Html.FromHtml(_listUnidades [i].Title); titleUnidad.SetTextColor(Color.ParseColor(Configuration.ListaColores [i % 6])); titleUnidad.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); TextView descriptionUnidad = new TextView(context); descriptionUnidad.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(440), -2); //descriptionUnidad.Text = _listUnidades [i].Description; descriptionUnidad.TextFormatted = Html.FromHtml(_listUnidades [i].Description); //descriptionUnidad.Text = _listUnidades [i].Description; descriptionUnidad.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); descriptionUnidad.SetTextSize(textFormat, Configuration.getHeight(28)); Linkify.AddLinks(descriptionUnidad, MatchOptions.All); //descriptionUnidad.MovementMethod = Android.Text.Method.LinkMovementMethod.Instance; //descriptionUnidad.LinksClickable = true; //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 == 3) { if (indexUnidad != 3) { ImageView info = new ImageView(context); info.Tag = i; info.SetImageBitmap(iconInfo); info.SetX(Configuration.getWidth(450)); info.SetY(Configuration.getHeight(10)); ImageView favorit_ = new ImageView(context); favorit_.Tag = i; favorit_.SetX(Configuration.getWidth(450)); favorit_.SetY(Configuration.getHeight(150)); favorit_.Click += delegate { funcFavoritos(favorit_); }; //Colocando icono de Favoritos if (!isFavoritos) { int id_auto = 0; if (isListFavorites(_listUnidades[i].Id) != -1) { favorit_.SetImageBitmap(iconFavorito); } else { favorit_.SetImageBitmap(iconFavorito_BN); } linearContenido.AddView(favorit_); } bool removido = true; if (isFavoritos) { /*_mainSpace.RemoveView(_contentScrollView_S2); * _mainSpace.RemoveView (_fondo2);*/ _mainSpace.RemoveAllViews(); favorit_.SetImageBitmap(iconFavorito); linearContenido.AddView(favorit_); _mainSpace.AddView(_spaceUnidades); removido = false; } if (removido) { try{ _mainSpace.RemoveAllViews(); _mainSpace.AddView(_fondo2); _mainSpace.AddView(_contentScrollView_S2); _mainSpace.AddView(_spaceUnidades); }catch (Exception e) { //ya existe esos hijos } } linearContenido.AddView(info); } 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); } }
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")); mapSpace.AddView (mapImage); /* mapImage.PivotX = mapImage.Width/2; mapImage.PivotY = mapImage.Height/2; mapImage.ScaleX = (float)1.5; mapImage.ScaleY = (float)1.5; */ 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 (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 { Random rnd = new Random(); showAd (rnd.Next(3)); } }; _mainLayout.AddView (leyendaLayout); scrollPlaces = new VerticalScrollView (context); scrollPlaces.LayoutParameters = new VerticalScrollView.LayoutParams (-1,Configuration.getHeight(1136-125-85)); scrollPlaces.AddView (placesInfoLayout); scrollPlaces.SetY (Configuration.getHeight (125)); //mainLayout.AddView (placesInfoLayout); //iniPlancesList (); }
public override View GetSampleContent(Context con) { LinearLayout linear = new LinearLayout(con); linear.SetBackgroundColor(Color.White); linear.Orientation = Orientation.Vertical; linear.SetPadding(10, 10, 10, 10); TextView text2 = new TextView(con); text2.TextSize = 17; text2.TextAlignment = TextAlignment.Center; text2.Text = "This sample demonstrates how to create a Word document with Group shapes."; text2.SetTextColor(Color.ParseColor("#262626")); text2.SetPadding(5, 5, 5, 5); linear.AddView(text2); TextView space1 = new TextView(con); space1.TextSize = 10; linear.AddView(space1); m_context = con; LinearLayout radioLinearLayout = new LinearLayout(con); radioLinearLayout.Orientation = Orientation.Horizontal; TextView imageType = new TextView(con); imageType.Text = "Save As : "; imageType.TextSize = 19; radioLinearLayout.AddView(imageType); radioGroup = new RadioGroup(con); radioGroup.TextAlignment = TextAlignment.Center; radioGroup.Orientation = Orientation.Horizontal; docxButton = new RadioButton(con); docxButton.Text = "DOCX"; radioGroup.AddView(docxButton); pdfButton = new RadioButton(con); pdfButton.Text = "PDF"; radioGroup.AddView(pdfButton); radioGroup.Check(1); radioLinearLayout.AddView(radioGroup); linear.AddView(radioLinearLayout); docxButton.Checked = true; TextView space2 = new TextView(con); space2.TextSize = 10; linear.AddView(space2); Button generateButton = new Button(con); generateButton.Text = "Generate"; generateButton.Click += OnButtonClicked; linear.AddView(generateButton); return(linear); }
public ActionBar(Context context, IAttributeSet attrs) : base(context, attrs) { m_Context = context; m_Inflater = (LayoutInflater)context.GetSystemService(Context.LayoutInflaterService); m_BarView = (RelativeLayout)m_Inflater.Inflate(Resource.Layout.ActionBar, null); AddView(m_BarView); m_LogoView = m_BarView.FindViewById<ImageView>(Resource.Id.actionbar_home_logo); m_HomeLayout = m_BarView.FindViewById<RelativeLayout>(Resource.Id.actionbar_home_bg); m_HomeBtn = m_BarView.FindViewById<ImageButton>(Resource.Id.actionbar_home_btn); m_BackIndicator = m_BarView.FindViewById(Resource.Id.actionbar_home_is_back); m_TitleView = m_BarView.FindViewById<TextView>(Resource.Id.actionbar_title); m_ActionsView = m_BarView.FindViewById<LinearLayout>(Resource.Id.actionbar_actions); m_Progress = m_BarView.FindViewById<ProgressBar>(Resource.Id.actionbar_progress); m_TitleLayout = m_BarView.FindViewById<RelativeLayout>(Resource.Id.actionbar_title_layout); //check if pre-honeycomb. Ideally here you would actually want to check if a menu button exists. //however on all pre-honeycomb phones they basically did. var currentapiVersion = (int)Build.VERSION.SdkInt; m_HasMenuButton = currentapiVersion <= 10; m_OverflowAction = new OverflowActionBarAction(context); //Custom Attributes (defined in Attrs.xml) var a = context.ObtainStyledAttributes(attrs, Resource.Styleable.ActionBar); var title = a.GetString(Resource.Styleable.ActionBar_title); if (null != title) Title = title; var titleColor = a.GetColor(Resource.Styleable.ActionBar_title_color, Resources.GetColor(Resource.Color.actionbar_title)); TitleColor = titleColor; var separatorColor = a.GetColor(Resource.Styleable.ActionBar_separator, Resources.GetColor(Resource.Color.actionbar_separator)); m_ActionsView.SetBackgroundColor(separatorColor); using (var background = a.GetDrawable(Resource.Styleable.ActionBar_background)) //recycling the drawable immediately { if (null != background) BackgroundDrawable = background; } var backgroundItem = a.GetDrawable(Resource.Styleable.ActionBar_background_item); if (null != backgroundItem) ItemBackgroundDrawable = backgroundItem; a.Recycle(); }
private void showPopOut (object sender, EventArgs e) { LinearLayout popOutLayout = new LinearLayout (context); popOutLayout.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth(500),Configuration.getWidth(500)); popOutLayout.SetBackgroundColor (Color.White); //infoPopUp.ContentView = popOutLayout; infoPopUp.ShowAsDropDown(popOutLayout); }
void Flip(LinearLayout tileLayout) { tileLayout.SetBackgroundColor(Resources.GetColor(Resource.Color.brown_background)); tileLayout.Click -= TileClick; tileLayout.LongClick -= TileLongClick; }
protected override View GetView(TooltipView p0) { LinearLayout rootLayout = new LinearLayout(context); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.MatchParent); rootLayout.Orientation = Orientation.Vertical; rootLayout.LayoutParameters = layoutParams; rootLayout.SetPadding(10, 5, 5, 5); rootLayout.SetBackgroundColor(Color.ParseColor("#404041")); TextView label = new TextView(context); label.Text = p0.Series.Label; label.TextSize = 12; label.TextAlignment = Android.Views.TextAlignment.Center; label.SetPadding(80, 0, 0, 0); label.SetTextColor(Color.White); LinearLayout line = new LinearLayout(context); LinearLayout.LayoutParams linelayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, 4); line.LayoutParameters = linelayoutParams; line.SetBackgroundColor(Color.White); LinearLayout xLayout = new LinearLayout(context); xLayout.Orientation = Orientation.Horizontal; xLayout.SetPadding(0, 5, 0, 0); TextView xLabel = new TextView(context); xLabel.Text = "Height : "; xLabel.TextSize = 12; xLabel.SetTextColor(Color.ParseColor("#CCCCCC")); TextView xValue = new TextView(context); xValue.Text = (p0.ChartDataPoint as DataPoint).XValue.ToString(); xValue.TextSize = 12; xValue.SetTextColor(Color.White); xLayout.AddView(xLabel); xLayout.AddView(xValue); LinearLayout yLayout = new LinearLayout(context); yLayout.Orientation = Orientation.Horizontal; yLayout.SetPadding(0, 5, 0, 0); TextView yLabel = new TextView(context); yLabel.Text = "Weight : "; yLabel.TextSize = 12; yLabel.SetTextColor(Color.ParseColor("#CCCCCC")); TextView yValue = new TextView(context); yValue.Text = (p0.ChartDataPoint as DataPoint).YValue + " lbs"; yValue.TextSize = 12; yValue.SetTextColor(Color.White); yLayout.AddView(yLabel); yLayout.AddView(yValue); rootLayout.AddView(label); rootLayout.AddView(line); rootLayout.AddView(yLayout); rootLayout.AddView(xLayout); p0.AddView(rootLayout); return(p0); }
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 { Random rnd = new Random(); showAd (rnd.Next(3)); } }; _mainLayout.AddView (leyendaLayout); scrollPlaces = new VerticalScrollView (context); scrollPlaces.LayoutParameters = new VerticalScrollView.LayoutParams (-1,Configuration.getHeight(1136-125-85)); scrollPlaces.AddView (placesInfoLayout); scrollPlaces.SetY (Configuration.getHeight (125)); //mainLayout.AddView (placesInfoLayout); //iniPlancesList (); }
public override View GetSampleContent(Context con) { circularGauge = new SfCircularGauge(con); ObservableCollection <CircularScale> _circularScales = new ObservableCollection <CircularScale>(); ObservableCollection <CircularPointer> _circularPointers = new ObservableCollection <CircularPointer>(); ObservableCollection <Header> _gaugeHeaders = new ObservableCollection <Header>(); // adding new CircularScale circularScale = new CircularScale(); circularScale.StartValue = 0; circularScale.EndValue = 100; circularScale.StartAngle = 130; circularScale.SweepAngle = 280; circularScale.RimWidth = 10; circularScale.RimColor = Color.ParseColor("#D14646"); circularScale.MinorTicksPerInterval = 0; circularScale.LabelOffset = labelsOffset; circularScale.LabelTextSize = 18; //adding major ticks majorTickstings = new TickSetting(); majorTickstings.Color = Color.ParseColor("#444444"); majorTickstings.Size = 15; majorTickstings.Offset = ticksOffset; circularScale.MajorTickSettings = majorTickstings; //adding minor ticks TickSetting minorTickstings = new TickSetting(); minorTickstings.Color = Color.Gray; circularScale.MinorTickSettings = minorTickstings; // adding needle Pointer needlePointer = new NeedlePointer(); needlePointer.Value = pointerValue; needlePointer.KnobColor = Color.ParseColor("#2BBFB8"); needlePointer.KnobRadius = 20; needlePointer.Type = NeedleType.Bar; needlePointer.LengthFactor = 0.8; needlePointer.Width = 3; needlePointer.Color = Color.Gray; _circularPointers.Add(needlePointer); // adding range Pointer rangePointer = new RangePointer(); rangePointer.Value = pointerValue; rangePointer.Color = Color.ParseColor("#2BBFB8"); rangePointer.Width = 10; _circularPointers.Add(rangePointer); circularScale.CircularPointers = _circularPointers; _circularScales.Add(circularScale); //adding header Header circularGaugeHeader = new Header(); circularGaugeHeader.Text = "Speedometer"; circularGaugeHeader.TextColor = Color.Gray; circularGaugeHeader.Position = new PointF((float)0.38, (float)0.7); circularGaugeHeader.TextSize = 20; _gaugeHeaders.Add(circularGaugeHeader); circularGauge.Headers = _gaugeHeaders; circularGauge.CircularScales = _circularScales; circularGauge.SetBackgroundColor(Color.White); LinearLayout linearLayout = new LinearLayout(con); linearLayout.AddView(circularGauge); linearLayout.SetPadding(30, 30, 30, 30); linearLayout.SetBackgroundColor(Color.White); return(linearLayout); }
//........................................................ //ON CREATE() *********************************************************************************************** protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); string url = Intent.GetStringExtra("url"); login(url); //PRVI TAB - HOMEPAGE *************************************************************************************** ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText(Resources.GetString(Resource.String.All)); tab.TabSelected += (sender, args) => { allitems = new List <BucketItem>(); var relative = new RelativeLayout(this) { LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent) }; this.SetContentView(relative); //Kreiranje osnovnog scroll view-a var scrollView = new ScrollView(this) { LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent) }; relative.AddView(scrollView); //Kreiranje glavnog layouta (koji je dio scroll view-a) mainLayout = new LinearLayout(this) { Orientation = Orientation.Vertical, LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent) }; mainLayout.SetBackgroundColor(Color.WhiteSmoke); scrollView.AddView(mainLayout); // Dohvat podataka conn("http://bucketlist.ddns.net/api/items", 0); }; ActionBar.AddTab(tab); //DRUGI TAB - PROFILE *************************************************************************************** tab = ActionBar.NewTab(); tab.SetText(Resources.GetString(Resource.String.Profile)); tab.TabSelected += (sender, args) => { myitems = new List <BucketItem>(); var relative = new RelativeLayout(this) { LayoutParameters = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent) }; this.SetContentView(relative); //Kreiranje osnovnog scroll view-a var scrollView = new ScrollView(this) { LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent) }; relative.AddView(scrollView); //Kreiranje glavnog layouta (koji je dio scroll view-a) mainLayout = new LinearLayout(this) { Orientation = Orientation.Vertical, LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent) }; mainLayout.SetBackgroundColor(Color.WhiteSmoke); scrollView.AddView(mainLayout); LinearLayout podaci = new LinearLayout(this) { LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent), Orientation = Orientation.Vertical }; podaci.SetBackgroundColor(Color.DarkSeaGreen); podaci.SetPadding(20, 20, 20, 20); var slikakorisnik = new ImageView(this); var bmp1 = BitmapFactory.DecodeByteArray(user.slika, 0, user.slika.Length); var bmp = getRoundedShape(bmp1); slikakorisnik.SetImageBitmap(bmp); LinearLayout.LayoutParams LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 402); slikakorisnik.LayoutParameters = LayoutParameters; //slikakorisnik.SetScaleType(ImageView.ScaleType.FitCenter); podaci.AddView(slikakorisnik); TextView imekorisnika = new TextView(this); LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); imekorisnika.LayoutParameters = LayoutParameters; imekorisnika.Text = user.imeprezime; imekorisnika.TextSize = 25; imekorisnika.SetTextColor(Color.White); imekorisnika.Gravity = GravityFlags.Center; podaci.AddView(imekorisnika); mainLayout.AddView(podaci); LinearLayout podaci2 = new LinearLayout(this); LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); podaci2.Orientation = Orientation.Vertical; LayoutParameters.SetMargins(0, 0, 0, 20); podaci2.SetPadding(40, 40, 40, 40); podaci2.SetBackgroundColor(Color.WhiteSmoke); podaci2.LayoutParameters = LayoutParameters; TextView motolabel = new TextView(this); motolabel.Text = "Moto"; motolabel.SetTextColor(Color.LightSlateGray); motolabel.SetTypeface(Typeface.SansSerif, TypefaceStyle.Italic); motolabel.LayoutParameters = LayoutParameters; motolabel.Gravity = GravityFlags.Center; podaci2.AddView(motolabel); TextView moto = new TextView(this); moto.Text = user.motto; moto.SetTextColor(Color.LightSlateGray); moto.LayoutParameters = LayoutParameters; moto.Gravity = GravityFlags.Center; podaci2.AddView(moto); TextView opislabel = new TextView(this); opislabel.Text = "Opis"; opislabel.SetTextColor(Color.LightSlateGray); opislabel.SetTypeface(Typeface.SansSerif, TypefaceStyle.Italic); opislabel.LayoutParameters = LayoutParameters; opislabel.Gravity = GravityFlags.Center; podaci2.AddView(opislabel); TextView opis = new TextView(this); opis.Text = user.opis; opis.SetTextColor(Color.LightSlateGray); opis.LayoutParameters = LayoutParameters; opis.Gravity = GravityFlags.Center; podaci2.AddView(opis); mainLayout.AddView(podaci2); // Dohvat podataka conn("http://bucketlist.ddns.net/api/items/" + user.id, 1); }; ActionBar.AddTab(tab); //TREĆI TAB - CREATE/EDIT************************************************************************************************** tab = ActionBar.NewTab(); tab.SetText(Resources.GetString(Resource.String.Add)); tab.TabSelected += (sender, args) => { //Kreiranje osnovnog scroll view-a var scrollView = new ScrollView(this) { LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent) }; SetContentView(scrollView); //Kreiranje glavnog layouta (koji je dio scroll view-a) mainLayout = new LinearLayout(this) { Orientation = Orientation.Vertical, LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent) }; mainLayout.SetBackgroundColor(Color.White); mainLayout.SetPadding(30, 30, 30, 30); scrollView.AddView(mainLayout); EditText naziv = new EditText(this); naziv.Hint = "Naziv"; mainLayout.AddView(naziv); pic = new ImageView(this); LinearLayout.LayoutParams LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); mainLayout.AddView(pic); slika = null; Button picbutt = new Button(this); picbutt.Text = "Odaberi sliku"; picbutt.SetPadding(20, 30, 20, 30); mainLayout.AddView(picbutt); picbutt.Click += delegate { var imageIntent = new Intent(); imageIntent.SetType("image/*"); imageIntent.SetAction(Intent.ActionGetContent); StartActivityForResult( Intent.CreateChooser(imageIntent, "Select photo"), 0); }; Spinner spinner = new Spinner(this); string[] kategorije = { "Travel", "Sport", "Education", "Fun", "Extreme", "Career", "Hobby", "Family", "Charity" }; spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected); var adapter = ArrayAdapter.CreateFromResource( this, Resource.Array.kategorija_array, Android.Resource.Layout.SimpleSpinnerItem); adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinner.Adapter = adapter; mainLayout.AddView(spinner); EditText opis = new EditText(this); opis.Hint = "Opis"; LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); opis.InputType = Android.Text.InputTypes.TextVariationLongMessage; opis.LayoutParameters = LayoutParameters; mainLayout.AddView(opis); Button spremi = new Button(this); spremi.SetPadding(20, 30, 20, 60); spremi.Text = "Spremi"; mainLayout.AddView(spremi); spremi.Click += (sender1, e) => { BucketItem bModel = new BucketItem(); bModel.Ime = naziv.Text; bModel.KategorijaNaziv = kategorija; bModel.Opis = opis.Text; bModel.Ostvareno = false; bModel.Slika = slika; client = new HttpClient(); conn2(bModel, user.id); }; }; ActionBar.AddTab(tab); } // --> KRAJ ONCREATE() METODE
public void AddControl(Controls control, int?sectionID) { Bindings binding = XForm.GetBindingForControl(control); try { View controlView = new View(this); switch ((ControlType)control.type) { case ControlType.input: //the user puts something in controlView = WidgetHelper.CreateInput(control, binding, inflater, this); break; case ControlType.output: Console.WriteLine("not yet"); controlView = new LinearLayout(this); controlView.SetBackgroundColor(Color.Red); controlView.SetMinimumHeight(25); break; case ControlType.select: controlView = WidgetHelper.CreateSelect(control, binding, inflater, this); break; case ControlType.select1: controlView = WidgetHelper.CreateSelectOne(control, binding, inflater, this); break; case ControlType.upload: controlView = WidgetHelper.CreateUpload(control, binding, inflater, this); break; } MainFormLayout.LayoutTransition.EnableTransitionType(Android.Animation.LayoutTransitionType.ChangeAppearing | Android.Animation.LayoutTransitionType.ChangeDisappearing); //root if (sectionID == null || sectionID == -1) { RunOnUiThread(() => { MainFormLayout.AddView(controlView); }); } //add to the group based on the ui else { RunOnUiThread(() => { LinearLayout groupParent = (LinearLayout)MainFormLayout.FindViewWithTag(sectionID.Value); LinearLayout groupLayout = groupParent.FindViewById <LinearLayout>(Resource.Id.mainGroupLayout); groupLayout.LayoutTransition.EnableTransitionType(Android.Animation.LayoutTransitionType.ChangeAppearing | Android.Animation.LayoutTransitionType.ChangeDisappearing); Console.WriteLine($"Group tag: {groupParent.Tag}"); groupLayout.AddView(controlView); }); } //Console.WriteLine(binding.nodeset); ControlViews.Add(controlView); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public void makeMove(){ if (messages.Count % 2 == 1) { Android.Graphics.Bitmap image; LinearLayout layout = new LinearLayout (this); layout.Orientation = Orientation.Vertical; layout.SetBackgroundColor(Android.Graphics.Color.White); LinearLayout horiLayout = new LinearLayout (this); horiLayout.SetBackgroundColor(Android.Graphics.Color.SlateGray); horiLayout.Orientation = Orientation.Horizontal; Button drawButt = new Button (this); drawButt.Text = "Draw"; horiLayout.AddView(drawButt); Button eraseButt = new Button (this); eraseButt.Text = "Erase"; horiLayout.AddView(eraseButt); Button clearButt = new Button (this); clearButt.Text = "Clear"; horiLayout.AddView(clearButt); Button doneButt = new Button (this); doneButt.Text = "Done"; horiLayout.AddView(doneButt); DrawTest dt = new DrawTest(this); layout.AddView(horiLayout); layout.AddView(dt); drawButt.Click += (object sender, EventArgs e) => { dt.setColor(false); }; eraseButt.Click += (object sender, EventArgs e) => { dt.setColor(true); }; clearButt.Click += (object sender, EventArgs e) => { dt.clear(); }; doneButt.Click += (object sender, EventArgs e) => { image = dt.done(); string message = "Image Sent."; messages.Add(message); MessageStruct ms = new MessageStruct(); ms.Data = message; ms.Number = 0; ms.Pass = false; ms.Type = false; ms.SetBit = true; SendMessages(handle.encode(ms)); messagesViewAdapter.Add(message); SetContentView(Resource.Layout.GameView); }; SetContentView(layout); } else { Button doneButt = FindViewById<Button> (Resource.Id.subButton); EditText text = FindViewById<EditText> (Resource.Id.messageEntry); doneButt.Click+= (object sender, EventArgs e) => { MessageStruct str = new MessageStruct(); str.Data = text.Text; str.Type = false; str.Pass = false; str.SetBit = true; str.Number = 0; messages.Add(text.Text); messagesViewAdapter.Add(text.Text); SendMessages(handle.encode(str)); }; } }
public override View GetPropertyWindowLayout(Android.Content.Context context) { TextView startAngle = new TextView(context); startAngle.Text = "Change StartAngle"; startAngle.Typeface = Typeface.DefaultBold; startAngle.SetTextColor(Color.ParseColor("#262626")); startAngle.TextSize = 20; TextView sweepAngle = new TextView(context); sweepAngle.Text = "Change SweepAngle"; sweepAngle.Typeface = Typeface.DefaultBold; sweepAngle.SetTextColor(Color.ParseColor("#262626")); sweepAngle.TextSize = 20; TextView startAngle1 = new TextView(context); startAngle1.Text = "Change StartAngle"; startAngle1.Typeface = Typeface.DefaultBold; startAngle1.SetTextColor(Color.ParseColor("#262626")); startAngle1.TextSize = 20; TextView sweepAngle1 = new TextView(context); sweepAngle1.Text = "Change SweepAngle"; sweepAngle1.Typeface = Typeface.DefaultBold; sweepAngle1.SetTextColor(Color.ParseColor("#262626")); sweepAngle1.TextSize = 20; SeekBar pointerSeek = new SeekBar(context); pointerSeek.Max = 350; pointerSeek.Progress = 135; pointerSeek.ProgressChanged += pointerSeek_ProgressChanged; SeekBar pointerSeek1 = new SeekBar(context); pointerSeek1.Max = 350; pointerSeek1.Progress = 270; pointerSeek1.ProgressChanged += pointerSeek_ProgressChanged1; SeekBar pointerSeek2 = new SeekBar(context); pointerSeek2.Max = 350; pointerSeek2.Progress = 135; pointerSeek2.ProgressChanged += pointerSeek_ProgressChanged2; SeekBar pointerSeek3 = new SeekBar(context); pointerSeek3.Max = 350; pointerSeek3.Progress = 270; pointerSeek3.ProgressChanged += pointerSeek_ProgressChanged3; LinearLayout optionsPage = new LinearLayout(context); optionsPage.Orientation = Orientation.Vertical; optionsPage.AddView(startAngle); optionsPage.AddView(pointerSeek); optionsPage.AddView(sweepAngle); optionsPage.AddView(pointerSeek1); optionsPage.AddView(startAngle1); optionsPage.AddView(pointerSeek2); optionsPage.AddView(sweepAngle1); optionsPage.AddView(pointerSeek3); optionsPage.SetPadding(10, 10, 10, 10); optionsPage.SetBackgroundColor(Color.White); return(optionsPage); }
public TillLayout(Context context, OrderFragment parent) : base(context) { borderPaint = new Paint(); borderPaint.AntiAlias = true; borderPaint.SetStyle(Paint.Style.Stroke); borderPaint.Color = Color.Black; borderPaint.StrokeWidth = 1; Orientation = Orientation.Vertical; SetPadding(10, 10, 10, 10); SetBackgroundColor(Color.White); SetMinimumHeight(800); this.parent = parent; LinearLayout entryLayout = new LinearLayout(context); entryLayout.Orientation = Orientation.Horizontal; TextView entryTitle = new TextView(context); entryTitle.Text = "Tendered: "; entryTitle.TextSize = 20; entryTitle.SetTextColor(Color.Black); entryTitle.SetPadding(10, 30, 0, 0); entryLayout.AddView(entryTitle); entry = new EditText(context); entry.TextSize = 20; entry.TextAlignment = TextAlignment.TextEnd; entry.Text = "0"; entry.SetTextColor(Color.Black); entry.SetSelection(entry.Text.Length); entryLayout.AddView(entry); AddView(entryLayout); entry.LayoutParameters.Width = 570; LinearLayout calcView = new LinearLayout(context); TextView calcTextView = new TextView(context); calcTextView.Text = "Change (£) : "; calcTextView.TextSize = 20; calcTextView.SetTextColor(Color.Black); calcTextView.SetPadding(10, 0, 0, 10); calcView.AddView(calcTextView); change = new TextView(context); change.Text = "Not calculated"; change.TextSize = 20; change.SetTextColor(Color.Blue); calcView.AddView(change); AddView(calcView); keypad = new TillKeypad(context); keypad.SetPadding(15, 0, 0, 0); keypad.AlignmentMode = GridAlign.Bounds; keypad.TillButtonClicked += Keypad_TillButtonClicked; AddView(keypad); keypad.LayoutParameters.Width = 600; keypad.LayoutParameters.Height = 400; LinearLayout bottomKeys = new LinearLayout(context); bottomKeys.Orientation = Orientation.Horizontal; bottomKeys.SetBackgroundColor(Color.White); bottomKeys.SetPadding(5, 0, 0, 0); Button calcButton = new Button(context); calcButton.Text = "Calc"; calcButton.TextSize = 20; calcButton.Click += CalcButton_Click; bottomKeys.AddView(calcButton); Button cancelButton = new Button(context); cancelButton.Text = "Cancel"; cancelButton.TextSize = 20; cancelButton.Click += CancelButton_Click; bottomKeys.AddView(cancelButton); Button payButton = new Button(context); payButton.Text = "Pay"; payButton.TextSize = 20; payButton.Click += PayButton_Click; bottomKeys.AddView(payButton); AddView(bottomKeys); bottomKeys.LayoutParameters.Width = 600; bottomKeys.LayoutParameters.Height = 130; }
public override View GetSampleContent (Context con) { LinearLayout mainLayout,layout1,layout2,layout3;; int height = con.Resources.DisplayMetrics.HeightPixels/2; int width = con.Resources.DisplayMetrics.WidthPixels/3; /** * Defining Linear Layout */ mainLayout = new LinearLayout(con); mainLayout.SetBackgroundColor(Color.White); mainLayout.SetGravity(GravityFlags.Center); LinearLayout parentLayout=new LinearLayout(con); parentLayout.Orientation=droid.Vertical; parentLayout.SetBackgroundColor(Color.White); parentLayout.LayoutParameters=new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); FrameLayout.LayoutParams sliderLayout = new FrameLayout.LayoutParams(width,height+(height/4)); textView = new TextView(con); textView7 = new TextView(con); textView8 = new TextView(con); textView9 = new TextView(con); textView9.Text=""; textView.Typeface= Typeface.Create("Roboto", TypefaceStyle.Normal); textView9.TextSize=20; textView9.Gravity=GravityFlags.Center; textView9.SetTextColor (Color.Argb(255,182,182,182)); //parentLayout.AddView(textView9); textView10 = new TextView(con); parentLayout.AddView(textView10); parentLayout.AddView(mainLayout); parentLayout.SetGravity(GravityFlags.Center); /** * Defining First Slider */ slider1 = new SfRangeSlider(con); slider1.Minimum=-12; slider1.Maximum=12; slider1.TickFrequency=12; slider1.TrackSelectionColor=Color.Gray; slider1.Orientation=Com.Syncfusion.Sfrangeslider.Orientation.Vertical; slider1.TickPlacement=TickPlacement.None; slider1.ValuePlacement=ValuePlacement.TopLeft; slider1.ShowValueLabel=true; slider1.SnapsTo=SnapsTo.None; slider1.Value=6; // slider1.setLayoutParams(sliderLayout); slider1.ValueChanged += (object sender, SfRangeSlider.ValueChangedEventArgs e) => { String str=(string)(Math.Round(e.P1)+".0db"); textView4.Text=str; }; layout1 = new LinearLayout(con); layout1.Orientation=droid.Vertical; layout1.SetGravity(GravityFlags.Center); textView1=new TextView(con); textView1.Text="60HZ"; textView1.TextSize=20; textView1.SetTextColor(Color.Black); textView1.Gravity=GravityFlags.Center; textView1.Typeface = Typeface.Create("Helvetica", TypefaceStyle.Normal); textView4 = new TextView(con); textView4.TextSize=14; textView4.SetTextColor(Color.Argb(255, 50, 180, 228)); textView4.Text="0.0db"; textView4.Typeface=Typeface.Create("Helvetica", TypefaceStyle.Normal); textView4.Gravity=GravityFlags.Center; layout1.AddView(textView1); layout1.AddView(textView4); layout1.AddView(textView); layout1.AddView(slider1,sliderLayout); /** * Defining Second Slider */ slider2 = new SfRangeSlider(con); slider2.Minimum=-12; slider2.Maximum=12; slider2.TickFrequency=12; slider2.TrackSelectionColor=Color.Gray; slider2.Orientation=Com.Syncfusion.Sfrangeslider.Orientation.Vertical; slider2.TickPlacement=TickPlacement.None; slider2.ValuePlacement=ValuePlacement.TopLeft; slider2.ShowValueLabel=true; slider2.SnapsTo=SnapsTo.None; slider2.Value=-3; slider2.LayoutParameters=sliderLayout; slider2.ValueChanged+= (object sender, SfRangeSlider.ValueChangedEventArgs e) => { textView5.Text=Convert.ToString(Math.Round(e.P1)+".0db"); }; layout2 = new LinearLayout(con); layout2.Orientation=droid.Vertical; layout2.SetGravity(GravityFlags.Center); textView2=new TextView(con); textView2.Text="170HZ"; textView2.TextSize=20; textView2.SetTextColor(Color.Black); textView2.Gravity=GravityFlags.Center; textView2.Typeface = Typeface.Create("Helvetica", TypefaceStyle.Normal); textView5 = new TextView(con); textView5.TextSize=14; textView5.SetTextColor(Color.Argb(255, 50, 180, 228)); textView5.Text="0.0db"; textView5.Typeface=Typeface.Create("Helvetica", TypefaceStyle.Normal); textView5.Gravity=GravityFlags.Center; layout2.AddView(textView2); layout2.AddView(textView5); layout2.AddView(textView7); layout2.AddView(slider2,sliderLayout); /** * Defining Third Slider */ slider3 = new SfRangeSlider(con); slider3.Minimum=-12; slider3.Maximum=12; slider3.TickFrequency=12; slider3.TrackSelectionColor=Color.Gray; slider3.Orientation=Com.Syncfusion.Sfrangeslider.Orientation.Vertical; slider3.TickPlacement=TickPlacement.None; slider3.ValuePlacement=ValuePlacement.TopLeft; slider3.ShowValueLabel=true; slider3.SnapsTo=SnapsTo.None; slider3.Value=12; slider3.LayoutParameters=sliderLayout; slider3.ValueChanged+= (object sender, SfRangeSlider.ValueChangedEventArgs e) => { textView6.Text=Convert.ToString(Math.Round(e.P1)+".0db"); }; layout3 = new LinearLayout(con); layout3.Orientation=droid.Vertical; layout3.SetGravity(GravityFlags.Center); textView3=new TextView(con); textView3.Text="310HZ"; textView3.TextSize=20; textView3.SetTextColor(Color.Black); textView3.Gravity=GravityFlags.Center; textView3.Typeface = Typeface.Create("Helvetica", TypefaceStyle.Normal); textView6 = new TextView(con); textView6.TextSize=14; textView6.SetTextColor(Color.Argb(255, 50, 180, 228)); textView6.Text="0.0db"; textView6.Typeface=Typeface.Create("Helvetica", TypefaceStyle.Normal); textView6.Gravity=GravityFlags.Center; layout3.AddView(textView3); layout3.AddView(textView6); layout3.AddView(textView8); layout3.AddView(slider3,sliderLayout); /** * Adding sliders to Layout */ mainLayout.AddView(layout1); mainLayout.AddView(layout2); mainLayout.AddView(layout3); return parentLayout; }
public override View GetSampleContent(Context con) { SfCircularGauge sfCircularGauge = new SfCircularGauge(con); ObservableCollection <CircularScale> circularScales = new ObservableCollection <CircularScale>(); scale = new CircularScale(); scale.StartValue = 0; scale.EndValue = 240; scale.Interval = 20; scale.StartAngle = 135; scale.SweepAngle = 270; scale.RimColor = Color.ParseColor("#C62E0A"); scale.LabelColor = Color.ParseColor("#C62E0A"); scale.LabelOffset = 0.88; scale.ScaleStartOffset = 0.7; scale.ScaleEndOffset = 0.69; scale.MinorTicksPerInterval = 1; scale.MajorTickSettings.StartOffset = 0.7; scale.MajorTickSettings.EndOffset = 0.77; scale.MajorTickSettings.Width = 2; scale.MajorTickSettings.Color = Color.ParseColor("#C62E0A"); scale.MinorTickSettings.StartOffset = 0.7; scale.MinorTickSettings.EndOffset = 0.75; scale.MinorTickSettings.Width = 2; scale.MinorTickSettings.Color = Color.ParseColor("#C62E0A"); ObservableCollection <CircularPointer> pointers = new ObservableCollection <CircularPointer>(); MarkerPointer markerPointer = new MarkerPointer(); markerPointer.Value = 120; markerPointer.Color = Color.ParseColor("#C62E0A"); markerPointer.Offset = 0.69; markerPointer.MarkerShape = Com.Syncfusion.Gauges.SfCircularGauge.Enums.MarkerShape.InvertedTriangle; markerPointer.EnableAnimation = false; pointers.Add(markerPointer); scale.CircularPointers = pointers; circularScales.Add(scale); circularScale2 = new CircularScale(); circularScale2.StartAngle = 135; circularScale2.SweepAngle = 270; circularScale2.StartValue = 0; circularScale2.EndValue = 160; circularScale2.Interval = 40; circularScale2.MinorTicksPerInterval = 1; circularScale2.RimColor = Color.ParseColor("#333333"); circularScale2.LabelOffset = 0.45; circularScale2.LabelColor = Color.ParseColor("#333333"); circularScale2.ScaleStartOffset = 0.65; circularScale2.ScaleEndOffset = 0.64; circularScale2.MajorTickSettings.StartOffset = 0.64; circularScale2.MajorTickSettings.EndOffset = 0.57; circularScale2.MajorTickSettings.Width = 2; circularScale2.MajorTickSettings.Color = Color.ParseColor("#333333"); circularScale2.MinorTickSettings.StartOffset = 0.64; circularScale2.MinorTickSettings.EndOffset = 0.59; circularScale2.MinorTickSettings.Width = 2; circularScale2.MinorTickSettings.Color = Color.ParseColor("#333333"); ObservableCollection <CircularPointer> circularPointers = new ObservableCollection <CircularPointer>(); MarkerPointer markerPointer1 = new MarkerPointer(); markerPointer1.Value = 80; markerPointer1.Color = Color.ParseColor("#333333"); markerPointer1.Offset = 0.65; markerPointer1.MarkerShape = Com.Syncfusion.Gauges.SfCircularGauge.Enums.MarkerShape.Triangle; markerPointer1.EnableAnimation = false; circularPointers.Add(markerPointer1); circularScale2.CircularPointers = circularPointers; circularScales.Add(circularScale2); sfCircularGauge.CircularScales = circularScales; sfCircularGauge.SetBackgroundColor(Color.White); LinearLayout linearLayout = new LinearLayout(con); linearLayout.AddView(sfCircularGauge); linearLayout.SetPadding(30, 30, 30, 30); linearLayout.SetBackgroundColor(Color.White); return(linearLayout); }
public void initUnidades(int indexCurso, int indexUnidad) { var textFormat = Android.Util.ComplexUnitType.Px; _spaceUnidades.RemoveAllViews(); _listLinearUnidades.Clear(); _listIconMap.Clear(); _listIconVerMap.Clear(); int numUnidades = _listUnidades.Count; for (int i = 0; i < numUnidades; i++) { LinearLayoutLO linearUnidad = new LinearLayoutLO(context); linearUnidad.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); linearUnidad.Orientation = Orientation.Vertical; linearUnidad.SetGravity(Android.Views.GravityFlags.CenterVertical); linearUnidad.index = i; linearUnidad.SetPadding(Configuration.getWidth(100), Configuration.getWidth(25), 0, Configuration.getWidth(25)); //linearUnidad.SetX (100); TextView titleUnidad = new TextView(context); titleUnidad.SetTextSize(textFormat, Configuration.getHeight(42)); titleUnidad.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(440), -2); /*if (indexCurso == 2) { * if (indexUnidad == 3) { * linearUnidad.Orientation = Orientation.Horizontal; * ImageIconMap icon = new ImageIconMap (context); * icon.index = i; * icon.SetImageBitmap(iconPlay); * icon.SetX (Configuration.getWidth (60)); * linearUnidad.AddView (icon); * _listIconMap.Add (icon); * } * } */ if (indexCurso == 0) //3 { titleUnidad.SetTextSize(textFormat, Configuration.getHeight(55)); } RelativeLayout linearContenido = new RelativeLayout(context); linearContenido.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); linearContenido.SetGravity(Android.Views.GravityFlags.Center); //TextView titleUnidad = new TextView(context); //titleUnidad.Text = _listUnidades [i].Title; titleUnidad.TextFormatted = Html.FromHtml(_listUnidades [i].Title); titleUnidad.SetTextColor(Color.ParseColor(Configuration.ListaColores [i % 6])); titleUnidad.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); TextView descriptionUnidad = new TextView(context); descriptionUnidad.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(440), -2); //descriptionUnidad.Text = _listUnidades [i].Description; descriptionUnidad.TextFormatted = Html.FromHtml(_listUnidades [i].Description); //descriptionUnidad.Text = _listUnidades [i].Description; descriptionUnidad.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); descriptionUnidad.SetTextSize(textFormat, Configuration.getHeight(28)); Linkify.AddLinks(descriptionUnidad, MatchOptions.All); //descriptionUnidad.MovementMethod = Android.Text.Method.LinkMovementMethod.Instance; //descriptionUnidad.LinksClickable = true; //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 == 3) { 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); } 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); } }
private LinearLayout createConfigPicker() { LinearLayout holder = new LinearLayout (context); holder.Orientation = Orientation.Horizontal; holder.LayoutParameters = new ViewGroup.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent); holder.SetBackgroundResource (Resource.Drawable.footerback); LinearLayout level2 = new LinearLayout (context); level2.Orientation = Orientation.Vertical; level2.LayoutParameters = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (260f, context), LinearLayout.LayoutParams.FillParent); LinearLayout topSeekHolder = new LinearLayout (context); topSeekHolder.Orientation = Orientation.Horizontal; LinearLayout.LayoutParams viewParams; viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.WrapContent); viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (25f, context), (int)ImageHelper.convertDpToPixel (10f, context), 0, 0); topSeekHolder.LayoutParameters = viewParams; SeekBar topSeek = new SeekBar (context); viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, (int)ImageHelper.convertDpToPixel (10f, context)); viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (15f, context), 0, (int)ImageHelper.convertDpToPixel (15f, context), 0); topSeek.LayoutParameters = viewParams; topSeekHolder.AddView (topSeek); LinearLayout set1 = new LinearLayout (context); set1.Orientation = Orientation.Horizontal; set1.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (25f, context)); TextView set1Text = new TextView (context); set1Text.SetTextColor (Color.Black); set1Text.LayoutParameters = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (20f, context), LinearLayout.LayoutParams.FillParent); set1Text.Gravity = GravityFlags.CenterHorizontal; set1Text.SetTextSize (Android.Util.ComplexUnitType.Dip, 20f); set1Text.Text = "1"; HorizontalScrollView set1HSV = new HorizontalScrollView (context); viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent); viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (10f, context), 0, (int)ImageHelper.convertDpToPixel (10f, context), 0); set1HSV.LayoutParameters = viewParams; set1.AddView (set1Text); set1.AddView (set1HSV); LinearLayout gap1 = new LinearLayout (context); gap1.Orientation = Orientation.Vertical; gap1.SetBackgroundColor (Color.Brown); viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (10f, context)); viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (25f, context), 0, 0, 0); gap1.LayoutParameters = viewParams; set1.AddView (gap1); LinearLayout set2 = new LinearLayout (context); set2.Orientation = Orientation.Horizontal; set2.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (25f, context)); TextView set2Text = new TextView (context); set2Text.SetTextColor (Color.Black); set2Text.LayoutParameters = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (20f, context), LinearLayout.LayoutParams.FillParent); set2Text.Gravity = GravityFlags.CenterHorizontal; set2Text.SetTextSize (Android.Util.ComplexUnitType.Dip, 20f); set2Text.Text = "2"; HorizontalScrollView set2HSV = new HorizontalScrollView (context); viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent); viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (10f, context), 0, (int)ImageHelper.convertDpToPixel (10f, context), 0); set2HSV.LayoutParameters = viewParams; set2.AddView (set2Text); set2.AddView (set2HSV); LinearLayout gap2 = new LinearLayout (context); gap2.Orientation = Orientation.Vertical; viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (10f, context)); viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (25f, context), 0, 0, 0); gap2.LayoutParameters = viewParams; gap2.SetBackgroundColor (Color.Brown); set2.AddView (gap2); LinearLayout set3 = new LinearLayout (context); set3.Orientation = Orientation.Horizontal; set3.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (25f, context)); TextView set3Text = new TextView (context); set3Text.SetTextColor (Color.Black); set3Text.LayoutParameters = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (20f, context), LinearLayout.LayoutParams.FillParent); set3Text.Gravity = GravityFlags.CenterHorizontal; set3Text.SetTextSize (Android.Util.ComplexUnitType.Dip, 20f); set3Text.Text = "3"; HorizontalScrollView set3HSV = new HorizontalScrollView (context); viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent); viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (10f, context), 0, (int)ImageHelper.convertDpToPixel (10f, context), 0); set3HSV.LayoutParameters = viewParams; set3.AddView (set3Text); set3.AddView (set3HSV); LinearLayout gap3 = new LinearLayout (context); gap3.Orientation = Orientation.Vertical; viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (10f, context)); viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (25f, context), 0, 0, 0); gap3.LayoutParameters = viewParams; gap3.SetBackgroundColor (Color.Brown); set3.AddView (gap3); LinearLayout set4 = new LinearLayout (context); set4.Orientation = Orientation.Horizontal; set4.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, (int)ImageHelper.convertDpToPixel (25f, context)); TextView set4Text = new TextView (context); set4Text.SetTextColor (Color.Black); set4Text.LayoutParameters = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (20f, context), LinearLayout.LayoutParams.FillParent); set4Text.Gravity = GravityFlags.CenterHorizontal; set4Text.SetTextSize (Android.Util.ComplexUnitType.Dip, 20f); set4Text.Text = "4"; HorizontalScrollView set4HSV = new HorizontalScrollView (context); viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent); viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (10f, context), 0, (int)ImageHelper.convertDpToPixel (10f, context), 0); set4HSV.LayoutParameters = viewParams; set4.AddView (set4Text); set4.AddView (set4HSV); level2.AddView (topSeekHolder); level2.AddView (set1); level2.AddView (set2); level2.AddView (set3); level2.AddView (set4); LinearLayout level3 = new LinearLayout (context); level3.LayoutParameters = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (25f, context), LinearLayout.LayoutParams.FillParent); level3.SetBackgroundColor (Color.Brown); level3.Orientation = Orientation.Vertical; ImageView addThing = new ImageView (context); addThing.SetBackgroundResource (Resource.Drawable.add); viewParams = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (23f, context), (int)ImageHelper.convertDpToPixel (23f, context)); viewParams.SetMargins (0, (int)ImageHelper.convertDpToPixel (15f, context), 0, 0); addThing.LayoutParameters = viewParams; ImageView wipeThing = new ImageView (context); wipeThing.SetBackgroundResource (Resource.Drawable.delete); viewParams = new LinearLayout.LayoutParams ((int)ImageHelper.convertDpToPixel (23f, context), (int)ImageHelper.convertDpToPixel (23f, context)); viewParams.SetMargins (0, (int)ImageHelper.convertDpToPixel (10f, context), 0, 0); wipeThing.LayoutParameters = viewParams; level3.AddView (addThing); level3.AddView (wipeThing); LinearLayout level4 = new LinearLayout (context); level4.Orientation = Orientation.Vertical; level4.SetBackgroundColor (Color.Brown); level4.LayoutParameters = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.FillParent, LinearLayout.LayoutParams.FillParent); SeekBar scroller = new SeekBar (context); viewParams = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.MatchParent); viewParams.SetMargins ((int)ImageHelper.convertDpToPixel (5f, context), (int)ImageHelper.convertDpToPixel (15f, context), 0, (int)ImageHelper.convertDpToPixel (20.8f, context)); scroller.LayoutParameters = viewParams; level4.AddView (scroller); holder.AddView (level2); holder.AddView (level3); holder.AddView (level4); return holder; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); BucketItem model = new BucketItem(); model.Id = Intent.GetIntExtra("itemId", 0); model.Ime = Intent.GetStringExtra("ime"); model.KategorijaNaziv = Intent.GetStringExtra("kategorija"); model.Opis = Intent.GetStringExtra("opis"); model.Slika = Intent.GetByteArrayExtra("slika"); model.koliko = Intent.GetIntExtra("koliko", 0); int userId = Intent.GetIntExtra("userId", 0); //Kreiranje osnovnog scroll view-a var scrollView = new ScrollView(this) { LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent) }; SetContentView(scrollView); //Kreiranje glavnog layouta (koji je dio scroll view-a) mainLayout = new LinearLayout(this) { Orientation = Orientation.Vertical, LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent) }; mainLayout.SetBackgroundColor(Color.White); mainLayout.SetPadding(30, 30, 30, 30); scrollView.AddView(mainLayout); EditText naziv = new EditText(this); naziv.Text = model.Ime; naziv.Hint = "Naziv"; mainLayout.AddView(naziv); pic = new ImageView(this); LinearLayout.LayoutParams LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); pic.LayoutParameters = LayoutParameters; if (model.Slika != null) { DisplayMetrics mets = new DisplayMetrics(); WindowManager.DefaultDisplay.GetMetrics(mets); var bmp = BitmapFactory.DecodeByteArray(model.Slika, 0, model.Slika.Length); double viewWidthToBitmapWidthRatio = (double)mets.WidthPixels / (double)bmp.Width; pic.LayoutParameters.Height = (int)(bmp.Height * viewWidthToBitmapWidthRatio); pic.SetImageBitmap(bmp); pic.SetScaleType(ImageView.ScaleType.FitCenter); } mainLayout.AddView(pic); Button picbutt = new Button(this); picbutt.Text = "Odaberi sliku"; picbutt.SetPadding(20, 30, 20, 30); mainLayout.AddView(picbutt); picbutt.Click += delegate { var imageIntent = new Intent(); imageIntent.SetType("image/*"); imageIntent.SetAction(Intent.ActionGetContent); StartActivityForResult( Intent.CreateChooser(imageIntent, "Select photo"), 0); }; Spinner spinner = new Spinner(this); string[] kategorije = { "Travel", "Sport", "Education", "Fun", "Extreme", "Career", "Hobby", "Family", "Charity" }; spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected); var adapter = ArrayAdapter.CreateFromResource( this, Resource.Array.kategorija_array, Android.Resource.Layout.SimpleSpinnerItem); adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinner.Adapter = adapter; spinner.SetSelection(adapter.GetPosition(model.KategorijaNaziv)); mainLayout.AddView(spinner); EditText opis = new EditText(this); opis.Hint = "Opis"; LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); opis.InputType = Android.Text.InputTypes.TextVariationLongMessage; opis.LayoutParameters = LayoutParameters; opis.Text = model.Opis; mainLayout.AddView(opis); Button spremi = new Button(this); spremi.SetPadding(20, 30, 20, 60); spremi.Text = "Spremi"; mainLayout.AddView(spremi); spremi.Click += (sender1, e) => { model.Ime = naziv.Text; model.KategorijaNaziv = kategorija; model.Opis = opis.Text; model.Ostvareno = false; if (slika != null) { model.Slika = slika; } client = new HttpClient(); conn(model, userId); }; }
private FrameLayout SetOptionPage(Context context) { FrameLayout propertyLayout = new FrameLayout(context); LinearLayout layout = new LinearLayout(context); layout.Orientation = Android.Widget.Orientation.Vertical; layout.SetBackgroundColor(Color.White); layout.SetPadding(15, 15, 15, 20); monthViewLayout = new LinearLayout(context); monthViewLayout.Orientation = Android.Widget.Orientation.Vertical; monthViewLayout.SetBackgroundColor(Color.White); monthViewLayout.SetPadding(15, 15, 15, 20); otherviewsLayout = new LinearLayout(context); otherviewsLayout.Orientation = Android.Widget.Orientation.Vertical; otherviewsLayout.SetBackgroundColor(Color.White); otherviewsLayout.SetPadding(15, 15, 15, 20); //Schedule Type TextView scheduleType_txtBlock = new TextView(context); scheduleType_txtBlock.Text = "Select the Schedule Type"; scheduleType_txtBlock.TextSize = 20; scheduleType_txtBlock.SetPadding(0, 0, 0, 10); scheduleType_txtBlock.SetTextColor(Color.Black); Spinner typeSpinner = new Spinner(context, SpinnerMode.Dialog); typeSpinner.SetMinimumHeight(60); typeSpinner.SetBackgroundColor(Color.Gray); typeSpinner.DropDownWidth = 600; typeSpinner.SetPadding(10, 10, 0, 10); typeSpinner.SetGravity(GravityFlags.CenterHorizontal); layout.AddView(scheduleType_txtBlock); layout.AddView(typeSpinner); List <String> list = new List <String>(); list.Add("Week View"); list.Add("Day View"); list.Add("Work Week View"); list.Add("Month View"); ArrayAdapter <String> dataAdapter = new ArrayAdapter <String>(context, Android.Resource.Layout.SimpleSpinnerItem, list); dataAdapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); typeSpinner.Adapter = dataAdapter; typeSpinner.ItemSelected += SType_spinner_ItemSelected; View divider1 = new View(context); divider1.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 2); divider1.SetBackgroundColor(Color.Gray); otherviewsLayout.AddView(divider1); //Working Hours Duration workingHoursTxtBlock = new TextView(context); workingHoursTxtBlock.SetPadding(0, 20, 0, 0); workingHoursTxtBlock.Text = "Working Hours Duration"; workingHoursTxtBlock.TextSize = 20; workingHoursTxtBlock.SetTextColor(Color.Black); workHourRangeSlider = new SfRangeSlider(context); workHourRangeSlider.SetPadding(0, 0, 0, 30); workHourRangeSlider.Minimum = 0; workHourRangeSlider.Maximum = 24; workHourRangeSlider.TickFrequency = 2; workHourRangeSlider.StepFrequency = 1; workHourRangeSlider.RangeStart = weekViewSetting.WorkStartHour; workHourRangeSlider.RangeEnd = weekViewSetting.WorkEndHour; workHourRangeSlider.LayoutParameters = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, 100); workHourRangeSlider.RangeChanged += WorkHour_rangeSlider_RangeChanged; workHourRangeSlider.ShowRange = true; workHourRangeSlider.ValuePlacement = ValuePlacement.TopLeft; workHourRangeSlider.ToolTipPlacement = ToolTipPlacement.None; workHourRangeSlider.TickPlacement = TickPlacement.None; workHourRangeSlider.ShowValueLabel = true; workHourRangeSlider.SnapsTo = SnapsTo.StepValues; if (context.Resources.DisplayMetrics.Density < 2) { workHourRangeSlider.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 150); } else if (context.Resources.DisplayMetrics.Density == 2) { workHourRangeSlider.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 200); } else { workHourRangeSlider.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 250); } otherviewsLayout.AddView(workingHoursTxtBlock); otherviewsLayout.AddView(workHourRangeSlider); View divider2 = new View(context); divider2.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 2); divider2.SetBackgroundColor(Color.Gray); otherviewsLayout.AddView(divider2); showNonAccessibleBlockcheckBox = new CheckBox(context); showNonAccessibleBlockcheckBox.SetPadding(0, 10, 0, 10); showNonAccessibleBlockcheckBox.Text = "Show Non-Accessible Blocks"; showNonAccessibleBlockcheckBox.TextSize = 20; showNonAccessibleBlockcheckBox.SetTextColor(Color.Black); showNonAccessibleBlockcheckBox.Checked = true; showNonAccessibleBlockcheckBox.CheckedChange += Show_Non_Accessible_Block_checkBox_CheckedChange; otherviewsLayout.AddView(showNonAccessibleBlockcheckBox); View monthlayoutDivider = new View(context); monthlayoutDivider.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 2); monthlayoutDivider.SetBackgroundColor(Color.Gray); monthViewLayout.AddView(monthlayoutDivider); //Show black out dates showBlackoutDates = new CheckBox(context); showBlackoutDates.SetPadding(0, 10, 0, 10); showBlackoutDates.Text = "Show Blackout days"; showBlackoutDates.TextSize = 20; showBlackoutDates.Checked = true; showBlackoutDates.SetTextColor(Color.Black); showBlackoutDates.CheckedChange += Show_Blackout_Dates_CheckedChange; monthViewLayout.AddView(showBlackoutDates); //Show week number showWeekNumber = new CheckBox(context); showWeekNumber.SetPadding(0, 10, 0, 10); showWeekNumber.Text = "Show Week number"; showWeekNumber.TextSize = 20; showWeekNumber.Checked = true; showWeekNumber.SetTextColor(Color.Black); showWeekNumber.CheckedChange += Show_week_number_CheckedChange; monthViewLayout.AddView(showWeekNumber); View monthLayoutdivider2 = new View(context); monthLayoutdivider2.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 2); monthLayoutdivider2.SetBackgroundColor(Color.Gray); monthViewLayout.AddView(monthLayoutdivider2); View divider5 = new View(context); divider5.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 2); divider5.SetBackgroundColor(Color.Gray); otherviewsLayout.AddView(divider5); FrameLayout collapsedLayouts = new FrameLayout(context); collapsedLayouts.AddView(otherviewsLayout); collapsedLayouts.AddView(monthViewLayout); layout.AddView(collapsedLayouts); if (sfschedule.ScheduleView != ScheduleView.MonthView) { monthViewLayout.Visibility = ViewStates.Invisible; } propertyLayout.AddView(layout); return(propertyLayout); }
public override View GetSampleContent(Context context) { mainLayout = new LinearLayout(context); mainLayout.Orientation = Orientation.Vertical; mainLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); LinearLayout colorPalatte1 = new LinearLayout(context); height = context.Resources.DisplayMetrics.HeightPixels; width = context.Resources.DisplayMetrics.WidthPixels; density = context.Resources.DisplayMetrics.Density; dd = new DoodleDraw(context); TextView pickColor = new TextView(context); pickColor.Text = "Pick Color"; pickColor.TextSize = 20; pickColor.Left = (int)(5 * density); pickColor.SetTextColor(Color.Black); //mainLayout.AddView(pickColor); buttonCount = (int)(width / (35 * density)); for (int i = 0; i < buttonCount; i++) { RoundButton btn = new RoundButton(context, (30 * density), (30 * density), GetRandomColor(), dd); btn.LayoutParameters = new ViewGroup.LayoutParams((int)(30 * density), (int)(30 * density)); colorPalatte1.AddView(new TextView(context), new ViewGroup.LayoutParams((int)(5 * density), ViewGroup.LayoutParams.MatchParent)); colorPalatte1.AddView(btn); } colorPalatte1.SetBackgroundColor(Color.LightGray); colorPalatte1.SetPadding((int)(10 * density), (int)(10 * density), (int)(10 * density), (int)(10 * density)); colorPalatte1.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); mainLayout.AddView(colorPalatte1); dd.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); FrameLayout frame = new FrameLayout(context); frame.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, (int)(0.80 * height)); frame.AddView(dd); mainLayout.AddView(frame); Typeface typeface = Typeface.CreateFromAsset(context.Assets, "Android.ttf"); Button touchDraw = new Button(context); touchDraw.Text = "Touch to draw"; touchDraw.SetTextColor(Color.Blue); touchDraw.SetBackgroundColor(Color.Transparent); touchDraw.TextSize = TypedValue.ApplyDimension(ComplexUnitType.Pt, 3, context.Resources.DisplayMetrics); frame.AddView(touchDraw, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.Center)); radialMenu = new SfRadialMenu(context); radialMenu.RimColor = Color.Transparent; FrameLayout penLayout = new FrameLayout(context); penLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); ImageView penImage = new ImageView(context); penImage.LayoutParameters = penLayout.LayoutParameters; penImage.SetImageResource(Resource.Drawable.green); penImage.SetScaleType(ImageView.ScaleType.FitXy); TextView penText = new TextView(context); penText.LayoutParameters = penLayout.LayoutParameters; penText.Text = "L"; penText.Typeface = typeface; penText.TextSize = 20; penText.TextAlignment = TextAlignment.Center; penText.Gravity = GravityFlags.Center; penText.SetTextColor(Color.White); penLayout.AddView(penImage); penLayout.AddView(penText, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); SfRadialMenuItem pen = new SfRadialMenuItem(context) { View = penLayout, ItemWidth = 70, ItemHeight = 70 }; pen.ItemTapped += Pen_ItemTapped; radialMenu.Items.Add(pen); FrameLayout brushLayout = new FrameLayout(context); brushLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); ImageView brushImage = new ImageView(context); brushImage.LayoutParameters = brushLayout.LayoutParameters; brushImage.SetImageResource(Resource.Drawable.green); brushImage.SetScaleType(ImageView.ScaleType.FitXy); TextView brushText = new TextView(context); brushText.LayoutParameters = brushLayout.LayoutParameters; brushText.Text = "A"; brushText.Typeface = typeface; brushText.TextSize = 20; brushText.TextAlignment = TextAlignment.Center; brushText.Gravity = GravityFlags.Center; brushText.SetTextColor(Color.White); brushLayout.AddView(brushImage); brushLayout.AddView(brushText, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); SfRadialMenuItem brush = new SfRadialMenuItem(context) { View = brushLayout, ItemWidth = 70, ItemHeight = 70 }; brush.SetBackgroundColor(Color.Transparent); brush.ItemTapped += Brush_ItemTapped;; radialMenu.Items.Add(brush); FrameLayout eraserLayout = new FrameLayout(context); eraserLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); ImageView eraserImage = new ImageView(context); eraserImage.LayoutParameters = eraserLayout.LayoutParameters; eraserImage.SetImageResource(Resource.Drawable.green); eraserImage.SetScaleType(ImageView.ScaleType.FitXy); TextView eraserText = new TextView(context); eraserText.LayoutParameters = eraserLayout.LayoutParameters; eraserText.Text = "R"; eraserText.Typeface = typeface; eraserText.TextSize = 20; eraserText.TextAlignment = TextAlignment.Center; eraserText.Gravity = GravityFlags.Center; eraserText.SetTextColor(Color.White); eraserLayout.AddView(eraserImage); eraserLayout.AddView(eraserText, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); SfRadialMenuItem eraser = new SfRadialMenuItem(context) { View = eraserLayout, ItemWidth = 70, ItemHeight = 70 }; eraser.ItemTapped += Eraser_ItemTapped; eraser.SetBackgroundColor(Color.Transparent); radialMenu.Items.Add(eraser); FrameLayout clearLayout = new FrameLayout(context); clearLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); ImageView clearImage = new ImageView(context); clearImage.LayoutParameters = clearLayout.LayoutParameters; clearImage.SetImageResource(Resource.Drawable.green); clearImage.SetScaleType(ImageView.ScaleType.FitXy); TextView clearText = new TextView(context); clearText.LayoutParameters = clearLayout.LayoutParameters; clearText.Text = "Q"; clearText.Typeface = typeface; clearText.TextSize = 20; clearText.TextAlignment = TextAlignment.Center; clearText.Gravity = GravityFlags.Center; clearText.SetTextColor(Color.White); clearLayout.AddView(clearImage); clearLayout.AddView(clearText, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); SfRadialMenuItem clear = new SfRadialMenuItem(context) { View = clearLayout, ItemWidth = 70, ItemHeight = 70 }; clear.ItemTapped += Clear_ItemTapped; clear.SetBackgroundColor(Color.Transparent); radialMenu.Items.Add(clear); FrameLayout thickLayout = new FrameLayout(context); thickLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); ImageView thickImage = new ImageView(context); thickImage.LayoutParameters = thickLayout.LayoutParameters; thickImage.SetImageResource(Resource.Drawable.green); thickImage.SetScaleType(ImageView.ScaleType.FitXy); TextView thickText = new TextView(context); thickText.LayoutParameters = thickLayout.LayoutParameters; thickText.Text = "G"; thickText.Typeface = typeface; thickText.TextSize = 20; brushText.TextAlignment = TextAlignment.Center; thickText.Gravity = GravityFlags.Center; thickText.SetTextColor(Color.White); thickLayout.AddView(thickImage); thickLayout.AddView(thickText, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); SfRadialMenuItem thickBrush = new SfRadialMenuItem(context) { View = thickLayout, ItemWidth = 70, ItemHeight = 70 }; thickBrush.ItemTapped += ThickBrush_ItemTapped; thickBrush.SetBackgroundColor(Color.Transparent); radialMenu.Items.Add(thickBrush); FrameLayout paintBoxLayout = new FrameLayout(context); paintBoxLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); ImageView paintBoxImage = new ImageView(context); paintBoxImage.LayoutParameters = paintBoxLayout.LayoutParameters; paintBoxImage.SetImageResource(Resource.Drawable.green); paintBoxImage.SetScaleType(ImageView.ScaleType.FitXy); TextView paintBoxText = new TextView(context); paintBoxText.LayoutParameters = paintBoxLayout.LayoutParameters; paintBoxText.Text = "V"; paintBoxText.Typeface = typeface; paintBoxText.TextSize = 20; paintBoxText.TextAlignment = TextAlignment.Center; paintBoxText.Gravity = GravityFlags.Center; paintBoxText.SetTextColor(Color.White); paintBoxLayout.AddView(paintBoxImage); paintBoxLayout.AddView(paintBoxText, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); SfRadialMenuItem paintBox = new SfRadialMenuItem(context) { View = paintBoxLayout, ItemWidth = 70, ItemHeight = 70 }; paintBox.ItemTapped += PaintBox_ItemTapped; paintBox.SetBackgroundColor(Color.Transparent); radialMenu.Items.Add(paintBox); FrameLayout menuLayout = new FrameLayout(context); menuLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); ImageView menuImage = new ImageView(context); menuImage.LayoutParameters = menuLayout.LayoutParameters; menuImage.SetImageResource(Resource.Drawable.blue); menuImage.SetScaleType(ImageView.ScaleType.FitXy); TextView menuText = new TextView(context); menuText.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); menuText.Text = "U"; menuText.Typeface = typeface; menuText.TextSize = 40; menuText.TextAlignment = TextAlignment.Center; menuText.Gravity = GravityFlags.Center; menuText.SetTextColor(Color.White); menuLayout.AddView(menuImage); menuLayout.AddView(menuText, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); radialMenu.CenterButtonView = menuLayout; radialMenu.IsDragEnabled = false; radialMenu.OuterRimColor = Color.Transparent; radialMenu.CenterButtonRadius = 30; radialMenu.RimRadius = 100; radialMenu.SelectionColor = Color.Transparent; radialMenu.CenterButtonBackground = Color.Transparent; frame.AddView(radialMenu, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.Center)); radialMenu.Point = new Point(0, (int)(context.Resources.DisplayMetrics.HeightPixels / context.Resources.DisplayMetrics.Density / 3.5)); touchDraw.Click += (sender, e) => { touchDraw.Visibility = ViewStates.Gone; }; return(mainLayout); }