kofigyan / StateProgressBar

Android library to realize the various states and transitions in a ProgressBar.
1.54k stars 233 forks source link

Remove state number limit #58

Open adrien1018 opened 3 years ago

adrien1018 commented 3 years ago

README and the sample program are also updated.

DalCreeper commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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

DalCreeper commented 3 years ago

@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:

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" android:orientation="vertical">

<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 commented 3 years ago

hi did you merge these changes i also want to use

DalCreeper commented 3 years ago

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

safiyaAkhtarDev commented 3 years ago

it is saying not found in Gradle, once can you check and let me know

On Thu, 25 Mar 2021 at 18:32, DalCreeper @.***> wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kofigyan/StateProgressBar/pull/58#issuecomment-806701564, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASD3533P5UVWXDI5TH3IQ4DTFMX45ANCNFSM4YAF4K3A .

DalCreeper commented 3 years ago

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

safiyaAkhtarDev commented 3 years ago

thank you so very very much, you are life saver

On Thu, 25 Mar 2021 at 19:10, DalCreeper @.***> wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kofigyan/StateProgressBar/pull/58#issuecomment-806760730, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASD353YL6OUVYWXR4PE4CTTTFM4LHANCNFSM4YAF4K3A .

adrien1018 commented 3 years ago

@DalCreeper The issue is now fixed.

DalCreeper commented 3 years ago

@DalCreeper The issue is now fixed.

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