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

Issues with layout. #4

Open
afaucogney opened this issue Oct 28, 2015 · 2 comments
Open

Issues with layout. #4

afaucogney opened this issue Oct 28, 2015 · 2 comments

Comments

@afaucogney
Copy link

I know this is the beginning of the lib, so to help you i just post my test that results with some strange behavior time to times.

This is taken from AS.

layout-2015-10-28-104119

This one from the device

device-2015-10-28-104224

My layout is:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity">


    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="vertical">


        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="22sp"
            android:textStyle="bold"
            app:prb_defaultRating="4"
            app:prb_symbolicTick="$"
            app:prb_symbolicTickNormalColor="@android:color/darker_gray"
            app:prb_symbolicTickSelectedColor="@android:color/holo_green_dark"
            app:prb_totalTicks="6" />


        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="22sp"
            android:textStyle="bold"
            app:prb_defaultRating="4"
            app:prb_symbolicTick="★"
            app:prb_symbolicTickNormalColor="@android:color/darker_gray"
            app:prb_symbolicTickSelectedColor="@android:color/holo_green_dark"
            app:prb_totalTicks="6" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textSize="22sp"
            android:textStyle="bold"
            app:prb_defaultRating="4"
            app:prb_symbolicTick="★"
            app:prb_symbolicTickNormalColor="@android:color/darker_gray"
            app:prb_symbolicTickSelectedColor="@android:color/holo_green_dark"
            app:prb_totalTicks="6" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="match_parent"
            android:layout_height="10dp"
            android:textSize="22sp"
            android:textStyle="bold"
            app:prb_defaultRating="4"
            app:prb_symbolicTick="★"
            app:prb_symbolicTickNormalColor="@android:color/darker_gray"
            app:prb_symbolicTickSelectedColor="@android:color/holo_green_dark"
            app:prb_totalTicks="6" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textStyle="bold"
            app:prb_defaultRating="4"
            app:prb_symbolicTick="★"
            app:prb_symbolicTickNormalColor="@android:color/darker_gray"
            app:prb_symbolicTickSelectedColor="@android:color/holo_green_dark"
            app:prb_totalTicks="6" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textStyle="bold"
            app:prb_defaultRating="4"
            app:prb_symbolicTick="★"
            app:prb_symbolicTickNormalColor="@android:color/darker_gray"
            app:prb_symbolicTickSelectedColor="@android:color/holo_green_dark"
            app:prb_totalTicks="6" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:textStyle="bold"
            app:prb_defaultRating="4"
            app:prb_symbolicTick="★"
            app:prb_clickable="true"
            app:prb_tickSpacing="10sp"
            app:prb_symbolicTickNormalColor="@android:color/darker_gray"
            app:prb_symbolicTickSelectedColor="@android:color/holo_green_dark"
            app:prb_totalTicks="6" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:textStyle="bold"
            app:prb_defaultRating="4"
            app:prb_symbolicTick="★★★☆✩✪"
            app:prb_clickable="true"
            app:prb_tickSpacing="10sp"
            app:prb_symbolicTickNormalColor="@android:color/darker_gray"
            app:prb_symbolicTickSelectedColor="@android:color/holo_green_dark"
            app:prb_totalTicks="6" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            fontPath="fonts/SanFransiscoDisplay-Regular.otf"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:textStyle="bold"
            app:prb_defaultRating="4"
            app:prb_symbolicTick="★"
            app:prb_clickable="true"
            app:prb_tickSpacing="10sp"
            app:prb_symbolicTickNormalColor="@android:color/darker_gray"
            app:prb_symbolicTickSelectedColor="@android:color/holo_green_dark"
            app:prb_totalTicks="6" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />


        <io.techery.properratingbar.ProperRatingBar
            fontPath="fonts/Besom.ttf"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:textStyle="bold"
            app:prb_defaultRating="4"
            app:prb_symbolicTick="a"
            app:prb_clickable="true"
            app:prb_tickSpacing="10sp"
            app:prb_symbolicTickNormalColor="@android:color/darker_gray"
            app:prb_symbolicTickSelectedColor="@android:color/holo_green_dark"
            app:prb_totalTicks="6" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:textStyle="bold"
            app:prb_defaultRating="4"
            app:prb_symbolicTick="a"
            app:prb_clickable="true"
            app:prb_tickSpacing="10sp"
            app:prb_symbolicTickNormalColor="@android:color/darker_gray"
            app:prb_symbolicTickSelectedColor="@android:color/holo_green_dark"
            app:prb_totalTicks="6" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />


    </LinearLayout>

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="vertical">


        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:id="@+id/ratingBar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:prb_clickable="true"
            app:prb_defaultRating="4"
            app:prb_tickNormalDrawable="@drawable/i_rating_star_off"
            app:prb_tickSelectedDrawable="@drawable/i_rating_star_on"
            app:prb_totalTicks="6" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="wrap_content"
            android:layout_height="10dp"
            app:prb_clickable="true"
            app:prb_defaultRating="4"
            app:prb_tickNormalDrawable="@drawable/i_rating_star_off"
            app:prb_tickSelectedDrawable="@drawable/i_rating_star_on"
            app:prb_totalTicks="6" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            app:prb_clickable="true"
            app:prb_defaultRating="4"
            app:prb_tickNormalDrawable="@drawable/i_rating_star_off"
            app:prb_tickSelectedDrawable="@drawable/i_rating_star_on"
            app:prb_totalTicks="6" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            app:prb_clickable="true"
            app:prb_defaultRating="4"
            app:prb_tickNormalDrawable="@drawable/i_rating_star_off"
            app:prb_tickSelectedDrawable="@drawable/i_rating_star_on"

            app:prb_totalTicks="6" />

        <!--app:prb_tickSpacing="10dp"-->

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="50dp"
            android:layout_height="wrap_content"
            app:prb_clickable="true"
            app:prb_defaultRating="4"
            app:prb_tickNormalDrawable="@drawable/i_rating_star_off"
            app:prb_tickSelectedDrawable="@drawable/i_rating_star_on"

            app:prb_totalTicks="6" />


        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="100dp"
            android:layout_height="10dp"
            app:prb_clickable="true"
            app:prb_defaultRating="4"
            app:prb_tickNormalDrawable="@drawable/i_rating_star_off"
            app:prb_tickSelectedDrawable="@drawable/i_rating_star_on"
            app:prb_tickSpacing="0dp"
            app:prb_totalTicks="6" />


        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="100dp"
            android:layout_height="10dp"
            app:prb_clickable="true"
            app:prb_defaultRating="4"
            app:prb_tickNormalDrawable="@drawable/i_rating_star_off"
            app:prb_tickSelectedDrawable="@drawable/i_rating_star_on"
            app:prb_tickSpacing="-10dp"
            app:prb_totalTicks="6" />


        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />

        <io.techery.properratingbar.ProperRatingBar
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:prb_clickable="true"
            app:prb_defaultRating="4"
            app:prb_tickNormalDrawable="@drawable/i_rating_star_off"
            app:prb_tickSelectedDrawable="@drawable/i_rating_star_on"
            app:prb_tickSpacing="0dp"
            app:prb_totalTicks="6" />


        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1" />
    </LinearLayout>

</LinearLayout>

@Den-Rimus
Copy link
Contributor

No response from us so far has been given for this issue. This means we saw it but don't have time to even investigate the problem. From the top of my head I can say for sure that element behaves incorrectly when the size of it tries to be less than it would assume to wrap it's content.

That applies both to size set as constant or as weight, if the latter one shrinks element too much.

As a workaround I would propose using wrap_content width, with parent that allows ProperRatingBar to take all the space it needs (or you can use set of weights that will do the same).

We will address this issue later during one of nearest updates for this library.

@sushant23
Copy link

I am having same problem. Did you find any solution for this?

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

No branches or pull requests

3 participants