mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-20 04:39:04 +00:00
Display quest status in menu
This commit is contained in:
parent
5bbba6552d
commit
262e6252f6
6 changed files with 29 additions and 52 deletions
|
|
@ -153,7 +153,7 @@ android {
|
|||
buildConfigField "String", "TESTING_LEVEL", "\"production\""
|
||||
resConfigs "en", "bg", "de", "en-rGB", "es", "fr", "hr-rHR", "in", "it", "iw", "ja", "ko", "lt", "nl", "pl", "pt-rBR", "pt-rPT", "ru", "tr", "zh", "zh-rTW"
|
||||
|
||||
versionCode 3051
|
||||
versionCode 3052
|
||||
versionName "3.4"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
|
|
|||
|
|
@ -160,7 +160,8 @@
|
|||
android:id="@+id/questMenuView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
|
|
@ -1,61 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:parentTag="android.widget.LinearLayout"
|
||||
android:clipChildren="true">
|
||||
<ImageView
|
||||
android:id="@+id/bossArtView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:background="@color/red_10"
|
||||
android:layout_marginTop="-30dp"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentTop="true">
|
||||
<LinearLayout
|
||||
android:id="@+id/topView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="40dp"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="@dimen/spacing_large"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="@dimen/spacing_medium"
|
||||
android:paddingEnd="@dimen/spacing_large"
|
||||
android:paddingTop="@dimen/spacing_medium"
|
||||
android:paddingBottom="@dimen/spacing_medium">
|
||||
<ImageButton
|
||||
android:id="@+id/closeButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:srcCompat="@drawable/ic_close_white_24dp"
|
||||
android:background="@color/transparent"
|
||||
android:contentDescription="@string/hide_boss_art"
|
||||
android:layout_gravity="end"/>
|
||||
android:paddingTop="@dimen/spacing_medium">
|
||||
<TextView
|
||||
android:id="@+id/bossNameView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
tools:text="Boss Name"
|
||||
/>
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:id="@+id/typeTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/world_boss"
|
||||
android:layout_gravity="end|center_vertical"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="12sp"/>
|
||||
</LinearLayout>
|
||||
|
|
@ -63,8 +39,8 @@
|
|||
android:id="@+id/bottomView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
tools:background="?colorPrimaryDark"
|
||||
android:paddingStart="@dimen/spacing_medium"
|
||||
android:paddingEnd="@dimen/spacing_large">
|
||||
|
|
@ -97,6 +73,4 @@
|
|||
tools:text="+1"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</merge>
|
||||
|
|
@ -1182,4 +1182,5 @@
|
|||
<string name="privacy_policy">Privacy Policy</string>
|
||||
<string name="terms_of_service">Terms of Service</string>
|
||||
<string name="damage_pending">%.01f dmg pending</string>
|
||||
<string name="x_remaining">%s remaining</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -270,8 +270,9 @@ class NavigationDrawerFragment : DialogFragment() {
|
|||
.doOnNext {
|
||||
updateUser(it)
|
||||
}
|
||||
.filter { it.party?.quest?.key != null }
|
||||
.flatMap { socialRepository.getGroup(it.party?.id ?: "") }
|
||||
.filter { it.quest?.key != null }
|
||||
.filter { it.quest?.active == true }
|
||||
.map {
|
||||
quest = it.quest
|
||||
it.quest?.key ?: ""
|
||||
|
|
@ -674,7 +675,7 @@ class NavigationDrawerFragment : DialogFragment() {
|
|||
val diff = activePromo.endDate.time - Date().time
|
||||
if (diff < (Duration.hours(1).inWholeMilliseconds)) Duration.seconds(1) else Duration.minutes(1)
|
||||
}) {
|
||||
promotedItem.subtitle = context?.getString(R.string.open_for, activePromo.endDate.getShortRemainingString())
|
||||
promotedItem.subtitle = context?.getString(R.string.x_remaining, activePromo.endDate.getShortRemainingString())
|
||||
updateItem(promotedItem)
|
||||
}
|
||||
} ?: run {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import com.habitrpg.android.habitica.ui.views.HabiticaIconsHelper
|
|||
import java.util.Locale
|
||||
|
||||
class QuestMenuView : LinearLayout {
|
||||
private val binding = QuestMenuViewBinding.inflate(context.layoutInflater, this, true)
|
||||
private val binding = QuestMenuViewBinding.inflate(context.layoutInflater, this)
|
||||
|
||||
private var questContent: QuestContent? = null
|
||||
|
||||
|
|
@ -33,20 +33,19 @@ class QuestMenuView : LinearLayout {
|
|||
}
|
||||
|
||||
private fun setupView(context: Context) {
|
||||
val inflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
|
||||
inflater.inflate(R.layout.quest_menu_view, this)
|
||||
orientation = VERTICAL
|
||||
|
||||
binding.heartIconView.setImageBitmap(HabiticaIconsHelper.imageOfHeartDarkBg())
|
||||
|
||||
binding.pendingDamageIconView.setImageBitmap(HabiticaIconsHelper.imageOfDamage())
|
||||
|
||||
binding.closeButton.setOnClickListener {
|
||||
/*binding.closeButton.setOnClickListener {
|
||||
hideBossArt()
|
||||
val preferences = context.getSharedPreferences("collapsible_sections", 0)
|
||||
preferences?.edit {
|
||||
putBoolean("boss_art_collapsed", true)
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
fun configure(quest: Quest) {
|
||||
|
|
@ -57,9 +56,10 @@ class QuestMenuView : LinearLayout {
|
|||
this.questContent = questContent
|
||||
binding.healthBarView.setMaxValue(questContent.boss?.hp?.toDouble() ?: 0.0)
|
||||
binding.bottomView.setBackgroundColor(questContent.colors?.darkColor ?: 0)
|
||||
binding.bossArtView.setBackgroundColor(questContent.colors?.mediumColor ?: 0)
|
||||
DataBindingUtils.loadImage(binding.bossArtView, "quest_" + questContent.key)
|
||||
//binding.bossArtView.setBackgroundColor(questContent.colors?.mediumColor ?: 0)
|
||||
//DataBindingUtils.loadImage(binding.bossArtView, "quest_" + questContent.key)
|
||||
binding.bossNameView.text = questContent.boss?.name
|
||||
binding.typeTextView.text = context.getString(R.string.boss_quest)
|
||||
}
|
||||
|
||||
fun configure(user: User) {
|
||||
|
|
@ -71,9 +71,9 @@ class QuestMenuView : LinearLayout {
|
|||
binding.topView.setBackgroundColor(questContent?.colors?.mediumColor ?: 0)
|
||||
binding.bossNameView.gravity = Gravity.START
|
||||
binding.bossNameView.layoutParams = LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1F)
|
||||
binding.bossArtView.visibility = View.GONE
|
||||
//binding.bossArtView.visibility = View.GONE
|
||||
binding.typeTextView.setTextColor(questContent?.colors?.extraLightColor ?: 0)
|
||||
binding.closeButton.visibility = View.GONE
|
||||
//binding.closeButton.visibility = View.GONE
|
||||
}
|
||||
|
||||
fun showBossArt() {
|
||||
|
|
@ -81,8 +81,8 @@ class QuestMenuView : LinearLayout {
|
|||
binding.topView.setBackgroundColor(ContextCompat.getColor(context, R.color.transparent))
|
||||
binding.bossNameView.gravity = Gravity.END
|
||||
binding.bossNameView.layoutParams = LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
binding.bossArtView.visibility = View.VISIBLE
|
||||
//binding.bossArtView.visibility = View.VISIBLE
|
||||
binding.typeTextView.setTextColor(ContextCompat.getColor(context, R.color.white))
|
||||
binding.closeButton.visibility = View.VISIBLE
|
||||
//binding.closeButton.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue