Skip to content

Instantly share code, notes, and snippets.

View kalvian1060's full-sized avatar

kalvian1060 kalvian1060

View GitHub Profile
@kalvian1060
kalvian1060 / main_activity.xml
Created May 13, 2017 03:32
Belajar Relavite Layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
</RelativeLayout>
@kalvian1060
kalvian1060 / main
Created May 13, 2017 03:35
Add 2 Button
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:text="Button1"
android:id="@+id/button1"
android:layout_width="wrap_content"
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:text="Button1"
android:id="@+id/button1"
android:layout_width="wrap_content"
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:layout_below="@+id/button2"
android:text="Button1"
android:id="@+id/button1"
@kalvian1060
kalvian1060 / main_activity.xml
Created May 13, 2017 04:25
Penggunaan Relative Layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#dce0e8">
<ImageView
android:id="@+id/icon_image"
@kalvian1060
kalvian1060 / main_linear.xml
Created May 13, 2017 07:20
Contoh Orientasi Horizontal dan Vertical Linear Layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8"
@kalvian1060
kalvian1060 / main_activity6.xml
Created May 13, 2017 07:50
Pengunaan Linear Layout horizontal dan vertical
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
@kalvian1060
kalvian1060 / main_activity.xml
Created May 16, 2017 14:24
Perubahan pada Layout main_activity.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp">
<Button
android:id="@+id/audio1"
android:layout_width="match_parent"
@kalvian1060
kalvian1060 / string.xml
Created May 16, 2017 14:25
Resoure untuk string button
<resources>
<string name="app_name">BelajarActivity</string>
<string name="audio1">Audio1</string>
<string name="audio2">Audio2</string>
<string name="audio3">Audio3</string>
</resources>