Skip to content

Can you please show me this in Java ? #22

@dedsec1911

Description

@dedsec1911

` 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
        }
    }
}

}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions