Back to Browse

Select and deselect a textview

1.1K views
Aug 26, 2020
7:28

This video shows how to make one in two textviews selected or deselected in Sketchware. The code used for creating GradientDrawable:- android.graphics.drawable.GradientDrawable gd = new android.graphics.drawable.GradientDrawable(); gd.setColor(Color.WHITE); gd.setStroke(1, Color.DKGRAY); if (_textview == textview2){ float[] radii = {60, 60, 0, 0, 0, 0, 60, 60}; gd.setCornerRadii(radii); } else { float[] radii = {0, 0, 60, 60, 60, 60, 0, 0}; gd.setCornerRadii(radii); } _textview.setBackground(gd);

Download

0 formats

No download links available.

Select and deselect a textview | NatokHD