mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Merge branch '422-forum-subtree-duplicates' into 'master'
fixed sub-tree duplicate bug Closes #422 See merge request !206
This commit is contained in:
@@ -307,7 +307,7 @@ public class ForumActivity extends BriarActivity implements
|
|||||||
private final List<ForumEntry> forumEntries;
|
private final List<ForumEntry> forumEntries;
|
||||||
// highlight not depandant on time
|
// highlight not depandant on time
|
||||||
private ForumEntry replyEntry;
|
private ForumEntry replyEntry;
|
||||||
// temporary highlight
|
// temporary highlight
|
||||||
private ForumEntry addedEntry;
|
private ForumEntry addedEntry;
|
||||||
|
|
||||||
public ForumAdapter(@NonNull List<ForumEntry> forumEntries) {
|
public ForumAdapter(@NonNull List<ForumEntry> forumEntries) {
|
||||||
@@ -334,6 +334,7 @@ public class ForumActivity extends BriarActivity implements
|
|||||||
isShowingDescendants = true;
|
isShowingDescendants = true;
|
||||||
showDescendants(higherEntry);
|
showDescendants(higherEntry);
|
||||||
}
|
}
|
||||||
|
notifyItemChanged(getVisiblePos(higherEntry));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -359,8 +360,9 @@ public class ForumActivity extends BriarActivity implements
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasVisibleDescendants(int visiblePos) {
|
private boolean hasVisibleDescendants(ForumEntry forumEntry) {
|
||||||
int levelLimit = forumEntries.get(visiblePos).getLevel();
|
int visiblePos = getVisiblePos(forumEntry);
|
||||||
|
int levelLimit = forumEntry.getLevel();
|
||||||
for (int i = visiblePos + 1; i < getItemCount(); i++) {
|
for (int i = visiblePos + 1; i < getItemCount(); i++) {
|
||||||
ForumEntry entry = getVisibleEntry(i);
|
ForumEntry entry = getVisibleEntry(i);
|
||||||
if (entry.getLevel() <= levelLimit)
|
if (entry.getLevel() <= levelLimit)
|
||||||
@@ -525,7 +527,7 @@ public class ForumActivity extends BriarActivity implements
|
|||||||
|
|
||||||
if (hasDescendants(data)) {
|
if (hasDescendants(data)) {
|
||||||
ui.chevron.setVisibility(VISIBLE);
|
ui.chevron.setVisibility(VISIBLE);
|
||||||
if (hasVisibleDescendants(position)) {
|
if (hasVisibleDescendants(data)) {
|
||||||
ui.chevron.setSelected(false);
|
ui.chevron.setSelected(false);
|
||||||
} else {
|
} else {
|
||||||
ui.chevron.setSelected(true);
|
ui.chevron.setSelected(true);
|
||||||
@@ -566,7 +568,7 @@ public class ForumActivity extends BriarActivity implements
|
|||||||
}
|
}
|
||||||
setReplyEntry(data);
|
setReplyEntry(data);
|
||||||
linearLayoutManager
|
linearLayoutManager
|
||||||
.scrollToPositionWithOffset(position, 0);
|
.scrollToPositionWithOffset(getVisiblePos(data), 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user