protected override void OnCreate(Bundle bundle) { try { RequestWindowFeature(WindowFeatures.NoTitle); base.OnCreate(bundle); SetContentView(Resource.Layout.Login); LoggerMobile.Instance.logMessage("Opening LoginAcitvity", LoggerEnum.message); LegacyBar = FindViewById<LegacyBar.Library.Bar.LegacyBar>(Resource.Id.actionbar); LegacyBar.SetHomeLogo(Resource.Drawable.icon); LegacyBarAction signUpAction = new DefaultLegacyBarAction(this, CreateSignUpIntent(), Resource.Drawable.social_add_person); LegacyBar.AddAction(signUpAction); LegacyBar.SeparatorColor = Color.Purple; AddHomeAction(typeof(Main), Resource.Drawable.icon); // Get our button from the layout resource, // and attach an event to it var loginBtn = FindViewById<Button>(Resource.Id.loginBtn); loginBtn.Click += loginBtn_Click; var signUpBtn = FindViewById<Button>(Resource.Id.signUpBtn); signUpBtn.Click += signUpBtn_Click; } catch (Exception exception) { ErrorHandler.Save(exception, MobileTypeEnum.Android, (Context)this); } }
protected override void OnCreate(Bundle bundle) { try { RequestWindowFeature(WindowFeatures.NoTitle); base.OnCreate(bundle); SetContentView(Resource.Layout.Main); LoggerMobile.Instance.logMessage("Opening Main", LoggerEnum.message); LegacyBar = FindViewById<LegacyBar.Library.Bar.LegacyBar>(Resource.Id.actionbar); LegacyBar.SetHomeLogo(Resource.Drawable.icon); LegacyBar.SeparatorColor = Color.Purple; if (SettingsMobile.Instance.User != null && SettingsMobile.Instance.User.IsLoggedIn) { LegacyBarAction loginAction = new DefaultLegacyBarAction(this, CreateSettingsIntent(), Resource.Drawable.action_settings); LegacyBar.AddAction(loginAction); } else { LegacyBarAction loginAction = new DefaultLegacyBarAction(this, CreateLoginIntent(), Resource.Drawable.social_person); LegacyBar.AddAction(loginAction); } var skatersBtn = FindViewById<Button>(Resource.Id.skatersBtn); skatersBtn.Click += skatersBtn_Click; var leaguesBtn = FindViewById<Button>(Resource.Id.leaguesBtn); leaguesBtn.Click += leaguesBtn_Click; var gamesBtn = FindViewById<Button>(Resource.Id.gamesBtn); gamesBtn.Click += gamesBtn_Click; var calendarBtn = FindViewById<Button>(Resource.Id.calendarBtn); calendarBtn.Click += calendarBtn_Click; var shopsBtn = FindViewById<Button>(Resource.Id.shopsBtn); shopsBtn.Click += shopsBtn_Click; LegacyBarAction infoAction = new DefaultLegacyBarAction(this, CreateInfoIntent(), Resource.Drawable.action_about); LegacyBar.AddAction(infoAction); //throw new Exception("BoomAndroid"); } catch (Exception exception) { ErrorHandler.Save(exception, MobileTypeEnum.Android, (Context)this); } }
protected override void OnCreate(Bundle bundle) { try { RequestWindowFeature(WindowFeatures.NoTitle); base.OnCreate(bundle); LoggerMobile.Instance.logMessage("Opening LeaguesActibity", LoggerEnum.message); SetContentView(Resource.Layout.PublicLeagues); LegacyBar = FindViewById<LegacyBar.Library.Bar.LegacyBar>(Resource.Id.actionbar); LegacyBar.SetHomeLogo(Resource.Drawable.icon); LegacyBar.SeparatorColor = Color.Purple; LegacyBarAction azAction = new MenuAction(this, null, Resource.Drawable.a_z); LegacyBar.AddAction(azAction); LegacyBar = FindViewById<LegacyBar.Library.Bar.LegacyBar>(Resource.Id.actionbar); AddHomeAction(typeof(Main), Resource.Drawable.icon); // Get our button from the layout resource, // and attach an event to it Action<LeaguesJson> leagues = new Action<LeaguesJson>(UpdateAdapter); LegacyBar.ProgressBarVisibility = ViewStates.Visible; League.PullLeagues(lastPagePulled, PAGE_COUNT, "", (Context)this, leagues); skaterList = FindViewById<ListView>(Resource.Id.leagueList); initialArray = new LeaguesJson(); Action pullMore= new Action(PullMore); ListAdapter = new LeagueAdapter(this, initialArray.Leagues, pullMore); skaterList.Adapter = ListAdapter; skaterList.FastScrollEnabled = true; skaterList.ItemClick += skaterList_ItemClick; var myString = new SpannableStringBuilder("lol"); Selection.SelectAll(myString); // needs selection or Index Out of bounds _dialog = new MyCharacterPickerDialog(this, new View(this), myString, options, false); _dialog.Clicked += (sender, args) => { lastPagePulled = 0; lastLetterPulled = args.Text; LegacyBar.ProgressBarVisibility = ViewStates.Visible; League.PullLeagues(0, PAGE_COUNT, lastLetterPulled, (Context)this, leagues); initialArray.Leagues.Clear(); }; search_leagues = FindViewById<EditText>(Resource.Id.search_leagues); search_leagues.TextChanged += search_skaters_TextChanged; var searchMenuItemAction = new SearchAction(this, null, Resource.Drawable.ic_action_search, search_leagues); LegacyBar.AddAction(searchMenuItemAction); LegacyBarAction infoAction = new DefaultLegacyBarAction(this, CreateInfoIntent(), Resource.Drawable.action_about); LegacyBar.AddAction(infoAction); m_AdView = FindViewById(Resource.Id.adView); if (SettingsMobile.Instance.User != null && SettingsMobile.Instance.User.IsValidSub) { } } catch (Exception exception) { ErrorHandler.Save(exception, MobileTypeEnum.Android, (Context)this); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.main); LegacyBar = FindViewById<Library.Bar.LegacyBar>(Resource.Id.actionbar); LegacyBar.SetHomeLogo(Resource.Drawable.icon); /* * You can also set the title of the LegacyBar with: * LegacyBar.Title = "MyAwesomeTitle"; * * or * * LegacyBar.Title = Resource.String.<yourStringId>; * * Title Color can be set with: * LegacyBar.TitleColor = Color.Blue; //Or any other Color you want * * The Separator between the Action Bar Items can be set with: * LegacyBar.SeparatorColor = Color.Blue; * * and with a drawable: * * LegacyBar.SeparatorDrawable = myDrawable; */ //always put these 2 in there since they are NOT in my menu.xml MenuId = Resource.Menu.mainmenu; LegacyBarAction shareAction = new DefaultLegacyBarAction(this, CreateShareIntent(), LegacyBar.LightIcons ? Resource.Drawable.ic_action_sort : Resource.Drawable.ic_action_sort_dark) { ActionType = ActionType.Always }; LegacyBar.AddAction(shareAction); var otherAction = new DefaultLegacyBarAction(this, new Intent(this, typeof (OtherActivity)), LegacyBar.LightIcons ? Resource.Drawable.ic_action_share : Resource.Drawable.ic_action_share_dark) { ActionType = ActionType.Always }; LegacyBar.AddAction(otherAction); //only put in if there is room var searchMenuItemAction = new MenuItemLegacyBarAction( this, Resource.Id.menu_search, LegacyBar.LightIcons ? Resource.Drawable.ic_action_share : Resource.Drawable.ic_action_share_dark, Resource.String.menu_string_search) { ActionType = ActionType.IfRoom }; LegacyBar.AddAction(searchMenuItemAction); //never put this guy in there searchMenuItemAction = new MenuItemLegacyBarAction( this, Resource.Id.menu_refresh, LegacyBar.LightIcons ? Resource.Drawable.ic_action_refresh : Resource.Drawable.ic_action_refresh_dark, Resource.String.menu_string_refresh) { ActionType = ActionType.Never }; LegacyBar.AddAction(searchMenuItemAction); var startProgress = FindViewById<Button>(Resource.Id.start_progress); startProgress.Click += (s, e) => LegacyBar.ProgressBarVisibility = ViewStates.Visible; var stopProgress = FindViewById<Button>(Resource.Id.stop_progress); stopProgress.Click += (s, e) => LegacyBar.ProgressBarVisibility = ViewStates.Gone; var removeActions = FindViewById<Button>(Resource.Id.remove_actions); removeActions.Click += (s, e) => LegacyBar.RemoveAllActions(); var removeShareAction = FindViewById<Button>(Resource.Id.remove_share_action); removeShareAction.Click += (s, e) => LegacyBar.RemoveAction(shareAction); var addAction = FindViewById<Button>(Resource.Id.add_action); addAction.Click += (s, e) => { var action = new MyOtherActionBarAction(this, null, LegacyBar.LightIcons ? Resource.Drawable.ic_action_share : Resource.Drawable.ic_action_share_dark); LegacyBar.AddAction(action); }; var removeAction = FindViewById<Button>(Resource.Id.remove_action); removeAction.Click += (s, e) => { LegacyBar.RemoveActionAt(LegacyBar.ActionCount - 1); Toast.MakeText(this, "Removed legacyBarAction.", ToastLength.Short).Show(); }; var otherActivity = FindViewById<Button>(Resource.Id.other_activity); otherActivity.Click += (s, e) => { var intent = new Intent(this, typeof (OtherActivity)); StartActivity(intent); }; var black = FindViewById<Button>(Resource.Id.black_activity); black.Click += (s, e) => { var intent = new Intent(this, typeof(OtherActivity)); intent.PutExtra("Theme", (int)LegacyBarTheme.HoloBlack); StartActivity(intent); }; var blue = FindViewById<Button>(Resource.Id.blue_activity); blue.Click += (s, e) => { var intent = new Intent(this, typeof(OtherActivity)); intent.PutExtra("Theme", (int)LegacyBarTheme.HoloBlue); StartActivity(intent); }; var light = FindViewById<Button>(Resource.Id.light_activity); light.Click += (s, e) => { var intent = new Intent(this, typeof(OtherActivity)); intent.PutExtra("Theme", (int)LegacyBarTheme.HoloLight); StartActivity(intent); }; var gray = FindViewById<Button>(Resource.Id.gray_activity); gray.Click += (s, e) => { var intent = new Intent(this, typeof(OtherActivity)); intent.PutExtra("Theme", (int) LegacyBarTheme.HoloGray); StartActivity(intent); }; var fragmentActivity = FindViewById<Button>(Resource.Id.fragment_activity); fragmentActivity.Click += (s, e) => { var intent = new Intent(this, typeof (FragmentTabActivity)); StartActivity(intent); }; var spinnerActivity = FindViewById<Button>(Resource.Id.dropdown_activity); spinnerActivity.Click += (s, e) => { var intent = new Intent(this, typeof(SpinnerActivity)); StartActivity(intent); }; }
protected override void OnCreate(Bundle bundle) { try { RequestWindowFeature(WindowFeatures.NoTitle); base.OnCreate(bundle); LoggerMobile.Instance.logMessage("Opening EventsActivity", LoggerEnum.message); SetContentView(Resource.Layout.PublicEvents); LegacyBar = FindViewById<LegacyBar.Library.Bar.LegacyBar>(Resource.Id.actionbar); LegacyBar.SetHomeLogo(Resource.Drawable.icon); LegacyBar.SeparatorColor = Color.Purple; LegacyBar = FindViewById<LegacyBar.Library.Bar.LegacyBar>(Resource.Id.actionbar); AddHomeAction(typeof(Main), Resource.Drawable.icon); // Get our button from the layout resource, // and attach an event to it Action<EventsJson> evs = new Action<EventsJson>(UpdateAdapter); LegacyBar.ProgressBarVisibility = ViewStates.Visible; eventsList = FindViewById<ListView>(Resource.Id.eventsList); initialArray = new EventsJson(); Action pullMore = new Action(PullMore); RDNation.Droid.Classes.Public.Calendar.PullEvents(lastPagePulled, PAGE_COUNT, (Context)this, evs); ListAdapter = new EventsAdapter(this, initialArray.Events, pullMore); eventsList.Adapter = ListAdapter; eventsList.FastScrollEnabled = true; eventsList.ItemClick += skaterList_ItemClick; var myString = new SpannableStringBuilder("lol"); Selection.SelectAll(myString); // needs selection or Index Out of bounds search_events = FindViewById<EditText>(Resource.Id.search_events); search_events.TextChanged += search_skaters_TextChanged; var searchMenuItemAction = new SearchAction(this, null, Resource.Drawable.ic_action_search, search_events); LegacyBar.AddAction(searchMenuItemAction); InitializeLocationManager(); LegacyBarAction infoAction = new DefaultLegacyBarAction(this, CreateInfoIntent(), Resource.Drawable.action_about); LegacyBar.AddAction(infoAction); m_AdView = FindViewById(Resource.Id.adView); if (SettingsMobile.Instance.User != null && SettingsMobile.Instance.User.IsValidSub) { } } catch (Exception exception) { ErrorHandler.Save(exception, MobileTypeEnum.Android, (Context)this); } }
protected override void OnCreate(Bundle bundle) { try { RequestWindowFeature(WindowFeatures.NoTitle); base.OnCreate(bundle); LoggerMobile.Instance.logMessage("Opening GamesActivity", LoggerEnum.message); SetContentView(Resource.Layout.PublicGames); LegacyBar = FindViewById<LegacyBar.Library.Bar.LegacyBar>(Resource.Id.actionbar); LegacyBar.SeparatorColor = Color.Purple; AddHomeAction(typeof(Main), Resource.Drawable.icon); // Get our button from the layout resource, // and attach an event to it LegacyBar.ProgressBarVisibility = ViewStates.Visible; //currentGamesList = FindViewById<ListView>(Resource.Id.currentGamesList); pastGamesList = FindViewById<ListView>(Resource.Id.pastGamesList); LegacyBarAction loginAction = new RefreshAction(this, null, Resource.Drawable.ic_action_refresh, this); LegacyBar.AddAction(loginAction); initialPastArray = new GamesJson(); //initialCurrentArray = new GamesJson(); Action pullMorePast = new Action(PullMorePast); //Action pullCurrent = new Action(PullMorePast); PastGamesAdapter = new GamesAdapter(this, initialPastArray.Games, pullMorePast); //CurrentGamesAdapter = new GamesAdapter(this, initialCurrentArray.Games, null); //currentGamesList.Adapter = CurrentGamesAdapter; pastGamesList.Adapter = PastGamesAdapter; Game.PullCurrentGames(this, UpdateCurrentAdapter); Game.PullPastGames(PAGE_COUNT, lastPagePulled, this, UpdatePastAdapter); //currentGamesList.ItemClick += currentGamesList_ItemClick; pastGamesList.ItemClick += pastGamesList_ItemClick; var myString = new SpannableStringBuilder("lol"); Selection.SelectAll(myString); // needs selection or Index Out of bounds LegacyBarAction infoAction = new DefaultLegacyBarAction(this, CreateInfoIntent(), Resource.Drawable.action_about); LegacyBar.AddAction(infoAction); m_AdView = FindViewById(Resource.Id.adView); if (SettingsMobile.Instance.User != null && SettingsMobile.Instance.User.IsValidSub) { } } catch (Exception exception) { ErrorHandler.Save(exception, MobileTypeEnum.Android, (Context)this); } }