fix: MediaGrid and LinkCard inset values too low, causing items to be cut by borders
This commit is contained in:
@@ -43,10 +43,18 @@ public class InsetStatusItemDecoration extends RecyclerView.ItemDecoration{
|
|||||||
boolean inset=(holder instanceof StatusDisplayItem.Holder<?> sdi) && sdi.getItem().inset;
|
boolean inset=(holder instanceof StatusDisplayItem.Holder<?> sdi) && sdi.getItem().inset;
|
||||||
if(inset){
|
if(inset){
|
||||||
if(rect.isEmpty()){
|
if(rect.isEmpty()){
|
||||||
|
if(holder instanceof MediaGridStatusDisplayItem.Holder || holder instanceof LinkCardStatusDisplayItem.Holder){
|
||||||
|
rect.set(child.getX(), i == 0 && pos > 0 && displayItems.get(pos - 1).inset ? V.dp(-10) : child.getY(), child.getX() + child.getWidth(), child.getY() + child.getHeight() + V.dp(4));
|
||||||
|
}else {
|
||||||
rect.set(child.getX(), i == 0 && pos > 0 && displayItems.get(pos - 1).inset ? V.dp(-10) : child.getY(), child.getX() + child.getWidth(), child.getY() + child.getHeight());
|
rect.set(child.getX(), i == 0 && pos > 0 && displayItems.get(pos - 1).inset ? V.dp(-10) : child.getY(), child.getX() + child.getWidth(), child.getY() + child.getHeight());
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(holder instanceof MediaGridStatusDisplayItem.Holder || holder instanceof LinkCardStatusDisplayItem.Holder){
|
||||||
|
rect.bottom=Math.max(rect.bottom, child.getY()+child.getHeight()) + V.dp(4);
|
||||||
}else {
|
}else {
|
||||||
rect.bottom=Math.max(rect.bottom, child.getY()+child.getHeight());
|
rect.bottom=Math.max(rect.bottom, child.getY()+child.getHeight());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}else if(!rect.isEmpty()){
|
}else if(!rect.isEmpty()){
|
||||||
drawInsetBackground(parent, c);
|
drawInsetBackground(parent, c);
|
||||||
rect.setEmpty();
|
rect.setEmpty();
|
||||||
|
|||||||
Reference in New Issue
Block a user