0% found this document useful (0 votes)
29 views3 pages

Kode Program: Relativelayout

This document contains the code for an Android layout file. The layout defines a form with fields for a user's NPM, name, date of birth, gender, address and two buttons. It organizes these using a RelativeLayout container and places the fields and buttons in a vertical flow aligned as specified.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views3 pages

Kode Program: Relativelayout

This document contains the code for an Android layout file. The layout defines a form with fields for a user's NPM, name, date of birth, gender, address and two buttons. It organizes these using a RelativeLayout container and places the fields and buttons in a vertical flow aligned as specified.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

KODE PROGRAM

<?xml version=
"1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:padding="10dp"
android:background="@drawable/ss"
android:layout_height="match_parent"
tools:context=".UpdateBiodata">

<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
android:inputType="number"
android:maxLength="10"/>
<requestFocus/>

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:text="NPM"/>

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editText1"
android:layout_below="@id/editText1"
android:layout_marginTop="10dp"
android:text="Nama"/>

<EditText
android:id="@+id/editText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/textView2"
android:layout_below="@id/textView2"
android:inputType="text"
android:maxLength="20"/>

<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editText2"
android:layout_below="@+id/editText2"
android:layout_marginTop="10dp"
android:text="Tanggal Lahir"/>

<EditText
android:id="@+id/editText3"
KODE PROGRAM
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView3"
android:layout_below="@+id/textView3"
android:inputType="date"/>

<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editText3"
android:layout_below="@+id/editText3"
android:layout_marginTop="10dp"
android:text="Jenis Kelamain"/>

<EditText
android:id="@+id/editText4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView4"
android:layout_below="@+id/textView4"
android:inputType="text"
android:maxLength="1"
android:hint="L atau P"/>

<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editText4"
android:layout_below="@id/editText4"
android:layout_marginTop="10dp"
android:text="Alamat"
android:inputType="text"
android:maxLength="100"/>

<EditText
android:id="@+id/editText5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView5"
android:layout_below="@+id/textView5"/>

<android.support.design.widget.FloatingActionButton
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/editText5"
android:layout_alignParentBottom="true"
app:fabSize="normal"
android:src="@drawable/update"
android:layout_margin="15dp"/>

<android.support.design.widget.FloatingActionButton
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:fabSize="normal"
android:layout_margin="15dp"
android:layout_alignParentBottom="true"
android:layout_alignRight="@+id/editText5"
android:src="@drawable/back"
KODE PROGRAM
android:layout_alignEnd="@id/editText5"/>
</RelativeLayout>

You might also like