Skip to content

Conversation

@namanhams
Copy link

Fixes #58

@bouchnafamd
Copy link

This fix is not working

@behelit
Copy link

behelit commented Feb 8, 2017

I think you also need to apply similar logic to the updateBackground() method, so that it applies the margins correctly.
E.g:

        final boolean isLTR;
        isLTR = Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 ||     (TextUtils.getLayoutDirectionFromLocale(getContext().getResources().getConfiguration().locale) == LAYOUT_DIRECTION_LTR);

        LayoutParams initParams = (LayoutParams) child.getLayoutParams();
        LayoutParams params = new LayoutParams(initParams.width, initParams.height, initParams.weight);
        // Check orientation for proper margins
        if(getOrientation() == LinearLayout.HORIZONTAL)
        {
            if(isLTR)
            {
                params.setMargins(0, 0, -mMarginDp, 0);
            }
            else
            {
                params.setMargins(-mMarginDp, 0, 0, 0);
            }
        }
        else
        {
            params.setMargins(0, 0, 0, -mMarginDp);
        }
        child.setLayoutParams(params);

@dmsherazi
Copy link

@behelit Your snippet works to an extent but still the left radius of the first radiobutton.
whatsapp image 2017-04-09 at 3 21 38 pm

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

Successfully merging this pull request may close these issues.

4 participants