0

I was try to apply styles in custom view . Here i was used com.todddavies.components.progressbar.ProgressWheel this library. Here is my xml layout view

<com.todddavies.components.progressbar.ProgressWheel xmlns:ProgressWheel="http://schemas.android.com/apk/res-auto"
                android:id="@+id/sample"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                ProgressWheel:barColor="@color/scan_progress_bar"
                ProgressWheel:barLength="10dp"
                ProgressWheel:barWidth="10dp"
                ProgressWheel:circleColor="@color/scan_progress_inner_bg"
                ProgressWheel:fontFamily="sans-serif-condensed"
                ProgressWheel:rimColor="@color/scan_progress_rim"
                ProgressWheel:rimWidth="@dimen/scan_count_wheel_tim_size"
                ProgressWheel:spinSpeed="3dp"
                ProgressWheel:text="10"
                ProgressWheel:textColor="#asdfdas"
                ProgressWheel:textSize="23dp" />

I try to access textsize, color from styles. How can i access.

<com.todddavies.components.progressbar.ProgressWheel xmlns:ProgressWheel="http://schemas.android.com/apk/res-auto"
                android:id="@+id/sample"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                style='@style/progressbar' />

1 Answers1

1

For custom attributes such as these, you simply don't use a namespace prefix.

For example:

<style name="progressbar">
    <item name="barColor">@color/scan_progress_bar</item>
    <item name="barLength">10dp</item>
</style>
Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120