Advertisement
Guest User

activity_main.xml

a guest
Mar 21st, 2017
38,037
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.40 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <RelativeLayout
  3.         xmlns:android="http://schemas.android.com/apk/res/android"
  4.         xmlns:tools="http://schemas.android.com/tools"
  5.         android:layout_width="match_parent"
  6.         android:layout_height="match_parent"
  7.         android:id="@+id/activity_main"
  8.         android:layout_marginTop="@dimen/activity_vertical_margin"
  9.         android:layout_marginBottom="@dimen/activity_vertical_margin"
  10.         android:layout_marginRight="@dimen/activity_vertical_margin"
  11.         android:layout_marginLeft="@dimen/activity_vertical_margin"
  12.         >
  13.  
  14.  
  15.     <TextView
  16.             android:text="Apa ibukota Indonesia? \n jawab :"
  17.             android:layout_width="wrap_content"
  18.             android:layout_height="wrap_content"
  19.             android:id="@+id/textView"
  20.             android:textSize="30sp"
  21.             android:textColor="@android:color/black"
  22.             android:layout_alignParentTop="true"
  23.             android:layout_centerHorizontal="true"
  24.             android:textStyle="bold"/>
  25.  
  26.     <RadioGroup
  27.             android:layout_width="wrap_content"
  28.             android:layout_height="wrap_content"
  29.             android:layout_below="@+id/textView"
  30.             android:layout_centerHorizontal="true"
  31.             android:layout_marginTop="39dp"
  32.             android:id="@+id/radioGroup"
  33.  
  34.             >
  35.  
  36.  
  37.     <RadioButton
  38.             android:text="Bandung"
  39.             android:foreground="?attr/selectableItemBackground"
  40.             android:layout_width="wrap_content"
  41.             android:layout_height="wrap_content"
  42.             android:id="@+id/radioButton"
  43.             android:onClick="onRadioButton"
  44.             android:layout_toLeftOf="@+id/radioGroup"
  45.             android:layout_toStartOf="@+id/radioGroup"
  46.             android:layout_below="@+id/radioGroup"/>
  47.  
  48.     <RadioButton
  49.             android:text="Surabaya"
  50.             android:foreground="?attr/selectableItemBackground"
  51.             android:onClick="onRadioButton"
  52.             android:layout_width="wrap_content"
  53.             android:layout_height="wrap_content"
  54.             android:layout_below="@+id/radioButton"
  55.             android:layout_alignLeft="@+id/radioButton"
  56.             android:layout_alignStart="@+id/radioButton"
  57.             android:layout_marginTop="36dp"
  58.             android:id="@+id/radioButton2"/>
  59.  
  60.     <RadioButton
  61.             android:text="Jakarta"
  62.             android:foreground="?attr/selectableItemBackground"
  63.             android:onClick="onRadioButton"
  64.             android:layout_width="wrap_content"
  65.             android:layout_height="wrap_content"
  66.             android:layout_marginTop="26dp"
  67.             android:id="@+id/radioButton3"
  68.             android:layout_below="@+id/radioButton2"
  69.             android:layout_alignLeft="@+id/radioButton2"
  70.             android:layout_alignStart="@+id/radioButton2"/>
  71.  
  72.     <RadioButton
  73.             android:text="Yogyakarta"
  74.             android:foreground="?attr/selectableItemBackground"
  75.             android:onClick="onRadioButton"
  76.             android:layout_width="wrap_content"
  77.             android:layout_height="wrap_content"
  78.             android:layout_below="@+id/radioButton3"
  79.             android:layout_alignLeft="@+id/radioButton3"
  80.             android:layout_alignStart="@+id/radioButton3"
  81.             android:layout_marginTop="39dp"
  82.             android:id="@+id/radioButton4"/>
  83.  
  84.     </RadioGroup>
  85.  
  86. </RelativeLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement