I'm trying to use a custom view for an annotation but the layout doesn't seem to propagate to its children.
Here's the layout I'm using:
<?xml version="1.0" encoding="utf-8"?>
And here's the relevant code:
NumberRange zeroToOneRange = new NumberRange(0D, 1D);
NumberAxis annotationXAxis = new NumberAxis(zeroToOneRange);
NumberAxis annotationYAxis = new NumberAxis(zeroToOneRange);
final ViewGroup testLayout = (ViewGroup) getActivity().getLayoutInflater().inflate(R.layout.test_layout, null, false);
testLayout.setLayoutParams(new ViewGroup.LayoutParams(0, 0));
Annotation testAnnotation = chart.getAnnotationsManager().addViewAnnotation(testLayout, 0, 0, annotationXAxis, annotationYAxis);
This code is towards the end of onCreate of my SupportChartFragment subclass. This is obviously a dumbed-down example to illustrate the problem. I would expect a full blue overlay on top of my chart, but instead I'm getting a red one.
Is there a workaround to allow view containers (ViewGroups) to be used as custom view annotations? I tried doing a requestLayout and a forceLayout on my annotation view inside a data range listener but that didn't make a difference.
This is using premium 1.4.1. I'll give it a shot soon using 1.5.