Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

Add extraSpacing attribute to CirclePageIndicator #231

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BurntBrunch
Copy link

The extraSpacing XML attribute specifies additional spacing between the circles,
also configurable via the setExtraSpacing(float) method.

The extraSpacing attribute specifies additional spacing between the circles,
also configurable via the setExtraSpacing(float) method.
@christopherperry
Copy link

@JakeWharton Pull this one Jake!

@SchneiderAdrian
Copy link

The centering of the circles is not working correctly anymore. You should maybe check the calculation of the longOffset inside the onDraw-Method (line 240++).

@thiagokimo
Copy link

@JakeWharton will you merge this?

@gotokatsuya
Copy link

Hi @JakeWharton

Could you please merge this?

@maxmalysh
Copy link

@JakeWharton merge this one, please!

@Malikkhoja-zz
Copy link

@JakeWharton As per your last commit. I have made the necessary changes in the code. it seems to be working fine. Only problem which i have facing currently is when I apply extra spacing the circle doesnt fit in the centre. Can you help me please?

@ghost
Copy link

ghost commented Sep 15, 2015

@malikkhoja This should solve your problem of centering (line 240 and following):

final float threeRadius = mRadius * 2 + mExtraSpacing;
final float shortOffset = shortPaddingBefore + mRadius;
float longOffset = longPaddingBefore + mRadius;
if (mCentered) {
    final float circleSize = mRadius * 2;
    final float width = count * circleSize + ((count - 1) * mExtraSpacing);
    longOffset += ((longSize - longPaddingBefore - longPaddingAfter) / 2.0f) - (width / 2.0f);
}

@Malikkhoja-zz
Copy link

Hi Jake,

Thanks for the reply. I really appreciate that. I ll try and let you know
the output.

Thanks,
Malik Khoja

On Tue, Sep 15, 2015 at 2:12 PM, YvesDelcoigne notifications@github.com
wrote:

@malikkhoja https://github.com/Malikkhoja This should solve your
problem of centering (line 240 and following):

final float threeRadius = mRadius * 2 + mExtraSpacing;final float shortOffset = shortPaddingBefore + mRadius;float longOffset = longPaddingBefore + mRadius;if (mCentered) {
final float circleSize = mRadius * 2;
final float width = count * circleSize + ((count - 1) * mExtraSpacing);
longOffset += ((longSize - longPaddingBefore - longPaddingAfter) / 2.0f) - (width / 2.0f);
}


Reply to this email directly or view it on GitHub
#231 (comment)
.

@gustavotemple
Copy link

Hi @JakeWharton,
Could you, please, merge this one?

@robl2e
Copy link

robl2e commented Jan 17, 2018

Can this change be merged in?

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

Successfully merging this pull request may close these issues.