diff --git a/Habitica/res/layout/avatar_with_bars.xml b/Habitica/res/layout/avatar_with_bars.xml index 205fc263e..bcb7c1820 100644 --- a/Habitica/res/layout/avatar_with_bars.xml +++ b/Habitica/res/layout/avatar_with_bars.xml @@ -7,85 +7,91 @@ android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:adjustViewBounds="true" + android:background="@color/brand" android:focusable="true" android:focusableInTouchMode="true" android:orientation="vertical" - android:background="@color/brand" + android:paddingEnd="@dimen/header_border_spacing" android:paddingLeft="@dimen/header_border_spacing" android:paddingRight="@dimen/header_border_spacing" - android:paddingStart="@dimen/header_border_spacing" - android:paddingEnd="@dimen/header_border_spacing"> + android:paddingStart="@dimen/header_border_spacing"> + + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + android:id="@+id/avatarView" + android:layout_width="@dimen/avatar_header_width" + android:layout_height="@dimen/avatar_header_height" + android:layout_gravity="center_vertical" + android:layout_marginEnd="16dp" + android:layout_marginRight="16dp" + app:showBackground="true" + app:showMount="true" + app:showPet="true"/> - - + android:orientation="vertical"> + android:id="@+id/hpBar" + layout="@layout/value_bar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/header_bar_spacing" + app:barForegroundColor="@color/hpColor" + app:description="@string/HP_default"/> + android:id="@+id/xpBar" + layout="@layout/value_bar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/header_bar_spacing" + app:barForegroundColor="@color/xpColor" + app:description="@string/XP_default"/> + + + - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_vertical" + android:paddingBottom="6dp" + android:paddingTop="2dp"> + + + - + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_weight="1"/> + + \ No newline at end of file diff --git a/Habitica/res/layout/value_bar.xml b/Habitica/res/layout/value_bar.xml index d3b65d9e7..17d25b0f3 100644 --- a/Habitica/res/layout/value_bar.xml +++ b/Habitica/res/layout/value_bar.xml @@ -1,65 +1,73 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/value_bar_layout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="@dimen/bar_padding" + android:orientation="horizontal"> + - - - - - - - - + android:layout_alignBottom="@id/progressBar" + android:layout_alignTop="@+id/progressBar" + android:layout_marginEnd="@dimen/bar_icon_padding" + android:layout_marginRight="@dimen/bar_icon_padding" + android:contentDescription="Bar Icon" + android:scaleType="center" + android:visibility="gone"/> + + + + + + + + + + + + diff --git a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/CurrencyViews.kt b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/CurrencyViews.kt index afc6e87c9..de8405a5e 100644 --- a/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/CurrencyViews.kt +++ b/Habitica/src/main/java/com/habitrpg/android/habitica/ui/views/CurrencyViews.kt @@ -1,6 +1,7 @@ package com.habitrpg.android.habitica.ui.views import android.content.Context +import android.os.Build import android.util.AttributeSet import android.util.TypedValue import android.widget.LinearLayout @@ -53,6 +54,9 @@ class CurrencyViews : LinearLayout { this.addView(view) val params = view.layoutParams as LayoutParams params.setMargins(margin, 0, 0, 0) + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + params.marginStart = margin + } view.layoutParams = params } }