protected void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); this.SetContentView(Resource.Layout.inbox); actionBar = SupportActionBar; ConfigureActionBar(); this.richPushInbox = RichPushManager.Shared().RichPushUser.Inbox; // Set up the inbox fragment this.inbox = (InboxFragment)this.SupportFragmentManager.FindFragmentById(Resource.Id.inbox); this.inbox.ListView.ChoiceMode = ChoiceMode.Single; this.inbox.ListView.SetBackgroundColor(Color.Black); // Set up the message view pager if it exists this.messagePager = (CustomViewPager)this.FindViewById(Resource.Id.message_pager); if (messagePager != null) { messagePager.Adapter = new MessageFragmentAdapter(this.SupportFragmentManager); this.messagePager.PageSelected += (sender, e) => { int position = e.P0; messages [position].MarkRead(); // Highlight the current item you are viewing in the inbox inbox.ListView.SetItemChecked(position, true); // If we are in actionMode, update the menu items if (actionMode != null) { actionMode.Invalidate(); } }; } slidingPaneLayout = (CustomSlidingPaneLayout)FindViewById(Resource.Id.sliding_pane_layout); if (slidingPaneLayout != null) { slidingPaneLayout.SetPanelSlideListener(this); slidingPaneLayout.OpenPane(); GlobalLayoutListener l = null; l = new GlobalLayoutListener(() => { // If sliding pane layout is slidable, set the actionbar to have an up action actionBar.SetDisplayHomeAsUpEnabled(slidingPaneLayout.IsSlideable); slidingPaneLayout.ViewTreeObserver.RemoveGlobalOnLayoutListener(l); }); slidingPaneLayout.ViewTreeObserver.AddOnGlobalLayoutListener(l); } // First create, try to show any messages from the intent if (savedInstanceState == null) { this.SetPendingMessageIdFromIntent(Intent); } }
/** * Configures the action bar to have a navigation list of * 'Home' and 'Inbox' */ private void ConfigureActionBar() { ActionBar actionBar = this.SupportActionBar; actionBar.SetDisplayUseLogoEnabled(true); actionBar.SetDisplayShowTitleEnabled(false); // FIXME: compiler bug: it resolves unqualified "ActionBar" as Android.App.ActionBar. actionBar.NavigationMode = Xamarin.ActionbarSherlockBinding.App.ActionBar.NavigationModeList; this.navAdapter = new ArrayAdapter <String> (this, Resource.Layout.sherlock_spinner_dropdown_item, RichPushApplication.navList); actionBar.SetListNavigationCallbacks(this.navAdapter, this); }
protected void OnCreate (Bundle savedInstanceState) { base.OnCreate (savedInstanceState); this.SetContentView (Resource.Layout.inbox); actionBar = SupportActionBar; ConfigureActionBar (); this.richPushInbox = RichPushManager.Shared ().RichPushUser.Inbox; // Set up the inbox fragment this.inbox = (InboxFragment)this.SupportFragmentManager.FindFragmentById (Resource.Id.inbox); this.inbox.ListView.ChoiceMode = ChoiceMode.Single; this.inbox.ListView.SetBackgroundColor (Color.Black); // Set up the message view pager if it exists this.messagePager = (CustomViewPager)this.FindViewById (Resource.Id.message_pager); if (messagePager != null) { messagePager.Adapter = new MessageFragmentAdapter (this.SupportFragmentManager); this.messagePager.PageSelected += (sender, e) => { int position = e.P0; messages [position].MarkRead (); // Highlight the current item you are viewing in the inbox inbox.ListView.SetItemChecked (position, true); // If we are in actionMode, update the menu items if (actionMode != null) { actionMode.Invalidate (); } }; } slidingPaneLayout = (CustomSlidingPaneLayout)FindViewById (Resource.Id.sliding_pane_layout); if (slidingPaneLayout != null) { slidingPaneLayout.SetPanelSlideListener (this); slidingPaneLayout.OpenPane (); GlobalLayoutListener l = null; l = new GlobalLayoutListener (() => { // If sliding pane layout is slidable, set the actionbar to have an up action actionBar.SetDisplayHomeAsUpEnabled (slidingPaneLayout.IsSlideable); slidingPaneLayout.ViewTreeObserver.RemoveGlobalOnLayoutListener (l); }); slidingPaneLayout.ViewTreeObserver.AddOnGlobalLayoutListener (l); } // First create, try to show any messages from the intent if (savedInstanceState == null) { this.SetPendingMessageIdFromIntent (Intent); } }
protected void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set the actionBar to have up navigation ABSActionBar actionBar = SupportActionBar; if (actionBar != null) { actionBar.SetDisplayOptions( ABSActionBar.DisplayHomeAsUp, ABSActionBar.DisplayHomeAsUp); } AirshipConfigOptions options = UAirship.Shared().AirshipConfigOptions; // Only add the push preferences if the pushServiceEnabled is true if (options.PushServiceEnabled) { this.AddPreferencesFromResource(Resource.Xml.push_preferences); } // Only add the location preferences if the locationServiceEnabled is true if (options.LocationOptions.LocationServiceEnabled) { this.AddPreferencesFromResource(Resource.Xml.location_preferences); } // Display the advanced settings if (options.PushServiceEnabled) { this.AddPreferencesFromResource(Resource.Xml.advanced_preferences); } // Creates the UAPreferenceAdapter with the entire preference screen preferenceAdapter = new UAPreferenceAdapter(PreferenceScreen); }
public void OnTabUnselected (SherlockActionBar.Tab tab, FragmentTransaction transaction) { }
public void OnTabSelected (SherlockActionBar.Tab tab, FragmentTransaction transaction) { mSelected.Text = "Selected: " + tab.Text; }
public void OnTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) { }
public void OnTabSelected (SherlockActionBar.Tab tab, FragmentTransaction transaction) { Pager.SetCurrentItem (tab.Position, true); }