Skip to content

Commit

Permalink
hides indicator when media viewer has only one page
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Apr 26, 2015
1 parent ae20834 commit 1639240
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ protected void onCreate(Bundle savedInstanceState) {
final ParcelableMedia currentMedia = intent.getParcelableExtra(EXTRA_CURRENT_MEDIA);
mPagerAdapter.setMedia(accountId, media);
mIndicator.notifyDataSetChanged();
mIndicator.setVisibility(mPagerAdapter.getCount() > 1 ? View.VISIBLE : View.GONE);
final int currentIndex = ArrayUtils.indexOf(media, currentMedia);
if (currentIndex != -1) {
mViewPager.setCurrentItem(currentIndex, false);
Expand Down Expand Up @@ -239,7 +240,7 @@ private void setBarVisibility(boolean visible) {
actionBar.hide();
}

mIndicator.setVisibility(visible ? View.VISIBLE : View.GONE);
mIndicator.setVisibility(visible && mPagerAdapter.getCount() > 1 ? View.VISIBLE : View.GONE);
mMediaStatusContainer.setVisibility(isMediaStatusEnabled() && visible ? View.VISIBLE : View.GONE);
}

Expand Down

0 comments on commit 1639240

Please sign in to comment.