protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.CorporationDetails_layout); playerRepo = PlayersRepositoryService.Instance; gameRepo = GameRepositoryService.Instance; gameId = Intent.GetIntExtra("gameId", 1); isExisting = Intent.GetBooleanExtra("isExisting", false); if (isExisting) { existingPlayerName = Intent.GetStringExtra("playerName"); existingGameId = Intent.GetIntExtra("GameID", 0); existingCorporation = gameRepo.GetCorporation(existingGameId, existingPlayerName); } ConnectViews(); if (isExisting) { SetupExistingCorporationValues(); playerLayout.Visibility = ViewStates.Gone; } }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { repo = PlayersRepositoryService.Instance; playersList = repo.GetAllPlayers(); repo.SetPlayerStatistic(); View view = inflater.Inflate(Resource.Layout.playersFragment_layout, container, false); playersRecyclerView = (RecyclerView)view.FindViewById(Resource.Id.playersRecyclerView); addPlayerFloatingActionButton = (FloatingActionButton)view.FindViewById(Resource.Id.addPlayerFab); addPlayerFloatingActionButton.Click += AddPlayerFloatingActionButton_Click; SetupRecyclerView(); return(view); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.newPlayer_activity); repo = PlayersRepositoryService.Instance; playerName = (EditText)FindViewById(Resource.Id.newPlayerNameEditText); saveButton = (Button)FindViewById(Resource.Id.newPlayerSaveButton); deleteButton = (Button)FindViewById(Resource.Id.deletePlayerButton); deleteButton.Visibility = ViewStates.Gone; saveButton.Click += SaveButton_Click; existingPlayerName = Intent.GetStringExtra("playerName"); if (!string.IsNullOrEmpty(existingPlayerName)) { playerName.Text = existingPlayerName; deleteButton.Activated = true; deleteButton.Visibility = ViewStates.Visible; } deleteButton.Click += DeleteButton_Click; }