public static void assistActivity(Activity activity)
 {
     aaa = new AndroidBug5497Workaround(activity);
 }
Пример #2
0
        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);
        }