Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Star padding problem at runtime #84

Open
AminEsmaeily opened this issue Mar 26, 2020 · 0 comments
Open

Star padding problem at runtime #84

AminEsmaeily opened this issue Mar 26, 2020 · 0 comments

Comments

@AminEsmaeily
Copy link

I have a layout view like this:

<RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="30dp"
        android:background="@drawable/btn1"
        android:paddingLeft="5dp"
        android:paddingTop="35dp"
        android:paddingRight="5dp"
        android:paddingBottom="5dp">

        <com.willy.ratingbar.ScaleRatingBar
            android:id="@+id/srbOveralRating"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layoutDirection="ltr"
            app:srb_numStars="5"
            app:srb_minimumStars="1"
            app:srb_starWidth="20dp"
            app:srb_starHeight="20dp"
            app:srb_starPadding="5dp"
            app:srb_stepSize="0.5"
            app:srb_isIndicator="true"
            app:srb_clickable="false"
            app:srb_scrollable="true"
            app:srb_clearRatingEnabled="true"
            app:srb_drawableEmpty="@drawable/ic_star_empty"
            app:srb_drawableFilled="@drawable/ic_star_full"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="20dp"/>

        <com.willy.ratingbar.ScaleRatingBar
            android:id="@+id/srbUserRate"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layoutDirection="ltr"
            app:srb_numStars="5"
            app:srb_minimumStars="1"
            app:srb_starWidth="40dp"
            app:srb_starHeight="40dp"
            app:srb_starPadding="5dp"
            app:srb_stepSize="1"
            app:srb_isIndicator="false"
            app:srb_clickable="true"
            app:srb_scrollable="true"
            app:srb_clearRatingEnabled="true"
            app:srb_drawableEmpty="@drawable/ic_star_empty"
            app:srb_drawableFilled="@drawable/ic_star_full"
            android:layout_below="@id/srbOveralRating"
            android:layout_marginTop="10dp"/>
    </RelativeLayout>

At design-time it shows perfectly:
Capture

but at runtime, the stars arrange without considering the starPadding property and they stretch to fill the parent:
Screenshot_1585210330

And the second issue is about displaying the half star when the main layout direction has been set to RTL, but as you can see in code, the control's layoutDirection property has set to LTR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant