mmoamenn / LuckyWheel_Android

A custom component that displays a lucky wheel. it ⁠ features easy customize of colors, addition of items and it's very trivial to integrate in your application.
MIT License
127 stars 55 forks source link

README.md instructions result in broken code #22

Closed mikeblas closed 3 years ago

mikeblas commented 3 years ago

Steps to Repro:

  1. In Android Studio, create a new "Empty Activity" project
  2. Per the LuckyWheel README.md, add the dependencies to the Gradle scripts
  3. Open the activity_main.xml layout resource and add the XML block from the LuckyWheel README.md instructions

BUG: The build fails with the message "app\src\main\res\layout\activity_main.xml:18: AAPT: error: unbound prefix."

It seems like the fix is to remove the background_color attribute, so the XML block looks like this:

<com.bluehomestudio.luckywheel.LuckyWheel
        android:id="@+id/lwv"
        android:layout_width="250dp"
        android:layout_height="250dp"
        android:layout_centerInParent="true" />

but that means that we can't access LuckyWheel attributes in the XML settings. My guess is that a new XML namespace must be imported, but the README.md doesn't mention that before recommending the qualified XML attributes, and doesn't explain how to do the import.

Maybe the README.md should be changed to not mention the broken properties. Or, maybe it should offer complete instructions that show how to make them work correctly.

mikeblas commented 3 years ago

Maybe this is related to item #13. Looks like @mhkarami there explains how to add the required namespace. I think it would be helpful if that advice were added to README.md.

FranH20 commented 3 years ago

I solved it with this line in the parent layout Yo lo solucione con esta línea en el layout padre xmlns:LuckyWheel="http://schemas.android.com/apk/res-auto"

mikeblas commented 3 years ago

Why is this closed? The README hasn't been fixed.