Giter Club home page Giter Club logo

Comments (7)

bitvale avatar bitvale commented on September 16, 2024

Can you provide usage example?

from switcher.

emreaydogdu avatar emreaydogdu commented on September 16, 2024

@bitvale

<com.bitvale.pacbutton.SwitcherX
    android:id="@+id/switcher"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:switcher_on_color="@color/on"
    app:switcher_off_color="@color/off"
    app:switcher_icon_color="@color/icon" />
SwitcherX switcher;
switcher = findViewByid(R.id.switcher);
switcher.setChecked(false);

will always show checked true

from switcher.

bitvale avatar bitvale commented on September 16, 2024

Thank you for submitting! I found an error in project description page.

Try com.bitvale.switcher.SwitcherX instead of com.bitvale.pacbutton.SwitcherX

from switcher.

emreaydogdu avatar emreaydogdu commented on September 16, 2024

@bitvale

That's not the problem. I already use
<com.bitvale.switcher.SwitcherX>

setChecked() doesn't change the state.
also if I set
checked="false"
İt shows reverse disabled and if I pressed there ist a buggy animation from switching false to true

Example https://i.imgur.com/a/KFNpcuH

from switcher.

bitvale avatar bitvale commented on September 16, 2024

Fixed in version 1.0.1 Thank You!

from switcher.

emreaydogdu avatar emreaydogdu commented on September 16, 2024

Thank you. The States are right now but the animation is still wrong and same like example before. İf I use

setChecked(false, true )(Withanimation) wrong
setChecked (false,false) everything is fine

from switcher.

bitvale avatar bitvale commented on September 16, 2024

Now I can not catch this.

Please try this: open MainActivity in demo app and replace setOncheckedChangeListener(s)

switcher_x.setOnCheckedChangeListener { checked ->
            switcher_c.setChecked(checked) // add this line
            if (checked) tv_switcher_x.setTextColor(defaultColor)
            else tv_switcher_x.setTextColor(disabledColor)
        }

switcher_c.setOnCheckedChangeListener { checked ->
            switcher_x.setChecked(checked) // add this line
            if (checked) tv_switcher_c.setTextColor(defaultColor)
            else tv_switcher_c.setTextColor(disabledColor)
        }

Let me know if it doesn't work. For me it works as expected.

from switcher.

Related Issues (17)

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.