mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-23 14:17:15 +00:00
create special insufficient gem view
This commit is contained in:
parent
9888a3bc22
commit
8cc46fb860
3 changed files with 23 additions and 2 deletions
18
Habitica/res/layout/dialog_insufficient_gems.xml
Normal file
18
Habitica/res/layout/dialog_insufficient_gems.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="12dp"
|
||||
android:scaleType="center" />
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"/>
|
||||
</LinearLayout>
|
||||
|
|
@ -16,10 +16,11 @@ abstract class InsufficientCurrencyDialog(context: Context) : HabiticaAlertDialo
|
|||
protected var imageView: ImageView
|
||||
protected var textView: TextView
|
||||
|
||||
init {
|
||||
open var layoutID = R.layout.dialog_insufficient_currency
|
||||
|
||||
init {
|
||||
val inflater = LayoutInflater.from(context)
|
||||
val view = inflater.inflate(R.layout.dialog_insufficient_currency, contentView, false)
|
||||
val view = inflater.inflate(layoutID, contentView, false)
|
||||
setAdditionalContentView(view)
|
||||
|
||||
imageView = view.findViewById(R.id.imageView)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import com.habitrpg.android.habitica.helpers.MainNavigationController
|
|||
|
||||
class InsufficientGemsDialog(context: Context) : InsufficientCurrencyDialog(context) {
|
||||
|
||||
override var layoutID: Int = R.layout.dialog_insufficient_gems
|
||||
|
||||
init {
|
||||
imageView.setImageResource(R.drawable.gems_84)
|
||||
textView.setText(R.string.insufficientGems)
|
||||
|
|
|
|||
Loading…
Reference in a new issue