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 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 SwBigFont_CheckedChange(object sender, CompoundButton.CheckedChangeEventArgs e) { var sw = PageFragment.view4.FindViewById <Switch>(Resource.Id.swBigFont); if (sw.Checked) { Nastaveni.BigFont = true; Nastaveni.SaveSetting("BigFont", true); } else { Nastaveni.BigFont = false; Nastaveni.SaveSetting("BigFont", 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; } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.main); 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(); // 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)); } Bitmap bm = BitmapFactory.DecodeResource(Resources, Resource.Drawable.ic_launcher_round); TaskDescription taskDesc = new TaskDescription("Tylko Mu Wierz", bm, new Android.Graphics.Color(234, 206, 96)); SetTaskDescription(taskDesc); AndroidBug5497Workaround.assistActivity(MainActivity.MyActivity); }