protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); adapter = new MyPagerAdapter (this, SupportFragmentManager); pager = FindViewById<ViewPager> (Resource.Id.pager); tabs = FindViewById<PagerSlidingTabStrip> (Resource.Id.tabs); pager.Adapter = adapter; tabs.SetViewPager (pager); tabs.OnPageChangeListener = this; var pageMargin = (int)TypedValue.ApplyDimension (ComplexUnitType.Dip, 4, Resources.DisplayMetrics); pager.PageMargin = pageMargin; pager.OffscreenPageLimit = 4; if (Settings.FirstRun) { pager.CurrentItem = 2; App.MessageDialog.SendMessage (Resources.GetString(Resource.String.get_started_welcome), Resources.GetString(Resource.String.welcome_to_kinderchat)); } else { pager.CurrentItem = 0; } SupportActionBar.SetDisplayHomeAsUpEnabled (false); SupportActionBar.SetHomeButtonEnabled (false); // Register for GCM KinderGcmService.Register (this); }
protected override void OnCreate (Bundle bundle) { base.OnCreate(bundle); adapter = new MyPagerAdapter(this, SupportFragmentManager); pager = FindViewById<ViewPager>(Resource.Id.pager); tabs = FindViewById<PagerSlidingTabStrip>(Resource.Id.tabs); tabs.SetBackgroundResource (Settings.AppTheme == AppTheme.Red ? Resource.Drawable.red_gradient : Resource.Drawable.blue_gradient); pager.Adapter = adapter; tabs.SetViewPager(pager); tabs.OnPageChangeListener = this; var pageMargin = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 4, Resources.DisplayMetrics); pager.PageMargin = pageMargin; pager.OffscreenPageLimit = 4; if (Settings.FirstRun) { pager.CurrentItem = 2; App.MessageDialog.SendMessage(Resources.GetString(Resource.String.get_started_welcome), Resources.GetString(Resource.String.welcome_to_kinderchat)); } else { pager.CurrentItem = 0; } //IntentFilter connectivityIntentFilter = new IntentFilter(); //connectivityIntentFilter.AddAction(Android.Net.ConnectivityManager.ConnectivityAction); //RegisterReceiver(new NetworkChangeReceiver(), connectivityIntentFilter); // Register for GCM KinderGcmService.Register(this); App.ConnectionManager.TryKeepConnectionAsync (); }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); adapter = new MyPagerAdapter(SupportFragmentManager); pager = FindViewById<ViewPager> (Resource.Id.pager); tabs = FindViewById<PagerSlidingTabStrip> (Resource.Id.tabs); pager.Adapter = adapter; tabs.Visibility = ViewStates.Invisible; tabs.SetViewPager (pager); var pageMargin = (int)TypedValue.ApplyDimension (ComplexUnitType.Dip, 4, Resources.DisplayMetrics); pager.PageMargin = pageMargin; tabs.OnPageChangeListener = this; PageIndicator mIndicator = FindViewById<CirclePageIndicator> (Resource.Id.indicator); mIndicator.SetViewPager (pager); mIndicator.SetOnPageChangeListener (new MyPageChangeListener (this)); // timer.Elapsed+=timer_Elapsed; // timer.Start(); SupportActionBar.SetDisplayHomeAsUpEnabled(false); SupportActionBar.SetHomeButtonEnabled(false); }
void GetViewReferences () { _toolbar = FindViewById<Android.Support.V7.Widget.Toolbar> (Resource.Id.toolbar); _pager = FindViewById<ViewPager> (Resource.Id.pager); _tabs = FindViewById<PagerSlidingTabStrip> (Resource.Id.tabs); _startAppButton = FindViewById<Button>(Resource.Id.done); }
protected async override void OnCreate(Bundle bundle) { base.OnCreate(bundle); ActionBar.SetDisplayHomeAsUpEnabled(true); ActionBar.SetDisplayShowHomeEnabled(true); adapter = new MyPagerAdapter(FragmentManager, this.LayoutInflater, false); pager = FindViewById<ViewPager>(Resource.Id.pager); tabs = FindViewById<PagerSlidingTabStrip>(Resource.Id.tabs); pager.Adapter = adapter; tabs.SetViewPager(pager); }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); adapter = new MyPagerAdapter(SupportFragmentManager); pager = FindViewById<ViewPager> (Resource.Id.pager); tabs = FindViewById<PagerSlidingTabStrip> (Resource.Id.tabs); pager.Adapter = adapter; tabs.SetViewPager (pager); var pageMargin = (int)TypedValue.ApplyDimension (ComplexUnitType.Dip, 4, Resources.DisplayMetrics); pager.PageMargin = pageMargin; tabs.OnTabReselectedListener = this; ChangeColor (Resources.GetColor (Resource.Color.green)); }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); adapter = new MyPagerAdapter (SupportFragmentManager); pager = FindViewById<ViewPager> (Resource.Id.pager); tabs = FindViewById<PagerSlidingTabStrip> (Resource.Id.tabs); pager.Adapter = adapter; tabs.SetViewPager (pager); pager.CurrentItem = 0; //tabs.OnTabReselectedListener = this; tabs.OnPageChangeListener = this; SupportActionBar.SetDisplayHomeAsUpEnabled (true); SupportActionBar.SetHomeButtonEnabled (true); }
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, Android.Views.ViewGroup container, Bundle savedInstanceState) { var ignored = base.OnCreateView(inflater, container, savedInstanceState); var view = inflater.Inflate(Resource.Layout.fragment_friends, null); // Create your application here this.m_ViewPager = view.FindViewById<ViewPager>(Resource.Id.viewPager); this.m_ViewPager.OffscreenPageLimit = 4; this.m_PageIndicator = view.FindViewById<PagerSlidingTabStrip>(Resource.Id.tabs); //Since we are a fragment in a fragment you need to pass down the child fragment manager! this.m_Adapter = new FriendsAdapter(this.ChildFragmentManager); this.m_ViewPager.Adapter = this.m_Adapter; this.m_PageIndicator.SetViewPager(this.m_ViewPager); return view; }
protected async override void OnCreate(Bundle bundle) { base.OnCreate(bundle); AuthenticationHelper.PlatformParameters = new PlatformParameters(this); adapter = new TabAdapter(this, SupportFragmentManager); pager = FindViewById<ViewPager>(Resource.Id.pager); tabs = FindViewById<PagerSlidingTabStrip>(Resource.Id.tabs); pager.Adapter = adapter; tabs.SetViewPager(pager); pager.OffscreenPageLimit = 2; SupportActionBar.SetDisplayHomeAsUpEnabled(false); SupportActionBar.SetHomeButtonEnabled(false); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); adapter = new MyIconPagerAdapter(SupportFragmentManager); pager = FindViewById<ViewPager>(Resource.Id.pager); tabs = FindViewById<PagerSlidingTabStrip>(Resource.Id.tabs); pager.Adapter = adapter; tabs.SetViewPager(pager); var pageMargin = (int) TypedValue.ApplyDimension(ComplexUnitType.Dip, 4, Resources.DisplayMetrics); pager.PageMargin = pageMargin; pager.CurrentItem = 1; tabs.OnTabReselectedListener = this; tabs.OnPageChangeListener = this; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); ChangeColor(Resources.GetColor(Resource.Color.green)); }
protected override void OnCreate(Bundle bundle) { RequestWindowFeature(WindowFeatures.ActionBar); base.OnCreate(bundle); // Register for tabs SetContentView(Resource.Layout.Main); tabs = FindViewById<PagerSlidingTabStrip>(Resource.Id.tabs); pager = FindViewById<ViewPager>(Resource.Id.viewPager); offlineNotice = FindViewById<RelativeLayout>(Resource.Id.offlineWarning); int pageMargin = (int) TypedValue.ApplyDimension(ComplexUnitType.Dip, 4, Resources.DisplayMetrics); pager.PageMargin = pageMargin; InitAdapter(); AndroidUtils.mainActivity = this; AndroidUtils.IsConnected(); SupportActionBar.Show(); CheckForFirstTime(); }
public PagerAdapterObserver(PagerSlidingTabStrip strip) { this.strip = strip; }
public MyOnGlobalLayoutListener(PagerSlidingTabStrip strip) { this.strip = strip; }