Design fixes

This commit is contained in:
Phillip Thelen 2022-01-31 13:54:01 +01:00
parent c6305d9121
commit 2e654c9c63
7 changed files with 44 additions and 18 deletions

View file

@ -233,11 +233,12 @@
android:layout_width="wrap_content"
android:paddingStart="41dp"
android:paddingEnd="41dp"
android:paddingBottom="20dp"
android:paddingBottom="30dp"
android:paddingTop="70dp"
android:text="@string/gem_purchase_title"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:lineSpacingExtra="3dp"
android:textColor="@color/white"
style="@style/Caption2"
android:drawablePadding="@dimen/spacing_medium"/>

View file

@ -17,19 +17,37 @@
android:contentDescription="@string/gems"
android:layout_marginTop="20dp"/>
<com.habitrpg.android.habitica.ui.views.DayNightTextView
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/gem_amount"
app:dayTextColor="@color/white"
app:nightTextColor="@color/white"
android:gravity="center"
android:layout_gravity="center"
android:textSize="16sp"
android:letterSpacing="0.027"
android:fontFamily="@string/font_family_medium"
android:layout_margin="10dp"
tools:text="21 GEMS" />
android:orientation="horizontal">
<com.habitrpg.android.habitica.ui.views.DayNightTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/gem_amount"
app:dayTextColor="@color/white"
app:nightTextColor="@color/white"
android:gravity="center"
android:layout_gravity="center"
android:textSize="16sp"
android:letterSpacing="0.03"
android:fontFamily="@string/font_family_medium"
android:layout_marginVertical="10dp"
android:layout_marginEnd="2dp"
tools:text="21" />
<com.habitrpg.android.habitica.ui.views.DayNightTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:dayTextColor="@color/white"
app:nightTextColor="@color/white"
android:gravity="center"
android:layout_gravity="center"
android:textSize="16sp"
android:letterSpacing="0.03"
android:layout_marginVertical="10dp"
android:textAllCaps="true"
android:text="@string/gems" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
@ -38,7 +56,7 @@
android:background="@drawable/purchase_button_background"
android:textColor="@color/brand_400"
android:gravity="center"
android:textSize="16sp"
style="@style/Subheader1"
android:letterSpacing="0.02"
android:layout_marginStart="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/spacing_medium"

View file

@ -374,7 +374,7 @@
<string name="google_services_missing">Google play services could not be found.</string>
<string name="gem_purchase_toolbartitle">Purchase</string>
<string name="gem_purchase_title">Buying gems supports the developers and helps keep Habitica running</string>
<string name="gem_purchase_subtitle">Gems allow you to buy fun extras for your account:</string>
<string name="gem_purchase_subtitle">Gems allow you to buy fun extras for your account</string>
<string name="gem_purchase_listitem1">Cool costumes for your avatar</string>
<string name="gem_purchase_listitem2">Awesome backgrounds</string>
<string name="gem_purchase_listitem3">Quests that reward you with pet eggs</string>

View file

@ -20,7 +20,7 @@ class GemPurchaseOptionsView(context: Context, attrs: AttributeSet) : FrameLayou
0, 0
)
binding.gemAmount.text = "${a.getText(R.styleable.GemPurchaseOptionsView_gemAmount)} GEMS"
binding.gemAmount.text = a.getText(R.styleable.GemPurchaseOptionsView_gemAmount)
val iconRes = a.getDrawable(R.styleable.GemPurchaseOptionsView_gemDrawable)
if (iconRes != null) {

View file

@ -215,8 +215,8 @@ class InboxMessageListFragment : BaseMainFragment<FragmentInboxMessageListBindin
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
{
binding?.recyclerView?.scrollToPosition(0)
viewModel.invalidateDataSource()
binding?.recyclerView?.scrollToPosition(0)
},
{ error ->
RxErrorHandler.reportError(error)

View file

@ -11,6 +11,7 @@ import androidx.core.content.ContextCompat
import androidx.core.graphics.drawable.toDrawable
import androidx.core.os.bundleOf
import com.google.firebase.analytics.FirebaseAnalytics
import com.habitrpg.android.habitica.HabiticaBaseApplication
import com.habitrpg.android.habitica.R
import com.habitrpg.android.habitica.components.UserComponent
import com.habitrpg.android.habitica.data.InventoryRepository
@ -319,6 +320,7 @@ class PurchaseDialog(context: Context, component: UserComponent?, val item: Shop
}
private fun buyItem(quantity: Int) {
val application = ownerActivity?.application as? HabiticaBaseApplication
FirebaseAnalytics.getInstance(context).logEvent(
"item_purchased",
bundleOf(
@ -373,7 +375,7 @@ class PurchaseDialog(context: Context, component: UserComponent?, val item: Shop
"hourglasses" -> ContextCompat.getColor(context, R.color.text_brand)
else -> 0
}
(ownerActivity as? SnackbarActivity)?.showSnackbar(
((application?.currentActivity?.get() ?: getActivity() ?: ownerActivity) as? SnackbarActivity)?.showSnackbar(
content = text,
rightIcon = priceLabel.compoundDrawables[0],
rightTextColor = rightTextColor,

View file

@ -158,7 +158,12 @@ class YesterdailyDialog private constructor(context: Context, private val userRe
private fun configureTaskView(taskView: View, task: Task) {
val completed = !task.isDisplayedActive
val checkmark = taskView.findViewById<View>(R.id.checkmark)
val checkmark = taskView.findViewById<ImageView>(R.id.checkmark)
if (task.completed) {
checkmark?.drawable?.setTint(ContextCompat.getColor(context, R.color.gray_400))
} else {
checkmark?.drawable?.setTint(ContextCompat.getColor(context, task.darkestTaskColor))
}
val checkboxHolder = taskView.findViewById<View>(R.id.checkBoxHolder)
val checkboxBackground = taskView.findViewById<View>(R.id.checkbox_background)
checkmark?.visibility = if (completed) View.VISIBLE else View.GONE