Skip to content

Instantly share code, notes, and snippets.

@rpandey1234
Created June 13, 2020 14:42
Show Gist options
  • Select an option

  • Save rpandey1234/b64049bb59864824ef9ba641b44fc4d7 to your computer and use it in GitHub Desktop.

Select an option

Save rpandey1234/b64049bb59864824ef9ba641b44fc4d7 to your computer and use it in GitHub Desktop.
Layout file for the Magic 8 Ball Android app
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Ask a yes/no question"
android:textAppearance="@style/TextAppearance.AppCompat.Large" />
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center_horizontal"
android:hint="Will it rain tomorrow?"
android:inputType="textShortMessage" />
<ImageButton
android:id="@+id/btnAnswer"
android:layout_width="250dp"
android:layout_height="250dp"
android:src="@mipmap/ic_launcher_round" />
<TextView
android:id="@+id/tvAnswer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:hint="..."
android:textAppearance="@style/TextAppearance.AppCompat.Display1"
android:textStyle="bold" />
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment