improve unlock condition display

This commit is contained in:
Phillip Thelen 2017-11-08 18:29:11 +01:00
parent 8e4278151e
commit fa7ec797da
2 changed files with 18 additions and 3 deletions

View file

@ -5,7 +5,8 @@
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:clickable="true"
android:background="@color/white">
android:background="@color/white"
android:focusable="true">
<LinearLayout
android:id="@+id/container"
android:layout_marginTop="6dp"
@ -36,6 +37,16 @@
style="@style/Body1"
app:hasLightBackground="true"
android:textSize="15sp" />
<TextView
android:id="@+id/unlockLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:layout_gravity="center_horizontal"
style="@style/Body1"
android:textSize="12sp"
android:textColor="@color/gray_300"
/>
</LinearLayout>
</LinearLayout>
<ImageView
@ -60,5 +71,4 @@
android:textColor="@color/white"
android:layout_marginRight="-4dp"
android:textSize="12sp" />
</RelativeLayout>

View file

@ -21,6 +21,7 @@ class ShopItemViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), Vi
private val imageView: SimpleDraweeView by bindView(itemView, R.id.imageView)
private val buyButton: View by bindView(itemView, R.id.buyButton)
private val priceLabel: CurrencyView by bindView(itemView, R.id.priceLabel)
private val unlockLabel: TextView by bindView(itemView, R.id.unlockLabel)
private val itemDetailIndicator: TextView by bindView(itemView, R.id.item_detail_indicator)
private val pinIndicator: ImageView by bindView(itemView, R.id.pin_indicator)
@ -67,8 +68,12 @@ class ShopItemViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView), Vi
if (item.currency == null) {
buyButton.visibility = View.GONE
}
priceLabel.visibility = View.VISIBLE
unlockLabel.visibility = View.GONE
} else {
priceLabel.setText(item.unlockCondition!!.readableUnlockConditionId())
unlockLabel.setText(item.unlockCondition!!.readableUnlockConditionId())
priceLabel.visibility = View.GONE
unlockLabel.visibility = View.VISIBLE
}
itemDetailIndicator.text = null