mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-22 05:38:55 +00:00
update header design. Fixes #1345
This commit is contained in:
parent
74bceccaf4
commit
6bc2365232
7 changed files with 17 additions and 21 deletions
|
|
@ -32,7 +32,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:titleEnabled="false"
|
||||
app:contentScrim="?attr/colorPrimary"
|
||||
app:contentScrim="?attr/colorPrimaryDark"
|
||||
app:expandedTitleMarginEnd="?attr/actionBarSize"
|
||||
app:expandedTitleMarginStart="0dp"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
|
|
@ -51,6 +51,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="@style/Toolbar"
|
||||
android:background="?attr/colorPrimaryDark"
|
||||
app:layout_collapseMode="pin"
|
||||
app:popupTheme="@style/Theme.AppCompat.Light">
|
||||
<RelativeLayout
|
||||
|
|
@ -87,7 +88,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="54dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="?colorPrimaryOffset"
|
||||
android:background="?colorPrimary"
|
||||
android:elevation="0dp"
|
||||
android:fillViewport="false"
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="?colorPrimary"
|
||||
android:background="?colorPrimaryDark"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
|
|
@ -24,8 +24,7 @@
|
|||
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"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:contentDescription="@string/sidebar_avatar"
|
||||
app:showBackground="true"
|
||||
app:showMount="true"
|
||||
|
|
|
|||
|
|
@ -11,10 +11,8 @@
|
|||
android:id="@+id/ic_header"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
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="@null"
|
||||
android:scaleType="center"
|
||||
android:visibility="gone"/>
|
||||
|
|
@ -24,7 +22,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/bar_size"
|
||||
android:layout_toEndOf="@id/ic_header"
|
||||
android:layout_toRightOf="@id/ic_header"
|
||||
android:orientation="horizontal"/>
|
||||
|
||||
<LinearLayout
|
||||
|
|
@ -33,15 +30,13 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/progressBar"
|
||||
android:layout_toEndOf="@id/ic_header"
|
||||
android:layout_toRightOf="@id/ic_header"
|
||||
android:paddingTop="4dp">
|
||||
android:paddingTop="2dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/secondaryIconView"
|
||||
android:layout_width="@dimen/icon_size"
|
||||
android:layout_height="@dimen/icon_size"
|
||||
android:layout_marginEnd="@dimen/spacing_small"
|
||||
android:layout_marginRight="@dimen/spacing_small"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
|
|
@ -57,7 +52,6 @@
|
|||
android:layout_width="@dimen/icon_size"
|
||||
android:layout_height="@dimen/icon_size"
|
||||
android:layout_marginEnd="@dimen/spacing_small"
|
||||
android:layout_marginRight="@dimen/spacing_small"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
|
|
|
|||
|
|
@ -19,14 +19,14 @@
|
|||
<dimen name="party_invite_separator">4dp</dimen>
|
||||
<dimen name="party_invite_text_width">140dp</dimen>
|
||||
|
||||
<dimen name="bar_size">15dp</dimen>
|
||||
<dimen name="bar_size">8dp</dimen>
|
||||
<dimen name="bar_padding">5dp</dimen>
|
||||
<dimen name="bar_padding_small">2dp</dimen>
|
||||
<dimen name="bar_radius">5dp</dimen>
|
||||
<dimen name="avatar_width">140dp</dimen>
|
||||
<dimen name="avatar_height">147dp</dimen>
|
||||
<dimen name="avatar_header_width">108dp</dimen>
|
||||
<dimen name="avatar_header_height">113dp</dimen>
|
||||
<dimen name="avatar_header_width">94dp</dimen>
|
||||
<dimen name="avatar_header_height">98dp</dimen>
|
||||
|
||||
<dimen name="quest_image_width">219dp</dimen>
|
||||
|
||||
|
|
@ -64,9 +64,9 @@
|
|||
<dimen name="mount_image_width">81dp</dimen>
|
||||
<dimen name="mount_image_height">99dp</dimen>
|
||||
<dimen name="shop_height">124dp</dimen>
|
||||
<dimen name="bar_icon_padding">10dp</dimen>
|
||||
<dimen name="bar_icon_padding">6dp</dimen>
|
||||
<dimen name="task_text_padding">16dp</dimen>
|
||||
<dimen name="header_bar_spacing">7dp</dimen>
|
||||
<dimen name="header_bar_spacing">3dp</dimen>
|
||||
<dimen name="bar_size_slim">13dp</dimen>
|
||||
|
||||
<dimen name="spacing_small">4dp</dimen>
|
||||
|
|
|
|||
|
|
@ -257,6 +257,7 @@
|
|||
<!-- used activity_main.xml -->
|
||||
<style name="Toolbar" parent="Base.ThemeOverlay.AppCompat.ActionBar">
|
||||
<item name="android:textColorPrimary">@color/white</item>
|
||||
<item name="background">?attr/colorPrimaryDark</item>
|
||||
</style>
|
||||
|
||||
<style name="HabitButton" parent="android:Widget.Button">
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class HabiticaIconsHelper {
|
|||
if (imageOfExperience != null)
|
||||
return imageOfExperience;
|
||||
|
||||
int size = scaleSize(18);
|
||||
int size = scaleSize(24);
|
||||
imageOfExperience = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(imageOfExperience);
|
||||
canvas.scale(displayDensity, displayDensity);
|
||||
|
|
@ -42,7 +42,7 @@ public class HabiticaIconsHelper {
|
|||
if (imageOfMagic != null)
|
||||
return imageOfMagic;
|
||||
|
||||
int size = scaleSize(18);
|
||||
int size = scaleSize(24);
|
||||
imageOfMagic = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(imageOfMagic);
|
||||
canvas.scale(displayDensity, displayDensity);
|
||||
|
|
@ -164,7 +164,7 @@ public class HabiticaIconsHelper {
|
|||
if (imageOfHeartLightBg != null)
|
||||
return imageOfHeartLightBg;
|
||||
|
||||
int size = scaleSize(18);
|
||||
int size = scaleSize(24);
|
||||
imageOfHeartLightBg = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
|
||||
Canvas canvas = new Canvas(imageOfHeartLightBg);
|
||||
canvas.scale(displayDensity, displayDensity);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import android.widget.ImageView
|
|||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.habitrpg.android.habitica.R
|
||||
import com.habitrpg.android.habitica.extensions.dpToPx
|
||||
import com.habitrpg.android.habitica.extensions.getThemeColor
|
||||
import com.habitrpg.android.habitica.ui.helpers.bindView
|
||||
import java.math.RoundingMode
|
||||
|
|
@ -73,7 +74,7 @@ class ValueBar(context: Context, attrs: AttributeSet?) : FrameLayout(context, at
|
|||
progressBar.barPendingColor = attributes?.getColor(R.styleable.ValueBar_barPendingColor, 0) ?: 0
|
||||
progressBar.barBackgroundColor = attributes?.getColor(R.styleable.ValueBar_barBackgroundColor, 0) ?: 0
|
||||
|
||||
val labelSpacing = attributes?.getDimension(R.styleable.ValueBar_labelSpacing, context.resources.getDimension(R.dimen.spacing_small))
|
||||
val labelSpacing = attributes?.getDimension(R.styleable.ValueBar_labelSpacing, 2.dpToPx(context).toFloat())
|
||||
if (labelSpacing != null) {
|
||||
labelWrapper.setPadding(0, labelSpacing.toInt(), 0, 0)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue