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

Can you please show me this in Java ? #22

Open
dedsec1911 opened this issue Jun 21, 2020 · 0 comments
Open

Can you please show me this in Java ? #22

dedsec1911 opened this issue Jun 21, 2020 · 0 comments

Comments

@dedsec1911
Copy link

dedsec1911 commented Jun 21, 2020

` toggleButtonLayout.onToggledListener = { _, toggle, selected ->
Snackbar.make(root, "Toggle ${toggle.id} selected state $selected", Snackbar.LENGTH_LONG)
.show()
}

    buttonSetSelectedColor.setOnClickListener {
        val primary = ContextCompat.getColor(this, R.color.colorPrimary)
        val accent = ContextCompat.getColor(this, R.color.colorAccent)
        if (toggleButtonLayoutText.selectedColor == accent) {
            toggleButtonLayoutText.selectedColor = primary
        } else {
            toggleButtonLayoutText.selectedColor = accent
        }
    }

    buttonSetDividerColor.setOnClickListener {
        val gray = Color.GRAY
        val red = Color.RED
        if (toggleButtonLayoutText.dividerColor == gray) {
            toggleButtonLayoutText.dividerColor = red
        } else {
            toggleButtonLayoutText.dividerColor = gray
        }
    }
}

}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant