Skip to content

Commit

Permalink
Show shortDescription as subtitle in InfoActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
teinvdlugt committed May 23, 2016
1 parent 144d87c commit 4761ba9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
if (savedInstanceState != null) {
backStack = (ArrayList<Info>) savedInstanceState.getSerializable(BACK_STACK);
posInBackStack = savedInstanceState.getInt(POS_IN_BACK_STACK, 0);
showInfo();
}
if (backStack == null || backStack.isEmpty()) {
Info info = (Info) getIntent().getSerializableExtra(INFO_EXTRA);
Expand All @@ -40,7 +41,12 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
}
}

public void setSubtitle(String subtitle) {
if (getSupportActionBar() != null) getSupportActionBar().setSubtitle(subtitle);
}

private void showInfo() {
setSubtitle(null);
Info info = backStack.get(posInBackStack);
switch (info.infoType) {
case Info.INFO_TYPE_PERSON:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ protected void onPostExecute(Void aVoid) {
if (name != null) {
getActivity().setTitle(name);
}
/*if (shortDescription != null && getSupportActionBar() != null) {
TODO getSupportActionBar().setSubtitle(shortDescription);
}*/
if (shortDescription != null) {
((InfoActivity) getActivity()).setSubtitle(shortDescription);
}
if (description != null) {
descriptionTV.setText(description);
} else {
Expand Down

0 comments on commit 4761ba9

Please sign in to comment.