mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-24 06:35:46 +00:00
update login incentive modal
This commit is contained in:
parent
b448c6bd6d
commit
ec14b054ca
4 changed files with 17 additions and 27 deletions
|
|
@ -9,7 +9,7 @@
|
|||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:id="@+id/imageView"
|
||||
android:layout_marginTop="16dp"/>
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
<TextView
|
||||
android:text=""
|
||||
|
|
@ -19,7 +19,9 @@
|
|||
android:layout_marginLeft="25dp"
|
||||
android:layout_marginRight="25dp"
|
||||
android:id="@+id/you_earned_message"
|
||||
tools:text="You unlocked something"/>
|
||||
tools:text="You unlocked something"
|
||||
android:gravity="center_horizontal"
|
||||
style="@style/Body2"/>
|
||||
|
||||
<TextView
|
||||
tools:text="Next prize unlocks in 2 check-ins."
|
||||
|
|
@ -27,6 +29,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:id="@+id/next_unlock_message"
|
||||
android:textColor="@color/blue_10"/>
|
||||
android:textColor="@color/gray_100"
|
||||
android:gravity="center_horizontal"
|
||||
style="@style/Body1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
<color name="brand_100">#432874</color>
|
||||
<color name="brand_200">#4f2a93</color>
|
||||
<color name="brand_300">#6133B4</color>
|
||||
<color name="brand_400">#9A62FF</color>
|
||||
<color name="brand_400">#925CF3</color>
|
||||
<color name="brand_500">#bda8ff</color>
|
||||
<color name="brand_700">#ede7f6</color>
|
||||
<color name="brand">@color/brand_100</color>
|
||||
|
|
|
|||
|
|
@ -545,7 +545,7 @@
|
|||
<string name="open">Open</string>
|
||||
<string name="notification_mystery_item">You open the box and find %s!</string>
|
||||
<string name="checkInRewardEarned">You earned a %1$s as a reward for your devotion to improving your life.</string>
|
||||
<string name="nextPrizeUnlocks" tools:ignore="PluralsCandidate">Your next prize unlocks at %1$d Check-Ins</string>
|
||||
<string name="nextPrizeUnlocks" tools:ignore="PluralsCandidate">Next prize in %1$d Check-Ins</string>
|
||||
<string name="pending_approval">pending approval</string>
|
||||
<string name="filters">Filters</string>
|
||||
<string name="done">Done</string>
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import android.view.*
|
|||
import android.widget.FrameLayout
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.ActionBarDrawerToggle
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.FileProvider
|
||||
|
|
@ -815,36 +814,23 @@ open class MainActivity : BaseActivity(), TutorialView.OnTutorialReaction {
|
|||
|
||||
val youEarnedMessage = this.getString(R.string.checkInRewardEarned, event.notification.data.rewardText)
|
||||
|
||||
val titleTextView = TextView(this)
|
||||
titleTextView.setBackgroundResource(R.color.blue_100)
|
||||
titleTextView.setTextColor(ContextCompat.getColor(this, R.color.white))
|
||||
val density = this.resources.displayMetrics.density
|
||||
val paddingDp = (16 * density).toInt()
|
||||
titleTextView.setPadding(paddingDp, paddingDp, paddingDp, paddingDp)
|
||||
titleTextView.textSize = 18f
|
||||
titleTextView.gravity = Gravity.CENTER_HORIZONTAL
|
||||
titleTextView.text = title
|
||||
|
||||
val youEarnedTexView = view.findViewById<View>(R.id.you_earned_message) as? TextView
|
||||
youEarnedTexView?.text = youEarnedMessage
|
||||
|
||||
val nextUnlockTextView = view.findViewById<View>(R.id.next_unlock_message) as? TextView
|
||||
nextUnlockTextView?.text = event.nextUnlockText
|
||||
|
||||
val builder = AlertDialog.Builder(this, R.style.AlertDialogTheme)
|
||||
.setView(view)
|
||||
.setCustomTitle(titleTextView)
|
||||
.setPositiveButton(R.string.start_day) { _, _ ->
|
||||
apiClient.readNotification(event.notification.id)
|
||||
.subscribe(Consumer { }, RxErrorHandler.handleEmptyError())
|
||||
}
|
||||
.setMessage("")
|
||||
|
||||
Completable.complete()
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(Action {
|
||||
val dialog = builder.create()
|
||||
dialog.show()
|
||||
val alert = HabiticaAlertDialog(this)
|
||||
alert.setAdditionalContentView(view)
|
||||
alert.setTitle(title)
|
||||
alert.addButton(R.string.see_you_tomorrow, true) { _, _ ->
|
||||
apiClient.readNotification(event.notification.id)
|
||||
.subscribe(Consumer { }, RxErrorHandler.handleEmptyError())
|
||||
}
|
||||
alert.show()
|
||||
}, RxErrorHandler.handleEmptyError())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue