protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); _flurryClient = new FlurryClient(); if (Java.Util.Locale.Default.DisplayLanguage == "русский") { AppInfo.IsLocaleRu = true; } else { AppInfo.IsLocaleRu = false; } _robotoLightFont = Typeface.CreateFromAsset(this.Assets, "Roboto-Light.ttf"); _vibe = (Vibrator)this.GetSystemService(Context.VibratorService); _messageDialogBuilder = new AlertDialog.Builder(this); //Считываем пользовательские данные if (!File.Exists(@"/data/data/ru.hintsolutions.itsbeta/data.txt")) { List <string> config = new List <string>(); config.Add(AppInfo._user.Fullname); config.Add(AppInfo._user.BirthDate); config.Add(AppInfo._user.FacebookUserID); config.Add(AppInfo._user.ItsBetaUserId); config.Add(AppInfo._user.City); config.Add(AppInfo._fbAccessToken); File.WriteAllLines(@"/data/data/ru.hintsolutions.itsbeta/data.txt", config.ToArray(), Encoding.UTF8); } //Binding на xmlразметку SetContentView(Resource.Layout.firstbadgeactivityloadinglayout); //Инициализируем костомный прогресс диалог _progressDialogRelativeLayout = new RelativeLayout(this); _baseLayoutInflater = (LayoutInflater)BaseContext.GetSystemService(LayoutInflaterService); _progressDialogView = _baseLayoutInflater.Inflate(Resource.Layout.progressdialoglayout, null); _progressDialogMessage = (TextView)_progressDialogView.FindViewById(Resource.Id.progressDialogMessageTextView); _progressDialogRelativeLayout.AddView(_progressDialogView); _progressDialog = new ProgressDialog(this, Resource.Style.FullHeightDialog); _progressDialog.Show(); _progressDialog.SetContentView(_progressDialogRelativeLayout); _progressDialog.Dismiss(); _progressDialog.SetCanceledOnTouchOutside(false); _progressDialogMessage.Text = "Загрузка данных..."; if (!AppInfo.IsLocaleRu) { _progressDialogMessage.Text = "Loading Data..."; } _progressDialog.Show(); //Запуск параллельного потока для выполнения основных действий _asyncInitThreadStart = new ThreadStart(AsyncInitCallback); _asyncInitThread = new Thread(_asyncInitThreadStart); _asyncInitThread.Start(); }
private void PopluteUserDataObjectClass(FetchUserPostsByUserIdObject cl) { try { GlideImageLoader.LoadImage(Activity, cl.data.UserData.Avatar, UserProfileImage, ImageStyle.RoundedCrop, ImagePlaceholders.Color); if (!string.IsNullOrEmpty(cl.data.UserData.About)) { About.Text = Methods.FunString.DecodeString(cl.data.UserData.About); AboutLiner.Visibility = ViewStates.Visible; } TxtCountFollowers.Text = Methods.FunString.FormatPriceValue(cl.data.UserFollowers); TxtCountFollowing.Text = Methods.FunString.FormatPriceValue(cl.data.UserFollowing); TxtCountFav.Text = Methods.FunString.FormatPriceValue(cl.data.TotalPosts); Username.Text = "@" + cl.data.UserData.Username; Fullname.Text = Methods.FunString.DecodeString(cl.data.UserData.Name); Typeface font = Typeface.CreateFromAsset(Application.Context.Resources.Assets, "ionicons.ttf"); if (!string.IsNullOrEmpty(cl.data.UserData.Google)) { Google = cl.data.UserData.Google; SocialGoogle.SetTypeface(font, TypefaceStyle.Normal); SocialGoogle.Text = IonIconsFonts.SocialGoogle; SocialGoogle.Visibility = ViewStates.Visible; } if (!string.IsNullOrEmpty(cl.data.UserData.Facebook)) { Facebook = cl.data.UserData.Facebook; SocialFacebook.SetTypeface(font, TypefaceStyle.Normal); SocialFacebook.Text = IonIconsFonts.SocialFacebook; SocialFacebook.Visibility = ViewStates.Visible; } if (!string.IsNullOrEmpty(cl.data.UserData.Website)) { Website = cl.data.UserData.Website; WebsiteButton.SetTypeface(font, TypefaceStyle.Normal); WebsiteButton.Text = IonIconsFonts.AndroidGlobe; WebsiteButton.Visibility = ViewStates.Visible; } if (!string.IsNullOrEmpty(cl.data.UserData.Twitter)) { Twitter = cl.data.UserData.Twitter; SocialTwitter.SetTypeface(font, TypefaceStyle.Normal); SocialTwitter.Text = IonIconsFonts.SocialTwitter; SocialTwitter.Visibility = ViewStates.Visible; } if (cl.data.IsFollowing) // My Friend { FollowButton.SetBackgroundResource(Resource.Drawable.Shape_Radius_Grey_Btn); FollowButton.SetTextColor(Color.ParseColor("#000000")); FollowButton.Text = Context.GetText(Resource.String.Lbl_Following); FollowButton.Tag = "true"; } else { //Not Friend FollowButton.SetBackgroundResource(Resource.Drawable.Shape_Radius_Gradient_Btn); FollowButton.SetTextColor(Color.ParseColor("#ffffff")); FollowButton.Text = Context.GetText(Resource.String.Lbl_Follow); FollowButton.Tag = "false"; } } catch (Exception e) { Console.WriteLine(e); } }
public SegementViewViewModel(Android.Content.Context con) { ClothTypeCollection.Add("Formals"); ClothTypeCollection.Add("Casuals"); ClothTypeCollection.Add("Trendy"); Typeface tf = Typeface.CreateFromAsset(con.Assets, "Segmented.ttf"); Typeface colorfontFamily = Typeface.CreateFromAsset(con.Assets, "SegmentIcon.ttf"); SizeCollection = new ObservableCollection <SfSegmentItem> { new SfSegmentItem() { IconFont = "A", Text = "XS", FontIconTypeface = tf, FontColor = Color.ParseColor("#3F3F3F") }, new SfSegmentItem() { IconFont = "A", Text = "S", FontColor = Color.ParseColor("#3F3F3F") }, new SfSegmentItem() { IconFont = "A", Text = "M", FontColor = Color.ParseColor("#3F3F3F") }, new SfSegmentItem() { IconFont = "A", Text = "L", FontColor = Color.ParseColor("#3F3F3F") }, new SfSegmentItem() { IconFont = "A", Text = "XL", FontColor = Color.ParseColor("#3F3F3F") }, }; EntertainCollection = new ObservableCollection <SfSegmentItem> { new SfSegmentItem() { IconFont = "A", FontIconFontColor = Color.ParseColor("#233a7e"), FontIconTypeface = tf }, new SfSegmentItem() { IconFont = "A", FontIconFontColor = Color.ParseColor("#7e8188"), FontIconTypeface = tf }, new SfSegmentItem() { IconFont = "A", FontIconFontColor = Color.ParseColor("#292639"), FontIconTypeface = tf }, new SfSegmentItem() { IconFont = "A", FontIconFontColor = Color.ParseColor("#11756d"), FontIconTypeface = tf }, new SfSegmentItem() { IconFont = "A", FontIconFontColor = Color.ParseColor("#6e0022"), FontIconTypeface = tf }, }; PrimaryColors = new ObservableCollection <SfSegmentItem> { new SfSegmentItem() { IconFont = "7", FontIconFontColor = Color.ParseColor("#32318E"), Text = "Square", FontIconFontSize = 32, FontIconTypeface = colorfontFamily }, new SfSegmentItem() { IconFont = "7", FontIconFontColor = Color.ParseColor("#2F7DC0"), Text = "Square", FontIconFontSize = 32, FontIconTypeface = colorfontFamily }, new SfSegmentItem() { IconFont = "7", FontIconFontColor = Color.ParseColor("#953376"), Text = "Square", FontIconFontSize = 32, FontIconTypeface = colorfontFamily }, new SfSegmentItem() { IconFont = "7", FontIconFontColor = Color.ParseColor("#B33F3F"), Text = "Square", FontIconFontSize = 32, FontIconTypeface = colorfontFamily }, new SfSegmentItem() { IconFont = "7", FontIconFontColor = Color.ParseColor("#F1973F"), Text = "Square", FontIconFontSize = 32, FontIconTypeface = colorfontFamily }, new SfSegmentItem() { IconFont = "7", FontIconFontColor = Color.ParseColor("#C9D656"), Text = "Square", FontIconFontSize = 32, FontIconTypeface = colorfontFamily }, new SfSegmentItem() { IconFont = "7", FontIconFontColor = Color.ParseColor("#008D7F"), Text = "Square", FontIconFontSize = 32, FontIconTypeface = colorfontFamily }, }; }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); try { SetContentView(Resource.Layout.RegionForSearching); applyCityFragment = new ApplyCityFragment(); fragmentManager = this.FragmentManager; InputMethodManager imm = (InputMethodManager)GetSystemService(Context.InputMethodService); searchET = FindViewById <EditText>(Resource.Id.searchET); close_searchBn = FindViewById <ImageButton>(Resource.Id.close_searchBn); activityIndicatorSearch = FindViewById <ProgressBar>(Resource.Id.activityIndicatorSearch); search_recyclerView = FindViewById <RecyclerView>(Resource.Id.search_recyclerView); searchLL = FindViewById <LinearLayout>(Resource.Id.searchLL); nothingIV = FindViewById <ImageView>(Resource.Id.nothingIV); searchIV = FindViewById <ImageView>(Resource.Id.searchIV); nothingTV = FindViewById <TextView>(Resource.Id.nothingTV); headerTV = FindViewById <TextView>(Resource.Id.headerTV); your_city_valueTV = FindViewById <TextView>(Resource.Id.your_city_valueTV); recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false); recyclerView.SetLayoutManager(layoutManager); back_button = FindViewById <ImageButton>(Resource.Id.back_button); autolocatonBn = FindViewById <Button>(Resource.Id.autolocatonBn); backRelativeLayout = FindViewById <RelativeLayout>(Resource.Id.backRelativeLayout); tintLL = FindViewById <RelativeLayout>(Resource.Id.tintLL); noTV = FindViewById <TextView>(Resource.Id.noTV); yesTV = FindViewById <TextView>(Resource.Id.yesTV); activityIndicator = FindViewById <ProgressBar>(Resource.Id.activityIndicator); activityIndicator.IndeterminateDrawable.SetColorFilter(Resources.GetColor(Resource.Color.buttonBackgroundColor), Android.Graphics.PorterDuff.Mode.Multiply); activityIndicatorSearch.IndeterminateDrawable.SetColorFilter(Resources.GetColor(Resource.Color.buttonBackgroundColor), Android.Graphics.PorterDuff.Mode.Multiply); search_layoutManager = new LinearLayoutManager(this, LinearLayoutManager.Vertical, false); search_recyclerView.SetLayoutManager(search_layoutManager); headerTV.Text = city_coord_for_edit_prefs.GetString("region_name", String.Empty); Typeface tf = Typeface.CreateFromAsset(Assets, "Roboto-Regular.ttf"); headerTV.SetTypeface(tf, TypefaceStyle.Bold); autolocatonBn.SetTypeface(tf, TypefaceStyle.Normal); searchET.SetTypeface(tf, TypefaceStyle.Normal); FindViewById <TextView>(Resource.Id.textView5).SetTypeface(tf, TypefaceStyle.Normal); your_city_valueTV.SetTypeface(tf, TypefaceStyle.Normal); yesTV.SetTypeface(tf, TypefaceStyle.Normal); noTV.SetTypeface(tf, TypefaceStyle.Normal); nothingTV.SetTypeface(tf, TypefaceStyle.Normal); backRelativeLayout.Click += (s, e) => { OnBackPressed(); }; back_button.Click += (s, e) => { OnBackPressed(); }; searchET.TextChanged += async(s, e) => { if (!String.IsNullOrEmpty(searchET.Text)) { nothingIV.Visibility = ViewStates.Gone; nothingTV.Visibility = ViewStates.Gone; searchLL.Visibility = ViewStates.Visible; close_searchBn.Visibility = ViewStates.Visible; activityIndicatorSearch.Visibility = ViewStates.Visible; search_recyclerView.Visibility = ViewStates.Gone; var search_content = await countryMethods.CitySearch(city_coord_for_edit_prefs.GetString("region_id", String.Empty), searchET.Text); if (!search_content.ToLower().Contains("пошло не так".ToLower()) && !search_content.Contains("null")) //try { search_recyclerView.Visibility = ViewStates.Visible; deserialized_search = JsonConvert.DeserializeObject <List <CitySearch> >(search_content.ToString()); List <CitySearch> searchDisplayings = new List <CitySearch>(); foreach (var item in deserialized_search) { searchDisplayings.Add(new CitySearch { id = item.id, city = item.city }); } citySearchAdapter = new CitySearchProfileEditAdapter(searchDisplayings, showFragment, this, tf); citySearchAdapter.NotifyDataSetChanged(); search_recyclerView.SetAdapter(citySearchAdapter); citySearchAdapter.NotifyDataSetChanged(); } //catch else { search_recyclerView.Visibility = ViewStates.Gone; nothingIV.Visibility = ViewStates.Visible; nothingTV.Visibility = ViewStates.Visible; } //search_recyclerView.Visibility = ViewStates.Visible; activityIndicatorSearch.Visibility = ViewStates.Gone; } else { searchIV.Visibility = ViewStates.Visible; close_searchBn.Visibility = ViewStates.Gone; //searchLL.Visibility = ViewStates.Visible; searchLL.Visibility = ViewStates.Gone; } }; close_searchBn.Click += (s, e) => { searchET.Text = null; imm.HideSoftInputFromWindow(searchET.WindowToken, 0); searchLL.Visibility = ViewStates.Gone; }; searchET.EditorAction += (object sender, EditText.EditorActionEventArgs e) => { imm.HideSoftInputFromWindow(searchET.WindowToken, 0); }; activityIndicator.Visibility = ViewStates.Visible; var citiesJson = await countryMethods.CityList(city_coord_for_edit_prefs.GetString("region_id", String.Empty)); activityIndicator.Visibility = ViewStates.Gone; var deserialized_cities = JsonConvert.DeserializeObject <List <CitySearch> >(citiesJson); var cityForRegAdapter = new CityProfileEditAdapter(deserialized_cities, showFragment, this, tf); recyclerView.SetAdapter(cityForRegAdapter); } catch { StartActivity(typeof(MainActivity)); } }
/// <summary> /// This method returns typeface for given typeface using following rules: /// 1. Lookup in the cache /// 2. If not found, look in the assets in the fonts folder. Save your font under its FontFamily name. /// If no extension is written in the family name .ttf is asumed /// 3. If not found look in the files under fonts/ folder /// If no extension is written in the family name .ttf is asumed /// 4. If not found, try to return typeface from Xamarin.Forms ToTypeface() method /// 5. If not successfull, return Typeface.Default /// </summary> /// <returns>The extended typeface.</returns> /// <param name="font">Font</param> /// <param name="context">Android Context</param> public static Typeface ToExtendedTypeface(this Font font, Context context) { Typeface typeface = null; //1. Lookup in the cache var hashKey = font.ToHasmapKey(); typeface = TypefaceCache.SharedCache.RetrieveTypeface(hashKey); #if DEBUG if (typeface != null) { Console.WriteLine("Typeface for font {0} found in cache", font); } #endif //2. If not found, try custom asset folder if (typeface == null && !string.IsNullOrEmpty(font.FontFamily)) { string filename = font.FontFamily; //if no extension given then assume and add .ttf if (filename.LastIndexOf(".", System.StringComparison.Ordinal) != filename.Length - 4) { filename = string.Format("{0}.ttf", filename); } try { var path = "fonts/" + filename; #if DEBUG Console.WriteLine("Lookking for font file: {0}", path); #endif typeface = Typeface.CreateFromAsset(context.Assets, path); #if DEBUG Console.WriteLine("Found in assets and cached."); #endif #pragma warning disable CS0168 // Variable is declared but never used } catch (Exception ex) { #if DEBUG Console.WriteLine("not found in assets. Exception: {0}", ex); Console.WriteLine("Trying creation from file"); #endif try { typeface = Typeface.CreateFromFile("fonts/" + filename); #if DEBUG Console.WriteLine("Found in file and cached."); #endif } catch (Exception ex1) #pragma warning restore CS0168 // Variable is declared but never used { #if DEBUG Console.WriteLine("not found by file. Exception: {0}", ex1); Console.WriteLine("Trying creation using Xamarin.Forms implementation"); #endif } } } //3. If not found, fall back to default Xamarin.Forms implementation to load system font if (typeface == null) { typeface = font.ToTypeface(); } if (typeface == null) { #if DEBUG Console.WriteLine("Falling back to default typeface"); #endif typeface = Typeface.Default; } //Store in cache TypefaceCache.SharedCache.StoreTypeface(hashKey, typeface); return(typeface); }
protected override void OnElementChanged(ElementChangedEventArgs <SegmentedControl> e) { base.OnElementChanged(e); if (Control == null) { // Instantiate the native control and assign it to the Control property with // the SetNativeControl method var layoutInflater = LayoutInflater.From(MainActivity.ApplicationContext); var view = layoutInflater.Inflate(Resource.Layout.RadioGroup, null); nativeControl = (RadioGroup)layoutInflater.Inflate(Resource.Layout.RadioGroup, null); for (var i = 0; i < Element.Children.Count; i++) { var o = Element.Children[i]; var rb = (RadioButton)layoutInflater.Inflate(Resource.Layout.RadioButton, null); Typeface typeface = Typeface.CreateFromAsset(this.Context.Assets, "fonts/SourceSansPro-R.ttf"); rb.SetTypeface(typeface, TypefaceStyle.Normal); rb.SetTextSize(ComplexUnitType.Dip, 13f); rb.LayoutParameters = new RadioGroup.LayoutParams(0, LayoutParams.WrapContent, 1f); rb.Text = o.Text; if (i == 0) { rb.SetBackgroundResource(Resource.Drawable.segmented_control_first_background); } else if (i == Element.Children.Count - 1) { rb.SetBackgroundResource(Resource.Drawable.segmented_control_last_background); } ConfigureRadioButton(i, rb); nativeControl.AddView(rb); } var option = (RadioButton)nativeControl.GetChildAt(Element.SelectedSegment); if (option != null) { option.Checked = true; } SetNativeControl(nativeControl); } if (e.OldElement != null) { // Unsubscribe from event handlers and cleanup any resources if (nativeControl != null) { nativeControl.CheckedChange -= NativeControl_ValueChanged; } } if (e.NewElement != null) { // Configure the control and subscribe to event handlers nativeControl.CheckedChange += NativeControl_ValueChanged; } }
private Typeface CreateTypeface(Context context, int typefaceValue) { try { Typeface typeface; switch (typefaceValue) { case RobotoThin: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-Thin.ttf"); break; case RobotoThinItalic: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-ThinItalic.ttf"); style = TypefaceStyle.Italic; break; case RobotoLight: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-Light.ttf"); break; case RobotoLightItalic: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-LightItalic.ttf"); style = TypefaceStyle.Italic; break; case RobotoRegular: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-Regular.ttf"); break; case RobotoItalic: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-Italic.ttf"); style = TypefaceStyle.Italic; break; case RobotoMedium: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-Medium.ttf"); break; case RobotoMediumItalic: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-MediumItalic.ttf"); style = TypefaceStyle.Italic; break; case RobotoBold: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-Bold.ttf"); style = TypefaceStyle.Bold; break; case RobotoBoldItalic: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-BoldItalic.ttf"); style = TypefaceStyle.BoldItalic; break; case RobotoBlack: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-Black.ttf"); break; case RobotoBlackItalic: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-BlackItalic.ttf"); style = TypefaceStyle.Italic; break; case RobotoCondensed: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-Condensed.ttf"); break; case RobotoCondensedItalic: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-CondensedItalic.ttf"); style = TypefaceStyle.Italic; break; case RobotoCondensedBold: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-BoldCondensed.ttf"); style = TypefaceStyle.Bold; break; case RobotoCondensedBoldItalic: typeface = Typeface.CreateFromAsset(context.Assets, "fonts/Roboto-BoldCondensedItalic.ttf"); style = TypefaceStyle.BoldItalic; break; default: throw new ArgumentException("Unknown typeface attribute value " + typefaceValue); } return(typeface); } catch (Exception) { } return(null); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.layout_register); var btnSave = FindViewById <Button> (Resource.Id.btnGuardar); var txtNombre = FindViewById <TextView> (Resource.Id.txtNombreCompleto); var txtEmail = FindViewById <TextView> (Resource.Id.txtEmailRegistro); var txtPassword = FindViewById <TextView> (Resource.Id.txtContraseña); var txtPassConfirm = FindViewById <TextView> (Resource.Id.txtContraseñaConfirmar); var IniciarSesion = FindViewById <TextView> (Resource.Id.txtIniciarSesion); Typeface font = Typeface.CreateFromAsset(Application.Context.Assets, "Fonts/HelveticaNeue-Thin.otf"); _supporttoolbar = FindViewById <Android.Support.V7.Widget.Toolbar> (Resource.Id.ToolBarRegistro); var ToolbarTitle = FindViewById <TextView> (Resource.Id.toolbar_titleRegister); ToolbarTitle.SetText(Resource.String.Registro); //_supporttoolbar.SetTitle(Resource.String.Registro); SetSupportActionBar(_supporttoolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(false); btnSave.SetTypeface(font, TypefaceStyle.Normal); _supporttoolbar.Click += (object sender, EventArgs e) => { StartActivity(typeof(MainActivity)); }; IniciarSesion.Click += (object sender, EventArgs e) => { StartActivity(typeof(IniciarSesionActivity)); }; btnSave.Click += (object sender, EventArgs e) => { btnSave.SetBackgroundColor(Color.White); btnSave.SetTextColor(Color.Orange); string strNombre = txtNombre.Text.Trim(); string strEmail = txtEmail.Text.Trim(); string strPassword = txtPassword.Text.Trim(); string strPassConfirm = txtPassConfirm.Text.Trim(); string string_key = "41f579fc-1445-4065-ab10-c06d50e724d3"; services_911consumidor_com.COCOService cliente = new Navigation_View.services_911consumidor_com.COCOService(); cliente.AccountRegistration(new Navigation_View.services_911consumidor_com.UserDTO { FirstName = strNombre, Email = strEmail, Password = strPassword, Device = string.Empty }, string_key); Xamarin.Auth.Account account = new Xamarin.Auth.Account(strEmail, AccountCore.Dictionary(strNombre, strEmail, strPassword)); AccountStore.Create(this).Save(account, "consumidor"); new Android.Support.V7.App.AlertDialog.Builder(this) .SetMessage("Su cuenta ha sido registrada.") .SetTitle("ATENCIÓN") .Show(); StartActivity(typeof(MainActivity)); }; // Create your application here }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view; Typeface font_italic = Typeface.CreateFromAsset(this.Activity.ApplicationContext.Assets, "fonts/Roboto-LightItalic.ttf"); Typeface font_light = Typeface.CreateFromAsset(this.Activity.ApplicationContext.Assets, "fonts/Roboto-Light.ttf"); Typeface font_regular = Typeface.CreateFromAsset(this.Activity.ApplicationContext.Assets, "fonts/Roboto-Regular.ttf"); switch (mPage) { case 1: view = inflater.Inflate(Resource.Layout.MyShindigs, container, false); TextView[] textviews = new TextView[] { view.FindViewById <TextView>(Resource.Id.events_label), view.FindViewById <TextView>(Resource.Id.invites_label) }; for (int i = 0; i < textviews.Length; i++) { textviews[i].SetTypeface(font_light, TypefaceStyle.Normal); } TextView shindigTip = view.FindViewById <TextView>(Resource.Id.myShindigsTip_label); shindigTip.SetTypeface(font_italic, TypefaceStyle.Normal); //View // Uri uri = new Uri("http://192.168.1.5/ShindyAdmin/application/controllers/api/events_ws.php"); // WebClient client = new WebClient(); // client.UploadValuesAsync(uri,new System.Collections.Specialized.NameValueCollection() { { "intent","evtsrch"},{ "receive","*****@*****.**"} }); // client.UploadValuesCompleted += Client_UploadValuesCompleted; for (int i = 0; i < 5; i++) { ViewGroup eventContainer = (ViewGroup)view.FindViewById <LinearLayout>(Resource.Id.events_container); ViewGroup inviteContainer = (ViewGroup)view.FindViewById <LinearLayout>(Resource.Id.invites_container); View eventLayout = LayoutInflater.From(this.Activity).Inflate(Resource.Layout.Event_template, null); ViewGroup eventDetailsContainer = (ViewGroup)eventLayout.FindViewById <LinearLayout>(Resource.Id.detailContainer); ViewGroup eventTemplate = (ViewGroup)eventLayout.FindViewById <LinearLayout>(Resource.Id.eventExpandContainer); View details_expand = LayoutInflater.From(this.Activity).Inflate(Resource.Layout.EventDetails_expand, null); ImageButton details_button = details_expand.FindViewById <ImageButton>(Resource.Id.details_button); details_button.Click += Details_button_Click; details_expand.Visibility = ViewStates.Gone; bool[] isExpandedEvent = new bool[5]; bool[] isExpandedInvite = new bool[5]; eventDetailsContainer.AddView(details_expand); isExpandedEvent[i] = false; isExpandedInvite[i] = false; eventLayout.Tag = i; eventLayout.Click += (sender, e) => { switch (isExpandedEvent[(int)eventLayout.Tag]) { case false: isExpandedEvent[(int)eventLayout.Tag] = true; details_expand.Visibility = ViewStates.Visible; int widthSpec = View.MeasureSpec.MakeMeasureSpec(0, MeasureSpecMode.Unspecified); int heightSpec = View.MeasureSpec.MakeMeasureSpec(0, MeasureSpecMode.Unspecified); details_expand.Measure(widthSpec, heightSpec); ValueAnimator expandAnimator = slideAnimator(0, details_expand.MeasuredHeight, details_expand); expandAnimator.Start(); break; case true: isExpandedEvent[(int)eventLayout.Tag] = false; int finalHeight = details_expand.Height; ValueAnimator collapseAnimator = slideAnimator(finalHeight, 0, details_expand); collapseAnimator.Start(); collapseAnimator.AnimationEnd += (sender2, e2) => { details_expand.Visibility = ViewStates.Gone; }; break; } }; View inviteLayout = LayoutInflater.From(this.Activity).Inflate(Resource.Layout.Invites_template, null); inviteLayout.Tag = i; ViewGroup inviteDetailsContainer = (ViewGroup)(inviteLayout.FindViewById <LinearLayout>(Resource.Id.detailContainer)); View inviteDetails_expand = LayoutInflater.From(this.Activity).Inflate(Resource.Layout.EventDetails_expand, null); inviteDetails_expand.Visibility = ViewStates.Gone; inviteDetailsContainer.AddView(inviteDetails_expand); inviteLayout.Click += (sender3, e3) => { // Toast.MakeText(this.Context, inviteLayout.Tag.ToString(), ToastLength.Short).Show(); switch (isExpandedInvite[(int)inviteLayout.Tag]) { case false: isExpandedInvite[(int)inviteLayout.Tag] = true; inviteDetails_expand.Visibility = ViewStates.Visible; int widthSpec = View.MeasureSpec.MakeMeasureSpec(0, MeasureSpecMode.Unspecified); int heightSpec = View.MeasureSpec.MakeMeasureSpec(0, MeasureSpecMode.Unspecified); inviteDetails_expand.Measure(widthSpec, heightSpec); ValueAnimator expandAnimator = slideAnimator(0, inviteDetails_expand.MeasuredHeight, inviteDetails_expand); expandAnimator.Start(); break; case true: isExpandedInvite[(int)inviteLayout.Tag] = false; int finalHeight = inviteDetails_expand.Height; ValueAnimator collapseAnimator = slideAnimator(finalHeight, 0, inviteDetails_expand); collapseAnimator.Start(); collapseAnimator.AnimationEnd += (sender2, e2) => { inviteDetails_expand.Visibility = ViewStates.Gone; }; break; } // ImageView eventImage = eventLayout.FindViewById<ImageView>(Resource.Id.eventPic); // eventImage.SetImageBitmap(GetImageBitmapFromUrl("https://coresites-cdn.factorymedia.com/mpora_new/wp-content/uploads/2015/12/iStock_000052710440_Medium.jpg")); // eventLayout.LayoutParameters = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent); }; eventContainer.AddView(eventLayout); inviteContainer.AddView(inviteLayout); } Button inviteCode_button = view.FindViewById <Button>(Resource.Id.inviteCode_button); inviteCode_button.Click += InviteCode_button_Click; return(view); case 2: view = inflater.Inflate(Resource.Layout.MyHostedEvents, container, false); TextView eventsHosted_title = view.FindViewById <TextView>(Resource.Id.eventsHostedTitle_label); TextView eventHostedTip = view.FindViewById <TextView>(Resource.Id.hostedEventsTip_label); eventsHosted_title.SetTypeface(font_regular, TypefaceStyle.Normal); eventHostedTip.SetTypeface(font_italic, TypefaceStyle.Normal); ViewGroup eventHostedContainer = (ViewGroup)view.FindViewById <LinearLayout>(Resource.Id.hostedEvents_container); View eventHostedLayout = LayoutInflater.From(this.Activity).Inflate(Resource.Layout.HostedEvent_template, null); eventHostedContainer.AddView(eventHostedLayout); return(view); default: return(null); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.GhostButtonLayout); var ghostButton = FindViewById <GhostButton>(Resource.Id.ghostButton); var themeDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.themeDropDown); var disabledColorDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.disabledTextColorDropDown); var enabledColorDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.enabledTextColorDropDown); var fontDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.fontDropDown); var letterSpacingDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.letterSpacingDropDown); var textSizeDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.textSizeDropDown); var rippleColorDropDown = FindViewById <EOSSandboxDropDown>(Resource.Id.rippleColorDropDown); var stateSwitch = FindViewById <Switch>(Resource.Id.stateSwitch); ghostButton.ResetCustomization(); var resetButton = FindViewById <Button>(Resource.Id.buttonResetCustomization); var spinners = new List <EOSSandboxDropDown>() { themeDropDown, disabledColorDropDown, enabledColorDropDown, fontDropDown, letterSpacingDropDown, textSizeDropDown, rippleColorDropDown }; themeDropDown.Name = Fields.Theme; themeDropDown.SetupAdapter(ThemeTypes.ThemeCollection.Select(item => item.Key).ToList()); themeDropDown.ItemSelected += (position) => { if (position > 0) { ghostButton.GetThemeProvider().SetCurrentTheme(ThemeTypes.ThemeCollection.ElementAt(position).Value); ghostButton.ResetCustomization(); spinners.Except(new[] { themeDropDown }).ToList().ForEach(s => s.SetSpinnerSelection(0)); UpdateAppearance(); } }; var theme = ghostButton.GetThemeProvider().GetCurrentTheme(); if (theme is LightEOSTheme) { themeDropDown.SetSpinnerSelection(1); } if (theme is DarkEOSTheme) { themeDropDown.SetSpinnerSelection(2); } fontDropDown.Name = Fields.Font; fontDropDown.SetupAdapter(GhostButtonConstants.GhostButtonFonts.Select(item => item.Key).ToList()); fontDropDown.ItemSelected += (position) => { ghostButton.Typeface = Typeface.CreateFromAsset(Assets, GhostButtonConstants.GhostButtonFonts.ElementAt(position).Value); }; letterSpacingDropDown.Name = Fields.LetterSpacing; letterSpacingDropDown.SetupAdapter(GhostButtonConstants.LetterSpacings.Select(item => item.Key).ToList()); letterSpacingDropDown.ItemSelected += (position) => { ghostButton.LetterSpacing = GhostButtonConstants.LetterSpacings.ElementAt(position).Value; }; enabledColorDropDown.Name = Fields.EnabledTextColor; enabledColorDropDown.SetupAdapter(GhostButtonConstants.FontColors.Select(item => item.Key).ToList()); enabledColorDropDown.ItemSelected += (position) => { ghostButton.TextColor = GhostButtonConstants.FontColors.ElementAt(position).Value; }; disabledColorDropDown.Name = Fields.DisabledTextColor; disabledColorDropDown.SetupAdapter(GhostButtonConstants.DisabledFontColors.Select(item => item.Key).ToList()); disabledColorDropDown.ItemSelected += (position) => { ghostButton.DisabledTextColor = GhostButtonConstants.DisabledFontColors.ElementAt(position).Value; }; textSizeDropDown.Name = Fields.TextSize; textSizeDropDown.SetupAdapter(GhostButtonConstants.TextSizes.Select(item => item.Key).ToList()); textSizeDropDown.ItemSelected += (position) => { ghostButton.TextSize = GhostButtonConstants.TextSizes.ElementAt(position).Value; }; rippleColorDropDown.Name = Fields.RippleColor; rippleColorDropDown.SetupAdapter(GhostButtonConstants.RippleColors.Select(item => item.Key).ToList()); rippleColorDropDown.ItemSelected += (position) => { ghostButton.RippleColor = GhostButtonConstants.RippleColors.ElementAt(position).Value; }; stateSwitch.CheckedChange += (sender, e) => { ghostButton.Enabled = stateSwitch.Checked; }; resetButton.Click += delegate { spinners.Except(new[] { themeDropDown }).ToList().ForEach(s => s.SetSpinnerSelection(0)); ghostButton.ResetCustomization(); }; }
private void FontItemSelected(int position) { _inputTop.Typeface = Typeface.CreateFromAsset(Assets, InputConstants.InputFonts.ElementAt(position).Value); _inputBottom.Typeface = Typeface.CreateFromAsset(Assets, InputConstants.InputFonts.ElementAt(position).Value); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); try { SetContentView(Resource.Layout.DisplayPortfolioPhoto); activityIndicatorDel = FindViewById <ProgressBar>(Resource.Id.activityIndicatorDel); tint_DelLL = FindViewById <RelativeLayout>(Resource.Id.tint_DelLL); noTV = FindViewById <TextView>(Resource.Id.noTV); yesTV = FindViewById <TextView>(Resource.Id.yesTV); activityIndicator = FindViewById <ProgressBar>(Resource.Id.activityIndicator); activityIndicator.IndeterminateDrawable.SetColorFilter(Resources.GetColor(Resource.Color.buttonBackgroundColor), Android.Graphics.PorterDuff.Mode.Multiply); activityIndicatorDel.IndeterminateDrawable.SetColorFilter(Resources.GetColor(Resource.Color.buttonBackgroundColor), Android.Graphics.PorterDuff.Mode.Multiply); removeBn = FindViewById <Button>(Resource.Id.removeBn); backRelativeLayout = FindViewById <RelativeLayout>(Resource.Id.backRelativeLayout); back_button = FindViewById <ImageButton>(Resource.Id.back_button); fullIV = FindViewById <ImageView>(Resource.Id.fullIV); Typeface tf = Typeface.CreateFromAsset(Assets, "Roboto-Regular.ttf"); FindViewById <TextView>(Resource.Id.headerTV).SetTypeface(tf, TypefaceStyle.Bold); removeBn.SetTypeface(tf, TypefaceStyle.Normal); FindViewById <TextView>(Resource.Id.textView5).SetTypeface(tf, TypefaceStyle.Normal); FindViewById <TextView>(Resource.Id.your_city_valueTV).SetTypeface(tf, TypefaceStyle.Normal); yesTV.SetTypeface(tf, TypefaceStyle.Normal); noTV.SetTypeface(tf, TypefaceStyle.Normal); tint_DelLL.Click += (s, e) => { tint_DelLL.Visibility = ViewStates.Gone; }; yesTV.Click += async(s, e) => { activityIndicatorDel.Visibility = ViewStates.Visible; var res = await profileAndExpertMethods.DeletePhoto(userMethods.GetUsersAuthToken(), image_url, specialization_for_edit_pref.GetString("categoryId", String.Empty)); var res_reload = await addServiceActivity.ReloadData(); activityIndicatorDel.Visibility = ViewStates.Gone; tint_DelLL.Visibility = ViewStates.Gone; //StartActivity(typeof(UserProfileActivity)); OnBackPressed(); }; noTV.Click += (s, e) => { tint_DelLL.Visibility = ViewStates.Gone; }; backRelativeLayout.Click += (s, e) => { OnBackPressed(); }; back_button.Click += (s, e) => { OnBackPressed(); }; Thread backgroundThread = new Thread(new ThreadStart(() => { Glide.Get(Application.Context).ClearDiskCache(); })); backgroundThread.IsBackground = true; backgroundThread.Start(); Glide.Get(this).ClearMemory(); Glide.With(Application.Context) .Load(image_url) .Apply(new Com.Bumptech.Glide.Request.RequestOptions() .SkipMemoryCache(true)) //.Placeholder(Resource.Drawable.specialization_imageIV) .Into(fullIV); removeBn.Click += (s, e) => { tint_DelLL.Visibility = ViewStates.Visible; }; if (!from_expert) { removeBn.Visibility = ViewStates.Visible; } else { removeBn.Visibility = ViewStates.Gone; } } catch { StartActivity(typeof(MainActivity)); } }
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); }
void Initialize() { this.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); this.Orientation = Orientation.Vertical; linea_separador = new View(context); linea_separador.LayoutParameters = new ViewGroup.LayoutParams(-1, 5); linea_separador.SetBackgroundColor(Color.ParseColor("#eeeeee")); imgUser = new ImageView(context); scrollImage = new HorizontalScrollView(context); scrollImage.HorizontalScrollBarEnabled = false; linearImage = new LinearLayout(context); linearPanelScroll = new LinearLayout(context); linearContainer = new LinearLayout(context); linearAll = new LinearLayout(context); txtAuthor = new TextView(context); txtContainer = new TextView(context); txtTitle = new TextView(context); linearAll.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); linearImage.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(140), -2); linearContainer.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(500), -2); linearPanelScroll.LayoutParameters = new LinearLayout.LayoutParams(-2, -2); scrollImage.LayoutParameters = new ViewGroup.LayoutParams(Configuration.getWidth(500), -2); linearAll.Orientation = Orientation.Horizontal; linearImage.Orientation = Orientation.Vertical; linearContainer.Orientation = Orientation.Vertical; txtTitle.SetTextSize(ComplexUnitType.Px, Configuration.getHeight(40)); txtAuthor.SetTextSize(ComplexUnitType.Px, Configuration.getHeight(30)); txtContainer.SetTextSize(ComplexUnitType.Px, Configuration.getHeight(45)); txtAuthor.SetTextColor(Color.ParseColor("#3c3c3c")); txtContainer.SetTextColor(Color.ParseColor("#3c3c3c")); txtTitle.SetSingleLine(true); txtAuthor.SetSingleLine(true); txtContainer.SetSingleLine(false); txtContainer.SetPadding(0, 0, 20, 0); txtContainer.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeueLight.ttf"); txtAuthor.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeueLight.ttf"); scrollImage.AddView(linearPanelScroll); linearAll.AddView(linearImage); linearAll.AddView(linearContainer); linearImage.AddView(imgUser); linearContainer.AddView(txtTitle); linearContainer.AddView(txtAuthor); linearContainer.AddView(txtContainer); linearContainer.AddView(scrollImage); int space = Configuration.getHeight(50); scrollImage.SetPadding(0, 0, 0, space); this.AddView(linearAll); this.AddView(linea_separador); this.SetPadding(0, 0, 0, space); }
private void ini() { mainLayout = new RelativeLayout(context); mainLayout.LayoutParameters = new RelativeLayout.LayoutParams(-1, -1); mainLayout.SetBackgroundColor(Color.ParseColor("#ffffff")); linearContainer = new LinearLayout(context); linearImageLO = new LinearLayout(context); linearTextLO = new LinearLayout(context); linearLike = new LinearLayout(context); linearUsers = new LinearLayout(context); txtAuthor = new TextView(context); txtChapter = new TextView(context); txtNameLO = new TextView(context); txtLike = new TextView(context); txtAuthor.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); txtChapter.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); txtNameLO.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); txtLike.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); imgHeart = new ImageView(context); commentList = new ListView(context); linearContainer.LayoutParameters = new LinearLayout.LayoutParams(-1, -1); linearImageLO.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(372)); linearTextLO.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(250)); linearLike.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(120), Configuration.getHeight(80)); linearUsers.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); linearTextLO.Orientation = Orientation.Vertical; linearTextLO.SetGravity(GravityFlags.Right); linearLike.Orientation = Orientation.Vertical; linearLike.SetGravity(GravityFlags.Center); linearUsers.Orientation = Orientation.Horizontal; linearUsers.SetGravity(GravityFlags.Center); linearContainer.Orientation = Orientation.Vertical; //linearContainer.SetGravity (GravityFlags.Center); //Drawable d = new BitmapDrawable (Bitmap.CreateScaledBitmap (getBitmapFromAsset ("images/fondounidad.png"), 480, 640, true)); //linearImageLO.SetBackgroundDrawable (d); imgHeart.SetImageBitmap(Bitmap.CreateScaledBitmap(getBitmapFromAsset("images/like.png"), Configuration.getWidth(43), Configuration.getHeight(43), true)); txtAuthor.Text = "Author : David Spencer"; txtChapter.Text = "Flora y Fauna"; txtNameLO.Text = "Camino Inca"; txtLike.Text = "10"; //txtChapter.SetMaxWidth (Configuration.getWidth (580)); //txtChapter.Ellipsize = TextUtils.TruncateAt.End; //txtChapter.SetMaxLines(1); txtAuthor.SetTextColor(Color.ParseColor("#ffffff")); txtChapter.SetTextColor(Color.ParseColor("#ffffff")); txtNameLO.SetTextColor(Color.ParseColor("#ffffff")); txtLike.SetTextColor(Color.ParseColor("#ffffff")); txtNameLO.SetTextSize(Android.Util.ComplexUnitType.Px, Configuration.getHeight(30)); txtChapter.SetTextSize(Android.Util.ComplexUnitType.Px, Configuration.getHeight(50)); txtAuthor.SetTextSize(Android.Util.ComplexUnitType.Px, Configuration.getHeight(30)); txtNameLO.Typeface = Typeface.DefaultBold; txtAuthor.Gravity = GravityFlags.Right; txtChapter.Gravity = GravityFlags.Right; txtNameLO.Gravity = GravityFlags.Right; txtLike.Gravity = GravityFlags.Center; linearTextLO.AddView(txtNameLO); linearTextLO.AddView(txtChapter); linearTextLO.AddView(txtAuthor); linearTextLO.SetPadding(0, 0, Configuration.getWidth(30), 0); linearLike.AddView(imgHeart); linearLike.AddView(txtLike); _mCommentData = new List <CommentDataRow> (); /* * _mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" }); * _mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" }); * _mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" }); * _mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" }); * _mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" }); * _mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" }); * _mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" }); * _mCommentData.Add (new CommentDataRow (){im_profile="images/e1.jpg" , name="Ryan Elliot", date = "10:00pm", comment = "Esto es un comentario" }); */ // commentList.Adapter = new CommentListViewAdapter (context, _mCommentData); commentList.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(654)); commentList.SetX(0); commentList.SetY(Configuration.getHeight(530)); linearTextLO.SetX(0); linearTextLO.SetY(Configuration.getHeight(200)); //linearImageLO.SetX (0); linearImageLO.SetY (0); linearLike.SetX(0); linearLike.SetY(Configuration.getHeight(256)); linearContainer.SetX(0); linearContainer.SetY(0); linearContainer.AddView(linearImageLO); linearContainer.AddView(linearUsers); mainLayout.AddView(linearContainer); //mainLayout.AddView (linearImageLO); mainLayout.AddView(linearTextLO); mainLayout.AddView(linearLike); mainLayout.AddView(commentList); this.AddView(mainLayout); /*linearImageLO.Click += delegate { * var com = ((LOViewModel)context.DataContext).SignUpCommand; * com.Execute(null); * }; */ }
void Initialize() { var metrics = Resources.DisplayMetrics; widthInDp = ((int)metrics.WidthPixels); heightInDp = ((int)metrics.HeightPixels); Configuration.setWidthPixel(widthInDp); Configuration.setHeigthPixel(heightInDp); adsImagesPath = AddResources.Instance.addList; _leyendaMap = new ImageView(context); _leyendaMapBack = new ImageView(context); int w = Configuration.getWidth(25); int h = Configuration.getHeight(45); _leyendaMap.SetImageBitmap(Bitmap.CreateScaledBitmap(getBitmapFromAsset("icons/atras.png"), w, h, true)); _leyendaMap.SetPadding(w, 0, 0, 0); _leyendaMap.Click += delegate { showLeyenda(); }; leyendaLayout = new RelativeLayout(context); leyendaLayout.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(500), Configuration.getHeight(1136 - 85)); leyendaLayout.SetBackgroundColor(Color.White); leyendaLayout.SetX(Configuration.getWidth(640)); leyendaLayout.Click += delegate { showLeyenda(); }; _leyendaImage = new ImageView(context); //_leyendaImage.LayoutParameters = new LinearLayout.LayoutParams (Configuration.getWidth (500), -1); _leyendaImage.SetImageBitmap(Bitmap.CreateScaledBitmap(getBitmapFromAsset("images/leyenda.png"), Configuration.getWidth(500), Configuration.getWidth(500), true)); //_leyendaImage.SetX (Configuration.getWidth (141)); _leyendaImage.SetY(Configuration.getHeight(125)); _leyendaImage.SetBackgroundColor(Color.Black); _leyendaMapBack.SetImageBitmap(Bitmap.CreateScaledBitmap(getBitmapFromAsset("icons/adelante.png"), w, h, true)); //_leyendaMapBack.Rotation = 180; _leyendaMapBack.SetPadding(w, 0, 0, 0); _leyendaMapBack.SetX(Configuration.getWidth(445)); _leyendaMapBack.SetY(Configuration.getHeight(40)); _leyendaMapBack.Click += delegate { showLeyenda(); }; TextView tituloLeyenda = new TextView(context); tituloLeyenda.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(125)); tituloLeyenda.Gravity = GravityFlags.Center; tituloLeyenda.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(38)); tituloLeyenda.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf"); tituloLeyenda.Text = "LEYENDA"; leyendaLayout.AddView(tituloLeyenda); leyendaLayout.AddView(_leyendaImage); leyendaLayout.AddView(_leyendaMapBack); loadIcons(); //loadMapas (); ini(); //iniNotifList (); this.AddView(_mainLayout); }
/// <summary> /// Creates the activity. /// Initializes, modifies and handles events for all widgets. /// </summary> protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Help); // Initialize widgets mTvHeaderHelp = FindViewById <TextView>(Resource.Id.tvHeaderHelp); mTvHelpText = FindViewById <TextView>(Resource.Id.tvHelpText); mTvHelpStartScreen = FindViewById <TextView>(Resource.Id.tvHelpStartScreen); mTvHelpStartScreenText = FindViewById <TextView>(Resource.Id.tvHelpTextStartScreen); mTvHelpControllerSettings = FindViewById <TextView>(Resource.Id.tvHelpControllerSettings); mTvHelpControllerSettingsText = FindViewById <TextView>(Resource.Id.tvHelpTextControllerSettings); mTvHelpController = FindViewById <TextView>(Resource.Id.tvHelpController); mTvHelpControllerText = FindViewById <TextView>(Resource.Id.tvHelpTextController); mTvHelpLogFiles = FindViewById <TextView>(Resource.Id.tvHelpLogFiles); mTvHelpLogFilesText = FindViewById <TextView>(Resource.Id.tvHelpTextLogFiles); mTvHelpAbout = FindViewById <TextView>(Resource.Id.tvHelpAbout); mTvVersion = FindViewById <TextView>(Resource.Id.tvVersion); mTvCredentials = FindViewById <TextView>(Resource.Id.tvCredentials); mTvLinkGithub = FindViewById <TextView>(Resource.Id.tvLinkGitHub); mTvAboutInfo = FindViewById <TextView>(Resource.Id.tvAboutInfo); mTvLinkHomepage = FindViewById <TextView>(Resource.Id.tvLinkHomepage); mTvThirdParty = FindViewById <TextView>(Resource.Id.tvThirdParty); mBtnBackHelp = FindViewById <Button>(Resource.Id.btnBackHelp); // Create and set font to widgets var font = Typeface.CreateFromAsset(Assets, "SourceSansPro-Light.ttf"); mTvHeaderHelp.Typeface = font; mTvHelpText.Typeface = font; mTvHelpStartScreen.Typeface = font; mTvHelpStartScreenText.Typeface = font; mTvHelpControllerSettings.Typeface = font; mTvHelpControllerSettingsText.Typeface = font; mTvHelpController.Typeface = font; mTvHelpControllerText.Typeface = font; mTvHelpLogFiles.Typeface = font; mTvHelpLogFilesText.Typeface = font; mTvHelpAbout.Typeface = font; mTvVersion.Typeface = font; mTvCredentials.Typeface = font; mTvLinkGithub.Typeface = font; mTvAboutInfo.Typeface = font; mTvLinkHomepage.Typeface = font; mTvThirdParty.Typeface = font; mBtnBackHelp.Typeface = font; mBtnBackHelp.Click += OnBackToMain; // Set help texts mTvHelpStartScreenText.TextFormatted = Html.FromHtml( "If the user opens the app, a start screen with three buttons appears. The app searches automatically for WiFi hotspots containing the strings <i>Raspberry</i>, <i>RPI</i> or <i>Pi</i>. If the <i>Connect</i> button remains red, the app can’t find a matching WiFi hotspot containing the strings mentioned above. If an appropriate network is found, the <i>Connect</i> button turns blue and the SSID and MAC of the Raspberry Pi are displayed.<br/>" + "<br/><b>Connect</b><br/>Asks the user to enter the password (usually 87654321 or 00000000) and confirm it. After that, the app navigates to <i>Controller Settings.</i><br/>" + "<br/><b>Log Files</b><br/>Navigates to the <i>Log File Menu</i>, where the user can either see raw log files or visualizations of previous flights.<br/>" + "<br/><b>Help</b><br/>Navigates to the help menu, where general information is displayed."); mTvHelpControllerSettingsText.TextFormatted = Html.FromHtml( "In this menu the user can choose between the positions of the functionality during the flight.<br/>" + "<br/><b>Mode 1</b><br/>The left joystick is used to control Throttle (vertical) and Yaw (horizontal). The right joystick is used to control Pitch (vertical) and Roll (horizontal).<br/>" + "<br/><b>Mode 2</b><br/>The left joystick is used to control Pitch (vertical) and Yaw (horizontal). The right joystick is used to control Throttle (vertical) and Roll (horizontal).<br/>" + "<br/>A click on <i>Start</i> opens the controller."); mTvHelpControllerText.TextFormatted = Html.FromHtml("With the controller view you can control a multicopter using the two joysticks. Depending on the previous selection the user can start the multicopter by pushing up the throttle joystick. At the top of the screen the user can activate altitude control and adjust trims for yaw, pitch and roll. The trim can be changed either by moving the bar or by clicking the two volume buttons (+ and -) on the smartphone. Once a flight is finished, the user can go back to the <i>Controller Settings</i> menu by clicking the smartphone’s back button."); mTvHelpLogFilesText.TextFormatted = Html.FromHtml( "In this menu a list of all log files is displayed. After a flight, sent and received data is logged and saved in a file. With a click on a file, the user can choose between these three options:<br/>" + "<br/><b>Raw Data</b><br/>This option shows the raw data from the log file.<br/>" + "<br/><b>Visualize</b><br/>This option visualizes the logged data and generates one or more graphs.<br/>" + "<br/><b>Delete file</b><br/>Deletes the file permanently."); mTvThirdParty.TextFormatted = Html.FromHtml( "Wifi Dronection includes third-party components and we are very thankful to their authors:<br/><br/>" + "● <a href='https://github.com/PhilJay/MPAndroidChart'>MPAndroidChart</a> by PhilJay" ); PackageManager manager = this.PackageManager; PackageInfo info = manager.GetPackageInfo(this.PackageName, 0); mTvVersion.Text = String.Format( "Version: {0}", info.VersionName); }
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(40), Configuration.getWidth(40)); int w = Configuration.getWidth(40); int h = Configuration.getWidth(40); iconMarker.SetImageBitmap(Bitmap.CreateScaledBitmap(getBitmapFromAsset("icons/iconmap12.png"), w, h, true)); iconMarker.SetX(-100); iconMarker.SetY(-100); iconMarker.SetAlpha(185); //hace que la imagen sea mas transparente 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(adsImagesPath.Count)); } }; _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 (); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.layout_classeduction); Typeface font = Typeface.CreateFromAsset(Assets, "Estedad.ttf"); classeductionbtnenterevent = FindViewById <Button>(Resource.Id.classeductionbtnenterevent); classeductionbtnenterevent.Click += delegate { StartActivity(typeof(EnterEvent)); }; classeductionbtnenterevent.Typeface = font; classeductiontxtviewcaption = FindViewById <TextView>(Resource.Id.classeductiontxtviewgroup); classeductiontxtviewcaption.Typeface = font; classeductionimgbtnlogo = FindViewById <ImageButton>(Resource.Id.classeductionimgbtnlogo); classeductionimgbtnlogo.Click += delegate { StartActivity(typeof(MainActivity)); }; classeductionbtnContact = FindViewById <Button>(Resource.Id.classeductionbtnContact); classeductionbtnContact.Click += delegate { StartActivity(typeof(Account)); }; classeductionbtnContact.Typeface = font; classeductionbtngift = FindViewById <Button>(Resource.Id.classeductionbtngift); classeductionbtngift.Click += delegate { StartActivity(typeof(Suprised_Activity)); }; classeductionbtngift.Typeface = font; classeductionbtnEventDay = FindViewById <Button>(Resource.Id.classeductionbtnEventDay); classeductionbtnEventDay.Click += delegate { StartActivity(typeof(EventDay_Activity)); }; classeductionbtnEventDay.Typeface = font; classeductionbtngroupingGrouping = FindViewById <Button>(Resource.Id.classeductionbtngroupingGrouping); classeductionbtngroupingGrouping.Typeface = font; classeductionbtngroupingGrouping.Click += delegate { StartActivity(typeof(Grouping)); }; classeductionbtnother = FindViewById <Button>(Resource.Id.classeductionbtnother); classeductionbtnother.Typeface = font; classeductionbtnother.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-سایر"); StartActivity(oi); }; classeductionbtnexhibition = FindViewById <Button>(Resource.Id.classeductionbtnexhibition); classeductionbtnexhibition.Typeface = font; classeductionbtnexhibition.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-گردشگری"); StartActivity(oi); }; classeductionbtnsport = FindViewById <Button>(Resource.Id.classeductionbtnsport); classeductionbtnsport.Typeface = font; classeductionbtnsport.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-ورزشی"); StartActivity(oi); }; classeductionbtnfastfoos = FindViewById <Button>(Resource.Id.classeductionbtnfastfoos); classeductionbtnfastfoos.Typeface = font; classeductionbtnfastfoos.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-خوراکی"); StartActivity(oi); }; classeductionbtnreligion = FindViewById <Button>(Resource.Id.classeductionbtnreligion); classeductionbtnreligion.Typeface = font; classeductionbtnreligion.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-مذهبی"); StartActivity(oi); }; classeductionbtnskill = FindViewById <Button>(Resource.Id.classeductionbtnskill); classeductionbtnskill.Typeface = font; classeductionbtnskill.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-بیشه و مهارتی"); StartActivity(oi); }; ///////// classeductionbtnlessons = FindViewById <Button>(Resource.Id.classeductionbtnlessons); classeductionbtnlessons.Typeface = font; classeductionbtnlessons.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-دروس مدرسه و دانشگاه"); StartActivity(oi); }; classeductionbtnlanguage = FindViewById <Button>(Resource.Id.classeductionbtnlanguage); classeductionbtnlanguage.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-زبان های خارجی"); StartActivity(oi); }; classeductionbtnlanguage.Typeface = font; classeductionbtnconsultation = FindViewById <Button>(Resource.Id.classeductionbtnconsultation); classeductionbtnconsultation.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزش- مشاوره تحصیلی"); StartActivity(oi); }; classeductionbtnconsultation.Typeface = font; classeductionbtnarticle = FindViewById <Button>(Resource.Id.classeductionbtnarticle); classeductionbtnarticle.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-هنری"); StartActivity(oi); }; classeductionbtnarticle.Typeface = font; classeductionbtnmedical = FindViewById <Button>(Resource.Id.classeductionbtnmedical); classeductionbtnmedical.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-پزشکی"); StartActivity(oi); }; classeductionbtnmedical.Typeface = font; classeductionbtnperfect = FindViewById <Button>(Resource.Id.classeductionbtnperfect); classeductionbtnperfect.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-زیبایی"); StartActivity(oi); }; classeductionbtnperfect.Typeface = font; classeductionbtnmusic = FindViewById <Button>(Resource.Id.classeductionbtnmusic); classeductionbtnmusic.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-آموزش موسیقی"); StartActivity(oi); }; classeductionbtnmusic.Typeface = font; classeductionbtnlearnphoto = FindViewById <Button>(Resource.Id.classeductionbtnlearnphoto); classeductionbtnlearnphoto.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-آموزش عکاسی"); StartActivity(oi); }; classeductionbtnlearnphoto.Typeface = font; classeductionbtnworkshop = FindViewById <Button>(Resource.Id.classeductionbtnworkshop); classeductionbtnworkshop.Click += delegate { Intent oi = new Intent(this, typeof(CategoryEvent)); oi.PutExtra("Key", "کلاس های آموزشی-ورک شاپ"); StartActivity(oi); }; classeductionbtnworkshop.Typeface = font; }
public void iniPlancesList() { //_currentPlaces.Clear (); _listLinearPlaces.Clear(); placeSpace.RemoveAllViews(); placesContainer.RemoveAllViews(); VerticalScrollView listScrollPlaces = new VerticalScrollView(context); listScrollPlaces.LayoutParameters = new VerticalScrollView.LayoutParams(-1, Configuration.getHeight(345)); listScrollPlaces.VerticalScrollBarEnabled = false; LinearLayout listSpaceLayout = new LinearLayout(context); listSpaceLayout.LayoutParameters = new LinearLayout.LayoutParams(-1, -2); listSpaceLayout.Orientation = Orientation.Vertical; for (int i = 0; i < _currentPlaces.Count; i++) { var item = _currentPlaces [i]; LinearLayoutLO linearItem = new LinearLayoutLO(context); linearItem.index = i; TextView txtName = new TextView(context); ImageView imgIcon = new ImageView(context); txtName.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(420), -1); txtName.Gravity = GravityFlags.CenterVertical; txtName.Text = item.titulo; //txtName.SetTextColor (Color.ParseColor ("#ffffff")); txtName.Typeface = Typeface.CreateFromAsset(context.Assets, "fonts/HelveticaNeue.ttf"); txtName.SetTextSize(ComplexUnitType.Fraction, Configuration.getHeight(32)); //imgIcon.SetImageBitmap (Bitmap.CreateScaledBitmap (getBitmapFromAsset (item.Asset), Configuration.getWidth (30), Configuration.getWidth (30), true)); int H = 80; int W = 120; linearItem.LayoutParameters = new LinearLayout.LayoutParams(-1, Configuration.getHeight(H)); //linearItem.SetBackgroundDrawable (background_row); linearItem.Orientation = Orientation.Horizontal; linearItem.SetGravity(Android.Views.GravityFlags.CenterVertical); //linearItem.AddView (imgIcon); RelativeLayout imageLayout = new RelativeLayout(context); imageLayout.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(W), Configuration.getHeight(H)); ImageView iconImage = new ImageView(context); Picasso.With(context).Load(item.pathIcon).Resize(Configuration.getWidth(W), Configuration.getHeight(H)).CenterCrop().Into(iconImage); imageLayout.AddView(iconImage); LinearLayout gradiente = new LinearLayout(context); gradiente.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(W), Configuration.getHeight(H)); imageLayout.AddView(gradiente); ImageIconMap icon = new ImageIconMap(context); icon.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(60), Configuration.getWidth(60)); icon.index = 0; icon.SetImageBitmap(_leyendaIcon[item.tipoIndex]); //icon.SetPadding (Configuration.getWidth (20), ,0,0); icon.SetX(Configuration.getWidth(30)); icon.SetY(Configuration.getHeight(10)); RelativeLayout iconLayout = new RelativeLayout(context); iconLayout.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(W), Configuration.getHeight(H)); iconLayout.SetGravity(GravityFlags.Center); LinearLayout gradiente2 = new LinearLayout(context); gradiente2.LayoutParameters = new LinearLayout.LayoutParams(Configuration.getWidth(W), Configuration.getHeight(H)); iconLayout.AddView(icon); iconLayout.AddView(gradiente2); linearItem.AddView(imageLayout); linearItem.AddView(txtName); linearItem.AddView(iconLayout); int space = Configuration.getWidth(30); //linearItem.SetPadding (space,0,space,0); //imgIcon.SetPadding (Configuration.getWidth(68), 0, 0, 0); txtName.SetPadding(Configuration.getWidth(10), 0, 0, 0); if (i % 2 == 0) { gradiente.SetBackgroundResource(Resource.Drawable.gradiente2); gradiente2.SetBackgroundResource(Resource.Drawable.gradiente22); linearItem.SetBackgroundColor(Color.ParseColor("#F0AE11")); txtName.SetTextColor(Color.White); } else { gradiente.SetBackgroundResource(Resource.Drawable.gradiente1); gradiente2.SetBackgroundResource(Resource.Drawable.gradiente11); txtName.SetTextColor(Color.ParseColor("#F0AE11")); } _listLinearPlaces.Add(linearItem); _listLinearPositonPlaces.Add(icon); listSpaceLayout.AddView(linearItem); } /* * listPlaces = new ListView (context); * listPlaces.LayoutParameters = new LinearLayout.LayoutParams (-1, Configuration.getHeight(345)); * * listPlaces.Adapter = new PlaceAdapter (context, _currentPlaces); * listPlaces.DividerHeight = 0; * * placesContainer.AddView (listPlaces); */ placesContainer.AddView(listSpaceLayout); placeSpace.AddView(placesContainer); titulo_header.Text = titulo_map_header; header.AddView(titulo_header); header.AddView(_leyendaMap); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var dlg = inflater.Inflate(Resource.Layout.layoutcaptioncultural, container, false); var font = Typeface.CreateFromAsset(ctx.Assets, "Estedad.ttf"); LinearLayout lnaboutus = dlg.FindViewById <LinearLayout>(Resource.Id.LinearlayoutfragmentCaptioncultrual); lnaboutus.SetBackgroundResource(Resource.Drawable.dialog_fragment_round); captioncultrualtxtviewheader = dlg.FindViewById <TextView>(Resource.Id.captioncultrualtxtviewheader); captioncultrualtxtviewheader.Typeface = font; captioncultrualtxtviewheader.Text = "انتخاب رویداد"; captioncultralchkboxsiminar = dlg.FindViewById <CheckBox>(Resource.Id.captioncultralchkboxsiminar); captioncultralchkboxsiminar.Typeface = font; captioncultralchkboxsiminar.Click += delegate { captioncultralchkboxcinema.Checked = false; captioncultralchkboxcocert.Checked = false; captioncultralchkboxgallery.Checked = false; captioncultralchkboxcongrees.Checked = false; captioncultralchkbxattractions.Checked = false; // captioncultralchkboxlearning.Checked = false; OnGetCaptionCultrual.Invoke(this, new GetCaptionCultrual(value + "-" + captioncultralchkboxsiminar.Text)); Dismiss(); }; captioncultralchkboxcinema = dlg.FindViewById <CheckBox>(Resource.Id.captioncultralchkboxcinema); captioncultralchkboxcinema.Typeface = font; captioncultralchkboxcinema.Click += delegate { captioncultralchkboxsiminar.Checked = false; captioncultralchkboxcocert.Checked = false; captioncultralchkboxgallery.Checked = false; captioncultralchkboxcongrees.Checked = false; captioncultralchkbxattractions.Checked = false; // captioncultralchkboxlearning.Checked = false; OnGetCaptionCultrual.Invoke(this, new GetCaptionCultrual(value + "-" + captioncultralchkboxcinema.Text)); Dismiss(); }; captioncultralchkboxcocert = dlg.FindViewById <CheckBox>(Resource.Id.captioncultralchkboxcocert); captioncultralchkboxcocert.Typeface = font; captioncultralchkboxcocert.Click += delegate { captioncultralchkboxsiminar.Checked = false; captioncultralchkboxcinema.Checked = false; captioncultralchkboxgallery.Checked = false; captioncultralchkboxcongrees.Checked = false; captioncultralchkbxattractions.Checked = false; // captioncultralchkboxlearning.Checked = false; OnGetCaptionCultrual.Invoke(this, new GetCaptionCultrual(value + "-" + captioncultralchkboxcocert.Text)); Dismiss(); }; captioncultralchkboxgallery = dlg.FindViewById <CheckBox>(Resource.Id.captioncultralchkboxgallery); captioncultralchkboxgallery.Typeface = font; captioncultralchkboxgallery.Click += delegate { captioncultralchkboxsiminar.Checked = false; captioncultralchkboxcinema.Checked = false; captioncultralchkboxcocert.Checked = false; captioncultralchkboxcongrees.Checked = false; captioncultralchkbxattractions.Checked = false; // captioncultralchkboxlearning.Checked = false; OnGetCaptionCultrual.Invoke(this, new GetCaptionCultrual(value + "-" + captioncultralchkboxgallery.Text)); Dismiss(); }; captioncultralchkboxcongrees = dlg.FindViewById <CheckBox>(Resource.Id.captioncultralchkboxcongrees); captioncultralchkboxcongrees.Typeface = font; captioncultralchkboxcongrees.Click += delegate { captioncultralchkboxsiminar.Checked = false; captioncultralchkboxcinema.Checked = false; captioncultralchkboxcocert.Checked = false; captioncultralchkboxgallery.Checked = false; captioncultralchkbxattractions.Checked = false; // captioncultralchkboxlearning.Checked = false; OnGetCaptionCultrual.Invoke(this, new GetCaptionCultrual(value + "-" + captioncultralchkboxcongrees.Text)); Dismiss(); }; captioncultralchkbxattractions = dlg.FindViewById <CheckBox>(Resource.Id.captioncultralchkbxattractions); captioncultralchkbxattractions.Typeface = font; captioncultralchkbxattractions.Click += delegate { captioncultralchkboxsiminar.Checked = false; captioncultralchkboxcinema.Checked = false; captioncultralchkboxcocert.Checked = false; captioncultralchkboxgallery.Checked = false; captioncultralchkboxcongrees.Checked = false; // captioncultralchkboxlearning.Checked = false; OnGetCaptionCultrual.Invoke(this, new GetCaptionCultrual(value + "-" + captioncultralchkbxattractions.Text)); Dismiss(); }; captioneventbtncancelll = dlg.FindViewById <Button>(Resource.Id.captioneventbtncancell); captioneventbtncancelll.Typeface = font; captioneventbtncancelll.Click += delegate { Dismiss(); }; return(dlg); }
public void Fonts() { LinotteRegular = Typeface.CreateFromAsset(Application.Context.Assets, "LinotteRegular.otf"); LinotteBold = Typeface.CreateFromAsset(Application.Context.Assets, "LinotteBold.otf"); }
void UpdateFont() { typeFace = Typeface.CreateFromAsset(Context.Assets, ExtendedElement.FontFamily.FontNameToFontFile()); Control.TextSize = (float)ExtendedElement.FontSize; Control.SetTypeface(typeFace, TypefaceStyle.Normal); }
protected async override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.layoutMyEvent); myeventlstview = FindViewById <ListView>(Resource.Id.myeventlstview); font = Typeface.CreateFromAsset(Assets, "Estedad.ttf"); Myeventbtnenterevent = FindViewById <Button>(Resource.Id.Myeventbtnenterevent); Myeventbtnenterevent.Typeface = font; Myeventbtnenterevent.Click += delegate { Intent oi = new Intent(this, typeof(EnterEvent)); StartActivity(oi); }; Myeventxtviewgroup = FindViewById <TextView>(Resource.Id.Myeventxtviewgroup); Myeventxtviewgroup.Typeface = font; Myeventimgbtnlogo = FindViewById <ImageButton>(Resource.Id.Myeventimgbtnlogo); Myeventimgbtnlogo.Click += delegate { Finish(); Intent om = new Intent(this, typeof(MainActivity)); StartActivity(om); }; MyeventbtnContact = FindViewById <Button>(Resource.Id.MyeventbtnContact); MyeventbtnContact.Typeface = font; MyeventbtnContact.Click += delegate { Intent oa = new Intent(this, typeof(Account)); StartActivity(oa); }; Myeventbtngift = FindViewById <Button>(Resource.Id.Myeventbtngift); Myeventbtngift.Typeface = font; MyeventbtnEventDay = FindViewById <Button>(Resource.Id.MyeventbtnEventDay); MyeventbtnEventDay.Typeface = font; MyeventbtnEventDay.Click += delegate { }; MyeventbtngroupingGrouping = FindViewById <Button>(Resource.Id.MyeventbtngroupingGrouping); MyeventbtngroupingGrouping.Typeface = font; MyeventbtngroupingGrouping.Click += delegate { Intent oa = new Intent(this, typeof(Grouping)); StartActivity(oa); }; List <Model.ItemEvent> eventlist = new List <Model.ItemEvent>() { new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = "5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = "5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = "5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = "5000" }, // new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000,00" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, // new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, // new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, // new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, // new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, new Model.ItemEvent() { id = 1, caption = "مسابقه کشتی", Placeevebt = "ورزشی_مسابقه", category = "شیراز زرهی", Timeevent = "از 22اردیبهشت تا 25خرداد", Cost = " 5000" }, }; //using (HttpClient client = new HttpClient()) //{ // client.BaseAddress = new Uri(WebAddress.MyAddress); // client.DefaultRequestHeaders.Accept.Clear(); // client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); // string json = JsonConvert.SerializeObject("", Formatting.Indented); // var httpContent = new StringContent(json); // HttpResponseMessage response = client.PostAsync("api/GetEventsItems", httpContent).Result; // if (response.IsSuccessStatusCode) // { // response.EnsureSuccessStatusCode(); // var responseJsonString = await response.Content.ReadAsStringAsync(); // var result = JsonConvert.DeserializeObject(responseJsonString).ToString(); // List<WebEventoo_DomainClasses.Model.Event> objr = JsonConvert.DeserializeObject<List<WebEventoo_DomainClasses.Model.Event>>(result); // var SelectItem = objr.Where(u => u.Statusevent == WebEventoo_DomainClasses.Model.Event.StatuseEvent.Published).ToList(); // MainShowEventAdapter t = new MainShowEventAdapter(this, SelectItem); // myeventlstview.Adapter = t; // } //} myeventlstview.ItemClick += Myeventlstview_ItemClick;; }
private void LoadUserData(UserDataObject cl, bool friends = true) { try { PPrivacy = cl.PPrivacy; GlideImageLoader.LoadImage(Activity, cl.Avatar, UserProfileImage, ImageStyle.RoundedCrop, ImagePlaceholders.Color); UserProfileImage.SetScaleType(ImageView.ScaleType.CenterCrop); TextSanitizerAutoLink.Load(AppTools.GetAboutFinal(cl)); AboutLiner.Visibility = ViewStates.Visible; Username.Text = "@" + cl.Username; Fullname.Text = AppTools.GetNameFinal(cl); IconVerified.Visibility = cl.Verified == "1" ? ViewStates.Visible : ViewStates.Gone; IconBusiness.Visibility = cl.BusinessAccount == "1" ? ViewStates.Visible : ViewStates.Gone; Typeface font = Typeface.CreateFromAsset(Application.Context.Resources.Assets, "ionicons.ttf"); TxtCountFav.Text = Methods.FunString.FormatPriceValue(Int32.Parse(cl.PostsCount)); TxtCountFollowers.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(cl.Followers)); TxtCountFollowing.Text = Methods.FunString.FormatPriceValue(Convert.ToInt32(cl.Following)); if (!string.IsNullOrEmpty(cl.Google)) { Google = cl.Google; SocialGoogle.SetTypeface(font, TypefaceStyle.Normal); SocialGoogle.Text = IonIconsFonts.SocialGoogle; SocialGoogle.Visibility = ViewStates.Visible; } if (!string.IsNullOrEmpty(cl.Facebook)) { Facebook = cl.Facebook; SocialFacebook.SetTypeface(font, TypefaceStyle.Normal); SocialFacebook.Text = IonIconsFonts.SocialFacebook; SocialFacebook.Visibility = ViewStates.Visible; } if (!string.IsNullOrEmpty(cl.Website)) { Website = cl.Website; WebsiteButton.SetTypeface(font, TypefaceStyle.Normal); WebsiteButton.Text = IonIconsFonts.AndroidGlobe; WebsiteButton.Visibility = ViewStates.Visible; } if (!string.IsNullOrEmpty(cl.Twitter)) { Twitter = cl.Twitter; SocialTwitter.SetTypeface(font, TypefaceStyle.Normal); SocialTwitter.Text = IonIconsFonts.SocialTwitter; SocialTwitter.Visibility = ViewStates.Visible; } if (cl.IsFollowing != null) { SIsFollowing = cl.IsFollowing.Value; if (!friends) { return; } if (cl.IsFollowing.Value) // My Friend { FollowButton.SetBackgroundResource(Resource.Drawable.Shape_Radius_Grey_Btn); FollowButton.SetTextColor(Color.ParseColor("#000000")); FollowButton.Text = Context.GetText(Resource.String.Lbl_Following); FollowButton.Tag = "true"; } else { //Not Friend FollowButton.SetBackgroundResource(Resource.Drawable.Shape_Radius_Gradient_Btn); FollowButton.SetTextColor(Color.ParseColor("#ffffff")); FollowButton.Text = Context.GetText(Resource.String.Lbl_Follow); FollowButton.Tag = "false"; } MessageButton.Visibility = cl.CPrivacy == "1" || cl.CPrivacy == "2" && cl.IsFollowing.Value ? ViewStates.Visible : ViewStates.Invisible; } } catch (Exception e) { Console.WriteLine(e); } }
public override View GetView(int position, View convertView, ViewGroup parent) { var item = items[position]; View view = convertView; if (view == null) { //view = context.LayoutInflater.Inflate(Resource.Layout.custom_item, null); view = context.LayoutInflater.Inflate(Resource.Layout.customCityForList, null); } //fonts var view1 = view.FindViewById <TextView>(Resource.Id.txtNombre); var cityBn = view.FindViewById <Button>(Resource.Id.cityBn); var delBn = view.FindViewById <Button>(Resource.Id.deleteBn); view1.Text = item.Nombre; Typeface tf = Typeface.CreateFromAsset(context.Assets, "dosis.book.ttf"); view1.SetTypeface(tf, TypefaceStyle.Bold); cityBn.SetTypeface(tf, TypefaceStyle.Bold); delBn.SetTypeface(tf, TypefaceStyle.Bold); //fonts ended Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(view.Context); builder.SetMessage("Delete?"); builder.SetCancelable(true); //IMPORTANT!!! this code: "if (!delBn.HasOnClickListeners)" is used to prevent the multiple click on delete button if (!delBn.HasOnClickListeners) { delBn.Click += delegate { builder.SetNegativeButton("Yes", (object sender, DialogClickEventArgs e) => { Toast.MakeText(view.Context, "Deleted: " + cityBn.Text, ToastLength.Short).Show(); dbr.RemoveCity(Convert.ToInt32(view1.Text)); view.Context.StartActivity(typeof(EditActivity)); }); builder.SetPositiveButton("No", (object sender, DialogClickEventArgs e) => { Toast.MakeText(view.Context, "Canceled", ToastLength.Short).Show(); //view.Context.StartActivity(typeof(EditActivity)); }); Android.App.AlertDialog dialog = builder.Create(); dialog.Show(); }; } string dbPath = System.IO.Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "MyDB.db3"); var db = new SQLiteConnection(dbPath); var table = db.Table <DB.city>(); int i = 0; //!!!IMPORTANT .AsEnumerable().Reverse() is for sorting cities at the end of the list foreach (var Item in table.AsEnumerable().Reverse()) { if (i == position) { if (Item.City != null) { //cityBn.Text = " " + Item.City; cityBn.Text = Item.City; } } i++; } cityBn.Click += delegate { dbr.InsertcityOrCoordIndicator("city"); //Console.WriteLine("this city is "+ cityBn.Text); foreach (var Item in table) { //if (" " + Item.City == cityBn.Text) if (Item.City == cityBn.Text) { foreach (char c in cityBn.Text) { if (c != ' ') { cityName += c; } } dbr.RemoveCity(Item.Id); //dbr.InsertCity(cityBn.Text); dbr.InsertCity(cityName); MAIN_Activity.cityButtonPressedIndicGlob = true; MAIN_Activity.cityTextGlobal = cityBn.Text.ToLower(); view.Context.StartActivity(typeof(LoadingActivity)); } } }; return(view); }
public override View GetSampleContent(Context con) { mainLayout = new LinearLayout(con); mainLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); mainLayout.Orientation = Android.Widget.Orientation.Vertical; segmentedIndicatorSettings = new SelectionIndicatorSettings(); colorIndicatorSettings = new SelectionIndicatorSettings(); sizeIndicatorSettings = new SelectionIndicatorSettings(); segmentedView = new SfSegmentedControl(con); colorSegmentView = new SfSegmentedControl(con); sizeSegmentView = new SfSegmentedControl(con); ViewModel = new SegementViewViewModel(con); LinearLayout segementLayout = new LinearLayout(con); segementLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 120); segementLayout.Orientation = Android.Widget.Orientation.Vertical; segementLayout.SetPadding(20, 0, 20, 0); segmentedView.ItemsSource = ViewModel.ClothTypeCollection; segmentedView.SegmentHeight = 100; segmentedView.CornerRadius = 50; segmentedView.SegmentHeight = 35; segmentedView.VisibleSegmentsCount = 3; segmentedView.SelectedIndex = 0; segmentedView.BorderColor = Color.Rgb(63, 63, 63); segmentedView.SelectionTextColor = Color.Rgb(2, 160, 174); segmentedView.FontColor = Color.DarkGray; segmentedView.SelectionIndicatorSettings = new SelectionIndicatorSettings { Color = Color.Transparent }; segmentedView.SelectionChanged += SegmentedView_SelectionChanged; segementLayout.AddView(segmentedView); Typeface tf = Typeface.CreateFromAsset(con.Assets, "Segmented.ttf"); ClothView = new TextView(con); ClothView.Text = "A"; ClothView.TextSize = 115; ClothView.TextAlignment = TextAlignment.Center; ClothView.Gravity = GravityFlags.Center; ClothView.Typeface = tf; ClothView.SetTextColor(Color.ParseColor("#32318E")); ///PriceSegment LinearLayout priceLAyout = new LinearLayout(con); priceLAyout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 150); priceLAyout.Orientation = Android.Widget.Orientation.Vertical; TextView clothText = new TextView(con); clothText.Text = "Best trendy outfits for men."; clothText.TextSize = 12; clothText.SetTextColor(Color.ParseColor("#3F3F3F")); clothText.TextAlignment = TextAlignment.TextStart; clothText.Gravity = GravityFlags.Start; TextView priceText = new TextView(con); priceText.Text = "$300"; priceText.Typeface = Typeface.DefaultBold; priceText.SetTextColor(Color.ParseColor("#3F3F3F")); priceText.TextAlignment = TextAlignment.TextStart; priceText.Gravity = GravityFlags.Start; priceText.TextSize = 12; priceLAyout.SetPadding(20, 0, 0, 0); priceLAyout.AddView(clothText); priceLAyout.AddView(priceText); ///ColorSegment LinearLayout colorSegementLayout = new LinearLayout(con); colorSegementLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 210); colorSegementLayout.Orientation = Android.Widget.Orientation.Vertical; colorSegementLayout.SetPadding(20, 0, 20, 0); TextView colorText = new TextView(con); colorText.Text = "Color"; colorText.Typeface = Typeface.DefaultBold; colorText.TextSize = 12; colorText.TextAlignment = TextAlignment.TextStart; colorText.Gravity = GravityFlags.Start; TextView colorspaceText = new TextView(con); colorspaceText.SetHeight(10); colorSegmentView.ItemsSource = ViewModel.PrimaryColors; colorSegmentView.CornerRadius = 50; colorSegmentView.SegmentHeight = 50; colorSegmentView.SegmentWidth = 70; colorSegmentView.SetBackgroundColor(Color.Transparent); colorSegmentView.BorderColor = Color.ParseColor("#EEEEEE"); colorSegmentView.FontIconFontColor = Color.Black; colorSegmentView.SelectedIndex = 0; colorSegmentView.FontSize = 12; colorSegmentView.VisibleSegmentsCount = 7; colorSegmentView.SegmentCornerRadius = 15; colorSegmentView.SelectionTextColor = Color.ParseColor("#32318E"); colorSegmentView.DisplayMode = SegmentDisplayMode.Image; colorIndicatorSettings.Color = Color.ParseColor("#EEEEEE"); colorIndicatorSettings.Position = SelectionIndicatorPosition.Fill; colorSegmentView.SelectionIndicatorSettings = colorIndicatorSettings; colorSegmentView.SelectionChanged += ColorSegmentView_SelectionChanged; colorSegmentView.SetGravity(GravityFlags.Center); colorSegementLayout.AddView(colorText); colorSegementLayout.AddView(colorspaceText); colorSegementLayout.AddView(colorSegmentView); ///SizeSegment LinearLayout sizeSegementLayout = new LinearLayout(con); sizeSegementLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 240); sizeSegementLayout.Orientation = Android.Widget.Orientation.Vertical; sizeSegementLayout.SetPadding(20, 0, 20, 0); TextView sizeText = new TextView(con); sizeText.Text = "Size"; sizeText.Typeface = Typeface.DefaultBold; sizeText.TextSize = 12; sizeText.TextAlignment = TextAlignment.TextStart; sizeText.Gravity = GravityFlags.Start; TextView sizespaceText = new TextView(con); sizespaceText.SetHeight(10); sizeSegmentView.ItemsSource = ViewModel.SizeCollection; sizeSegmentView.SegmentHeight = 100; sizeSegmentView.CornerRadius = 50; sizeSegmentView.BorderColor = Color.ParseColor("#2C7BBC"); sizeSegmentView.SelectionTextColor = Color.White; sizeSegmentView.DisplayMode = SegmentDisplayMode.Text; sizeSegmentView.VisibleSegmentsCount = 5; sizeSegmentView.SegmentHeight = 40; sizeSegmentView.FontSize = 16; sizeSegmentView.SegmentWidth = 40; sizeSegmentView.FontColor = Color.Black; sizeIndicatorSettings.Color = Color.ParseColor("#2C7BBC"); sizeSegmentView.FontIconFontColor = Color.Black; //sizeIndicatorSettings.CornerRadius = 20; sizeIndicatorSettings.Position = SelectionIndicatorPosition.Fill; sizeSegmentView.SelectionIndicatorSettings = sizeIndicatorSettings; sizeSegementLayout.AddView(sizeText); sizeSegementLayout.AddView(sizespaceText); sizeSegementLayout.AddView(sizeSegmentView); ///DesCription LinearLayout desCriptionLayout = new LinearLayout(con); desCriptionLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 250); desCriptionLayout.Orientation = Android.Widget.Orientation.Vertical; desCriptionLayout.SetPadding(20, 0, 0, 0); TextView descriptionText = new TextView(con); descriptionText.Text = "Description"; descriptionText.Typeface = Typeface.DefaultBold; descriptionText.TextSize = 12; descriptionText.TextAlignment = TextAlignment.TextStart; descriptionText.Gravity = GravityFlags.Start; TextView spaceText = new TextView(con); spaceText.SetHeight(5); TextView detailDescription = new TextView(con); detailDescription.Text = "95 % Polyester, 5 % Spandex, imported, machine wash, casual wear.This outfit keeps you cool and comfortable in quick - dry fabric that wicks away moisture."; detailDescription.TextSize = 12; detailDescription.TextAlignment = TextAlignment.TextStart; detailDescription.Gravity = GravityFlags.Start; desCriptionLayout.AddView(descriptionText); desCriptionLayout.AddView(spaceText); desCriptionLayout.AddView(detailDescription); TextView space = new TextView(con); if (IsTabletDevice(con) == true) { mainLayout.SetPadding(50, 0, 50, 0); descriptionText.TextSize = 16; detailDescription.TextSize = 16; sizeText.TextSize = 16; clothText.TextSize = 16; colorText.TextSize = 16; priceText.TextSize = 16; } if (con.Resources.DisplayMetrics.Density > 3) { segementLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 120 * 2); priceLAyout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 150 * 2); colorSegementLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 210 * 2); sizeSegementLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 240 * 2); desCriptionLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, 250 * 2); } mainLayout.AddView(space); mainLayout.AddView(segementLayout); mainLayout.AddView(ClothView); mainLayout.AddView(priceLAyout); mainLayout.AddView(colorSegementLayout); mainLayout.AddView(sizeSegementLayout); mainLayout.AddView(desCriptionLayout); return(mainLayout); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); try { SetContentView(Resource.Layout.AuthAfter); AuthorizationMethods authorizationMethods = new AuthorizationMethods(); profileLL = FindViewById <LinearLayout>(Resource.Id.profileLL); dialogsLL = FindViewById <LinearLayout>(Resource.Id.dialogsLL); specialistsLL = FindViewById <LinearLayout>(Resource.Id.specialistsLL); dialogsLL.Click += (s, e) => { edit_dialog = dialog_data.Edit(); edit_dialog.PutString("come_from", "Came directly from bottom"); edit_dialog.Apply(); StartActivity(typeof(ChatListActivity)); }; specialistsLL.Click += (s, e) => { StartActivity(typeof(SpecialistsCategoryActivity)); }; Typeface tf = Typeface.CreateFromAsset(Assets, "Roboto-Regular.ttf"); emailTV = FindViewById <TextView>(Resource.Id.emailTV); emailTV.Text = pref.GetString("email", String.Empty); resendBn = FindViewById <Button>(Resource.Id.resendBn); completeLoginBn = FindViewById <Button>(Resource.Id.completeLoginBn); textviewwe = FindViewById <TextView>(Resource.Id.textviewwe); textView1 = FindViewById <TextView>(Resource.Id.textView1); activityIndicator = FindViewById <ProgressBar>(Resource.Id.activityIndicator); activityIndicator.IndeterminateDrawable.SetColorFilter(Resources.GetColor(Resource.Color.buttonBackgroundColor), Android.Graphics.PorterDuff.Mode.Multiply); resendBn.SetTypeface(tf, TypefaceStyle.Normal); completeLoginBn.SetTypeface(tf, TypefaceStyle.Normal); FindViewById <TextView>(Resource.Id.specialistsTV).SetTypeface(tf, TypefaceStyle.Normal); FindViewById <TextView>(Resource.Id.dialogsTV).SetTypeface(tf, TypefaceStyle.Normal); FindViewById <TextView>(Resource.Id.profileTV).SetTypeface(tf, TypefaceStyle.Normal); textviewwe.SetTypeface(tf, TypefaceStyle.Normal); textView1.SetTypeface(tf, TypefaceStyle.Normal); emailTV.SetTypeface(tf, TypefaceStyle.Normal); completeLoginBn.Click += async(s, e) => { completeLoginBn.Visibility = ViewStates.Gone; resendBn.Visibility = ViewStates.Gone; activityIndicator.Visibility = ViewStates.Visible; var activate = await authorizationMethods.AuthActivate(pref.GetString("email", String.Empty), true); completeLoginBn.Visibility = ViewStates.Visible; resendBn.Visibility = ViewStates.Visible; activityIndicator.Visibility = ViewStates.Gone; if (activate.Contains("authToken")) { if (activate != "null" && activate != null && activate != "false") { var deserialized_value = JsonConvert.DeserializeObject <RegAfter>(activate.ToString()); if (deserialized_value.confirmed != false) { userMethods.InsertUser(deserialized_value.authToken, pref.GetString("email", String.Empty)); StartActivity(typeof(UserProfileActivity)); } else { Toast.MakeText(this, GetString(Resource.String.no_confirmation_by_mail), ToastLength.Short).Show(); } } } }; resendBn.Click += async(s, e) => { resendBn.Visibility = ViewStates.Gone; completeLoginBn.Visibility = ViewStates.Gone; activityIndicator.Visibility = ViewStates.Visible; var reg_result = await authorizationMethods.Authorize(pref.GetString("email", String.Empty)); resendBn.Visibility = ViewStates.Visible; completeLoginBn.Visibility = ViewStates.Visible; activityIndicator.Visibility = ViewStates.Gone; StartActivity(typeof(AuthAfterActivity)); }; } catch { StartActivity(typeof(MainActivity)); } }
/// <summary> /// UI views acquisition and initialization /// </summary> private void InitializeUI() { _noteText = FindViewById <EditText>(Resource.Id.noteText); _saveButton = FindViewById <ImageButton>(Resource.Id.saveNoteButton); _categoriesListButton = FindViewById <Button>(Resource.Id.categoriesListButton); _categoriesList = FindViewById <LinearLayout>(Resource.Id.categoriesDialogEntriesList); _categoriesListButton.Click += (object sender, EventArgs e) => RevealCategoriesDialog(); FindViewById <RelativeLayout>(Resource.Id.categoriesDialogBG).Click += (object sender, EventArgs e) => (sender as RelativeLayout).Visibility = ViewStates.Invisible; FindViewById <LinearLayout>(Resource.Id.categoriesDialogContainer).Click += (object sender, EventArgs e) => { }; FindViewById <TextView>(Resource.Id.categoriesDialogTitle).Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/MINIONPRO-REGULAR.OTF"); _categoriesListButton.Typeface = Typeface.CreateFromAsset(this.Assets, "fonts/MINIONPRO-REGULAR.OTF"); _saveButton.Click += (object sender, EventArgs e) => UpdateNotes(); if (_originalNote != null) { _noteText.Text = _originalNote.Text; _categoriesListButton.Text = NoteStorage.GetCurrentCategories(this)[_originalNote.CategoryId]; _categoriesListButton.Tag = _originalNote.CategoryId; } else { _categoriesListButton.Text = NoteStorage.GetCurrentCategories(this)[0]; _categoriesListButton.Tag = 0; } }
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); con = context; density = con.Resources.DisplayMetrics.Density; TextView about = new TextView(context); about.Text = "About Syncfusion"; if (IsTabletDevice(context)) { about.SetPadding(0, 10, 0, 40); about.Gravity = GravityFlags.Center; } about.SetTextColor(Color.Black); about.SetBackgroundColor(Color.Transparent); about.TextSize = 10 * density; //TypedValue.ApplyDimension(ComplexUnitType.Pt, 5, context.Resources.DisplayMetrics); mainLayout.AddView(about); TextView desc = new TextView(context); if (density > 2) { mainLayout.SetPadding(10, 10, 10, 10); about.TextSize = 20; } else { about.TextSize = 17; mainLayout.SetPadding(5, 5, 5, 5); } if (IsTabletDevice(context)) { desc.Text = "\tSyncfusion is the enterprise technology partner of choice for software development, delivering \n \n a broad range of web, mobile, and desktop controls coupled with a service-oriented approach \n \n throughout the entire application lifecycle. Syncfusion has established itself as the trusted\n\n partner worldwide for use in applications."; } else { desc.Text = "\tSyncfusion is the enterprise technology partner of choice for software development, delivering a broad range of web, mobile, and desktop controls coupled with a service-oriented approach throughout the entire application lifecycle. Syncfusion has established itself as the trusted partner worldwide for use in applications."; } desc.SetTextColor(Color.Black); desc.SetBackgroundColor(Color.Transparent); //desc.TextSize =5 * density; //TypedValue.ApplyDimension(ComplexUnitType.Pt, 3.5f, context.Resources.DisplayMetrics); mainLayout.AddView(desc); FrameLayout backFrame = new FrameLayout(context); backFrame.SetBackgroundColor(Color.Gray); mainLayout.AddView(backFrame, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)); FrameLayout frontFrame = new FrameLayout(context); frontFrame.SetBackgroundColor(Color.White); frontFrame.SetPadding(5, 5, 5, 5); touchDraw = new Button(context); touchDraw.Text = "Tap here to follow us"; touchDraw.SetTextColor(Color.Blue); touchDraw.SetBackgroundColor(Color.Transparent); //touchDraw.TextSize = 10 * density; //TypedValue.ApplyDimension(ComplexUnitType.Pt, 3, context.Resources.DisplayMetrics); frontFrame.AddView(touchDraw, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent, GravityFlags.Center)); Typeface typeface = Typeface.CreateFromAsset(context.Assets, "socialicons.ttf"); radialMenu = new SfRadialMenu(context); radialMenu.RimColor = Color.Transparent; radialMenu.SelectionColor = Color.Transparent; FrameLayout facebookLayout = new FrameLayout(context); facebookLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); ImageView facebookImage = new ImageView(context); facebookImage.LayoutParameters = facebookLayout.LayoutParameters; facebookImage.SetImageResource(Resource.Drawable.facebook); facebookImage.SetScaleType(ImageView.ScaleType.FitXy); TextView facebookText = new TextView(context); facebookText.LayoutParameters = facebookLayout.LayoutParameters; facebookText.Text = "\uE700"; facebookText.Typeface = typeface; facebookText.TextSize = 20; facebookText.TextAlignment = TextAlignment.Center; facebookText.Gravity = GravityFlags.Center; facebookText.SetTextColor(Color.White); facebookLayout.AddView(facebookImage); facebookLayout.AddView(facebookText, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); SfRadialMenuItem facebookItem = new SfRadialMenuItem(context) { View = facebookLayout, ItemWidth = 50, ItemHeight = 50 }; facebookItem.ItemTapped += FacebookItem_ItemTapped; facebookItem.SetBackgroundColor(Color.Transparent); radialMenu.Items.Add(facebookItem); FrameLayout gplusLayout = new FrameLayout(context); gplusLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); ImageView gplusImage = new ImageView(context); gplusImage.LayoutParameters = gplusLayout.LayoutParameters; gplusImage.SetImageResource(Resource.Drawable.gplus); gplusImage.SetScaleType(ImageView.ScaleType.FitXy); TextView gplusText = new TextView(context); gplusText.LayoutParameters = gplusLayout.LayoutParameters; gplusText.Text = "\uE707"; gplusText.Typeface = typeface; gplusText.TextSize = 20; gplusText.TextAlignment = TextAlignment.Center; gplusText.Gravity = GravityFlags.Center; gplusText.SetTextColor(Color.White); gplusLayout.AddView(gplusImage); gplusLayout.AddView(gplusText, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); SfRadialMenuItem gplusItem = new SfRadialMenuItem(context) { View = gplusLayout, ItemWidth = 50, ItemHeight = 50 }; gplusItem.ItemTapped += GplusItem_ItemTapped; gplusItem.SetBackgroundColor(Color.Transparent); radialMenu.Items.Add(gplusItem); FrameLayout twitterLayout = new FrameLayout(context); twitterLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); ImageView twitterImage = new ImageView(context); twitterImage.LayoutParameters = twitterLayout.LayoutParameters; twitterImage.SetImageResource(Resource.Drawable.twitter); twitterImage.SetScaleType(ImageView.ScaleType.FitXy); TextView twitterText = new TextView(context); twitterText.LayoutParameters = twitterLayout.LayoutParameters; twitterText.Text = "\uE704"; twitterText.Typeface = typeface; twitterText.TextSize = 20; twitterText.TextAlignment = TextAlignment.Center; twitterText.Gravity = GravityFlags.Center; twitterText.SetTextColor(Color.White); twitterLayout.AddView(twitterImage); twitterLayout.AddView(twitterText, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); SfRadialMenuItem twitterItem = new SfRadialMenuItem(context) { View = twitterLayout, ItemWidth = 50, ItemHeight = 50 }; twitterItem.ItemTapped += TwitterItem_ItemTapped; twitterItem.SetBackgroundColor(Color.Transparent); radialMenu.Items.Add(twitterItem); FrameLayout pinterestLayout = new FrameLayout(context); pinterestLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); ImageView pinterestImage = new ImageView(context); pinterestImage.LayoutParameters = pinterestLayout.LayoutParameters; pinterestImage.SetImageResource(Resource.Drawable.pinterest); pinterestImage.SetScaleType(ImageView.ScaleType.FitXy); TextView pinterestText = new TextView(context); pinterestText.LayoutParameters = pinterestLayout.LayoutParameters; pinterestText.Text = "\uE705"; pinterestText.Typeface = typeface; pinterestText.TextSize = 20; pinterestText.TextAlignment = TextAlignment.Center; pinterestText.Gravity = GravityFlags.Center; pinterestText.SetTextColor(Color.White); pinterestLayout.AddView(pinterestImage); pinterestLayout.AddView(pinterestText, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); SfRadialMenuItem pinterestItem = new SfRadialMenuItem(context) { View = pinterestLayout, ItemWidth = 50, ItemHeight = 50 }; pinterestItem.ItemTapped += PinterestItem_ItemTapped; pinterestItem.SetBackgroundColor(Color.Transparent); radialMenu.Items.Add(pinterestItem); FrameLayout linkedInLayout = new FrameLayout(context); linkedInLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); ImageView linkedInImage = new ImageView(context); linkedInImage.LayoutParameters = linkedInLayout.LayoutParameters; linkedInImage.SetImageResource(Resource.Drawable.linkedin); linkedInImage.SetScaleType(ImageView.ScaleType.FitXy); TextView linkedInText = new TextView(context); linkedInText.LayoutParameters = linkedInLayout.LayoutParameters; linkedInText.Text = "\uE706"; linkedInText.Typeface = typeface; linkedInText.TextSize = 20; linkedInText.TextAlignment = TextAlignment.Center; linkedInText.Gravity = GravityFlags.Center; linkedInText.SetTextColor(Color.White); linkedInLayout.AddView(linkedInImage); linkedInLayout.AddView(linkedInText, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); SfRadialMenuItem linkedInItem = new SfRadialMenuItem(context) { View = linkedInLayout, ItemWidth = 50, ItemHeight = 50 }; linkedInItem.ItemTapped += LinkedInItem_ItemTapped; linkedInItem.SetBackgroundColor(Color.Transparent); radialMenu.Items.Add(linkedInItem); FrameLayout instagramLayout = new FrameLayout(context); instagramLayout.LayoutParameters = new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent); ImageView instagramImage = new ImageView(context); instagramImage.LayoutParameters = instagramLayout.LayoutParameters; instagramImage.SetImageResource(Resource.Drawable.instagram); instagramImage.SetScaleType(ImageView.ScaleType.FitXy); TextView instagramText = new TextView(context); instagramText.LayoutParameters = instagramLayout.LayoutParameters; instagramText.Text = "\uE708"; instagramText.Typeface = typeface; instagramText.TextSize = 20; instagramText.TextAlignment = TextAlignment.Center; instagramText.Gravity = GravityFlags.Center; instagramText.SetTextColor(Color.White); instagramLayout.AddView(instagramImage); instagramLayout.AddView(instagramText, new ViewGroup.LayoutParams(FrameLayout.LayoutParams.MatchParent, FrameLayout.LayoutParams.MatchParent)); SfRadialMenuItem instagramItem = new SfRadialMenuItem(context) { View = instagramLayout, ItemWidth = 50, ItemHeight = 50 }; instagramItem.ItemTapped += InstagramItem_ItemTapped; instagramItem.SetBackgroundColor(Color.Transparent); radialMenu.Items.Add(instagramItem); backFrame.AddView(frontFrame, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)); TextView menuIcon = new TextView(context); menuIcon.Text = "\uE703"; menuIcon.TextSize = 20; menuIcon.Typeface = typeface; menuIcon.SetTextColor(Color.White); menuIcon.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent); menuIcon.Gravity = GravityFlags.Center; radialMenu.Visibility = ViewStates.Invisible; radialMenu.CenterButtonView = menuIcon; radialMenu.IsDragEnabled = false; radialMenu.EnableRotation = false; radialMenu.OuterRimColor = Color.Transparent; radialMenu.CenterButtonBackground = Color.Rgb(41, 146, 247); radialMenu.CenterButtonRadius = 25; radialMenu.RimRadius = 100; radialMenu.Closed += RadialMenu_Closed; frontFrame.AddView(radialMenu); touchDraw.Click += (sender, e) => { radialMenu.Visibility = ViewStates.Visible; touchDraw.Visibility = ViewStates.Invisible; radialMenu.Show(); }; return(mainLayout); }