mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-19 20:29:02 +00:00
small design updates
This commit is contained in:
parent
19c125a690
commit
1f0c2d20bf
8 changed files with 35 additions and 52 deletions
|
|
@ -179,6 +179,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="11dp"
|
||||
android:lineSpacingExtra="4sp"
|
||||
android:background="@drawable/layout_rounded_bg_window"
|
||||
android:padding="@dimen/spacing_large"
|
||||
tools:text="There’s always more to learn! Maybe it’s a specialized topic you’re interested in, or maybe it’s the experiences of a notable contributor. Read about it and you may win 15 gems!" />
|
||||
</com.habitrpg.android.habitica.ui.views.CollapsibleSectionView>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/refreshLayout"
|
||||
android:background="@color/window_background">
|
||||
android:background="@color/content_background">
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
|
@ -101,10 +101,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="?attr/colorContentBackground">
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/content_background_offset" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -130,11 +126,6 @@
|
|||
style="@style/HabiticaButton.Green"
|
||||
android:layout_marginStart="@dimen/spacing_large"/>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/content_background_offset" />
|
||||
<LinearLayout
|
||||
android:id="@+id/leader_wrapper"
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -183,7 +174,9 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="@string/inn_description"
|
||||
android:layout_marginTop="@dimen/spacing_large" />
|
||||
android:layout_marginTop="@dimen/spacing_large"
|
||||
android:background="@drawable/layout_rounded_bg_window"
|
||||
android:padding="@dimen/spacing_large"/>
|
||||
</com.habitrpg.android.habitica.ui.views.CollapsibleSectionView>
|
||||
<com.habitrpg.android.habitica.ui.views.CollapsibleSectionView
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -195,14 +188,11 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="@string/inn_description"
|
||||
android:layout_marginTop="@dimen/spacing_large" />
|
||||
android:layout_marginTop="@dimen/spacing_large"
|
||||
android:background="@drawable/layout_rounded_bg_window"
|
||||
android:padding="@dimen/spacing_large" />
|
||||
</com.habitrpg.android.habitica.ui.views.CollapsibleSectionView>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/content_background_offset"
|
||||
android:layout_marginTop="@dimen/spacing_medium"/>
|
||||
</LinearLayout>
|
||||
<Button
|
||||
android:id="@+id/leave_button"
|
||||
|
|
|
|||
|
|
@ -38,9 +38,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="?attr/colorContentBackground"
|
||||
android:showDividers="beginning|end|middle"
|
||||
android:divider="@drawable/vertical_divider">
|
||||
android:background="?attr/colorContentBackground">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -180,7 +178,9 @@
|
|||
android:id="@+id/description_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="This is our super awesome party!"/>
|
||||
tools:text="This is our super awesome party!"
|
||||
android:background="@drawable/layout_rounded_bg_window"
|
||||
android:padding="@dimen/spacing_large"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/inn_description"
|
||||
android:layout_marginTop="@dimen/spacing_large"/>
|
||||
android:layout_marginTop="@dimen/spacing_large"
|
||||
android:background="@drawable/layout_rounded_bg_window"
|
||||
android:padding="@dimen/spacing_large"/>
|
||||
</com.habitrpg.android.habitica.ui.views.CollapsibleSectionView>
|
||||
<com.habitrpg.android.habitica.ui.views.CollapsibleSectionView
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -61,7 +63,9 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/guidelines_description"
|
||||
android:layout_marginTop="@dimen/spacing_large"/>
|
||||
android:layout_marginTop="@dimen/spacing_large"
|
||||
android:background="@drawable/layout_rounded_bg_window"
|
||||
android:padding="@dimen/spacing_large"/>
|
||||
</com.habitrpg.android.habitica.ui.views.CollapsibleSectionView>
|
||||
<com.habitrpg.android.habitica.ui.views.CollapsibleSectionView
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -100,7 +104,9 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/tiers_descriptions"/>
|
||||
android:text="@string/tiers_descriptions"
|
||||
android:background="@drawable/layout_rounded_bg_window"
|
||||
android:padding="@dimen/spacing_large"/>
|
||||
</com.habitrpg.android.habitica.ui.views.CollapsibleSectionView>
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
|
@ -5,9 +5,11 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:background="@drawable/layout_rounded_bg_window"
|
||||
android:padding="@dimen/spacing_large"
|
||||
android:foreground="?android:attr/selectableItemBackground"
|
||||
android:focusable="true">
|
||||
android:focusable="true"
|
||||
android:layout_marginBottom="@dimen/spacing_medium">
|
||||
<com.habitrpg.common.habitica.views.AvatarView
|
||||
android:id="@+id/avatarView"
|
||||
android:layout_width="97dp"
|
||||
|
|
@ -88,7 +90,7 @@
|
|||
android:layout_height="@dimen/bar_size"
|
||||
android:id="@+id/health_bar"
|
||||
app:barForegroundColor="@color/hpColor"
|
||||
app:barBackgroundColor="@color/window_background"/>
|
||||
app:barBackgroundColor="@color/offset_background"/>
|
||||
<TextView
|
||||
android:id="@+id/health_textview"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
@ -106,7 +108,7 @@
|
|||
android:layout_height="@dimen/bar_size"
|
||||
android:id="@+id/experience_bar"
|
||||
app:barForegroundColor="@color/xpColor"
|
||||
app:barBackgroundColor="@color/window_background"/>
|
||||
app:barBackgroundColor="@color/offset_background"/>
|
||||
<TextView
|
||||
android:id="@+id/experience_textview"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
@ -124,7 +126,7 @@
|
|||
android:layout_height="@dimen/bar_size"
|
||||
android:id="@+id/mana_bar"
|
||||
app:barForegroundColor="@color/mpColor"
|
||||
app:barBackgroundColor="@color/window_background"/>
|
||||
app:barBackgroundColor="@color/offset_background"/>
|
||||
<TextView
|
||||
android:id="@+id/mana_textview"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
|||
|
|
@ -5,11 +5,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:parentTag="android.widget.LinearLayout">
|
||||
<View
|
||||
android:id="@+id/separator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/content_background_offset"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/section_title_view"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ package com.habitrpg.android.habitica.ui.views
|
|||
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
|
|
@ -48,14 +47,6 @@ class CollapsibleSectionView(context: Context, attrs: AttributeSet?) : LinearLay
|
|||
|
||||
var identifier: String? = null
|
||||
|
||||
var separatorColor: Int
|
||||
get() {
|
||||
return (binding.separator.background as? ColorDrawable)?.color ?: 0
|
||||
}
|
||||
set(value) {
|
||||
binding.separator.setBackgroundColor(value)
|
||||
}
|
||||
|
||||
private fun showViews() {
|
||||
updatePreferences()
|
||||
setCaretImage()
|
||||
|
|
@ -67,7 +58,7 @@ class CollapsibleSectionView(context: Context, attrs: AttributeSet?) : LinearLay
|
|||
private fun hideViews() {
|
||||
updatePreferences()
|
||||
setCaretImage()
|
||||
(2 until childCount)
|
||||
(0 until childCount)
|
||||
.map { getChildAt(it) }
|
||||
.filter { it != binding.sectionTitleView }
|
||||
.forEach {
|
||||
|
|
@ -87,7 +78,7 @@ class CollapsibleSectionView(context: Context, attrs: AttributeSet?) : LinearLay
|
|||
}
|
||||
|
||||
private fun setChildMargins() {
|
||||
(2 until childCount)
|
||||
(0 until childCount)
|
||||
.map { getChildAt(it) }
|
||||
.filter { it != binding.sectionTitleView }
|
||||
.forEach {
|
||||
|
|
@ -104,11 +95,9 @@ class CollapsibleSectionView(context: Context, attrs: AttributeSet?) : LinearLay
|
|||
|
||||
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
|
||||
var height = 0
|
||||
measureChildWithMargins(binding.separator, widthMeasureSpec, 0, heightMeasureSpec, height)
|
||||
height += binding.separator.measuredHeight
|
||||
measureChildWithMargins(binding.sectionTitleView, widthMeasureSpec, 0, heightMeasureSpec, height)
|
||||
height += binding.sectionTitleView.measuredHeight
|
||||
(2 until childCount)
|
||||
(1 until childCount)
|
||||
.map { getChildAt(it) }
|
||||
.forEach {
|
||||
if (it.visibility != View.GONE) {
|
||||
|
|
|
|||
|
|
@ -19,19 +19,19 @@ import androidx.core.graphics.drawable.toBitmap
|
|||
import com.habitrpg.android.habitica.R
|
||||
import com.habitrpg.android.habitica.databinding.QuestCollectBinding
|
||||
import com.habitrpg.android.habitica.databinding.QuestProgressBinding
|
||||
import com.habitrpg.common.habitica.extensions.layoutInflater
|
||||
import com.habitrpg.android.habitica.helpers.ExceptionHandler
|
||||
import com.habitrpg.android.habitica.models.inventory.Quest
|
||||
import com.habitrpg.android.habitica.models.inventory.QuestContent
|
||||
import com.habitrpg.android.habitica.models.inventory.QuestProgressCollect
|
||||
import com.habitrpg.android.habitica.models.user.User
|
||||
import com.habitrpg.common.habitica.extensions.DataBindingUtils
|
||||
import com.habitrpg.common.habitica.extensions.loadImage
|
||||
import com.habitrpg.common.habitica.helpers.setMarkdown
|
||||
import com.habitrpg.android.habitica.ui.views.HabiticaIcons
|
||||
import com.habitrpg.android.habitica.ui.views.HabiticaIconsHelper
|
||||
import com.habitrpg.android.habitica.ui.views.NPCBannerView
|
||||
import com.habitrpg.android.habitica.ui.views.dialogs.HabiticaAlertDialog
|
||||
import com.habitrpg.common.habitica.extensions.DataBindingUtils
|
||||
import com.habitrpg.common.habitica.extensions.layoutInflater
|
||||
import com.habitrpg.common.habitica.extensions.loadImage
|
||||
import com.habitrpg.common.habitica.helpers.setMarkdown
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.core.Observable
|
||||
|
||||
|
|
@ -152,7 +152,6 @@ class QuestProgressView : LinearLayout {
|
|||
binding.questFlourishesImageView.loadImage("quest_" + quest.key + "_flourishes")
|
||||
val lightColor = quest.colors?.lightColor
|
||||
if (lightColor != null) {
|
||||
binding.questDescriptionSection.separatorColor = lightColor
|
||||
binding.questImageSeparator.setBackgroundColor(lightColor)
|
||||
|
||||
val gradientDrawable = GradientDrawable(
|
||||
|
|
|
|||
Loading…
Reference in a new issue