mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-14 05:52:52 +00:00
Apply top margin to the first entry if there are no groups
This commit is contained in:
parent
5f737582fb
commit
9c907cf14a
1 changed files with 5 additions and 0 deletions
|
@ -419,6 +419,7 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener {
|
||||||
public void setGroups(TreeSet<String> groups) {
|
public void setGroups(TreeSet<String> groups) {
|
||||||
_groups = groups;
|
_groups = groups;
|
||||||
_groupChip.setVisibility(_groups.isEmpty() ? View.GONE : View.VISIBLE);
|
_groupChip.setVisibility(_groups.isEmpty() ? View.GONE : View.VISIBLE);
|
||||||
|
updateDividerDecoration();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateDividerDecoration() {
|
private void updateDividerDecoration() {
|
||||||
|
@ -471,6 +472,10 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
|
||||||
|
if (parent.getChildAdapterPosition(view) == 0 && (_groups == null || _groups.isEmpty())) {
|
||||||
|
// the first item should also have a top margin
|
||||||
|
outRect.top = _height;
|
||||||
|
}
|
||||||
outRect.bottom = _height;
|
outRect.bottom = _height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue