diff --git a/app/src/main/java/com/benrostudios/enchante/ui/home/fragments/WalletFragment.kt b/app/src/main/java/com/benrostudios/enchante/ui/home/fragments/WalletFragment.kt index 66a0372..276808e 100644 --- a/app/src/main/java/com/benrostudios/enchante/ui/home/fragments/WalletFragment.kt +++ b/app/src/main/java/com/benrostudios/enchante/ui/home/fragments/WalletFragment.kt @@ -6,13 +6,18 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.widget.ImageView +import android.widget.TextView import androidx.fragment.app.Fragment import androidx.lifecycle.Observer import androidx.navigation.fragment.findNavController +import androidx.recyclerview.widget.LinearLayoutManager import com.benrostudios.enchante.R +import com.benrostudios.enchante.adapters.withSimpleAdapter import com.benrostudios.enchante.databinding.FragmentWalletBinding import com.benrostudios.enchante.ui.nearby.NearbyPaymentActivity import com.benrostudios.enchante.ui.viewmodels.WalletViewModel +import com.bumptech.glide.Glide import org.koin.androidx.viewmodel.ext.android.viewModel import java.text.DecimalFormat @@ -41,6 +46,15 @@ class WalletFragment : Fragment() { binding.addMoneyCard.setOnClickListener { this.findNavController().navigate(R.id.action_walletFragment_to_addFundsFragment) } + binding.offersRv.layoutManager = + LinearLayoutManager(requireContext(), LinearLayoutManager.HORIZONTAL, false) + + binding.offersRv.withSimpleAdapter(listOf("Free event pass"), R.layout.offer_item) { + itemView.findViewById(R.id.offer_name).text = "Free event pass" + itemView.findViewById(R.id.offer_token).text = "Get this for $10USD" + Glide.with(itemView).load(R.drawable.offer) + .into(itemView.findViewById(R.id.offer_image)) + } } diff --git a/app/src/main/java/com/benrostudios/enchante/ui/nearby/fragments/NearbyTransactionDetailsFragment.kt b/app/src/main/java/com/benrostudios/enchante/ui/nearby/fragments/NearbyTransactionDetailsFragment.kt index a301df4..e49b0f1 100644 --- a/app/src/main/java/com/benrostudios/enchante/ui/nearby/fragments/NearbyTransactionDetailsFragment.kt +++ b/app/src/main/java/com/benrostudios/enchante/ui/nearby/fragments/NearbyTransactionDetailsFragment.kt @@ -41,7 +41,7 @@ class NearbyTransactionDetailsFragment : Fragment() { private fun moveFunds() { walletViewModel.makeTransaction( "+919999999999", - binding.nearbyDetailsMoneyText.toString().toDouble() + binding.nearbyDetailsMoneyText.text.toString().toDouble() ) } } \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/offer.png b/app/src/main/res/drawable-v24/offer.png new file mode 100644 index 0000000..ce83217 Binary files /dev/null and b/app/src/main/res/drawable-v24/offer.png differ diff --git a/app/src/main/res/layout/fragment_nearby_transaction_result.xml b/app/src/main/res/layout/fragment_nearby_transaction_result.xml index 4758847..151da60 100644 --- a/app/src/main/res/layout/fragment_nearby_transaction_result.xml +++ b/app/src/main/res/layout/fragment_nearby_transaction_result.xml @@ -23,25 +23,31 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> - + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.341" + app:lottie_autoPlay="true" + app:lottie_loop="false" + app:lottie_rawRes="@raw/success" /> + app:layout_constraintEnd_toEndOf="@+id/animationView2" + app:layout_constraintStart_toStartOf="@+id/animationView2" + app:layout_constraintTop_toBottomOf="@+id/animationView2" /> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_wallet.xml b/app/src/main/res/layout/fragment_wallet.xml index 3dfc5d9..8311b92 100644 --- a/app/src/main/res/layout/fragment_wallet.xml +++ b/app/src/main/res/layout/fragment_wallet.xml @@ -13,6 +13,37 @@ tools:context=".ui.home.fragments.WalletFragment"> + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/offer_item.xml b/app/src/main/res/layout/offer_item.xml new file mode 100644 index 0000000..c16ac56 --- /dev/null +++ b/app/src/main/res/layout/offer_item.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/raw/success.json b/app/src/main/res/raw/success.json new file mode 100644 index 0000000..28b2aed --- /dev/null +++ b/app/src/main/res/raw/success.json @@ -0,0 +1 @@ +{"v":"5.5.1","fr":60,"ip":0,"op":150,"w":81,"h":81,"nm":"icn-success","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"tick-parent","sr":1,"ks":{"o":{"a":0,"k":0,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[40.5,40.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.576,0.576,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":87.5,"s":[90,90,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.423,0.423,0.333],"y":[0,0,0]},"t":130,"s":[108,108,100]},{"t":147.5,"s":[100,100,100]}],"ix":6}},"ao":0,"ip":0,"op":1800,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"dash-1","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[-11.053,15.359,0],"ix":2},"a":{"a":0,"k":[4.302,4.302,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[3.303,3.302],[-3.303,-3.302]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.8,0.8,0.8,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[4.302,4.302],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.302],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":87.5,"s":[100]},{"t":115,"s":[0]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":87.5,"s":[100]},{"t":115,"s":[0]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":1800,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"dash-2","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[11.07,3.502,0],"ix":2},"a":{"a":0,"k":[11.358,11.257,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[10.357,-10.258],[-10.357,10.258]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.8,0.8,0.8,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[11.358,11.257],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.302],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":102.5,"s":[100]},{"t":125,"s":[0]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":102.5,"s":[100]},{"t":125,"s":[0]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":1800,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"tick","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[-0.333,1.799,0],"ix":2},"a":{"a":0,"k":[17.739,13.258,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[14.739,-10.258],[-5.976,10.258],[-14.739,1.494]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.054901960784313725,0.8313725490196079,0.4588235294117647,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":8,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[17.739,13.258],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.185],"y":[1]},"o":{"x":[0.324],"y":[0]},"t":87.5,"s":[100]},{"t":147.5,"s":[0]}],"ix":1},"e":{"a":0,"k":100,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":1800,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":4,"nm":"circle-blue","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":120,"s":[360]}],"ix":10},"p":{"a":0,"k":[40.5,40.5,0],"ix":2},"a":{"a":0,"k":[37.5,37.5,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-19.054,0],[0,-19.054],[19.054,0],[0,19.054]],"o":[[19.054,0],[0,19.054],[-19.054,0],[0,-19.054]],"v":[[0,-34.5],[34.5,0],[0,34.5],[-34.5,0]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.054901960784313725,0.8313725490196079,0.4588235294117647,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":8,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[37.5,37.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.123],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"t":120,"s":[100]}],"ix":1},"e":{"a":0,"k":0,"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":1800,"st":0,"bm":0}],"markers":[]} \ No newline at end of file