diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/SupportDevelopmentActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/SupportDevelopmentActivity.kt index 010b1808..ab37ff9f 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/SupportDevelopmentActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/SupportDevelopmentActivity.kt @@ -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() { diff --git a/app/src/main/java/code/name/monkey/retromusic/dialogs/UpiPaymentBottomSheetDialogFragment.kt b/app/src/main/java/code/name/monkey/retromusic/dialogs/UpiPaymentBottomSheetDialogFragment.kt deleted file mode 100644 index 3455374c..00000000 --- a/app/src/main/java/code/name/monkey/retromusic/dialogs/UpiPaymentBottomSheetDialogFragment.kt +++ /dev/null @@ -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()) - } - } -} \ No newline at end of file diff --git a/app/src/main/res/layout/activity_donation.xml b/app/src/main/res/layout/activity_donation.xml index c89f85d8..fcb83a9b 100644 --- a/app/src/main/res/layout/activity_donation.xml +++ b/app/src/main/res/layout/activity_donation.xml @@ -75,13 +75,6 @@ android:paddingStart="6dp" android:paddingEnd="6dp" android:scrollbarStyle="outsideOverlay" /> - - \ No newline at end of file