askIT

Android Buttons

android_buttons.png The Android buttons doesnt look very good, so I created some new buttons that are ready to be used in your Android application. Download the xml files, and you are ready to go.

media-floppy.png Download android_buttons.zip

your_xml_layout_activity.xml

Here is a example of how to load all the buttons to the screen.

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fitsSystemWindows="true">

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="18dp"
        android:layout_marginRight="18dp"
        android:layout_marginBottom="30dp"
        android:layout_marginLeft="18dp">

        <TableLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal">

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="16dp">

                <Button
                    android:id="@+id/buttonDefault"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/btn_default"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:layout_marginEnd="20dp"
                    android:textAllCaps="false"
                    android:textColor="@color/colorDarkGray"
                    android:text="Default" />

                <Button
                    android:id="@+id/buttonDefaultHover"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/btn_default_hover"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textAllCaps="false"
                    android:textColor="@color/colorDarkGray"
                    android:text="Default Hover" />
            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="16dp">

                <Button
                    android:id="@+id/buttonPrimary"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/btn_primary"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:layout_marginEnd="20dp"
                    android:textAllCaps="false"
                    android:textColor="@color/colorWhite"
                    android:text="Primary" />

                <Button
                    android:id="@+id/buttonPrimaryHover"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/btn_primary_hover"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textAllCaps="false"
                    android:textColor="@color/colorWhite"
                    android:text="Primary Hover" />
            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="16dp">

                <Button
                    android:id="@+id/buttonSuccess"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/btn_success"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:layout_marginEnd="20dp"
                    android:textAllCaps="false"
                    android:textColor="@color/colorWhite"
                    android:text="Success" />

                <Button
                    android:id="@+id/buttonSuccessHover"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/btn_success_hover"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textAllCaps="false"
                    android:textColor="@color/colorWhite"
                    android:text="Success Hover" />
            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="16dp">

                <Button
                    android:id="@+id/buttonInfo"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/btn_info"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:layout_marginEnd="20dp"
                    android:textAllCaps="false"
                    android:textColor="@color/colorWhite"
                    android:text="Info" />

                <Button
                    android:id="@+id/buttonInfoHover"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/btn_info_hover"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textAllCaps="false"
                    android:textColor="@color/colorWhite"
                    android:text="Info Hover" />
            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="16dp">

                <Button
                    android:id="@+id/buttonWarning"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/btn_warning"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:layout_marginEnd="20dp"
                    android:textAllCaps="false"
                    android:textColor="@color/colorWhite"
                    android:text="Warning" />

                <Button
                    android:id="@+id/buttonWarningHover"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/btn_warning_hover"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textAllCaps="false"
                    android:textColor="@color/colorWhite"
                    android:text="Warning Hover" />
            </TableRow>

            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="16dp">

                <Button
                    android:id="@+id/buttonDanger"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/btn_danger"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:layout_marginEnd="20dp"
                    android:textAllCaps="false"
                    android:textColor="@color/colorWhite"
                    android:text="Danger" />

                <Button
                    android:id="@+id/buttonDangerHover"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/btn_danger_hover"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textAllCaps="false"
                    android:textColor="@color/colorWhite"
                    android:text="Danger Hover" />
            </TableRow>


        </TableLayout>



    </LinearLayout>
</ScrollView>

Add comment

avatar_blank_60.png

Comment:

Name:

Email:

Comments

No comments yet. You can be the first one to comment. Just write your comment in the form and click on the submit button.