private void UpdateTaleAndroidGUI() { mediaPlayerTale.Stop(); frmLytFrontPage.SetBackgroundColor(Color.WhiteSmoke); frmLytFrontPage.SetBackgroundResource(0); imgBackgroundPage.SetImageBitmap(null); if (taleManager != null) { lblFrontPage.Text = taleManager.Title; //-- Background String background = taleManager.Background; int tamBackground = background.Length; if (tamBackground > 0) { if (UtilsAndroid.isArchive(background)) { UtilsImageAndroid.SetImage(background, imgBackgroundFrontPage); } if (background.Contains("#")) { frmLytFrontPage.SetBackgroundColor(Color.ParseColor(background)); } } if (taleManager.Music != "") { mediaPlayerTale = MediaPlayer.Create(this, Android.Net.Uri.Parse(taleManager.Music)); mediaPlayerTale.Start(); } } Application.Dispose(); Application.OnTrimMemory(TrimMemory.RunningCritical); }
private void UpdatePageAndroidGUI() { mediaPlayerTale.Stop(); frmLytPage.SetBackgroundColor(Color.WhiteSmoke); imgBackgroundPage.SetImageBitmap(null); for (int i = 0; i < 10; i++) { textBlocksWord[i].Text = ""; images[i].SetImageResource(0); images[i].SetImageBitmap(null); borders[i].SetBackgroundColor(Color.Transparent); } //-- Background TestingEditor.Page auxPage = taleManager.CurrentPage; if (auxPage.Background != "") { String background = auxPage.Background; int tamBackground = background.Length; if (tamBackground > 0) { String p = background.Substring(tamBackground - 4); UtilsImageAndroid.SetImage(background, imgBackgroundFrontPage); if (p.Contains(".")) { UtilsImageAndroid.SetImage(background, imgBackgroundPage); } if (background.Contains("#")) { frmLytPage.SetBackgroundColor(Color.ParseColor(background)); } } } if (auxPage.Music != "") { mediaPlayerTale = MediaPlayer.Create(this, Android.Net.Uri.Parse(auxPage.Music)); mediaPlayerTale.Start(); } //-- PICTOGRAMAS ---- foreach (Pictogram pictogram in auxPage.Pictograms) { int i = pictogram.Index; textBlocksWord[i].Text = pictogram.TextToRead; string path = pictogram.ImageName; if (path != "") { Bitmap bit = BitmapFactory.DecodeFile(path); images[i].SetImageBitmap(bit); EditBorderAndroid(borders[i], pictogram.getColorByType(pictogram.Type), images[i], 10); } } Application.Dispose(); Application.OnTrimMemory(TrimMemory.RunningCritical); }