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

Smaller Stepper Touch #38

Closed
udongeex opened this issue Feb 18, 2019 · 4 comments · Fixed by #39
Closed

Smaller Stepper Touch #38

udongeex opened this issue Feb 18, 2019 · 4 comments · Fixed by #39

Comments

@udongeex
Copy link

I need to set the stepper touch with below size for a full display
android:layout_width="130dp"
android:layout_height="50dp
Is there a way I can make it smaller ? Thanks a lot

@artprasetya
Copy link

i have same problem

@DanielMartinus
Copy link
Owner

DanielMartinus commented Mar 19, 2019

I've seen the issue, thanks for reporting. Currently there is no way of making it smaller as the size is indeed hardcoded. In order to make this work I will have to make some changes. I can't say when I will have a fix for it yet but It's on my list.

DanielMartinus added a commit that referenced this issue Mar 23, 2019
@DanielMartinus
Copy link
Owner

DanielMartinus commented Mar 23, 2019

As you can see in the image below it's now resizable to a smaller size than 130dp by 50dp. When the linked pull request in this issue is merged I will release a new version with the fix.

In order to get the same look as the stepper at the top I also had to make the margins and size of the text configurable. See below how I did that,

In your layout.xml you can use for example 80dp by 32dp or anything else.

<nl.dionsegijn.steppertouch.StepperTouch
                android:id="@+id/stepperTouch"
                android:layout_width="80dp"
                android:layout_height="32dp"
                android:layout_margin="40dp"
                android:clipChildren="true"
                android:orientation="horizontal"/>

But do note, you'll have to change the margins and text size by overriding it in the dimens.xml of your app if you want it to look nice, for example:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <dimen name="stepper_side_control_margin_start">8dp</dimen>
    <dimen name="stepper_side_control_margin_end">8dp</dimen>
    <dimen name="stepper_side_control_text_size">18sp</dimen>
</resources>

Let me know if you have any further questions.

@DanielMartinus
Copy link
Owner

Update 1.0.1 should now be available:

dependencies {
    implementation 'com.github.DanielMartinus:Stepper-Touch:1.0.1'
}

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 a pull request may close this issue.

3 participants