Linear Border Stroke and Radius

Linear Border And Radius

    To create Linear border stroke and border radius on sketchware you must need to add more "Block".
In this page you can see how I make that border stroke and radius on my Linear. You can watch the video too so you can follow what I'm doing and you can easy to learn.

1.) Open your sketchware and create a new project and put your project name then click the "Create App".



2.) After you create your project, put a "Linera(H)" and "Linear(V)". Put two "Linear(H)" on the top see the image below how I made it.



3.) After you made that go to "Event" and go to "More Block".


4.) Then add a create your costum "Block" by clicking the + button on the bottom right corner of your Sketchware.



5.)  Then put the "Block Name" you want, you can put anything there.


6.) Then after you put your "Block Name" there, click the "Add Variable".


7.) Then go to "View" variable and choose "view" type. 


8.) After you choose the variable you want to add enter "variable name" for that.



9.) After that click the "Add" button.

10.) Then add another "Variable", add a "String" variable or your "Linear Stroke".



11.) Then after you choose that "Variable" enter a label text for your "String" variable then click the "Add" button.


12.) Then put a unique "Variable Name" for your "Stroke String" then click the "Add" button.


13.) Then add another "Label Text" for another "String" "Variable" for your "Linear" "Background Color" then click the "Add" button again.


14.) Put again another "Variable Name" for your "Linear Background Color" "String" then click again the "Add" button.


15.) After that add a "Number Variable" for the "Border Radius".



16.) Then after that enter a "Label Text" for your "Border Radius" then click the "Add" Button.



17.) Then enter a unique "Variable Name" for your "Border Radius" then click the "Add" button.


18.) Then after you done that click the "Block" you create.


19.) In that block put a "Add Source Directly" "Block".



20.) Then after you put that input there this code.

android.graphics.drawable.GradientDrawable gd = new android.graphics.drawable.GradientDrawable(); gd.setColor(Color.parseColor(_c)); gd.setCornerRadius((float)_r); gd.setStroke(2, Color.parseColor(_sc)); _view.setBackground(gd);

21.) After that "Save" and "Run" your project.


Watch here the full tutorial, how to make a linear border and radius.