askIT

Android Sign up xml

sign_up.png

This page will show you a layout for a example sign up page in Android.

res/drawable/logo.png

logo.png
Figure: Logo used in this design (also avaible as psd)

res/layout/sign_up.xml

<?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="match_parent"
        android:layout_marginRight="24dp"
        android:layout_marginLeft="24dp">

        <!-- Logo -->
        <ImageView
            android:id="@+id/imageViewLogo"
            android:layout_width="wrap_content"
            android:layout_height="72dp"
            android:layout_gravity="center_horizontal"
            android:layout_marginBottom="24dp"
            android:layout_marginTop="24dp"
            android:src="@drawable/logo" />
        <!-- //Logo -->

        <!-- Error handling -->
        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent" >
                <ImageView
                    android:id="@+id/imageViewError"
                    android:src="@drawable/dialog_error"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    />
                <TextView
                    android:id="@+id/textViewErrorMessage"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="Error!"
                    android:layout_marginTop="8dp"
                    android:layout_marginLeft="8dp"
                    /><!-- @string/blank -->
                </TableRow>
        </TableLayout>
        <!-- //Error handling -->



        <!-- Table layout -->
        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <!-- Email -->
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent" >

                <TextView
                    android:id="@+id/textViewEmail"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/email" />

                <EditText
                    android:id="@+id/editTextEmail"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:ems="10"
                    android:inputType="textEmailAddress" />
            </TableRow>
            <!-- //Email -->

            <!-- Date of Birth -->
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="12dp"
                >

                <TextView
                    android:id="@+id/textView2"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/date_of_birth"
                    android:layout_marginTop="4dp"
                    android:layout_marginRight="2dp" />

                <TableLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="match_parent" >


                        <Spinner
                            android:id="@+id/spinnerDOBDay"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content" />


                        <Spinner
                            android:id="@+id/spinnerDOBMonth"
                            android:entries="@array/array_months"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content" />

                        <Spinner
                            android:id="@+id/spinnerDOBYear"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content" />
                    </TableRow>


                </TableLayout>

            </TableRow>
            <!-- //Date of Birth -->


            <!-- Gender -->
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="12dp" >

                <TextView
                    android:id="@+id/textView7"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/gender"
                    android:layout_marginTop="8dp" />

                <TableLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" >


                        <RadioGroup
                            android:id="@+id/radioGroupGender"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal">

                            <RadioButton
                                android:id="@+id/radioButtonGenderMale"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:checked="true"
                                android:text="@string/male"
                                android:layout_marginRight="5dp"/>

                            <RadioButton
                                android:id="@+id/radioButtonGenderFemale"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="@string/female" />
                        </RadioGroup>
                    </TableRow>

                </TableLayout>

                <TextView
                    android:id="@+id/textViewx"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/blank" />

            </TableRow>
            <!-- //Gender -->

            <!-- Mesurment -->
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="12dp" >

                <TextView
                    android:id="@+id/textView8"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/mesurment" />

                <Spinner
                    android:id="@+id/spinnerMesurment"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:entries="@array/array_mesurments" />


            </TableRow>
            <!-- //Mesurment -->

            <!-- Height -->
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="12dp" >

                <TextView
                    android:id="@+id/textView9"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/height"
                    android:layout_marginTop="12dp" />

                <TableLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" >

                        <EditText
                            android:id="@+id/editTextHeightCm"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:ems="3"
                            android:inputType="number" />

                        <EditText
                            android:id="@+id/editTextHeightInches"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:ems="3"
                            android:inputType="number" />

                        <TextView
                            android:id="@+id/textViewCm"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/cm" />
                    </TableRow>
                </TableLayout>
            </TableRow>
            <!-- //Height -->


            <!-- Weight -->
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="12dp" >

                <TextView
                    android:id="@+id/textView11"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/weight"
                    android:layout_marginTop="12dp" />

                <TableLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TableRow
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" >

                        <EditText
                            android:id="@+id/editTextWeight"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:ems="3"
                            android:inputType="number" />

                        <TextView
                            android:id="@+id/textViewKg"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="@string/kg" />
                    </TableRow>
                </TableLayout>
            </TableRow>
            <!-- //Weight -->

            <!-- Activity Level -->
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="12dp" >

                <TextView
                    android:id="@+id/textView13"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/activity_level"
                    />

                <Spinner
                    android:id="@+id/spinnerActivityLevel"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:entries="@array/array_activity_levels" />

            </TableRow>
            <!-- //Activity Level -->

            <!-- Submit button -->
            <TableRow
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="12dp" >

                <TextView
                    android:id="@+id/textView14"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/blank"
                    android:layout_marginTop="12dp" />

                <Button
                    android:id="@+id/buttonSignUp"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Sign up" />
                <TextView
                    android:id="@+id/textView15"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/blank"
                    android:layout_marginTop="12dp" />

            </TableRow>
            <!-- //Submit button -->



        </TableLayout>

    </LinearLayout>

</ScrollView>

res/values/strings.xml

<resources>
    <string name="app_name">StramDiet</string>
    <string name="email">Email</string>
    <string name="date_of_birth">Date of birth</string>
    <string name="gender">Gender</string>
    <string name="male">Male</string>
    <string name="female">Female</string>
    <string name="height">Height</string>
    <string name="activity_level">Activity level</string>
    <string name="weight">Weight</string>
    <string name="target_weight">Target weight</string>
    <string name="mesurment">Mesurment</string>
    <string name="cm">cm</string>
    <string name="feet_inches">feet and inches</string>
    <string name="kg">kg</string>
    <string name="pound">pound</string>


    <string-array name="array_mesurments">
        <item>Metric</item>
        <item>Imperial</item>
    </string-array>

    <string name="metric">Metric</string>
    <string name="imperial">Imperial</string>

    <string name="day">Day</string>
    <string name="month">Month</string>
    <string name="year">Year</string>

    <string-array name="array_months">
        <item>January</item>
        <item>February</item>
        <item>March</item>
        <item>April</item>
        <item>May</item>
        <item>June</item>
        <item>July</item>
        <item>August</item>
        <item>September</item>
        <item>October</item>
        <item>November</item>
        <item>December</item>
    </string-array>
    <string name="january">January</string>
    <string name="february">February</string>
    <string name="march">March</string>
    <string name="april">April</string>
    <string name="may">May</string>
    <string name="june">June</string>
    <string name="july">July</string>
    <string name="august">August</string>
    <string name="september">September</string>
    <string name="october">October</string>
    <string name="november">November</string>
    <string name="december">December</string>
    <string name="blank"> </string>


    <string-array name="array_activity_levels">
        <item>Little to no exercise</item>
        <item>Light exercise (1-3 days per week)</item>
        <item>Moderate exercise (3-5 days per week)</item>
        <item>Heavy exercise (6-7 days per week)</item>
        <item>Very heavy exercise (twice per day, extra heavy workouts)</item>
    </string-array>

    <string name="i_want_to">I want to</string>
    <string name="sign_up">Sign up</string>
</resources>

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.