From f20b9140f19d306f7866d6ab0863d225520719b7 Mon Sep 17 00:00:00 2001 From: Ezerous Date: Sun, 31 May 2020 13:15:28 +0300 Subject: [PATCH] Pad and center personal text in ProfileActivity --- .../thmmy/mthmmy/activities/profile/ProfileActivity.java | 2 +- app/src/main/res/layout-v21/activity_profile.xml | 7 ++++++- app/src/main/res/layout/activity_profile.xml | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java index 380a827b..81f70fae 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java @@ -312,7 +312,7 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment loadAvatar(false); else loadAvatar(true); - if (personalText != null) { + if (personalText != null && !personalText.isEmpty()) { personalTextView.setText(personalText); personalTextView.setVisibility(View.VISIBLE); } diff --git a/app/src/main/res/layout-v21/activity_profile.xml b/app/src/main/res/layout-v21/activity_profile.xml index f8f2faff..34064eaf 100644 --- a/app/src/main/res/layout-v21/activity_profile.xml +++ b/app/src/main/res/layout-v21/activity_profile.xml @@ -37,7 +37,7 @@ android:id="@+id/user_thumbnail" android:layout_width="@dimen/profile_activity_avatar_size" android:layout_height="@dimen/profile_activity_avatar_size" - android:layout_marginBottom="5dp" + android:layout_marginBottom="6dp" android:layout_gravity="center" android:adjustViewBounds="true" android:contentDescription="@string/post_thumbnail" @@ -50,6 +50,11 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:paddingTop="6dp" + android:paddingBottom="4dp" + android:textAlignment="center" android:textColor="@color/primary_text" android:visibility="gone"/> diff --git a/app/src/main/res/layout/activity_profile.xml b/app/src/main/res/layout/activity_profile.xml index 3a63ad27..097805a6 100644 --- a/app/src/main/res/layout/activity_profile.xml +++ b/app/src/main/res/layout/activity_profile.xml @@ -37,7 +37,7 @@ android:id="@+id/user_thumbnail" android:layout_width="@dimen/profile_activity_avatar_size" android:layout_height="@dimen/profile_activity_avatar_size" - android:layout_marginBottom="5dp" + android:layout_marginBottom="6dp" android:layout_gravity="center" android:adjustViewBounds="true" android:contentDescription="@string/post_thumbnail" @@ -49,6 +49,11 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:paddingTop="6dp" + android:paddingBottom="4dp" + android:textAlignment="center" android:textColor="@color/primary_text" android:visibility="gone"/>