Search code examples
androidxmlattributesandroidplot

Why doesn't Android Studio recognise androidplot attribute in my xml?


I'm using Androidplot and i have this in my xml file:

<com.androidplot.xy.XYPlot
    android:id="@+id/dynamicXYPlot"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    androidplot.renderMode="use_background_thread"
    androidPlot.title="A Dynamic XY Plot"
    androidPlot.domainLabel="Domain"
    androidPlot.rangeLabel="Range"
    androidPlot.titleWidget.labelPaint.textSize="@dimen/title_font_size"
    androidPlot.domainLabelWidget.labelPaint.textSize="@dimen/domain_label_font_size"
    androidPlot.rangeLabelWidget.labelPaint.textSize="@dimen/range_label_font_size"
    androidPlot.graphWidget.marginTop="20dp"
    androidPlot.graphWidget.marginLeft="15dp"
    androidPlot.graphWidget.marginBottom="25dp"
    androidPlot.graphWidget.marginRight="10dp"
    androidPlot.graphWidget.rangeLabelPaint.textSize="@dimen/range_tick_label_font_size"
    androidPlot.graphWidget.rangeOriginLabelPaint.textSize="@dimen/range_tick_label_font_size"
    androidPlot.graphWidget.domainLabelPaint.textSize="@dimen/domain_tick_label_font_size"
    androidPlot.graphWidget.domainOriginLabelPaint.textSize="@dimen/domain_tick_label_font_size"
    androidPlot.legendWidget.textPaint.textSize="@dimen/legend_text_font_size"
    androidPlot.legendWidget.iconSizeMetrics.heightMetric.value="15dp"
    androidPlot.legendWidget.iconSizeMetrics.widthMetric.value="15dp"
    androidPlot.legendWidget.heightMetric.value="25dp"
    androidPlot.legendWidget.positionMetrics.anchor="right_bottom"
    androidPlot.graphWidget.gridLinePaint.color="#000000"/>

But it says :unknown attribute androidplot

Why doesn't Android Studio recognise androidplot attribute?

Note that I have inserted the .jar file in the libs directory and I have added it as a library!


Solution

  • I have solved the problem by adding this to my xml:

    xmlns:androidplot="http://schemas.android.com/apk/lib/com.example.applicationname"
    

    and by adding "androidplot:" in front of all androidplot's references, for example:

    androidplot:androidPlot.domainLabel="Domain"