Commit 6ea960a0 authored by satya's avatar satya

fix pinfragment and update game

parent f26fc380
...@@ -149,13 +149,14 @@ ...@@ -149,13 +149,14 @@
<tools:validation testUrl="https://api.yes.com.kh/.well-known/assetlinks.json" /> <tools:validation testUrl="https://api.yes.com.kh/.well-known/assetlinks.json" />
<intent-filter android:autoVerify="true"> <intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<data <data
android:scheme="https"
android:host="api.yes.com.kh" android:host="api.yes.com.kh"
android:pathPattern="/.well-known/assetlinks.json" /> android:pathPattern="/.well-known/assetlinks.json"
android:scheme="https" />
</intent-filter> </intent-filter>
</activity> </activity>
...@@ -334,16 +335,16 @@ ...@@ -334,16 +335,16 @@
android:exported="true" android:exported="true"
android:screenOrientation="locked" /> android:screenOrientation="locked" />
<activity <activity
android:name=".ui.mysterybox.MysteryBoxActivity" android:name=".ui.game.GameActivity"
android:exported="true" android:exported="true"
android:screenOrientation="locked" /> android:screenOrientation="locked" />
<activity <activity android:name=".ui.game.GameRewardActivity"
android:name=".ui.mysterybox.ValentineRewardActivity"
android:allowEmbedded="true"
android:exported="true" android:exported="true"
android:screenOrientation="locked" /> android:screenOrientation="locked"/>
</application> </application>
......
package com.seatel.mobilehall.ui.game
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.view.View
import android.view.View.OnClickListener
import com.android.volley.Request
import com.seatel.mobilehall.R
import com.seatel.mobilehall.data.network.SeatelJSONObjectRequest
import com.seatel.mobilehall.data.network.SeatelSuperRequest
import com.seatel.mobilehall.databinding.ActivityGameBinding
import com.seatel.mobilehall.ui.base.activity.BaseActivity
import com.seatel.mobilehall.util.SeatelAlertDialog
import com.seatel.mobilehall.util.customview.ErrorHandleView
import com.seatel.mobilehall.util.dialogannouncement.CustomGameDialog
import com.seatel.mobilehall.util.viewBinding
import kotlinx.android.synthetic.main.activity_game.btn_center
import kotlinx.android.synthetic.main.activity_game.btn_claim
import kotlinx.android.synthetic.main.activity_game.btn_left
import kotlinx.android.synthetic.main.activity_game.btn_right
import kotlinx.android.synthetic.main.activity_game.error_view
import kotlinx.android.synthetic.main.activity_game.imageViewBack
import org.json.JSONObject
class GameActivity : BaseActivity(), OnClickListener {
private val binding by viewBinding(
ActivityGameBinding::inflate
)
private var mChance: Int = 0
private var mTitle: String = ""
private var mPrize: String = ""
private var mSubTitle: String = ""
private var mImage: String = ""
private var isButtonClickable = true
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(binding.root)
init()
}
private fun init() {
btn_left.setOnClickListener(this)
btn_center.setOnClickListener(this)
btn_right.setOnClickListener(this)
btn_claim.setOnClickListener(this)
imageViewBack.setOnClickListener(this)
}
companion object {
fun lunch(context: Context) {
val intent = Intent(context, GameActivity::class.java)
context.startActivity(intent)
}
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.btn_left -> {
if (isButtonClickable) {
// Disable the button to prevent multiple clicks
disableButton()
// Do your button click logic here
// ...
requestChance()
// Example: simulate a delay and then re-enable the button
Handler().postDelayed({
enableButton()
}, 1000) // 1000 milliseconds delay
}
}
R.id.btn_center -> {
requestChance()
}
R.id.btn_right -> {
requestChance()
}
R.id.btn_claim -> {
GameRewardActivity.launch(this)
}
R.id.imageViewBack -> onBackPressed()
}
}
private fun disableButton() {
isButtonClickable = false
btn_left.isEnabled = false
}
private fun enableButton() {
isButtonClickable = true
btn_left.isEnabled = true
}
private fun requestChance() {
error_view.setViewMode(ErrorHandleView.Mode.LOADING)
object : SeatelJSONObjectRequest(this) {
override fun getFunctionName(): String {
return "v2/seatel/get-chance/${getPhoneLogin()}/mystery-box"
}
override fun getMethod(): Int {
return Request.Method.GET
}
}.setOnErrorListener {
error_view.visibility = View.GONE
SeatelAlertDialog.with(this, SeatelSuperRequest.getErrorMessageFrom(it)).show()
}.execute {
error_view.visibility = View.GONE
mChance = (it as JSONObject).optInt("chance")
if (mChance > 0) {
randomGame()
} else SeatelAlertDialog.with(
this,
applicationContext.getString(R.string.game_no_chance)
).show()
}
}
private fun randomGame() {
object : SeatelJSONObjectRequest(this) {
override fun getFunctionName(): String {
return "v2/seatel/get-angpao/${getPhoneLogin()}/mystery-box"
}
override fun getMethod(): Int {
return Request.Method.GET
}
}.setOnErrorListener {
SeatelAlertDialog.with(this, SeatelSuperRequest.getErrorMessageFrom(it)).show()
}.execute {
val data = it as JSONObject
mTitle = data.optString("title")
mPrize = data.optString("prize")
mSubTitle = data.optString("subtitle")
mImage = data.optString("image")
val valentineDialog = CustomGameDialog(this, mTitle, mPrize, mSubTitle, mImage, false)
valentineDialog.show()
}
}
}
package com.seatel.mobilehall.ui.game
import com.android.volley.VolleyError
interface GameInteractor {
interface View {
fun onGameRewardSucceed(angPaoListItem: ArrayList<GameModel>)
fun onGameRewardFailed(error: VolleyError)
}
interface Presenter {
fun getGameReward(phoneNumber: String)
}
}
\ No newline at end of file
package com.seatel.mobilehall.ui.mysterybox package com.seatel.mobilehall.ui.game
data class MysteryBoxModelItem( data class GameModel(
val _id: String, val _id: String,
val claimed: Boolean, val claimed: Boolean,
val prize: String, val prize: String,
......
package com.seatel.mobilehall.ui.mysterybox package com.seatel.mobilehall.ui.game
import android.content.Context import android.content.Context
import com.google.gson.Gson import com.google.gson.Gson
...@@ -6,23 +6,23 @@ import com.google.gson.reflect.TypeToken ...@@ -6,23 +6,23 @@ import com.google.gson.reflect.TypeToken
import com.seatel.mobilehall.data.network.SeatelJSONArrayRequest import com.seatel.mobilehall.data.network.SeatelJSONArrayRequest
import org.json.JSONArray import org.json.JSONArray
class ValentinePresenter( class GamePresenter(
private var mContext: Context, private var mContext: Context,
private var angPaoInteractor: ValentineInteractor.View private var angPaoInteractor: GameInteractor.View
) : ValentineInteractor.Presenter { ) : GameInteractor.Presenter {
override fun getValentineReward(phoneNumber: String) { override fun getGameReward(phoneNumber: String) {
valentineRequest(phoneNumber).setOnErrorListener { error -> valentineRequest(phoneNumber).setOnErrorListener { error ->
angPaoInteractor.onValentineRewardFailed(error) angPaoInteractor.onGameRewardFailed(error)
}.setOnResponseListener { response -> }.setOnResponseListener { response ->
angPaoInteractor.onValentineRewardSucceed(getResponseValentine(response as JSONArray)) angPaoInteractor.onGameRewardSucceed(getResponseValentine(response as JSONArray))
}.execute() }.execute()
} }
private fun getResponseValentine(response: JSONArray): ArrayList<MysteryBoxModelItem> { private fun getResponseValentine(response: JSONArray): ArrayList<GameModel> {
val itemType = object : TypeToken<List<MysteryBoxModelItem>>() {}.type val itemType = object : TypeToken<List<GameModel>>() {}.type
return Gson().fromJson(response.toString(), itemType) return Gson().fromJson(response.toString(), itemType)
} }
......
package com.seatel.mobilehall.ui.mysterybox package com.seatel.mobilehall.ui.game
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.View import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager import com.android.volley.NoConnectionError
import com.android.volley.Request import com.android.volley.Request
import com.android.volley.TimeoutError
import com.android.volley.VolleyError import com.android.volley.VolleyError
import com.seatel.mobilehall.R import com.seatel.mobilehall.R
import com.seatel.mobilehall.data.network.SeatelJSONObjectRequest import com.seatel.mobilehall.data.network.SeatelJSONObjectRequest
import com.seatel.mobilehall.data.network.SeatelSuperRequest import com.seatel.mobilehall.data.network.SeatelSuperRequest
import com.seatel.mobilehall.databinding.LayoutGameRewardBinding
import com.seatel.mobilehall.ui.base.activity.BaseActivity import com.seatel.mobilehall.ui.base.activity.BaseActivity
import com.seatel.mobilehall.util.CustomGameDialog import com.seatel.mobilehall.util.SeatelAlertDialog
import com.seatel.mobilehall.util.customview.ErrorHandleView import com.seatel.mobilehall.util.customview.ErrorHandleView
import kotlinx.android.synthetic.main.valentine_reward_layout.* import com.seatel.mobilehall.util.dialogannouncement.CustomGameDialog
import com.seatel.mobilehall.util.viewBinding
import kotlinx.android.synthetic.main.layout_game_reward.error_view
import kotlinx.android.synthetic.main.layout_game_reward.game_recycler
import kotlinx.android.synthetic.main.layout_game_reward.imageViewBack
import org.json.JSONObject import org.json.JSONObject
class ValentineRewardActivity : BaseActivity(), ValentineInteractor.View { class GameRewardActivity : BaseActivity(), GameInteractor.View {
private val binding by viewBinding(
LayoutGameRewardBinding::inflate
)
companion object { companion object {
fun launch(context: Context) { fun launch(context: Context) {
val intent = Intent(context, ValentineRewardActivity::class.java) val intent = Intent(context, GameRewardActivity::class.java)
context.startActivity(intent) context.startActivity(intent)
} }
} }
...@@ -30,30 +41,47 @@ class ValentineRewardActivity : BaseActivity(), ValentineInteractor.View { ...@@ -30,30 +41,47 @@ class ValentineRewardActivity : BaseActivity(), ValentineInteractor.View {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.valentine_reward_layout) setContentView(binding.root)
error_view.setViewMode(ErrorHandleView.Mode.LOADING) error_view.setViewMode(ErrorHandleView.Mode.LOADING)
imageViewBack.setOnClickListener {
onBackPressed()
}
firstOpen = true firstOpen = true
ValentinePresenter(this, this).getValentineReward("${getPhoneLogin()}") GamePresenter(this, this).getGameReward("${getPhoneLogin()}")
} }
override fun onValentineRewardSucceed(angPaoListItem: ArrayList<MysteryBoxModelItem>) { override fun onGameRewardSucceed(angPaoListItem: ArrayList<GameModel>) {
firstOpen = false firstOpen = false
valentine_recycler.apply { error_view.visibility = View.GONE
layoutManager = game_recycler.apply {
LinearLayoutManager( adapter = GameRewardAdapter(this@GameRewardActivity, angPaoListItem) {
this@ValentineRewardActivity,
LinearLayoutManager.VERTICAL,
false
)
adapter = ValentineRewardAdapter(this@ValentineRewardActivity, angPaoListItem) {
claimPrize(it._id, it.usefor)
error_view.visibility = View.VISIBLE error_view.visibility = View.VISIBLE
claimPrize(it._id, it.usefor)
} }
} }
error_view.visibility = View.GONE
} }
override fun onGameRewardFailed(error: VolleyError) {
firstOpen = false
error_view.visibility = View.GONE
when (error) {
is TimeoutError -> {
error_view.errorMessage = getString(R.string.connection_timeout)
error_view.setViewMode(ErrorHandleView.Mode.TIME_OUT)
}
is NoConnectionError -> {
error_view.errorMessage = getString(R.string.message_no_internet)
error_view.setViewMode(ErrorHandleView.Mode.NO_INTERNET)
}
else -> {
error_view.errorMessage = getString(R.string.no_data)
error_view.setViewMode(ErrorHandleView.Mode.NO_DATA)
}
}
}
private fun claimPrize(id: String, type: String) { private fun claimPrize(id: String, type: String) {
object : SeatelJSONObjectRequest(this) { object : SeatelJSONObjectRequest(this) {
...@@ -66,47 +94,30 @@ class ValentineRewardActivity : BaseActivity(), ValentineInteractor.View { ...@@ -66,47 +94,30 @@ class ValentineRewardActivity : BaseActivity(), ValentineInteractor.View {
} }
}.setOnErrorListener { }.setOnErrorListener {
/*SeatelAlertDialog.with(this, SeatelSuperRequest.getErrorMessageFrom(it))
.show()*/
val valentineDialog =
CustomGameDialog(this, SeatelSuperRequest.getErrorMessageFrom(it), "", "", "", true)
valentineDialog.show()
error_view.visibility = View.GONE error_view.visibility = View.GONE
SeatelAlertDialog.with(this, SeatelSuperRequest.getErrorMessageFrom(it)).show()
}.execute { }.execute {
val mTitile = (it as JSONObject).optString("title") error_view.visibility = View.GONE
val mTitle = (it as JSONObject).optString("title")
val mPrize = it.optString("prize") val mPrize = it.optString("prize")
val image = it.optString("image") val image = it.optString("image")
val subtitle = it.optString("subtitle") val subtitle = it.optString("subtitle")
// showDialog(this, mTitile, mPrize, type) val valentineDialog = CustomGameDialog(this, mTitle, mPrize, subtitle, image, true)
val valentineDialog = CustomGameDialog(this, mTitile, mPrize, subtitle, image, true)
valentineDialog.show() valentineDialog.show()
valentineDialog.setOnDismissListener { valentineDialog.setOnDismissListener {
onResume() onResume()
} }
error_view.visibility = View.GONE
}
}
override fun onValentineRewardFailed(error: VolleyError) { }
firstOpen = false
val valentineDialog =
CustomGameDialog(this, SeatelSuperRequest.getErrorMessageFrom(error), "", "", "", true)
valentineDialog.show()
error_view.visibility = View.GONE
} }
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (!firstOpen) if (!firstOpen)
ValentinePresenter(this, this).getValentineReward("${getPhoneLogin()}") GamePresenter(this, this).getGameReward("${getPhoneLogin()}")
}
override fun getToolbarTitle(): String {
return resources.getString(R.string.claim)
} }
......
package com.seatel.mobilehall.ui.mysterybox package com.seatel.mobilehall.ui.game
import android.content.Context import android.content.Context
import android.content.res.ColorStateList import android.content.res.ColorStateList
...@@ -12,12 +12,12 @@ import com.seatel.mobilehall.R ...@@ -12,12 +12,12 @@ import com.seatel.mobilehall.R
import com.seatel.mobilehall.ui.base.adapter.BaseAdapter import com.seatel.mobilehall.ui.base.adapter.BaseAdapter
import com.seatel.mobilehall.util.SeatelUtils import com.seatel.mobilehall.util.SeatelUtils
class ValentineRewardAdapter( class GameRewardAdapter(
private var mContext: Context, private var mContext: Context,
private var angPaoListItem: ArrayList<MysteryBoxModelItem>, private var angPaoListItem: ArrayList<GameModel>,
private var rowClick: (index: MysteryBoxModelItem) -> Unit private var rowClick: (index: GameModel) -> Unit
) : ) :
BaseAdapter<ValentineRewardAdapter.YesAngPaoViewHolder>() { BaseAdapter<GameRewardAdapter.YesAngPaoViewHolder>() {
class YesAngPaoViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { class YesAngPaoViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
...@@ -32,7 +32,7 @@ class ValentineRewardAdapter( ...@@ -32,7 +32,7 @@ class ValentineRewardAdapter(
viewType: Int viewType: Int
): YesAngPaoViewHolder { ): YesAngPaoViewHolder {
return YesAngPaoViewHolder( return YesAngPaoViewHolder(
LayoutInflater.from(mContext).inflate(R.layout.valentine_reward_item, parent, false) LayoutInflater.from(mContext).inflate(R.layout.item_game_reward, parent, false)
) )
} }
......
...@@ -27,12 +27,12 @@ import com.google.firebase.messaging.FirebaseMessaging ...@@ -27,12 +27,12 @@ import com.google.firebase.messaging.FirebaseMessaging
import com.google.gson.Gson import com.google.gson.Gson
import com.seatel.mobilehall.R import com.seatel.mobilehall.R
import com.seatel.mobilehall.data.network.SeatelJSONArrayRequest import com.seatel.mobilehall.data.network.SeatelJSONArrayRequest
import com.seatel.mobilehall.data.network.SeatelJSONObjectRequest
import com.seatel.mobilehall.data.network.SeatelSuperRequest import com.seatel.mobilehall.data.network.SeatelSuperRequest
import com.seatel.mobilehall.data.prefs.SeatelSharePreferences import com.seatel.mobilehall.data.prefs.SeatelSharePreferences
import com.seatel.mobilehall.databinding.FragmentHomeBinding import com.seatel.mobilehall.databinding.FragmentHomeBinding
import com.seatel.mobilehall.ui.application.MyApplication import com.seatel.mobilehall.ui.application.MyApplication
import com.seatel.mobilehall.ui.base.fragment.BaseFragment import com.seatel.mobilehall.ui.base.fragment.BaseFragment
import com.seatel.mobilehall.ui.game.GameActivity
import com.seatel.mobilehall.ui.home.activity.BuyTopUpCardActivity import com.seatel.mobilehall.ui.home.activity.BuyTopUpCardActivity
import com.seatel.mobilehall.ui.home.activity.BuyYesNumberPhaseTwoActivity import com.seatel.mobilehall.ui.home.activity.BuyYesNumberPhaseTwoActivity
import com.seatel.mobilehall.ui.home.activity.EShopPhaseTwoActivity import com.seatel.mobilehall.ui.home.activity.EShopPhaseTwoActivity
...@@ -60,11 +60,9 @@ import com.seatel.mobilehall.ui.home.presenter.BannersPresenter ...@@ -60,11 +60,9 @@ import com.seatel.mobilehall.ui.home.presenter.BannersPresenter
import com.seatel.mobilehall.ui.home.presenter.CategoryPresenter import com.seatel.mobilehall.ui.home.presenter.CategoryPresenter
import com.seatel.mobilehall.ui.invite_friend.InviteFriendActivity import com.seatel.mobilehall.ui.invite_friend.InviteFriendActivity
import com.seatel.mobilehall.ui.login.activity.LoginActivity import com.seatel.mobilehall.ui.login.activity.LoginActivity
import com.seatel.mobilehall.ui.mysterybox.MysteryBoxActivity
import com.seatel.mobilehall.ui.profile.activity.ProfileActivity import com.seatel.mobilehall.ui.profile.activity.ProfileActivity
import com.seatel.mobilehall.util.AnalyticsHelper import com.seatel.mobilehall.util.AnalyticsHelper
import com.seatel.mobilehall.util.Constant import com.seatel.mobilehall.util.Constant
import com.seatel.mobilehall.util.CustomGameDialog
import com.seatel.mobilehall.util.Resource import com.seatel.mobilehall.util.Resource
import com.seatel.mobilehall.util.SeatelAlertDialog import com.seatel.mobilehall.util.SeatelAlertDialog
import com.seatel.mobilehall.util.SeatelUtils import com.seatel.mobilehall.util.SeatelUtils
...@@ -285,32 +283,12 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie ...@@ -285,32 +283,12 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie
layoutInviteFriend.setOnClickListener(this@HomeFragment) layoutInviteFriend.setOnClickListener(this@HomeFragment)
frameStatusBalance.setOnClickListener(this@HomeFragment) frameStatusBalance.setOnClickListener(this@HomeFragment)
floatingSupportButton.setOnClickListener(this@HomeFragment) floatingSupportButton.setOnClickListener(this@HomeFragment)
btnBalance.setOnClickListener(this@HomeFragment)
btnTopUp.setOnClickListener(this@HomeFragment)
btnNumber.setOnClickListener(this@HomeFragment)
} }
} }
private fun getChance() {
object : SeatelJSONObjectRequest(context) {
override fun getFunctionName(): String {
return "v2/seatel/get-chance/${getPhoneLogin()}/veay-kaorm"
}
override fun getMethod(): Int {
return Request.Method.GET
}
}.setOnErrorListener {
// SeatelAlertDialog.with(requireContext(), SeatelSuperRequest.getErrorMessageFrom(it)).show()
val valentineDialog = CustomGameDialog(
requireActivity(), SeatelSuperRequest.getErrorMessageFrom(it), "", "", "", false
)
valentineDialog.show()
}.execute {
mChance = (it as JSONObject).optInt("chance")
if (getPhoneLogin().isNotBlank() || getMainPhoneLogin().isNotBlank()) {
MysteryBoxActivity.lunch(requireContext())
} else LoginActivity.lunch(requireContext())
}
}
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
...@@ -543,10 +521,10 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie ...@@ -543,10 +521,10 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie
AnalyticsHelper.logEvent(AnalyticsHelper.Event.HOME_TAP_SUPPORT, null) AnalyticsHelper.logEvent(AnalyticsHelper.Event.HOME_TAP_SUPPORT, null)
} }
"Mystery Box" -> { "Ang Pao" -> {
if (getPhoneLogin().isBlank() || getMainPhoneLogin().isBlank()) { if (getPhoneLogin().isBlank() || getMainPhoneLogin().isBlank()) {
LoginActivity.lunch(requireContext()) LoginActivity.lunch(requireContext())
} else getChance() } else GameActivity.lunch(requireContext())
} }
"Point" -> { "Point" -> {
...@@ -622,13 +600,19 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie ...@@ -622,13 +600,19 @@ class HomeFragment : BaseFragment(), View.OnClickListener, BannersInteractor.Vie
MySubscriptionsActivity.lunch(requireContext()) MySubscriptionsActivity.lunch(requireContext())
} }
"ANG_PAO" -> { "BUTTON_BALANCE" -> {
if (getPhoneLogin().isNullOrEmpty()) { AnalyticsHelper.logEvent(AnalyticsHelper.Event.HOME_TAP_PLAN, null)
LoginActivity.lunch(getmContext()) MySubscriptionsActivity.lunch(requireContext())
} else }
// YesAngPaoActivity.lunch(getmContext())
MysteryBoxActivity.lunch(getmContext())
"BUTTON_TOP_UP" -> {
BuyTopUpCardActivity.lunch(requireActivity())
AnalyticsHelper.logEvent(AnalyticsHelper.Event.HOME_TAP_BUY_TOP_UP_CART, null)
}
"BUTTON_NUMBER" -> {
BuyYesNumberPhaseTwoActivity.lunch(requireActivity())
AnalyticsHelper.logEvent(AnalyticsHelper.Event.HOME_TAP_BUY_YES_NUMBER, null)
} }
......
...@@ -19,6 +19,7 @@ import com.journeyapps.barcodescanner.ScanOptions ...@@ -19,6 +19,7 @@ import com.journeyapps.barcodescanner.ScanOptions
import com.seatel.mobilehall.R import com.seatel.mobilehall.R
import com.seatel.mobilehall.data.network.SeatelSuperRequest import com.seatel.mobilehall.data.network.SeatelSuperRequest
import com.seatel.mobilehall.ui.base.fragment.BaseFragment import com.seatel.mobilehall.ui.base.fragment.BaseFragment
import com.seatel.mobilehall.ui.home.activity.ConfirmationActivity
import com.seatel.mobilehall.ui.invite_friend.InviteFriendScanQrActivity import com.seatel.mobilehall.ui.invite_friend.InviteFriendScanQrActivity
import com.seatel.mobilehall.ui.login.interactor.VerifyPinInteractor import com.seatel.mobilehall.ui.login.interactor.VerifyPinInteractor
import com.seatel.mobilehall.ui.login.presenter.VerifyPinPresenter import com.seatel.mobilehall.ui.login.presenter.VerifyPinPresenter
...@@ -60,10 +61,10 @@ class PinFragment : BaseFragment(), VerifyPinInteractor.View { ...@@ -60,10 +61,10 @@ class PinFragment : BaseFragment(), VerifyPinInteractor.View {
error_view.visibility = View.GONE error_view.visibility = View.GONE
val amount = response.optDouble("amount", 0.0) val amount = response.optDouble("amount", 0.0)
val pin = edit_text_amount.text.toString() val pin = edit_text_amount.text.toString()
/* ConfirmationActivity.lunch( ConfirmationActivity.lunch(
getmContext(), edit_text_top_up_phone_number.text.toString(), getmContext(), edit_text_top_up_phone_number.text.toString(),
amount, true, pin amount, true, pin
)*/ )
} }
override fun onVerifyPinNumberFailed(error: VolleyError) { override fun onVerifyPinNumberFailed(error: VolleyError) {
...@@ -208,7 +209,7 @@ class PinFragment : BaseFragment(), VerifyPinInteractor.View { ...@@ -208,7 +209,7 @@ class PinFragment : BaseFragment(), VerifyPinInteractor.View {
ScanContract() ScanContract()
) { result: ScanIntentResult -> ) { result: ScanIntentResult ->
if (result.contents == null) { if (result.contents == null) {
// Toast.makeText(requireContext(), "Cancelled", Toast.LENGTH_LONG).show() // Toast.makeText(requireContext(), "Cancelled", Toast.LENGTH_LONG).show()
} else { } else {
val mResult = result.contents.substringBeforeLast("*") val mResult = result.contents.substringBeforeLast("*")
val finalResult = mResult.substringAfterLast("*") val finalResult = mResult.substringAfterLast("*")
......
package com.seatel.mobilehall.ui.mysterybox
import android.content.Context
import android.content.Intent
import android.media.MediaPlayer
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.View
import android.view.View.OnClickListener
import com.android.volley.Request
import com.seatel.mobilehall.R
import com.seatel.mobilehall.data.network.SeatelJSONObjectRequest
import com.seatel.mobilehall.data.network.SeatelSuperRequest
import com.seatel.mobilehall.ui.base.activity.BaseActivity
import com.seatel.mobilehall.util.CustomGameDialog
import com.seatel.mobilehall.util.customview.ErrorHandleView
import kotlinx.android.synthetic.main.activity_veaykaorm.anim_bottom
import kotlinx.android.synthetic.main.activity_veaykaorm.anim_middle
import kotlinx.android.synthetic.main.activity_veaykaorm.anim_top
import kotlinx.android.synthetic.main.activity_veaykaorm.btn_first_mystery_box
import kotlinx.android.synthetic.main.activity_veaykaorm.btn_mystery
import kotlinx.android.synthetic.main.activity_veaykaorm.btn_second_mystery_box
import kotlinx.android.synthetic.main.activity_veaykaorm.btn_third_mystery_box
import kotlinx.android.synthetic.main.activity_veaykaorm.img_bottom
import kotlinx.android.synthetic.main.activity_veaykaorm.img_middle
import kotlinx.android.synthetic.main.activity_veaykaorm.img_top
import kotlinx.android.synthetic.main.activity_veaykaorm.view_error
import org.json.JSONObject
class MysteryBoxActivity : BaseActivity(), OnClickListener {
private var mChance: Int? = null
private var mLastClickTime: Long = 0
private var leftClick: Boolean = false
private var midClick: Boolean = false
private var rightClick = false
private lateinit var mp: MediaPlayer
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_veaykaorm)
btn_second_mystery_box.setOnClickListener(this)
btn_third_mystery_box.setOnClickListener(this)
btn_first_mystery_box.setOnClickListener(this)
btn_mystery.setOnClickListener {
ValentineRewardActivity.launch(this)
}
}
private fun playSound() {
// mp = MediaPlayer.create(this, R.raw.break_kaorm)
// mp.start()
}
private fun mysteryBoxMiddle() {
img_middle.visibility = View.GONE
anim_middle.visibility = View.VISIBLE
anim_middle.playAnimation()
view_error.setViewMode(ErrorHandleView.Mode.LOADING)
object : SeatelJSONObjectRequest(this) {
override fun getFunctionName(): String {
return "v2/seatel/get-angpao/${getPhoneLogin()}/mystery-box"
}
override fun getMethod(): Int {
return Request.Method.GET
}
}.setOnErrorListener {
Handler(Looper.getMainLooper()).postDelayed({
anim_middle.pauseAnimation()
img_middle.visibility = View.VISIBLE
anim_middle.visibility = View.GONE
view_error.visibility = View.GONE
val valentineDialog = CustomGameDialog(
this, SeatelSuperRequest.getErrorMessageFrom(it), "", "", "", false
)
valentineDialog.show()
}, 500)
}.execute {
Handler(Looper.getMainLooper()).postDelayed({
anim_middle.pauseAnimation()
view_error.visibility = View.GONE
img_middle.visibility = View.VISIBLE
anim_middle.visibility = View.GONE
val title = (it as JSONObject).optString("title")
val prize = it.optString("prize")
val subtitle = it.optString("subtitle")
val image = it.optString("image")
val valentineDialog = CustomGameDialog(this, title, prize, subtitle, image, false)
valentineDialog.show()
}, 500)
}
}
private fun mysteryBoxTop() {
img_top.visibility = View.GONE
anim_top.visibility = View.VISIBLE
anim_top.playAnimation()
view_error.setViewMode(ErrorHandleView.Mode.LOADING)
object : SeatelJSONObjectRequest(this) {
override fun getFunctionName(): String {
return "v2/seatel/get-angpao/${getPhoneLogin()}/mystery-box"
}
override fun getMethod(): Int {
return Request.Method.GET
}
}.setOnErrorListener {
Handler(Looper.getMainLooper()).postDelayed({
anim_top.pauseAnimation()
img_top.visibility = View.VISIBLE
anim_top.visibility = View.GONE
view_error.visibility = View.GONE
val valentineDialog = CustomGameDialog(
this, SeatelSuperRequest.getErrorMessageFrom(it), "", "", "", false
)
valentineDialog.show()
}, 500)
}.execute {
Handler(Looper.getMainLooper()).postDelayed({
anim_top.pauseAnimation()
view_error.visibility = View.GONE
img_top.visibility = View.VISIBLE
anim_top.visibility = View.GONE
val title = (it as JSONObject).optString("title")
val prize = it.optString("prize")
val subtitle = it.optString("subtitle")
val image = it.optString("image")
val valentineDialog = CustomGameDialog(this, title, prize, subtitle, image, false)
valentineDialog.show()
}, 500)
}
}
private fun mysteryBoxBottom() {
img_bottom.visibility = View.GONE
anim_bottom.visibility = View.VISIBLE
anim_bottom.playAnimation()
view_error.setViewMode(ErrorHandleView.Mode.LOADING)
object : SeatelJSONObjectRequest(this) {
override fun getFunctionName(): String {
return "v2/seatel/get-angpao/${getPhoneLogin()}/mystery-box"
}
override fun getMethod(): Int {
return Request.Method.GET
}
}.setOnErrorListener {
Handler(Looper.getMainLooper()).postDelayed({
anim_bottom.pauseAnimation()
img_bottom.visibility = View.VISIBLE
anim_bottom.visibility = View.GONE
view_error.visibility = View.GONE
val valentineDialog = CustomGameDialog(
this, SeatelSuperRequest.getErrorMessageFrom(it), "", "", "", false
)
valentineDialog.show()
}, 500)
}.execute {
Handler(Looper.getMainLooper()).postDelayed({
anim_bottom.pauseAnimation()
view_error.visibility = View.GONE
img_bottom.visibility = View.VISIBLE
anim_bottom.visibility = View.GONE
val title = (it as JSONObject).optString("title")
val prize = it.optString("prize")
val subtitle = it.optString("subtitle")
val image = it.optString("image")
val valentineDialog = CustomGameDialog(this, title, prize, subtitle, image, false)
valentineDialog.show()
}, 500)
}
}
/*private fun getChance() {
object : SeatelJSONObjectRequest(this) {
override fun getFunctionName(): String {
return "v2/seatel/get-chance/${getPhoneLogin()}/veay-kaorm"
}
override fun getMethod(): Int {
return Request.Method.GET
}
}.setOnErrorListener {
SeatelAlertDialog.with(this, SeatelSuperRequest.getErrorMessageFrom(it)).show()
}.execute {
mChance = (it as JSONObject).optInt("chance")
}
}*/
private fun vaiLeftKaorm() {/* btn_mid_kaorm.setOnClickListener {
midClick = true
rightClick = false
btn_right_kaorm.isClickable = false
btn_left_kaorm.isClickable = false
btn_left_kaorm.performClick()
}
btn_right_kaorm.setOnClickListener {
rightClick = true
midClick = false
btn_mid_kaorm.isClickable = false
btn_left_kaorm.isClickable = false
btn_left_kaorm.performClick()
}
btn_left_kaorm.setOnClickListener {
btn_mid_kaorm.isClickable = false
btn_right_kaorm.isClickable = false
btn_left_kaorm.isClickable = false
view_error.setViewMode(ErrorHandleView.Mode.LOADING)
object : SeatelJSONObjectRequest(this) {
override fun getFunctionName(): String {
return "v2/seatel/get-angpao/${getPhoneLogin()}/veay-kaorm"
}
override fun getMethod(): Int {
return Request.Method.GET
}
}.setOnErrorListener {
view_error.visibility = View.GONE
val valentineDialog =
ValentineDialog(
this,
SeatelSuperRequest.getErrorMessageFrom(it),
"",
"",
"",
false
)
valentineDialog.show()
Handler(Looper.getMainLooper()).postDelayed({
midClick = false
rightClick = false
btn_right_kaorm.isClickable = true
btn_left_kaorm.isClickable = true
btn_mid_kaorm.isClickable = true
}, 500)
}.execute {
playSound()
when {
midClick -> {
gifMidKaorm.visibility = View.VISIBLE
gifRightKaorm.visibility = View.GONE
gifLeftKaorm.visibility = View.GONE
gifMidKaorm.playAnimation()
}
rightClick -> {
gifMidKaorm.visibility = View.GONE
gifRightKaorm.visibility = View.VISIBLE
gifLeftKaorm.visibility = View.GONE
gifRightKaorm.playAnimation()
}
else -> {
gifMidKaorm.visibility = View.GONE
gifRightKaorm.visibility = View.GONE
gifLeftKaorm.visibility = View.VISIBLE
gifLeftKaorm.playAnimation()
}
}
val title = (it as JSONObject).optString("title")
val prize = it.optString("prize")
val subtitle = it.optString("subtitle")
val image = it.optString("image")
Handler(Looper.getMainLooper()).postDelayed({
val valentineDialog =
ValentineDialog(this, title, prize, subtitle, image, false)
valentineDialog.show()
view_error.visibility = View.GONE
gifLeftKaorm.frame = 0
gifRightKaorm.frame = 0
gifMidKaorm.frame = 0
gifMidKaorm.pauseAnimation()
gifRightKaorm.pauseAnimation()
gifLeftKaorm.pauseAnimation()
mp.reset()
Handler(Looper.getMainLooper()).postDelayed({
midClick = false
rightClick = false
btn_right_kaorm.isClickable = true
btn_left_kaorm.isClickable = true
btn_mid_kaorm.isClickable = true
}, 500)
}, 1000)
}
}*/
}
override fun getToolbarTitle(): String {
return resources.getString(R.string.mystery_box)
}
companion object {
fun lunch(context: Context) {
val intent = Intent(context, MysteryBoxActivity::class.java)
context.startActivity(intent)
}
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.btn_first_mystery_box -> mysteryBoxTop()
R.id.btn_second_mystery_box -> mysteryBoxMiddle()
R.id.btn_third_mystery_box -> mysteryBoxBottom()
}
}
}
\ No newline at end of file
package com.seatel.mobilehall.ui.mysterybox
import com.android.volley.VolleyError
interface ValentineInteractor {
interface View {
fun onValentineRewardSucceed(angPaoListItem: ArrayList<MysteryBoxModelItem>)
fun onValentineRewardFailed(error: VolleyError)
}
interface Presenter {
fun getValentineReward(phoneNumber: String)
}
}
\ No newline at end of file
package com.seatel.mobilehall.util.dialogannouncement
import android.app.Dialog
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.view.View
import android.view.ViewGroup
import android.view.Window
import android.widget.Button
import android.widget.ImageView
import android.widget.TextView
import coil.load
import com.seatel.mobilehall.R
import com.seatel.mobilehall.util.lang.LanguageManager
class CustomGameDialog(
context: Context,
title: String,
prize: String,
subtitle: String,
image: String,
isDoneShow: Boolean
) : Dialog(context) {
private var isDimissClose = false
init {
initValentine(title, prize, subtitle, image, isDoneShow)
}
fun isDimissClose(): Boolean {
return isDimissClose
}
private fun initValentine(
title: String, prize: String, subtitle: String, image: String, isDoneShow: Boolean
) {
requestWindowFeature(Window.FEATURE_NO_TITLE)
setContentView(R.layout.dialog_game)
setCancelable(false)
if (window != null) {
window!!.setLayout(
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT
)
window!!.attributes.windowAnimations = R.style.DialogAnimationScaleInOut
window!!.setDimAmount(0.5f)
window!!.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
}
val mTitle = findViewById<TextView>(R.id.tv_congratulation)
val mPrize = findViewById<ImageView>(R.id.iv_data)
val mSubTitle = findViewById<TextView>(R.id.sub_title)
// val mSubTitle = findViewById<TextView>(R.id.valentine_subTitle)
val btnDone = findViewById<Button>(R.id.btn_done)
val bgImage = findViewById<ImageView>(R.id.imageView2)
val imageOpenAngPao = findViewById<ImageView>(R.id.image_open_ang_pao)
btnDone.text = LanguageManager(context).translateWords(
context, context.resources.getString(R.string.done)
)
if (title == "Thank You") {
mTitle.text = ""
} else mTitle.text = title/* if (prize.isEmpty()) {
mPrize.visibility = View.GONE
} else*/
if (image.isNotBlank()) mPrize.load(image) { crossfade(true) }
else mPrize.visibility = View.GONE
mSubTitle.text = subtitle
if (isDoneShow) {
btnDone.visibility = View.VISIBLE
bgImage.setImageDrawable(context.resources.getDrawable(R.drawable.bg_dialog_game))
} else {
btnDone.visibility = View.GONE
imageOpenAngPao.visibility = View.VISIBLE
}
btnDone.setOnClickListener {
dismiss()
}
val close = findViewById<ImageView>(R.id.valentine_close)
close.setOnClickListener {
dismiss()
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/ripple">
<item>
<shape android:shape="rectangle">
<corners android:radius="50dp" />
<solid android:color="@color/colorPrimary" />
</shape>
</item>
</ripple>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/imageView_cny"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:scaleType="fitXY"
android:src="@drawable/bg_cny"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/btn_left"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginStart="25dp"
android:layout_marginTop="50dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/btn_center"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginTop="50dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/btn_right"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginTop="50dp"
android:layout_marginEnd="25dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/btn_claim"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginStart="25dp"
android:layout_marginEnd="25dp"
android:layout_marginBottom="30dp"
app:layout_constraintBottom_toBottomOf="@+id/imageView_cny" />
<androidx.appcompat.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageViewBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_left_back" />
<com.seatel.mobilehall.util.customview.CustomTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/ang_pao"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
</androidx.appcompat.widget.Toolbar>
<com.seatel.mobilehall.util.customview.ErrorHandleView
android:id="@+id/error_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorValentineTransparent">
<ImageView
android:id="@+id/valentine_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:padding="10dp"
android:src="@drawable/ic_close_x" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="center">
<ImageView
android:id="@+id/imageView2"
android:layout_width="250dp"
android:layout_height="250dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="@+id/imageView2"
app:layout_constraintEnd_toEndOf="@+id/imageView2"
app:layout_constraintStart_toStartOf="@+id/imageView2"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tv_congratulation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/iv_data"
android:layout_width="150dp"
android:layout_height="80dp" />
<TextView
android:id="@+id/sub_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="15sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/image_open_ang_pao"
android:layout_width="150dp"
android:layout_height="150dp"
android:src="@drawable/ic_open_cny"
android:visibility="gone" />
<Button
android:id="@+id/btn_done"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_marginTop="10dp"
android:background="@drawable/bg_radius_white"
android:text="@string/done"
android:textColor="@color/colorPrimary"
android:visibility="gone" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
\ No newline at end of file
...@@ -424,6 +424,7 @@ ...@@ -424,6 +424,7 @@
</RelativeLayout> </RelativeLayout>
<Button <Button
android:id="@+id/btn_balance"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
...@@ -432,6 +433,7 @@ ...@@ -432,6 +433,7 @@
android:background="@drawable/bg_button_primary" android:background="@drawable/bg_button_primary"
android:padding="5dp" android:padding="5dp"
android:text="Click Here" android:text="Click Here"
android:tag="BUTTON_BALANCE"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="10sp" android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
...@@ -505,6 +507,7 @@ ...@@ -505,6 +507,7 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<Button <Button
android:id="@+id/btn_top_up"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
...@@ -513,6 +516,7 @@ ...@@ -513,6 +516,7 @@
android:background="@drawable/bg_box_white_stroke_primary" android:background="@drawable/bg_box_white_stroke_primary"
android:padding="5dp" android:padding="5dp"
android:text="Click Here" android:text="Click Here"
android:tag="BUTTON_TOP_UP"
android:textColor="@color/colorPrimary" android:textColor="@color/colorPrimary"
android:textSize="10sp" /> android:textSize="10sp" />
...@@ -604,6 +608,7 @@ ...@@ -604,6 +608,7 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<Button <Button
android:id="@+id/btn_number"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
...@@ -612,6 +617,7 @@ ...@@ -612,6 +617,7 @@
android:background="@drawable/bg_box_white_stroke_primary" android:background="@drawable/bg_box_white_stroke_primary"
android:padding="5dp" android:padding="5dp"
android:text="Click Here" android:text="Click Here"
android:tag="BUTTON_NUMBER"
android:textColor="@color/colorPrimary" android:textColor="@color/colorPrimary"
android:textSize="10sp" /> android:textSize="10sp" />
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/margin_1x_size"
android:layout_marginTop="@dimen/margin_1x_size"
android:layout_marginEnd="@dimen/margin_1x_size"
android:layout_marginBottom="@dimen/margin_1x_size"
android:background="@drawable/bg_round_valentine_white"
android:paddingStart="@dimen/margin_1x_size"
android:paddingTop="@dimen/margin_3x_size"
android:paddingEnd="@dimen/margin_1x_size"
android:paddingBottom="@dimen/margin_3x_size">
<ImageView
android:id="@+id/iv_heart"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:padding="@dimen/margin_1x_size"
android:src="@drawable/ic_cny" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/margin_1x_size"
android:layout_marginEnd="@dimen/margin_1x_size"
android:layout_toEndOf="@+id/iv_heart"
android:orientation="vertical">
<com.seatel.mobilehall.util.customview.CustomTextView
android:id="@+id/valentine_data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="520GB Data"
android:textColor="@color/colorPrimary"
android:textSize="@dimen/large_text_size"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_1x_size"
android:orientation="horizontal">
<com.seatel.mobilehall.util.customview.CustomTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Use for:"
android:textSize="@dimen/small_text_size"
android:textStyle="bold" />
<com.seatel.mobilehall.util.customview.CustomTextView
android:id="@+id/valentine_use_for"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" Call, Sms, Internet"
android:textSize="@dimen/small_text_size" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.seatel.mobilehall.util.customview.CustomTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Validity:"
android:textSize="@dimen/small_text_size"
android:textStyle="bold" />
<com.seatel.mobilehall.util.customview.CustomTextView
android:id="@+id/valentine_validity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" 10/10/2023 17/01/2023"
android:textSize="@dimen/small_text_size" />
</LinearLayout>
</LinearLayout>
<com.seatel.mobilehall.util.customview.CustomButton
android:id="@+id/btn_claim_valentine"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="@drawable/bg_round_button_primary"
android:gravity="center"
android:paddingStart="@dimen/margin_2x_size"
android:paddingEnd="@dimen/margin_2x_size"
android:text="Claim"
android:textColor="@color/white" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_confirmation_blur">
<androidx.appcompat.widget.Toolbar
android:id="@+id/mToolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageViewBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_left_back" />
<com.seatel.mobilehall.util.customview.CustomTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/claim"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
</androidx.appcompat.widget.Toolbar>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/game_recycler"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="5dp"
android:nestedScrollingEnabled="false"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mToolbar" />
<com.seatel.mobilehall.util.customview.ErrorHandleView
android:id="@+id/error_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/mToolbar" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -633,4 +633,7 @@ ...@@ -633,4 +633,7 @@
<string name="service">Service</string> <string name="service">Service</string>
<string name="charging_rate">Charging Rate</string> <string name="charging_rate">Charging Rate</string>
<string name="ang_pao">yes Ang Pao</string>
<string name="game_no_chance" translatable="false">No Chance Message</string>
</resources> </resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment