ToggleButtonLayout icon indicating copy to clipboard operation
ToggleButtonLayout copied to clipboard

Can you please show me this in Java ?

Open dedsec1911 opened this issue 5 years ago • 0 comments

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

}`

dedsec1911 avatar Jun 21 '20 08:06 dedsec1911