//public string getDescription() //{ // return description; //} public SpannedString getDescription() { int pos1 = -1; int pos2 = -1; //Log.d("Task - getDescription - HtmlScript before", "***" + description + "***"); //Log.d("Task object: getDescription Flat", "*"+descriptionPure+"*"); // TODO: Bug in Html.fromHtml(), erase font-size changes SpannedString spanned = (SpannedString)Html.FromHtml(description); SpannedString tmpSpanned = null; // = richTextReInsertFontSize(description, spanned); if (tmpSpanned != null) { spanned = tmpSpanned; } else { spanned = MH_Utils.Utils.trimSpannedText(spanned); } if (spanned != null) { //Log.d("Task - getDescription - HtmlScript after", "***" + Html.toHtml(spanned) + "***"); } return(spanned); }
/// <summary> /// Asettaa ja muotoilee tekstin. /// </summary> /// <param name="position"></param> /// <param name="convertView"></param> /// <param name="parent"></param> /// <returns></returns> public override View GetView(int position, View convertView, ViewGroup parent) { var Ravintola = this.ravintolatList[position]; var view = (convertView ?? context.LayoutInflater.Inflate(Resource.Layout.FeedItemListItemLayout, parent, false)) as LinearLayout; //string del = "<br>"; string del2 = "()"; //feedItem.Description = feedItem.Description.Replace(del, ""); Ravintola.Ruokalista = Ravintola.Ruokalista.Replace(del2, ""); Ravintola.Ruokalista = FormatText(Ravintola.Ruokalista); SpannedString text = new SpannedString(Html.FromHtml(Ravintola.Ruokalista)); //feedItem.Description = Regex.Replace(feedItem.Description, @"^\s*$\n", string.Empty, RegexOptions.Multiline); view.FindViewById <TextView>(Resource.Id.title).Text = Ravintola.Nimi; view.FindViewById <TextView>(Resource.Id.creator).TextFormatted = text; view.FindViewById <TextView>(Resource.Id.creator).SetTextColor(setDescColor()); view.FindViewById <TextView>(Resource.Id.title).SetTextColor(setTitleColor()); //view.FindViewById<TextView>(Resource.Id.creator).SetTextAppearance(ChangeTheme.getTheme()); //view.FindViewById<TextView>(Resource.Id.title).SetTextAppearance(ChangeTheme.getTheme()); //view.FindViewById<TextView>(Resource.Id.creator) return(view); }
public override Java.Lang.ICharSequence GetPageTitleFormatted(int position) { SpannedString txt = new SpannedString(new string('x', 1 + position)); return(txt); }
public override Java.Lang.ICharSequence GetPageTitleFormatted(int position) { SpannedString txt = new SpannedString(new string('x', 1 + position)); return txt; }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.MainScreen); TextView txtCommuteBuddy = FindViewById<TextView> (Resource.Id.selectService); Button btnMTA = FindViewById<Button> (Resource.Id.btnMTA); Button btnHighway = FindViewById<Button> (Resource.Id.btnHighway); btnMTA.Click += delegate { StartActivity(typeof(MTAfeed)); }; btnHighway.Click += delegate { StartActivity(typeof(highwayFeed)); }; XmlSerializer MtaSerializer = new XmlSerializer (typeof(Service), new XmlRootAttribute ("service")); XmlTextReader mtaReader = new XmlTextReader ("http://www.mta.info/status/serviceStatus.txt"); Service mtaObject = (Service)MtaSerializer.Deserialize (mtaReader); String statusString = (String)mtaObject.mta [7].name + " - " + mtaObject.mta[7].status; SpannedString statusSpanned = new SpannedString (Html.FromHtml (statusString)); int notificationId = 1000; Intent resultIntent = new Intent(this, typeof(MTAfeed)); Android.Support.V4.App.TaskStackBuilder stackBuilder = Android.Support.V4.App.TaskStackBuilder.Create(this); stackBuilder.AddParentStack(Java.Lang.Class.FromType(typeof(MTAfeed))); stackBuilder.AddNextIntent(resultIntent); PendingIntent resultPendingIntent = stackBuilder.GetPendingIntent(0, (int)PendingIntentFlags.UpdateCurrent); Android.Support.V4.App.NotificationCompat.Builder note = new Android.Support.V4.App.NotificationCompat.Builder (this) .SetContentTitle("Service Change") .SetAutoCancel(true) .SetContentIntent(resultPendingIntent) .SetSmallIcon(Resource.Drawable.icon) .SetContentText(statusSpanned); NotificationManager notificationManager = (NotificationManager)GetSystemService (Context.NotificationService); notificationManager.Notify (notificationId, note.Build()); }