Skip to content

Instantly share code, notes, and snippets.

@yasriady
Created September 24, 2024 23:09
Show Gist options
  • Save yasriady/51f34f65c699c07d92e69b7ee2dc3c2e to your computer and use it in GitHub Desktop.
Save yasriady/51f34f65c699c07d92e69b7ee2dc3c2e to your computer and use it in GitHub Desktop.
Layout dasar pemrograman android
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
tools:context="com.example.mahasiswa.MainActivity">
<EditText
android:id="@+id/inputNama"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Nama"
android:inputType="textPersonName"
android:textSize="16sp" />
<EditText
android:id="@+id/inputNik"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Nomor Induk Kependudukan"
android:inputType="number"
android:textSize="16sp" />
<EditText
android:id="@+id/inputUmur"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Umur"
android:inputType="number"
android:textSize="16sp" />
<EditText
android:id="@+id/inputAlamat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Alamat"
android:inputType="text"
android:textSize="16sp" />
<EditText
android:id="@+id/inputAsalSekolah"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Asal Sekolah"
android:inputType="textCapWords"
android:textSize="16sp" />
<Button
android:id="@+id/simpan_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="save"
android:text="Save"
android:textAllCaps="true"
android:textSize="16sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="180dp"
android:background="#eceff1"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Nama" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="NIK" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Umur" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Alamat" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Asal Sekolah" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=":" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=":" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=":" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=":" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=":" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:orientation="vertical">
<TextView
android:id="@+id/txtNama"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/txtNik"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/txtUmur"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/txtAlamat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@+id/txtAsalSekolah"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment