In the below example I have created Business details screen layout. Here, first I have created LinearLayout and added all layouts in this Main(Parent) LinearLayout, After this I have added ScrollView for page scrolling. I have also used TextView, EditText,Button and In drawable folder I have created login_bg.xml layout. You can see below program it will clearly describe you to design Business details layout in android.
Step(1)business_details.xml layout-
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@mipmap/background"
xmlns:android="http://schemas.android.com/apk/res/android">
<include
android:id="@+id/tool_bar"
layout="@layout/toolbar"
>
</include>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@mipmap/background"
xmlns:android="http://schemas.android.com/apk/res/android">
<!--parent linear layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="@dimen/margin_medium"
android:layout_marginLeft="@dimen/margin_medium"
android:layout_marginRight="@dimen/margin_medium">
<!--busines title layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_margin="@dimen/margin_medium"
android:background="@drawable/login_bg">
<EditText
android:id="@+id/businessTitleEditText"
android:hint="@string/business_tittle"
style="@style/edit_text_style"/>
</LinearLayout>
<!--busines title layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_small"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/upload_image"
android:layout_marginLeft="@dimen/margin_medium"
android:textSize="@dimen/text_large"
android:id="@+id/imageUploadedTextView"
android:textColor="@color/font_color"/>
<Button
android:layout_weight="1"
android:id="@+id/imageBrowseButton"
android:layout_width="0dp"
android:layout_height="40dp"
android:background="@drawable/login_btn"
android:text="@string/browse"
android:textSize="@dimen/text_large"
android:textColor="@color/font_color"/>
</LinearLayout>
<!--Business detaisl layout-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/margin_medium"
android:orientation="vertical" >
<!-- <!–Select suberb spinner layoyut–>
<RelativeLayout
android:id="@+id/spinnercategory_layout"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:background="@drawable/login_bg"
android:visibility="visible">
<TextView
android:id="@+id/spinnerCategory"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="text"
android:textColor="@color/font_color"
android:textSize="@dimen/text_large"
android:text="@string/select_category"
android:layout_marginLeft="@dimen/margin_small"
android:background="@android:color/transparent"
android:layout_centerVertical="true"/>
<ImageView
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:paddingRight="@dimen/margin_medium"
android:src="@mipmap/icon_drop_down"/>
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/businee_details"
android:textSize="@dimen/text_large"
android:layout_marginTop="@dimen/margin_medium"
android:textColor="@color/font_color"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:orientation="vertical"
android:background="@drawable/login_bg"
android:layout_marginTop="@dimen/margin_small"
>
<EditText
android:id="@+id/businessDetailsEditText"
android:hint="@string/business_tittle"
android:inputType="textMultiLine"
android:lines="8"
android:minLines="6"
android:gravity="top|left"
android:maxLines="10"
style="@style/edit_text_style2"/>
</LinearLayout>
</LinearLayout>
<!--busines title layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_margin="@dimen/margin_medium"
android:background="@drawable/login_bg">
<EditText
android:id="@+id/businessAddressEditText"
android:hint="@string/business_address"
style="@style/edit_text_style" />
</LinearLayout>
<!--busines address2 layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_margin="@dimen/margin_medium"
android:background="@drawable/login_bg">
<EditText
android:id="@+id/businessAddress2EditText"
android:hint="@string/business_address2"
style="@style/edit_text_style" />
</LinearLayout>
<!--postal code layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_margin="@dimen/margin_medium"
android:background="@drawable/login_bg">
<EditText
android:id="@+id/postalCodeEditText"
android:hint="@string/postal_code"
android:singleLine="true"
style="@style/edit_text_style"
android:inputType="textPostalAddress"/>
</LinearLayout>
<!-- <!–latitude longitude code layout –>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_margin="@dimen/margin_medium"
android:background="@drawable/login_bg">
<EditText
android:id="@+id/latitudeEditText"
android:focusable="false"
android:hint="@string/latitude_longitude"
style="@style/edit_text_style"/>
</LinearLayout>-->
<!--landline phone number layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_margin="@dimen/margin_medium"
android:background="@drawable/login_bg">
<EditText
android:id="@+id/landlineNumberEditText"
android:hint="@string/landline_phone_num"
style="@style/edit_text_style"
android:inputType="phone"/>
</LinearLayout>
<!--cell phone number layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_margin="@dimen/margin_medium"
android:background="@drawable/login_bg">
<EditText
android:id="@+id/cellPhoneNumberEditText"
android:hint="@string/cell_phone_nuber"
style="@style/edit_text_style"
android:inputType="phone"/>
</LinearLayout>
<!--business link layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_margin="@dimen/margin_medium"
android:background="@drawable/login_bg">
<EditText
android:id="@+id/businessLinkEditText"
android:hint="@string/business_url"
style="@style/edit_text_style" />
</LinearLayout>
<!--email layout -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_margin="@dimen/margin_medium"
android:background="@drawable/login_bg">
<EditText
android:id="@+id/emailAddressEditTextEditText"
android:hint="@string/email"
style="@style/edit_text_style"
android:inputType="textEmailAddress"/>
</LinearLayout>
<!--Login button-->
<Button
android:id="@+id/signUpButton"
android:layout_marginLeft="@dimen/margin_large"
android:layout_marginRight="@dimen/margin_large"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_large"
android:layout_marginBottom="@dimen/margin_large"
android:background="@drawable/login_btn"
android:text="@string/add_business"
android:textSize="@dimen/text_large"
android:textColor="@color/font_color"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
Step(2)-In drawable folder I hve created login_bg.xml layout-
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke
android:width="0.5dip"
android:color="@color/font_color" />
<gradient android:angle="270" />
<corners android:radius="6dp" />
</shape>
0 Comment(s)