forked from mirror/monocles_chat
reparent if parented (Cheogram)
This commit is contained in:
parent
4b722cce64
commit
72a6b50bf9
1 changed files with 6 additions and 0 deletions
|
@ -1773,10 +1773,16 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
|
|||
@Override
|
||||
public Object instantiateItem(@NonNull ViewGroup container, int position) {
|
||||
if (position == 0) {
|
||||
if (page1 != null && page1.getParent() != null) {
|
||||
((ViewGroup) page1.getParent()).removeView(page1);
|
||||
}
|
||||
container.addView(page1);
|
||||
return page1;
|
||||
}
|
||||
if (position == 1) {
|
||||
if (page2 != null && page2.getParent() != null) {
|
||||
((ViewGroup) page2.getParent()).removeView(page2);
|
||||
}
|
||||
container.addView(page2);
|
||||
return page2;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue