コード例 #1
0
 public PageFragment()
 {
     if (pc == null)
     {
         pc = new PageCreator(MainActivity.MyContext);
     }
 }
コード例 #2
0
        public static void SetView2()
        {
            if (PageFragment.view2 == null)
            {
                return;
            }

            if (SelectedFolder != last_songbook)
            {
                PageCreator.RefreshListView();
                last_songbook = SelectedFolder;
            }

            MainActivity.MyActivity.Window.ClearFlags(WindowManagerFlags.KeepScreenOn);
        }
コード例 #3
0
        public static void SetView4()
        {
            if (PageFragment.view4 == null)
            {
                return;
            }

            MainActivity.MyActivity.Window.ClearFlags(WindowManagerFlags.KeepScreenOn);
            PageCreator.HideKeyboard();

            if (Nastaveni.SelectedSong != null)
            {
                Button btnShareSong = PageFragment.view4.FindViewById <Button>(Resource.Id.btnShareSong);
                btnShareSong.Text = "Pieśń " + Nastaveni.SelectedSong.Tytul;
            }
        }
コード例 #4
0
        public static void SetView3()
        {
            if (PageFragment.view3 == null)
            {
                return;
            }

            if (Nastaveni.SelectedSong == null)
            {
                Toast.MakeText(MainActivity.MyContext, "Błąd!", ToastLength.Short).Show();
                return;
            }

            TextView tvTytul = PageFragment.view3.FindViewById <TextView>(Resource.Id.tvTytul);

            tvTytul.Text = Nastaveni.SelectedSong.Tytul;

            TextView tvNumer = PageFragment.view3.FindViewById <TextView>(Resource.Id.tvNumer);

            tvNumer.Text = Nastaveni.SelectedSong.Numer.ToString();

            TextView tvTonacja = PageFragment.view3.FindViewById <TextView>(Resource.Id.tvTonacja);

            tvTonacja.Text = Nastaveni.SelectedSong.Tonacja;

            TextView tvSlowa = PageFragment.view3.FindViewById <TextView>(Resource.Id.tvSlowa);

            if (Nastaveni.ChorusItalic)
            {
                tvSlowa.Text = Nastaveni.SelectedSong.SlowaToDisplay;
            }
            else
            {
                //SpannableString sss = new SpannableString("abc def");
                //sss.SetSpan(new UnderlineSpan(), 0, 2, 0);
                //sss.SetSpan(new StyleSpan(TypefaceStyle.Bold), 2, 4, 0);
                //tvSlowa.SetText(sss, TextView.BufferType.Spannable);
                string          slowa = Nastaveni.SelectedSong.SlowaToDisplay;
                List <Refren>   lr    = Song.GetRefreny(slowa);
                SpannableString sss   = new SpannableString(slowa);
                foreach (Refren r in lr)
                {
                    sss.SetSpan(new StyleSpan(TypefaceStyle.Italic), r.Start, r.End, 0);
                }
                tvSlowa.SetText(sss, TextView.BufferType.Spannable);
            }

            if (Nastaveni.Center)
            {
                tvSlowa.Gravity = GravityFlags.CenterHorizontal;
            }
            else
            {
                tvSlowa.Gravity = GravityFlags.NoGravity;
            }

            if (Nastaveni.BigFont)
            {
                tvSlowa.SetTextSize(Android.Util.ComplexUnitType.Dip, 22);
            }
            else
            {
                tvSlowa.SetTextSize(Android.Util.ComplexUnitType.Dip, 18);
            }

            MainActivity.MyActivity.Window.AddFlags(WindowManagerFlags.KeepScreenOn);
            PageCreator.HideKeyboard();
        }