Skip to content

Remove state number limit#58

Open
adrien1018 wants to merge 15 commits into
kofigyan:masterfrom
adrien1018:master
Open

Remove state number limit#58
adrien1018 wants to merge 15 commits into
kofigyan:masterfrom
adrien1018:master

Conversation

@adrien1018

Copy link
Copy Markdown

README and the sample program are also updated.

@DalCreeper

DalCreeper commented Mar 18, 2021

Copy link
Copy Markdown

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
Copy Markdown

@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

adrien1018 commented Mar 19, 2021

Copy link
Copy Markdown
Author

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

@DalCreeper

Copy link
Copy Markdown

@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
Copy Markdown

hi did you merge these changes i also want to use

@DalCreeper

Copy link
Copy Markdown

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

@safiyaAkhtarDev

safiyaAkhtarDev commented Mar 25, 2021 via email

Copy link
Copy Markdown

@DalCreeper

Copy link
Copy Markdown

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

@safiyaAkhtarDev

safiyaAkhtarDev commented Mar 26, 2021 via email

Copy link
Copy Markdown

@adrien1018

Copy link
Copy Markdown
Author

@DalCreeper The issue is now fixed.

@DalCreeper

Copy link
Copy Markdown

@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