Move app details view up when expanding links/permissions

This commit is contained in:
Peter Serwylo 2017-03-15 13:09:55 +11:00
parent c65029ae8d
commit b01a871d9d

View File

@ -627,6 +627,9 @@ public class AppDetailsRecyclerViewAdapter
boolean shouldBeVisible = contentView.getVisibility() != View.VISIBLE; boolean shouldBeVisible = contentView.getVisibility() != View.VISIBLE;
contentView.setVisibility(shouldBeVisible ? View.VISIBLE : View.GONE); contentView.setVisibility(shouldBeVisible ? View.VISIBLE : View.GONE);
updateExpandableItem(shouldBeVisible); updateExpandableItem(shouldBeVisible);
if (shouldBeVisible && recyclerView != null) {
((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(items.indexOf(VIEWTYPE_PERMISSIONS), 0);
}
} }
}); });
headerView.setText(R.string.permissions); headerView.setText(R.string.permissions);
@ -655,6 +658,9 @@ public class AppDetailsRecyclerViewAdapter
boolean shouldBeVisible = contentView.getVisibility() != View.VISIBLE; boolean shouldBeVisible = contentView.getVisibility() != View.VISIBLE;
contentView.setVisibility(shouldBeVisible ? View.VISIBLE : View.GONE); contentView.setVisibility(shouldBeVisible ? View.VISIBLE : View.GONE);
updateExpandableItem(shouldBeVisible); updateExpandableItem(shouldBeVisible);
if (shouldBeVisible && recyclerView != null) {
((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(items.indexOf(VIEWTYPE_LINKS), 0);
}
} }
}); });
headerView.setText(R.string.links); headerView.setText(R.string.links);