Removed Indian payment button
This commit is contained in:
parent
82a19b5462
commit
c9d05299fc
3 changed files with 0 additions and 81 deletions
|
@ -18,13 +18,11 @@ import androidx.recyclerview.widget.GridLayoutManager
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import code.name.monkey.appthemehelper.ThemeStore
|
||||
import code.name.monkey.appthemehelper.util.ATHUtil
|
||||
import code.name.monkey.appthemehelper.util.MaterialUtil
|
||||
import code.name.monkey.appthemehelper.util.TintHelper
|
||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper
|
||||
import code.name.monkey.retromusic.BuildConfig
|
||||
import code.name.monkey.retromusic.R
|
||||
import code.name.monkey.retromusic.activities.base.AbsBaseActivity
|
||||
import code.name.monkey.retromusic.dialogs.UpiPaymentBottomSheetDialogFragment
|
||||
import code.name.monkey.retromusic.extensions.textColorPrimary
|
||||
import code.name.monkey.retromusic.extensions.textColorSecondary
|
||||
import com.anjlab.android.iab.v3.BillingProcessor
|
||||
|
@ -73,14 +71,6 @@ class SupportDevelopmentActivity : AbsBaseActivity(), BillingProcessor.IBillingH
|
|||
billingProcessor = BillingProcessor(this, BuildConfig.GOOGLE_PLAY_LICENSING_KEY, this)
|
||||
TintHelper.setTint(progress, ThemeStore.accentColor(this))
|
||||
donation.setTextColor(ThemeStore.accentColor(this))
|
||||
|
||||
MaterialUtil.setTint(upiClick)
|
||||
upiClick.setOnClickListener {
|
||||
UpiPaymentBottomSheetDialogFragment().show(
|
||||
supportFragmentManager,
|
||||
UpiPaymentBottomSheetDialogFragment.TAG
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupToolbar() {
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
package code.name.monkey.retromusic.dialogs
|
||||
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import code.name.monkey.appthemehelper.util.MaterialUtil
|
||||
import code.name.monkey.retromusic.R
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import kotlinx.android.synthetic.main.fragment_upi_payment_dialog.*
|
||||
|
||||
class UpiPaymentBottomSheetDialogFragment : BottomSheetDialogFragment() {
|
||||
companion object {
|
||||
const val TAG: String = "UpiPaymentBottomSheetDialogFragment"
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
return inflater.inflate(R.layout.fragment_upi_payment_dialog, container, false)
|
||||
}
|
||||
|
||||
private fun upi(name: String, amount: String, note: String) {
|
||||
val currentTime = System.currentTimeMillis() / 1000
|
||||
val transactionId = "${currentTime}UPI"
|
||||
val upi =
|
||||
"upi://pay?pa=retromusic@ybl&pn=$name&mc=0000&tid=$transactionId&tr=$transactionId&tn=$note&am=$amount&cu=INR&refUrl=refurl".replace(
|
||||
" ",
|
||||
"+"
|
||||
)
|
||||
val intent = Intent();
|
||||
intent.action = Intent.ACTION_VIEW;
|
||||
intent.data = Uri.parse(upi);
|
||||
val chooser = Intent.createChooser(intent, "Pay with...");
|
||||
startActivityForResult(chooser, 1, null)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
MaterialUtil.setTint(submit)
|
||||
submit.setOnClickListener {
|
||||
val name = nameText.text.toString()
|
||||
if (TextUtils.isEmpty(name)) {
|
||||
nameContainer.error = "Name is empty"
|
||||
return@setOnClickListener
|
||||
} else {
|
||||
nameContainer.error = null
|
||||
}
|
||||
val amount = amountText.text.toString()
|
||||
if (TextUtils.isEmpty(amount)) {
|
||||
amountContainer.error = "Amount is empty"
|
||||
return@setOnClickListener
|
||||
} else {
|
||||
amountContainer.error = null
|
||||
}
|
||||
upi(name, amount, noteText.text.toString())
|
||||
}
|
||||
}
|
||||
}
|
|
@ -75,13 +75,6 @@
|
|||
android:paddingStart="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:scrollbarStyle="outsideOverlay" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/upiClick"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="For indian payment" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
Loading…
Reference in a new issue