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

Remove state number limit #58

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Conversation

adrien1018
Copy link

README and the sample program are also updated.

@DalCreeper
Copy link

DalCreeper commented Mar 18, 2021

Please merge the updates!! I'm using this stepProgressBar in my project, but i need 6 step instead of 5, so these commits solve my problem. I can't insert the entire project with the changes in mine, i need a simple implementation, like this: (implementation 'com.kofigyan.stateprogressbar:stateprogressbar:1.0.0') in my dependencies. Really please, this is the fifth library that i use for make a stepProgressBar and this is the only one that work as i want.

@DalCreeper
Copy link

@adrien1018 if you make the artifact of your master-SNAPSHOT i can implement your library with this implementation (implementation 'com.github.adrien1018:StateProgressBar:master-SNAPSHOT') using jitpack.io . Tell me if you can/want 👍

@adrien1018
Copy link
Author

adrien1018 commented Mar 19, 2021

@DalCreeper It turned out that jitpack was not working due to missing gradlew. Artifact is now built.

@DalCreeper
Copy link

@adrien1018 Man, THANK YOU!!! Now it works perfectly!
Just a thing if you want to fix it:

Kotlin code:

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import com.kofigyan.stateprogressbar.StateProgressBar

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

    val btn1 : Button = findViewById(R.id.btn1)
    val btn2 : Button = findViewById(R.id.btn2)

    max4()

    btn1.setOnClickListener {
        max4()
        recreate()
    }

    btn2.setOnClickListener {
        max6()
        recreate()
    }
}

fun max4() {
    val prova : StateProgressBar = findViewById(R.id.prova)
    prova.maxStateNumber = 4
}

fun max6() {
    val prova : StateProgressBar = findViewById(R.id.prova)
    prova.maxStateNumber = 6
}

}

XML code:

<com.kofigyan.stateprogressbar.StateProgressBar
    android:id="@+id/prova"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="20dp"
    android:layout_marginStart="10dp"
    android:layout_marginEnd="10dp"/>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    tools:context=".MainActivity"
    android:orientation="horizontal"
    android:gravity="center"
    android:layout_marginTop="20dp">

    <Button
        android:id="@+id/btn1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="20dp"/>

    <Button
        android:id="@+id/btn2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>
</LinearLayout>

If you take a look on the code that i wrote above, you'll see that for make a simple modify about the maxNumberState you have to use the recreate() to adjust the entire stateProgressBar in the linearLayout, if you find a easier way to fix it automatically would be a cool feature to insert!

@safiyaAkhtarDev
Copy link

hi did you merge these changes i also want to use

@DalCreeper
Copy link

@safiyaAkhtarDev you can obtain these changes with this dependencies:
implementation 'com.github.adrien1018:StateProgressBar:52cd5e85be'

@safiyaAkhtarDev
Copy link

safiyaAkhtarDev commented Mar 25, 2021 via email

@DalCreeper
Copy link

@safiyaAkhtarDev if that version doesn't work, you can check other version here:
https://jitpack.io/#adrien1018/StateProgressBar

@safiyaAkhtarDev
Copy link

safiyaAkhtarDev commented Mar 26, 2021 via email

@adrien1018
Copy link
Author

@DalCreeper The issue is now fixed.

@DalCreeper
Copy link

@DalCreeper The issue is now fixed.

You're the number one my friend! Good job!

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.

Allow use of integer instead of enum value
3 participants