Created user page fragment

This commit is contained in:
Pierre
2018-01-13 17:47:59 +01:00
parent e837449f5c
commit df91120b66
6 changed files with 353 additions and 5 deletions

View File

@ -0,0 +1,36 @@
<?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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
style="@style/UserPageHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- User name and account image -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/user_account_image"
android:layout_width="@dimen/account_image_default_width"
android:layout_height="@dimen/account_image_default_height"
android:src="@drawable/default_account_image"
android:contentDescription="@string/user_image_description"/>
<TextView
android:id="@+id/user_account_name"
style="@style/UserPageName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="User name"/>
</LinearLayout>
</FrameLayout>
</LinearLayout>

View File

@ -8,4 +8,22 @@
<item name="colorAccent">@color/colorAccent</item>
</style>
<!-- User page fragment -->
<!-- User page header -->
<style name="UserPageHeader">
<item name="android:background">@color/colorPrimary</item>
<item name="android:paddingTop">1dp</item>
<item name="android:paddingBottom">5dp</item>
<item name="android:paddingStart">5dp</item>
<item name="android:paddingEnd">5dp</item>
</style>
<!-- User name -->
<style name="UserPageName">
<item name="android:layout_gravity">center</item>
<item name="android:textColor">#ffffff</item>
<item name="android:textSize">20sp</item>
<item name="android:paddingStart">5dp</item>
<item name="android:paddingEnd">5dp</item>
</style>
</resources>