Skip to content

Instantly share code, notes, and snippets.

@ssaurel
Last active January 1, 2020 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssaurel/6ffd0f33018400b10d84a0dfc2757da0 to your computer and use it in GitHub Desktop.
Save ssaurel/6ffd0f33018400b10d84a0dfc2757da0 to your computer and use it in GitHub Desktop.
UI for the Anagram Finder App on the SSaurel's Blog
<?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:padding="16dp"
android:orientation="vertical"
tools:context=".MainActivity">
<!-- We add a Dummy layout to prevent EditText to gain focus -->
<LinearLayout
android:focusable="true"
android:focusableInTouchMode="true"
android:layout_width="0px"
android:layout_height="0px"
/>
<EditText
android:id="@+id/input"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/validate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Validate"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp" />
<!-- For simplicity, we use a simple TextView to display results.
For better management, you can use a RecyclerView -->
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp">
<TextView
android:id="@+id/result"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</ScrollView>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment