I create an isometric map with simple fragments, and I & rsquo; ve extended RelativeLayoutto create a layout containing these fragments. Indeed, just using RelativeLayoutas-works fine, as long as my orientation matches the order in which the tiles were written to the XML file; all i & rsquo; ve are overwritten - these are the constructors where I just call superand setChildrenDrawingOrderEnabled(true);along with setting some variables (grid height and width) and then getChildDrawingOrder.
My code for getChildDrawingOrdercalculates a new index for a given child, and also sets the line in the child i->i', where iis the source index and i'is the new index. i & rsquo; m using this for testing; children set this line on themselves together with their coordinates.
Unfortunately, this does not work correctly, or rather, it is unstable. Of the nine plates in my test case, three dons do not seem to have any at all getChildDrawingOrder: the line mentioned above is - null. Of the rest, at least one of them is disabled, despite the fact that he received the correct index.
Here's the image (in orientation TOP):

, (0,2), (1,2) (2,1) null, getChildDrawingOrder, -, . , (1,0) (1,1), i (3) i' (1) (1,1) & ss; s (4 4, ).
s getChildDrawingOrder:
@Override
protected int getChildDrawingOrder(int childCount, int i)
{
TileView ch = (TileView)getChildAt(i);
ch.order = "Called";
int gx, gy;
switch (rotation)
{
case TOP:
gx = ch.x();
gy = ch.y();
break;
case LEFT:
gx = (width()-1-ch.x());
gy = ch.y();
break;
case RIGHT:
gx = ch.x();
gy = (length()-1-ch.y());
break;
case BOTTOM:
gx = (width()-1-ch.x());
gy = (length()-1-ch.y());
break;
default:
gx = ch.x();
gy = ch.y();
}
int row = gx+gy;
if ( row == 0 )
{
ch.order = new String(i+"->0");
return 0;
}
else
{
int mx = width()-1,
my = length()-1,
mrow = mx+my,
min = Math.min(mx, my),
maj = Math.max(mx, my),
retn;
if ( row <= min )
{
retn = row*(row+1)/2+gy;
}
else if ( row <= maj )
{
retn = min*(min+1)/2+min*(row-min)+gy;
}
else
{
retn = (min+1)*(min+2)/2
+ min*(maj-min)
+ (mrow-maj)*(mrow-maj+1)/2
- (mrow-row+1)*(mrow-row+2)/2
+ gy
- (row-maj)
;
}
ch.order = new String(i+"->"+retn);
return retn;
}
}
- , ? isn & rsquo; t getChildDrawingOrder ? (1,0) , getChildDrawingOrder?