Giter VIP home page Giter VIP logo

progressbutton's People

Contributors

guilhe avatar jcminarro avatar kwiky avatar paour avatar razir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

progressbutton's Issues

RTL Support

Hello,

First of all, thank you for your great job here it is a great library,

I have noticed that when the app is RTL the padding start and padding end of the drawable are misplaced and there is no spacing between the drawable and the text, can you please support RTL.

Thanks and Regards.

ProgressColor not working with textAllCaps true in api 22

With textAllCaps = true the progressCircle not working in api 22

 <style name="DefaultButtonStyle">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textAllCaps">true</item>
        <item name="android:textColor">@android:color/white</item>
        <item name="android:textSize">16sp</item>
        <item name="cornerRadius">30dp</item>
        <item name="layout_constrainedWidth">true</item>
        <item name="layout_constrainedHeight">true</item>
        <item name="layout_constraintWidth_min">@dimen/defaultBtnWidth</item>
        <item name="layout_constraintHeight_min">55dp</item>
    </style> 

@razir

[Question] - Image instead of Text

The idea is to have a "submit" image, a progress animation (already provided by your lib) and a "finish" image. Does your lib allow us to have an image instead of "submit text"?

Using your sample I cannot:

buttonProgressMixed.showDrawable(ContextCompat.getDrawable(this, R.drawable.ic_chevron_right_black_24dp)!!)
buttonProgressMixed.setOnClickListener {
    showMixed(buttonProgressMixed)
}

private fun showMixed(button: Button) {
        val animatedDrawable = ContextCompat.getDrawable(this, R.drawable.animated_check)!!
        val drawableSize = resources.getDimensionPixelSize(R.dimen.doneSize)
        animatedDrawable.setBounds(0, 0, drawableSize, drawableSize)

        button.showProgress {
            progressColor = Color.WHITE
            gravity = DrawableButton.GRAVITY_CENTER
        }
        button.isEnabled = false

        Handler().postDelayed({
            button.isEnabled = true
            button.showDrawable(animatedDrawable) { gravity = DrawableButton.GRAVITY_CENTER }
        }, 3000)
    }

It shows the loading animation, the finish animation, but not the "star/idle" drawable. Why?

Migrate to AndroidX ?

Could you migrate the lib to use androidx instead of support.android which is no longer maintained

Memory leak

Output from LeakCanary:

┬───
│ GC Root: Input or output parameters in native code

├─ okio.AsyncTimeout class
│ Leaking: NO (PathClassLoader↓ is not leaking and a class is never leaking)
│ ↓ static AsyncTimeout.$class$classLoader
├─ dalvik.system.PathClassLoader instance
│ Leaking: NO (ProgressButtonHolderKt↓ is not leaking and A ClassLoader is never leaking)
│ ↓ PathClassLoader.runtimeInternalObjects
├─ java.lang.Object[] array
│ Leaking: NO (ProgressButtonHolderKt↓ is not leaking)
│ ↓ Object[].[454]
├─ com.github.razir.progressbutton.ProgressButtonHolderKt class
│ Leaking: NO (a class is never leaking)
│ ↓ static ProgressButtonHolderKt.activeViews
│ ~~~~~~~~~~~
├─ java.util.WeakHashMap instance
│ Leaking: UNKNOWN
│ ↓ WeakHashMap.table
│ ~~~~~
├─ java.util.WeakHashMap$Entry[] array
│ Leaking: UNKNOWN
│ ↓ WeakHashMap$Entry[].[1]
│ ~~~
├─ java.util.WeakHashMap$Entry instance
│ Leaking: UNKNOWN
│ ↓ WeakHashMap$Entry.value
│ ~~~~~
├─ com.github.razir.progressbutton.DrawableViewData instance
│ Leaking: UNKNOWN
│ ↓ DrawableViewData.callback
│ ~~~~~~~~
├─ com.github.razir.progressbutton.DrawableButtonExtensionsKt$setupDrawableCallback$callback$1 instance
│ Leaking: UNKNOWN
│ Anonymous class implementing android.graphics.drawable.Drawable$Callback
│ ↓ DrawableButtonExtensionsKt$setupDrawableCallback$callback$1.$textView
│ ~~~~~~~~~
├─ com.google.android.material.button.MaterialButton instance
│ Leaking: YES (View.mContext references a destroyed activity)
│ mContext instance of ...MyActivity with mDestroyed = true
│ View#mParent is set
│ View#mAttachInfo is null (view detached)
│ View.mID = R.id.submitMaterialButton
│ View.mWindowAttachCount = 1
│ ↓ MaterialButton.mContext
╰→ ...MyActivity instance
​ Leaking: YES (ObjectWatcher was watching this because ...MyActivity received Activity#onDestroy() callback and Activity#mDestroyed is true)
​ key = 5a2c63ce-96e2-49a1-b85e-8ac67750641c
​ watchDurationMillis = 5175
​ retainedDurationMillis = 172

METADATA

Build.VERSION.SDK_INT: 29
Build.MANUFACTURER: Google
LeakCanary version: 2.2
App process name: ...
Analysis duration: 12134 ms

Any clue?

How to implement by using Java

Hello,

I want to use this lib but unable to understand how can I use it in layout.xml file.
And I m using Java for development so can you please help us with how we can implement it with java.
Thanks

Question: Use with data binding

Hello.
Do I still need to call bindProgressButton if I'm using databining? See the snippet below.

        val binding = FragmentSignInBinding.bind(view)
        binding.viewModel = viewModel
        binding.lifecycleOwner = this
        binding.signIn.attachTextChangeAnimator()
        binding.signIn.showProgress { ... }
.....

Progress Bar Stuck Issue

I'm using this library as per the code you've provided in the README. Here's how I'm using it..

LoginFragment....

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
    super.onViewCreated(view, savedInstanceState)
    bindProgressButton(btnLogin)
    btnLogin.attachTextChangeAnimator()
    btnLogin.setOnClickListener {
        btnLogin.showProgress {
            buttonTextRes = R.string.signing_user_in
            progressColor = Color.WHITE
        }
        api.performLogin(username, password)...
         // Async call which runs a handler OnComplete in which I'm calling btnLogin.hideProgress(R.string.action_sign_in)
    }
    ...
    ...
}

However the loading bar freezes. Why do you think this is happened? Am I doing it wrong? Also, I noticed that the text became uppercase which is pretty much bad! Here's a recording:
https://youtu.be/FTSd1FnSRP4

Software visualisation

Hi Razir!

I believe there is a need for software visualisation tools to support the understanding of software systems. Many software visualisation tools, both open source and commercial, have been created for many languages, but no software visualisation tool has been created for the language Kotlin.

I have now however created one for my Bachelor thesis. I have used my application to visualise your project, and it shows the complexity of the project. The idea is the bigger the class or function, the more complex it is.

https___github com_razir_ProgressButton

If you could answer a few question for me, that would be very helpful!

  1. To get started, can you tell me briefly about yourself?
    a) What is your current occupation?
    b) What about your programming background?
  2. Do you use software visualisation tools to support tasks?
    a) When was the last time you used these tools?
    b) Please describe your experience with these tools.
  3. Have you learned anything new from looking at this visualisation?
    a) What did you learn?
    b) Was it valuable?
  4. Suggestions for improvement

Your help would really be appreciated.
Best,
Ayanle.

Question: Maven repo

Hi,

I like your library, looks amazing. Is it available in jCenter/MavenCentral or is it only on JitPack?

Cheers

JAVA Usage?

I have imported the library in my android project written in java.
But i couldn't use
bindProgressButton(myButton);

is it possible to use this library in java?

defective api for custom view

I want to use this library in my custom button that used in whole in my app.
but for avoiding memory leak, I must use provided bindProgressButton extension.
but in custom views we don't have lifecycleOwner! and should implement LifecycleObserver in our custom view and then dispose progressButton resources.

Unfortunately provided api for disposing is defective.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.