Android Button Maker

Button

Button

android:text
android:textColor
android:textSize
Shadow
android:shadowColor
android:shadowDx
android:shadowDy
android:shadowRadius

size

android:width
android:height

ButtonShape.xml

corners

android:radius
Radius Property
android:topLeftRadius
android:topRightRadius
android:bottomLeftRadius
android:bottomRightRadius

Background

gradient solid
android:type   Center
android:centerX
android:centerY
android:startColor
android:centerColor
android:endColor
android:angle
android:gradientRadius

padding

Padding On
android:left
android:top
android:right
android:bottom

stroke

android:width
android:color
Button buttonshape.xml
Code Button
Click Event
Button angryButton = (Button) findViewById(R.id.angry_btn);
angryButton.setOnClickListener(new View.OnClickListener()
public void onClick(View v)
// Click event trigger here
);

Android Button Maker is online tool to generate buttons code for Android Apps. Android API provide Drawable Resources where XML file defines geometric shape, including colors, border and gradients.
These button is generating based on shape drawable XML code which load faster compare to normal PNG buttons. You can customize button properties in setting panel and get source code.

Button Click Event: There are two ways to handle button click event.
(1) Add android:onClick attribute inside button xml code

<Button xmlns:android='http://schemas.android.com/apk/res/android'
android:id='@+id/button_send'
...
android:onClick='clickMethod'
/>
public void clickMethod(View view) { // Do something in response to button click }
(2) Your Activity class need to implement View.OnClickListener then write button click listener method which shows above.
public class MyActivity extends Activity implements View.OnClickListener { 
// Write click event code
}

resources