Skip to content

Instantly share code, notes, and snippets.

@luqmanoop
Last active September 2, 2017 20:08
Show Gist options
  • Save luqmanoop/06fd72e3254a476623528c92097e6e47 to your computer and use it in GitHub Desktop.
Save luqmanoop/06fd72e3254a476623528c92097e6e47 to your computer and use it in GitHub Desktop.
HNG profile app example layout
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
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"
tools:context="your_package_name.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="300dp"
android:scaleType="centerCrop"
android:src="@drawable/image_name_with_extension"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:padding="16dp">
<TextView
style="@style/MyTextStyle"
android:text="Name: Code Bobrisky"/>
<TextView
style="@style/MyTextStyle"
android:autoLink="web"
android:text="Github https://github.com/github_username"/>
<TextView
style="@style/MyTextStyle"
android:autoLink="web"
android:text="Slack: https://hnginterns.slack.com/team/slack_username"/>
<TextView
style="@style/MyTextStyle"
android:autoLink="phone"
android:text="Phone: +234 80 000 000 000"
android:textSize="16sp"/>
<TextView
style="@style/MyTextStyle"
android:text="About Me: I code all day and sleep all night!"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="@color/colorAccent"
android:onClick="sendEmail"
android:text="email me"
android:textColor="#fff"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
@luqmanoop
Copy link
Author

luqmanoop commented Aug 30, 2017

<!-- add this in styles.xml -->

<style name="MyTextStyle">
        <item name="android:fontFamily">sans-serif-medium</item>
        <item name="android:layout_marginTop">15dp</item>
        <item name="android:layout_marginBottom">15dp</item>
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textSize">16sp</item>
        <item name="android:gravity">center</item>
    </style>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment