Skip to content

Commit

Permalink
suit type hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
mattvb91 committed Nov 27, 2016
1 parent 0dad3e4 commit baf2821
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
13 changes: 10 additions & 3 deletions app/src/main/java/mavonie/subterminal/Forms/JumpForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,20 @@ protected void updateForm() {

this.date.setText(getItem().getDate());
this.pilotChute.setSelection(Arrays.asList(Jump.getPcSizeArray()).indexOf(getItem().getPc_size()));
this.jumpTypeSpinner.setSelection(getItem().getType(), false);

if (getItem().getType() != null) {
this.jumpTypeSpinner.setSelection(getItem().getType(), false);
}

this.suits.clear();
this.suits.putAll(new Suit().getItemsForSpinner(convertTypes(getItem().getType())));
this.suitsAdapter.notifyDataSetChanged();

if (getItem().getType() != null) {
this.suits.putAll(new Suit().getItemsForSpinner(convertTypes(getItem().getType())));
this.suitsAdapter.notifyDataSetChanged();
}
suitSpinner.setAdapter(this.suitsAdapter);
if (getItem().getSuit_id() != null) {
suitEntry = suitsAdapter.getItem(this.suitsAdapter.findPositionFromKey(getItem().getSuit_id()));
suitSpinner.setSelection(this.suitsAdapter.findPositionFromKey(getItem().getSuit_id()), false);
}

Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/mavonie/subterminal/Models/Jump.java
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,11 @@ public String getFormattedDelay() {
}

public String getFormattedType() {
return getTypeArray()[this.getType()];
if(this.getType() != null) {
return getTypeArray()[this.getType()];
}

return null;
}

@Override
Expand Down

0 comments on commit baf2821

Please sign in to comment.