//private IList<RideModel> rides; protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); IEnumerable <Account> accounts = AccountStore.Create(this).FindAccountsForService("google"); Account useraccount = accounts.FirstOrDefault(); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; SetContentView(Resource.Layout.Rides); ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText("Rides"); tab.SetIcon(Resource.Drawable.bunchy); tab.TabSelected += (sender, args) => { // Do something when tab is selected }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Following"); tab.SetIcon(Resource.Drawable.bunchy); tab.TabSelected += (sender, args) => { // Do something when tab is selected }; ActionBar.AddTab(tab); var ridesAdapter = new RidesAdapter(this, useraccount.Username); var ridesListView = FindViewById <ListView> (Resource.Id.rideListView); ridesListView.Adapter = ridesAdapter; ridesListView.ItemClick += OnRideItemClick; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.SetDisplayShowTitleEnabled(false); ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText("Stolen Bike Brands"); tab.SetIcon(Resource.Drawable.Icon); tab.TabSelected += (sender, args) => { listofpieChart data = new listofpieChart(); List <string> test = data.listofpieChart1(); ListAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleDropDownItem1Line, test); }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Favorite Stolen Bike Colors"); tab.SetIcon(Resource.Drawable.Icon); tab.TabSelected += (sender, args) => { listofpieChartColor data2 = new listofpieChartColor(); List <string> test2 = data2.listofpieChart1(); ListAdapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleDropDownItem1Line, test2); }; ActionBar.AddTab(tab); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.tablayout); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.SetDisplayShowTitleEnabled(false); ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText("Group Bar Chart"); tab.SetIcon(Resource.Drawable.barfix); tab.TabSelected += (sender, args) => { SetContentView(Resource.Layout.barChartEdit); List <string> spinnerArray = new List <string>(); List <string> Buurten = preLoad.csvFD.getBuurten(); Dictionary <int, string> Districts = new Dictionary <int, string>(); Districts.Add(3, "Delfshaven"); Districts.Add(4, "Centrum"); Districts.Add(5, "Noord-Hillegersberg"); Districts.Add(6, "Kralingen/Crooswijk"); Districts.Add(9, "Feijenoord"); Districts.Add(10, "Charlois"); foreach (string item in Buurten) { if (item.Length > 0) { spinnerArray.Add(item.Remove(0, 2)); } } Spinner spinner = FindViewById <Spinner>(Resource.Id.spinner); spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected); var adapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleSpinnerItem, spinnerArray); adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinner.Adapter = adapter; }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Single Bar Chart"); tab.SetIcon(Resource.Drawable.barfix); tab.TabSelected += (sender, args) => { SetContentView(Resource.Layout.barChart); PlotView view = FindViewById <PlotView>(Resource.Id.plot_view_bar); CreateBarChart barchart = new CreateBarChart(); view.Model = barchart.CreatePlotModel(); }; ActionBar.AddTab(tab); }
//protected override void OnElementChanged(VisualElement oldModel, VisualElement newModel) //protected override void OnElementChanged(ElementChangedEventArgs<TabbedPage> e) protected override void OnDraw(Canvas canvas) { _activity = this.Context as Activity; ActionBar actionBar = _activity.ActionBar; if (actionBar.TabCount > 0) { ActionBar.Tab tabPrompting = actionBar.GetTabAt(0); ActionBar.Tab tabActivities = actionBar.GetTabAt(1); ActionBar.Tab tabReminders = actionBar.GetTabAt(2); ActionBar.Tab tabMapping = actionBar.GetTabAt(3); ActionBar.Tab tabSettings = actionBar.GetTabAt(4); //Set the tab icons tabPrompting.SetIcon(Resource.Drawable.ic_description_white_24dp); tabActivities.SetIcon(Resource.Drawable.ic_local_activity_white_24dp); tabReminders.SetIcon(Resource.Drawable.ic_schedule_white_24dp); tabMapping.SetIcon(Resource.Drawable.ic_map_white_24dp); tabSettings.SetIcon(Resource.Drawable.ic_settings_white_24dp); //Remove the page's title from the tab tabPrompting.SetText(""); tabActivities.SetText(""); tabReminders.SetText(""); tabMapping.SetText(""); tabSettings.SetText(""); base.OnDraw(canvas); } }
public static void SetTabIcon(int tab, bool active = true) { if (m_actionBars.Count > tab) { ActionBar.Tab curr = m_actionBars[tab]; ScriptingFragment fragment = ScriptingFragment.GetFragment(tab); int resourceId = fragment.GetViewImage(active); curr.SetIcon(resourceId); } }
void AddTabToActionBar(string tabTitle) { ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText(tabTitle); tab.SetIcon(Android.Resource.Drawable.IcInputAdd); tab.TabSelected += TabOnTabSelected; ActionBar.AddTab(tab); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.Tab mytab = ActionBar.NewTab(); mytab.SetText(Resource.String.tab1_text); mytab.SetIcon(Resource.Drawable.images); mytab.TabSelected += Mytab_TabSelected; ActionBar.AddTab(mytab); mytab = ActionBar.NewTab(); mytab.SetText(Resource.String.tab2_text); mytab.SetIcon(Resource.Drawable.download); mytab.TabReselected += Mytab_TabReselected; ActionBar.AddTab(mytab); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); this.SetContentView(Resource.Layout.ThreeView); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText(Resources.GetString(Resource.String.Home)); tab.SetIcon(Resource.Drawable.Icon); tab.SetTabListener(new TabListener <HomeFragment>(this, "Home")); ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText(Resources.GetString(Resource.String.Games)); tab.SetIcon(Resource.Drawable.Icon); tab.SetTabListener(new TabListener <GamesFragment>(this, "Games")); ActionBar.AddTab(tab); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); this.ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText(Resources.GetString(Resource.String.setting_tab_name)); tab.SetIcon(Android.Resource.Drawable.IcMenuPreferences); tab.TabSelected += (sender, args) => { // Do something when tab is selected }; this.ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText(Resources.GetString(Resource.String.company_tab_name)); tab.SetIcon(Android.Resource.Drawable.IcMenuSave); tab.TabSelected += (sender, args) => { // Do something when tab is selected }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText(Resources.GetString(Resource.String.order_tab_name)); tab.SetIcon(Android.Resource.Drawable.IcMenuSearch); tab.TabSelected += (sender, args) => { // Do something when tab is selected }; ActionBar.AddTab(tab); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it Button button = FindViewById <Button> (Resource.Id.myButton); button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.tablayout); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.SetDisplayShowTitleEnabled(false); ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText("PieChart Stolen Brands"); tab.SetIcon(Resource.Drawable.piefix); tab.TabSelected += (sender, args) => { SetContentView(Resource.Layout.barChart); PlotView view = FindViewById <PlotView>(Resource.Id.plot_view_bar); CreatePieChart barchart = new CreatePieChart(); view.Model = barchart.CreatePlotModel(); }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Favorite Stolen Bike Colors"); tab.SetIcon(Resource.Drawable.piefix); tab.TabSelected += (sender, args) => { SetContentView(Resource.Layout.barChart); PlotView view = FindViewById <PlotView>(Resource.Id.plot_view_bar); CreatePieChart2 pieChart = new CreatePieChart2(); view.Model = pieChart.CreatePlotModel(); }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("List for piecharts"); tab.TabSelected += (sender, args) => { var intent = new Intent(this, typeof(pielist)); StartActivity(intent); }; ActionBar.AddTab(tab); }
void TabSetup(ActionBar.Tab tab, int resourceId) { if (resourceId != 0) { //if (Droid.OS.Build.VERSION.SdkInt > Droid.OS.BuildVersionCodes.JellyBeanMr1) { // ImageView iv = new ImageView(activity); // iv.SetImageResource(resourceId); // iv.SetPadding(-25, 8, -25, 16); // tab.SetCustomView(iv); //} else { tab.SetIcon(resourceId); tab.SetText(""); //} } tab.TabSelected -= TabOnTabSelected; tab.TabSelected += TabOnTabSelected; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.tablayout); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.SetDisplayShowTitleEnabled(false); ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText("LineChart"); tab.SetIcon(Resource.Drawable.linefix); tab.TabSelected += (sender, args) => { SetContentView(Resource.Layout.barChart); PlotView view = FindViewById <PlotView>(Resource.Id.plot_view_bar); CreateLineChart linechart = new CreateLineChart(); view.Model = linechart.CreatePlotModel(); }; ActionBar.AddTab(tab); }
private void AddTab(string tabText, int iconResourceId, Fragment view) { ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText(tabText); tab.SetIcon(iconResourceId); tab.TabSelected += delegate(object sender, ActionBar.TabEventArgs e) { Fragment fragment = FragmentManager.FindFragmentById(Resource.Id.fragmentContainer); if (fragment != null) { e.FragmentTransaction.Remove(fragment); } e.FragmentTransaction.Add(Resource.Id.fragmentContainer, view); }; tab.TabUnselected += delegate(object sender, ActionBar.TabEventArgs args) { args.FragmentTransaction.Remove(view); }; ActionBar.AddTab(tab); }
protected override void OnCreate(Bundle savedInstanceState) { //Calendar ID on phone _calId = Intent.GetIntExtra("calId", 1); base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.tablayout); ActionBar.SetDisplayShowTitleEnabled(false); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.SetDisplayShowTitleEnabled(false); ActionBar.Tab tab = ActionBar.NewTab(); tab.SetText("Calendar"); tab.SetIcon(Resource.Drawable.biconfix); tab.TabSelected += (sender, args) => { SetContentView(Resource.Layout.savebike); var a = new AddEventCalendar(); DateTime dateTime1 = new DateTime(); DateTime dateTime2 = new DateTime(); var button1 = FindViewById <Button>(Resource.Id.button1); var button2 = FindViewById <Button>(Resource.Id.button2); var button3 = FindViewById <Button>(Resource.Id.button3); var timePicker = FindViewById <TimePicker>(Resource.Id.timePicker1); var datePicker = FindViewById <DatePicker>(Resource.Id.datePicker1); var label1 = FindViewById <TextView>(Resource.Id.textView1); var label2 = FindViewById <TextView>(Resource.Id.textView2); var textbox1 = FindViewById <EditText>(Resource.Id.editText1); var textbox2 = FindViewById <EditText>(Resource.Id.editText2); timePicker.SetIs24HourView(Java.Lang.Boolean.True); int status = 0; button1.Click += delegate { if (status == 0) { status = 1; } else if (status == 1 || status == 2) { status = 0; } else { Address adres = adresC.GetAddress(); textbox2.Text = "Location: " + adres.GetAddressLine(0) + " " + adres.GetAddressLine(1); } this.switchState(status, button1, button2, button3, datePicker, timePicker, label1, label2, textbox1, textbox2); }; button2.Click += delegate { if (status == 1) { status = 2; } else if (status == 2) { status = 1; } else if (status == 3) { try { a.AddEvent(this, _calId, textbox1.Text, textbox2.Text, dateTime1, dateTime2); button2.Text = "Succes! Tap here to go back"; status = 4; } catch { button2.Text = "Failed, tap here to try again"; } } else { //System.Diagnostics.Debug.WriteLine("AAAAAmemes"); this.Finish(); } this.switchState(status, button1, button2, button3, datePicker, timePicker, label1, label2, textbox1, textbox2); }; button3.Click += delegate { if (status == 2) { dateTime1 = dateTimeAdapter(datePicker.DateTime, timePicker.CurrentHour, timePicker.CurrentMinute); dateTime2 = dateTimeAdapter(datePicker.DateTime, timePicker.CurrentHour, timePicker.CurrentMinute, 1); System.Diagnostics.Debug.WriteLine(dateTime1.ToString() + "----" + dateTime2.ToString()); status = 3; } this.switchState(status, button1, button2, button3, datePicker, timePicker, label1, label2, textbox1, textbox2); }; //AddEventCalendar.AddEvent(this, _calId, "This is a Test", "Lorem Ipsum perpetuum mobile", )) }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Memo"); tab.SetIcon(Resource.Drawable.biconfix); tab.TabSelected += (sender, args) => { SetContentView(Resource.Layout.savebike2); Button writeNote = FindViewById <Button>(Resource.Id.writeNote); TextView writeResponse = FindViewById <TextView>(Resource.Id.writeResponse); writeNote.Click += delegate { Address adres = adresC.GetAddress(); SaveMemo test = new SaveMemo(adres); test.WriteFile(); writeResponse.Text = "Your bike location has been saved in your downloads folder."; writeNote.Visibility = ViewStates.Invisible; }; }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Maps"); tab.SetIcon(Resource.Drawable.biconfix); tab.TabSelected += (sender, args) => { var intent = new Intent(this, typeof(gmaps)); StartActivity(intent); }; ActionBar.AddTab(tab); }
private void LoadTabs() { ActionBar.Tab tab = ActionBar.NewTab(); ActionBar.NavigationMode = ActionBarNavigationMode.Tabs; ActionBar.SetBackgroundDrawable(new ColorDrawable(Android.Graphics.Color.ParseColor(GeneralSettings.AndroidActionBarColor))); //tab.SetText("News"); tab.SetText("Nyheter"); tab.SetIcon(null); tab.TabSelected += async(sender, args) => { sSelectedTab = "news"; SetContentView(Resource.Layout.NewsfeedView); await LoadNewsfeedView(); }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Din kod"); tab.SetIcon(null); tab.TabSelected += (sender, args) => { sSelectedTab = "id"; SetContentView(Resource.Layout.IdView); LoadIdView(); }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Erbjudanden"); tab.SetIcon(null); tab.TabSelected += (sender, args) => { if (GeneralSettings.UseLoyaltyCard) { sSelectedTab = "offersWithLoyalty"; SetContentView(Resource.Layout.OffersView); LoadOffersView(); } else { sSelectedTab = "offersWithoutLoyalty"; SetContentView(Resource.Layout.OfferSingleView); LoadOffersSingleView(); } }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Övrigt"); tab.SetIcon(null); tab.TabSelected += (sender, args) => { sSelectedTab = "more"; SetContentView(Resource.Layout.MoreView); LoadMoreFeed(); }; ActionBar.AddTab(tab); tab = ActionBar.NewTab(); tab.SetText("Profil"); tab.SetIcon(null); tab.TabSelected += (sender, args) => { sSelectedTab = "profile"; SetContentView(Resource.Layout.ProfileView); loadProfileViewContent(true); }; ActionBar.AddTab(tab); ActionBar.SetSelectedNavigationItem(1); // SetActionbarFont(); }