Hide buy on playstore, margins on captcha button

This commit is contained in:
Kelvin 2023-10-20 17:38:33 +02:00
parent 7e54a2ce3d
commit a2c63c59c5
2 changed files with 17 additions and 5 deletions

View file

@ -10,6 +10,7 @@ import android.widget.TextView
import androidx.lifecycle.lifecycleScope
import com.futo.futopay.PaymentConfigurations
import com.futo.futopay.PaymentManager
import com.futo.platformplayer.BuildConfig
import com.futo.platformplayer.R
import com.futo.platformplayer.UIDialogs
import com.futo.platformplayer.logging.Logger
@ -68,9 +69,12 @@ class BuyFragment : MainFragment() {
}
}
_buttonBuy.setOnClickListener {
buy();
}
if(!BuildConfig.IS_PLAYSTORE_BUILD)
_buttonBuy.setOnClickListener {
buy();
}
else
_buttonBuy.visibility = View.GONE;
_buttonPaid.setOnClickListener {
paid();
}

View file

@ -263,10 +263,18 @@ class SourceDetailFragment : MainFragment() {
BigButtonGroup(c, "Management",
BigButton(c, "Uninstall", "Removes the plugin from the app", R.drawable.ic_block) {
uninstallSource();
}.withBackground(R.drawable.background_big_button_red),
}.withBackground(R.drawable.background_big_button_red).apply {
this.layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT).apply {
setMargins(0, TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5f, resources.displayMetrics).toInt(), 0, 0);
};
},
if(clientIfExists?.captchaEncrypted != null)
BigButton(c, "Delete Captcha", "Deletes captcha for this plugin", R.drawable.ic_block) {
BigButton(c, "Delete Captcha", "Deletes stored captcha answer for this plugin", R.drawable.ic_block) {
clientIfExists?.updateCaptcha(null);
}.apply {
this.layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT).apply {
setMargins(0, TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 5f, resources.displayMetrics).toInt(), 0, 0);
};
}.withBackground(R.drawable.background_big_button_red)
else null
)