protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); MyContext = this.ApplicationContext; MyActivity = this; Nastaveni.ChorusMany = Nastaveni.GetSetting("ChorusMany"); Nastaveni.Center = Nastaveni.GetSetting("Center"); Nastaveni.BigFont = Nastaveni.GetSetting("BigFont"); Nastaveni.NoLineBreaks = Nastaveni.GetSetting("NoLineBreaks"); DataManager.LoadSongs(); // Set our view from the "main" layout resource SetContentView(Resource.Layout.main); // Find views var pager = FindViewById<ViewPager>(Resource.Id.pager); var tabLayout = FindViewById<TabLayout>(Resource.Id.sliding_tabs); var adapter = new CustomPagerAdapter(this, SupportFragmentManager); //var toolbar = FindViewById<Toolbar>(Resource.Id.my_toolbar); MyPager = pager; //IOnPageChangeListener l = new pager.AddOnPageChangeListener(new MyOnPageChangeListener()); // Setup Toolbar //SetSupportActionBar(toolbar); //SupportActionBar.Title = "Test"; // Set adapter to view pager pager.Adapter = adapter; //pager.SetCurrentItem(0, false); // Setup tablayout with view pager tabLayout.SetupWithViewPager(pager, true); MyTabLayout = tabLayout; Nastaveni.HideHeader = Nastaveni.GetSetting("HideHeader"); Nastaveni.HideStatusBar = Nastaveni.GetSetting("HideStatusBar"); Nastaveni.LockPortrait = Nastaveni.GetSetting("LockPortrait"); // Iterate over all tabs and set the custom view for (int i = 0; i < tabLayout.TabCount; i++) { TabLayout.Tab tab = tabLayout.GetTabAt(i); tab.SetCustomView(adapter.GetTabView(i)); } }
private void SwLockPortrait_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { var sw = PageFragment.view4.FindViewById <Switch>(Resource.Id.swLockPortrait); if (sw.Checked) { Nastaveni.LockPortrait = true; Nastaveni.SaveSetting("LockPortrait", true); } else { Nastaveni.LockPortrait = false; Nastaveni.SaveSetting("LockPortrait", false); } }
private void SwStatusBar_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { var sw = PageFragment.view4.FindViewById <Switch>(Resource.Id.swHideStatusBar); if (sw.Checked) { Nastaveni.HideStatusBar = true; Nastaveni.SaveSetting("HideStatusBar", true); } else { Nastaveni.HideStatusBar = false; Nastaveni.SaveSetting("HideStatusBar", false); } }
private void SwLineBreaks_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { var sw = PageFragment.view4.FindViewById <Switch>(Resource.Id.swLineBreaks); if (sw.Checked) { Nastaveni.NoLineBreaks = true; Nastaveni.SaveSetting("NoLineBreaks", true); } else { Nastaveni.NoLineBreaks = false; Nastaveni.SaveSetting("NoLineBreaks", false); } }
private void SwChorusMany_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { var sw = PageFragment.view4.FindViewById <Switch>(Resource.Id.swChorusMany); if (sw.Checked) { Nastaveni.ChorusMany = true; Nastaveni.SaveSetting("ChorusMany", true); } else { Nastaveni.ChorusMany = false; Nastaveni.SaveSetting("ChorusMany", false); } }
void ViewPager.IOnPageChangeListener.OnPageSelected(int position) { switch (position) { //case 0: // Nastaveni.SetView1(); // break; case 0: Nastaveni.SetView2(); break; case 1: Nastaveni.SetView3(); break; case 2: Nastaveni.SetView4(); break; } }