AnimatedCircleLoadingView icon indicating copy to clipboard operation
AnimatedCircleLoadingView copied to clipboard

Colors not found; can not compile

Open Sub-Zero-1 opened this issue 7 years ago • 5 comments

I have added the layout like in your example:

<com.github.jlmd.animatedcircleloadingview.AnimatedCircleLoadingView
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/circle_loading_view"
    android:layout_width="250dp"
    android:layout_height="250dp"
    android:background="@color/background"
    android:layout_centerInParent="true"
    app:animCircleLoadingView_mainColor="@color/main_color"
    app:animCircleLoadingView_secondaryColor="@color/secondary_color"
    app:animCircleLoadingView_textColor="@android:color/white"
    />

Additionaly I added the colors to my color.xml file:

<resources>
  <color name="background">#65828e</color>
  <color name="main_color">#ff9a00</color>
  <color name="secondary_color">#BDBDBD</color>
</resources>

Error: It can't find mainColor, secondaryColor and textColor.

Sub-Zero-1 avatar Sep 27 '18 15:09 Sub-Zero-1

I am also facing the same issue, any suggestions how to remove this error?

harshmalik avatar Sep 28 '18 12:09 harshmalik

Same issue here but works when cloning directly from repo, that should give me a clue but can't seem to remove this error.

mlu-linkin avatar Oct 04 '18 02:10 mlu-linkin

I found a workaround. Create a new XML file named attrs inside values folder in the resources directory with following code:

`

<declare-styleable name="AnimatedCircleLoadingView">

    <attr name="animCircleLoadingView_mainColor" format="color" localization="suggested" />

    <attr name="animCircleLoadingView_secondaryColor" format="color" localization="suggested" />

    <attr name="animCircleLoadingView_checkMarkTintColor" format="color" localization="suggested" />

    <attr name="animCircleLoadingView_failureMarkTintColor" format="color" localization="suggested" />

    <attr name="animCircleLoadingView_textColor" format="color" localization="suggested" />

</declare-styleable>

`

gabrielkdc avatar Oct 10 '18 01:10 gabrielkdc

@gabrielkdc Can you please share full code? How are you using this XML file that you created?

apexkid avatar Dec 02 '18 12:12 apexkid

Not required. I just created the XML and things started working. Thanks @gabrielkdc

apexkid avatar Dec 02 '18 14:12 apexkid