Using blurred avatar as background. (#532)

Fixing NullPointerException when image isn't loaded yet.

Display country instead of raw language code.

Minor improvements and contrasting color.

First changes.

Co-authored-by: opyale <opyale@noreply.gitea.io>
Reviewed-by: M M Arif <mmarif@noreply.codeberg.org>
This commit is contained in:
opyale
2020-06-06 22:04:07 +02:00
committed by M M Arif
parent e267aa5100
commit acc55e3433
12 changed files with 371 additions and 225 deletions

View File

@ -1,8 +1,8 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:background="?attr/primaryBackgroundColor"
android:orientation="vertical"
android:gravity="center"
@ -239,4 +239,4 @@
</LinearLayout>
</ScrollView>
</ScrollView>

View File

@ -10,58 +10,89 @@
<RelativeLayout
android:id="@+id/aboutFrame"
android:layout_width="match_parent"
android:layout_height="172dp"
android:orientation="vertical"
android:background="@drawable/nav_background"
android:gravity="top">
android:layout_height="200dp"
android:gravity="top"
android:orientation="vertical">
<LinearLayout
android:id="@+id/layoutFrameAccount"
<ImageView
android:id="@+id/userAvatarBackground"
android:layout_width="match_parent"
android:layout_height="186dp"
android:padding="16dp"
android:orientation="vertical">
android:layout_height="match_parent"
android:contentDescription="@string/generalImgContentText"
android:scaleType="centerCrop" />
<ImageView
android:id="@+id/userAvatar"
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_marginBottom="8dp"
android:layout_gravity="center"
android:contentDescription="@string/generalImgContentText"
android:src="@mipmap/app_logo_round" />
<eightbitlab.com.blurview.BlurView
android:id="@+id/blurView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:blurOverlayColor="@color/blurColor">
<TextView
android:id="@+id/userFullName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textIsSelectable="true"
android:layout_marginBottom="8dp"
android:textSize="16sp"
android:textColor="@color/white"
android:layout_gravity="center" />
<LinearLayout
android:id="@+id/layoutFrameAccount"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/userLogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textIsSelectable="true"
android:layout_marginBottom="8dp"
android:textSize="16sp"
android:textColor="@color/white"
android:layout_gravity="center" />
<ImageView
android:id="@+id/userAvatar"
android:layout_width="54dp"
android:layout_height="54dp"
android:layout_marginBottom="8dp"
android:contentDescription="@string/generalImgContentText"
android:src="@mipmap/app_logo_round" />
<TextView
android:id="@+id/userEmail"
android:textIsSelectable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="0dp"
android:textSize="16sp"
android:textColor="@color/white"
android:layout_gravity="center" />
<TextView
android:id="@+id/userFullName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textIsSelectable="true"
android:textSize="18sp" />
</LinearLayout>
<TextView
android:id="@+id/userLogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:textColor="@color/white"
android:textIsSelectable="true"
android:textSize="14sp" />
<View
android:layout_width="50dp"
android:layout_height="1dp"
android:layout_marginBottom="10dp"
android:background="@color/colorWhite" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="18dp"
android:layout_marginRight="2dp"
android:contentDescription="@string/generalImgContentText"
android:src="@drawable/ic_language"
app:tint="@color/colorWhite" />
<TextView
android:id="@+id/userLanguage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textIsSelectable="true"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
</eightbitlab.com.blurview.BlurView>
</RelativeLayout>
@ -108,4 +139,4 @@
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</LinearLayout>
</LinearLayout>

View File

@ -25,7 +25,6 @@
android:id="@+id/userFullName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="@string/userName"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
@ -34,10 +33,9 @@
android:id="@+id/userName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="@string/userName"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
android:textSize="14sp" />
</LinearLayout>

View File

@ -25,7 +25,6 @@
android:id="@+id/userFullName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="@string/userName"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
@ -34,10 +33,9 @@
android:id="@+id/userName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:text="@string/userName"
android:textColor="?attr/primaryTextColor"
android:textSize="16sp" />
android:textSize="14sp" />
</LinearLayout>

View File

@ -1,62 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/navHeaderFrame"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="@drawable/nav_background"
android:gravity="bottom"
android:paddingTop="16dp">
android:layout_height="200dp">
<ImageView
android:id="@+id/userAvatar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_android"
android:maxHeight="24dp"
android:maxWidth="24dp"
android:paddingStart="20dp"
android:paddingEnd="5dp"
android:contentDescription="@string/app_name"/>
<TextView
android:id="@+id/userFullname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:text="@string/app_name"
android:textSize="18sp"
android:textIsSelectable="true"
android:textColor="@color/white"
android:paddingStart="20dp"
android:paddingEnd="5dp" />
<LinearLayout
android:orientation="horizontal"
android:id="@+id/userAvatarBackground"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
android:layout_height="match_parent"
android:contentDescription="@string/generalImgContentText"
android:scaleType="centerCrop" />
<TextView
android:id="@+id/userEmail"
android:layout_width="0dp"
android:layout_weight="0.85"
android:layout_height="wrap_content"
android:text="@string/appEmail"
android:textSize="14sp"
android:textIsSelectable="true"
android:textColor="@color/white"
android:gravity="start"
android:layout_gravity="center_vertical"
android:paddingStart="20dp"
android:paddingEnd="5dp" />
</LinearLayout>
<View
<eightbitlab.com.blurview.BlurView
android:id="@+id/blurView"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="?attr/dividerColor" />
android:layout_height="match_parent"
app:blurOverlayColor="@color/blurColor">
</LinearLayout>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:paddingTop="16dp">
<ImageView
android:id="@+id/userAvatar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_android"
android:maxHeight="24dp"
android:maxWidth="24dp"
android:paddingStart="20dp"
android:paddingEnd="5dp"
android:contentDescription="@string/app_name"/>
<TextView
android:id="@+id/userFullname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:text="@string/app_name"
android:textSize="18sp"
android:textIsSelectable="true"
android:textColor="@color/white"
android:paddingStart="20dp"
android:paddingEnd="5dp" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<TextView
android:id="@+id/userEmail"
android:layout_width="0dp"
android:layout_weight="0.85"
android:layout_height="wrap_content"
android:text="@string/appEmail"
android:textSize="14sp"
android:textIsSelectable="true"
android:textColor="@color/white"
android:gravity="start"
android:layout_gravity="center_vertical"
android:paddingStart="20dp"
android:paddingEnd="5dp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:background="?attr/dividerColor" />
</LinearLayout>
</eightbitlab.com.blurview.BlurView>
</RelativeLayout>