diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 62affbe1f..8ccbcd025 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -21,10 +21,6 @@
android:theme="@style/SplashTheme"
tools:replace="android:allowBackup"
tools:targetApi="n">
-
-
) = (activity is LoginChooserActivity || activity is LoginActivity ||
- activity is DonateActivity)
+ private fun hasTheme(activity: BaseActivity<*, *>) = (activity is LoginChooserActivity || activity is LoginActivity)
}
\ No newline at end of file
diff --git a/app/src/main/java/com/fastaccess/ui/modules/about/FastHubAboutActivity.java b/app/src/main/java/com/fastaccess/ui/modules/about/FastHubAboutActivity.java
index c9afe6ecb..2ce20e62b 100644
--- a/app/src/main/java/com/fastaccess/ui/modules/about/FastHubAboutActivity.java
+++ b/app/src/main/java/com/fastaccess/ui/modules/about/FastHubAboutActivity.java
@@ -24,6 +24,7 @@
import com.fastaccess.provider.tasks.version.CheckVersionService;
import com.fastaccess.provider.theme.ThemeEngine;
import com.fastaccess.ui.modules.changelog.ChangelogBottomSheetDialog;
+import com.fastaccess.ui.modules.main.donation.DonationActivity;
import com.fastaccess.ui.modules.repos.RepoPagerActivity;
import com.fastaccess.ui.modules.repos.issues.create.CreateIssueActivity;
import com.fastaccess.ui.modules.user.UserPagerActivity;
@@ -86,6 +87,14 @@ private void buildLibre(Context context, MaterialAboutCard.Builder libreCardBuil
.subText("by thermatk")
.icon(ContextCompat.getDrawable(context, R.drawable.ic_github))
.setOnClickAction(() -> startActivity(RepoPagerActivity.createIntent(this, "FastHub-Libre", "thermatk")))
+ .build())
+ .addItem(new MaterialAboutActionItem.Builder()
+ .text("Unlock all features")
+ .subText("but don't forget to support developers!")
+ .icon(ContextCompat.getDrawable(context, R.drawable.ic_lock))
+ .setOnClickAction(() -> {
+ startActivity(new Intent(context, DonationActivity.class));
+ })
.build());
}
diff --git a/app/src/main/java/com/fastaccess/ui/modules/login/LoginActivity.java b/app/src/main/java/com/fastaccess/ui/modules/login/LoginActivity.java
index b645d9401..5743e507f 100644
--- a/app/src/main/java/com/fastaccess/ui/modules/login/LoginActivity.java
+++ b/app/src/main/java/com/fastaccess/ui/modules/login/LoginActivity.java
@@ -4,7 +4,6 @@
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.TextInputEditText;
@@ -14,7 +13,6 @@
import com.evernote.android.state.State;
import com.fastaccess.App;
-import com.fastaccess.BuildConfig;
import com.fastaccess.R;
import com.fastaccess.helper.ActivityHelper;
import com.fastaccess.helper.AnimHelper;
@@ -22,15 +20,10 @@
import com.fastaccess.helper.BundleConstant;
import com.fastaccess.helper.Bundler;
import com.fastaccess.helper.InputHelper;
-import com.fastaccess.helper.Logger;
import com.fastaccess.ui.base.BaseActivity;
import com.fastaccess.ui.modules.login.chooser.LoginChooserActivity;
-import com.fastaccess.ui.modules.main.donation.DonateActivity;
import com.fastaccess.ui.widgets.FontCheckbox;
import com.fastaccess.ui.widgets.dialog.MessageDialogView;
-import com.miguelbcr.io.rx_billing_service.RxBillingService;
-import com.miguelbcr.io.rx_billing_service.entities.ProductType;
-import com.miguelbcr.io.rx_billing_service.entities.Purchase;
import butterknife.BindView;
import butterknife.OnCheckedChanged;
@@ -163,10 +156,8 @@ public static void start(@NonNull Activity activity, boolean isBasicAuth, boolea
}
@Override public void onSuccessfullyLoggedIn(boolean extraLogin) {
- checkPurchases(() -> {
- hideProgress();
- onRestartApp();
- });
+ hideProgress();
+ onRestartApp();
}
@Override protected void onCreate(Bundle savedInstanceState) {
@@ -228,29 +219,6 @@ public static void start(@NonNull Activity activity, boolean isBasicAuth, boolea
login.show();
}
- protected void checkPurchases(@Nullable Action action) {
- getPresenter().manageViewDisposable(RxBillingService.getInstance(this, BuildConfig.DEBUG)
- .getPurchases(ProductType.IN_APP)
- .doOnSubscribe(disposable -> showProgress(0))
- .subscribe((purchases, throwable) -> {
- hideProgress();
- if (throwable == null) {
- Logger.e(purchases);
- if (purchases != null && !purchases.isEmpty()) {
- for (Purchase purchase : purchases) {
- String sku = purchase.sku();
- if (!InputHelper.isEmpty(sku)) {
- DonateActivity.Companion.enableProduct(sku, App.getInstance());
- }
- }
- }
- } else {
- throwable.printStackTrace();
- }
- if (action != null) action.run();
- }));
- }
-
private void doLogin() {
if (progress.getVisibility() == View.GONE) {
getPresenter().login(InputHelper.toString(username),
diff --git a/app/src/main/java/com/fastaccess/ui/modules/main/donation/CheckPurchaseActivity.kt b/app/src/main/java/com/fastaccess/ui/modules/main/donation/CheckPurchaseActivity.kt
deleted file mode 100644
index acd1b1e5e..000000000
--- a/app/src/main/java/com/fastaccess/ui/modules/main/donation/CheckPurchaseActivity.kt
+++ /dev/null
@@ -1,79 +0,0 @@
-package com.fastaccess.ui.modules.main.donation
-
-import android.app.Activity
-import android.app.ProgressDialog
-import android.os.Bundle
-import android.widget.Toast
-import com.fastaccess.App
-import com.fastaccess.BuildConfig
-import com.fastaccess.R
-import com.fastaccess.helper.AppHelper
-import com.fastaccess.helper.RxHelper
-import com.miguelbcr.io.rx_billing_service.RxBillingService
-import com.miguelbcr.io.rx_billing_service.entities.ProductType
-import es.dmoral.toasty.Toasty
-import io.reactivex.Observable
-import io.reactivex.disposables.Disposable
-
-/**
- * Created by kosh on 14/07/2017.
- */
-class CheckPurchaseActivity : Activity() {
-
- private var progress: ProgressDialog? = null
- private var disposable: Disposable? = null
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- progress = ProgressDialog(this)
- .apply {
- setMessage(getString(R.string.in_progress))
- setOnCancelListener { finishActivity(false) }
- show()
- }
- if (AppHelper.isGoogleAvailable(this) && !AppHelper.isEmulator()) {
- disposable = RxHelper.getObservable(Observable.fromCallable {
- try {
- val purchases = RxBillingService.getInstance(this, BuildConfig.DEBUG)
- .getPurchases(ProductType.IN_APP)
- .toMaybe()
- .blockingGet(mutableListOf())
- if (!purchases.isEmpty()) {
- purchases.filterNotNull()
- .map { it.sku() }
- .filterNot { !it.isNullOrBlank() }
- .onEach { DonateActivity.enableProduct(it, App.getInstance()) }
- return@fromCallable true
- }
- } catch (e: Exception) {
- e.printStackTrace()
- }
- return@fromCallable false
- }).subscribe({ finishActivity(it) }, { finishActivity(false) })
- } else {
- finishActivity(false)
- }
- }
-
- override fun onStart() {
- super.onStart()
- setVisible(true)
- }
-
- override fun onBackPressed() = Unit
-
- private fun finishActivity(showMessage: Boolean) {
- if (showMessage) Toasty.success(App.getInstance(), getString(R.string.success_purchase_message), Toast.LENGTH_LONG).show()
- finish()
- }
-
- override fun onDestroy() {
- progress?.let {
- it.dismiss()
- }
- disposable?.let {
- if (!it.isDisposed) it.dispose()
- }
- super.onDestroy()
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/fastaccess/ui/modules/main/donation/DonateActivity.kt b/app/src/main/java/com/fastaccess/ui/modules/main/donation/DonateActivity.kt
deleted file mode 100644
index f46a2fb8b..000000000
--- a/app/src/main/java/com/fastaccess/ui/modules/main/donation/DonateActivity.kt
+++ /dev/null
@@ -1,112 +0,0 @@
-package com.fastaccess.ui.modules.main.donation
-
-import android.app.Activity
-import android.content.Context
-import android.content.Intent
-import android.os.Bundle
-import android.support.v4.app.Fragment
-import com.fastaccess.BuildConfig
-import com.fastaccess.R
-import com.fastaccess.helper.*
-import com.fastaccess.provider.fabric.FabricProvider
-import com.fastaccess.ui.base.BaseActivity
-import com.fastaccess.ui.base.mvp.BaseMvp
-import com.fastaccess.ui.base.mvp.presenter.BasePresenter
-import com.miguelbcr.io.rx_billing_service.RxBillingService
-import com.miguelbcr.io.rx_billing_service.RxBillingServiceError
-import com.miguelbcr.io.rx_billing_service.RxBillingServiceException
-import com.miguelbcr.io.rx_billing_service.entities.ProductType
-import com.miguelbcr.io.rx_billing_service.entities.Purchase
-import io.reactivex.disposables.Disposable
-
-/**
- * Created by Kosh on 10 Jun 2017, 1:04 PM
- */
-
-class DonateActivity : BaseActivity>() {
-
- private var subscription: Disposable? = null
-
- override fun layout(): Int = 0
-
- override fun isTransparent(): Boolean = true
-
- override fun canBack(): Boolean = false
-
- override fun isSecured(): Boolean = true
-
- override fun providePresenter(): BasePresenter = BasePresenter()
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- val bundle: Bundle = intent.extras
- val productKey: String = bundle.getString(BundleConstant.EXTRA)
- subscription = RxHelper.getSingle(RxBillingService.getInstance(this, BuildConfig.DEBUG)
- .purchase(ProductType.IN_APP, productKey, "inapp:com.fastaccess.github:" + productKey))
- .subscribe({ p: Purchase?, throwable: Throwable? ->
- if (throwable == null) {
- FabricProvider.logPurchase(productKey)
- showMessage(R.string.success, R.string.success_purchase_message)
- enableProduct(productKey, applicationContext)
- val intent = Intent()
- intent.putExtra(BundleConstant.ITEM, productKey)
- setResult(Activity.RESULT_OK, intent)
- } else {
- if (throwable is RxBillingServiceException) {
- val code = throwable.code
- if (code == RxBillingServiceError.ITEM_ALREADY_OWNED) {
- enableProduct(productKey, applicationContext)
- val intent = Intent()
- intent.putExtra(BundleConstant.ITEM, productKey)
- setResult(Activity.RESULT_OK, intent)
- } else {
- showErrorMessage(throwable.message!!)
- Logger.e(code)
- setResult(Activity.RESULT_CANCELED)
- }
- }
- throwable.printStackTrace()
- }
- finish()
- })
- }
-
- override fun onDestroy() {
- subscription?.let { if (!it.isDisposed) it.dispose() }
- super.onDestroy()
- }
-
- companion object {
- fun start(context: Activity, product: String?) {
- val intent = Intent(context, DonateActivity::class.java)
- intent.putExtras(Bundler.start()
- .put(BundleConstant.EXTRA, product)
- .end())
- context.startActivityForResult(intent, BundleConstant.REQUEST_CODE)
- }
-
- fun start(context: Fragment, product: String?) {
- val intent = Intent(context.context, DonateActivity::class.java)
- intent.putExtras(Bundler.start()
- .put(BundleConstant.EXTRA, product)
- .end())
- context.startActivityForResult(intent, BundleConstant.REQUEST_CODE)
- }
-
- fun enableProduct(productKey: String, context: Context) {
- when (productKey) {
- context.getString(R.string.donation_product_1), context.getString(R.string.amlod_theme_purchase) -> PrefGetter.enableAmlodTheme()
- context.getString(R.string.midnight_blue_theme_purchase) -> PrefGetter.enableMidNightBlueTheme()
- context.getString(R.string.theme_bluish_purchase) -> PrefGetter.enableBluishTheme()
- context.getString(R.string.donation_product_2), context.getString(R.string.fasthub_pro_purchase) -> PrefGetter.setProItems()
- context.getString(R.string.fasthub_enterprise_purchase) -> PrefGetter.setEnterpriseItem()
- context.getString(R.string.donation_product_3), context.getString(R.string.donation_product_4),
- context.getString(R.string.fasthub_all_features_purchase) -> {
- PrefGetter.setProItems()
- PrefGetter.setEnterpriseItem()
- }
- else -> Logger.e(productKey)
- }
- }
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/fastaccess/ui/modules/main/donation/DonationActivity.java b/app/src/main/java/com/fastaccess/ui/modules/main/donation/DonationActivity.java
index 5d6fe0761..fc5f6137f 100644
--- a/app/src/main/java/com/fastaccess/ui/modules/main/donation/DonationActivity.java
+++ b/app/src/main/java/com/fastaccess/ui/modules/main/donation/DonationActivity.java
@@ -5,18 +5,12 @@
import android.support.design.widget.AppBarLayout;
import android.view.View;
-import com.fastaccess.App;
-import com.fastaccess.BuildConfig;
import com.fastaccess.R;
import com.fastaccess.helper.AnimHelper;
-import com.fastaccess.helper.AppHelper;
-import com.fastaccess.helper.InputHelper;
+import com.fastaccess.helper.PrefGetter;
import com.fastaccess.ui.base.BaseActivity;
import com.fastaccess.ui.base.mvp.presenter.BasePresenter;
-import com.fastaccess.ui.modules.main.premium.PremiumActivity;
-import com.miguelbcr.io.rx_billing_service.RxBillingService;
-import com.miguelbcr.io.rx_billing_service.entities.ProductType;
-import com.miguelbcr.io.rx_billing_service.entities.Purchase;
+import com.fastaccess.ui.modules.repos.RepoPagerActivity;
import net.grandcentrix.thirtyinch.TiPresenter;
@@ -50,53 +44,19 @@ public class DonationActivity extends BaseActivity {
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AnimHelper.animateVisibility(cardsHolder, true);
- checkPurchase();
}
@OnClick(R.id.two) void onTwoClicked(View v) {
- onProceed(getString(R.string.donation_product_1));
+ PrefGetter.setProItems();
+ PrefGetter.setEnterpriseItem();
+ showMessage(getString(R.string.success), "\"Pro\" features unlocked, but don't forget to support development!");
}
@OnClick(R.id.five) void onFiveClicked(View v) {
- onProceed(getString(R.string.donation_product_2));
- }
-
- @OnClick(R.id.ten) void onTenClicked(View v) {
- onProceed(getString(R.string.donation_product_3));
- }
-
- @OnClick(R.id.twenty) void onTwentyClicked(View v) {
- onProceed(getString(R.string.donation_product_4));
- }
-
- @OnClick(R.id.premium) void onNavToPremium() {
- PremiumActivity.Companion.startActivity(this);
+ startActivity(RepoPagerActivity.createIntent(this, "FastHub", "k0shk0sh"));
}
@NonNull @Override public TiPresenter providePresenter() {
return new BasePresenter();
}
-
- private void onProceed(@NonNull String productKey) {
- if (AppHelper.isGoogleAvailable(this)) {
- DonateActivity.Companion.start(this, productKey);
- } else {
- showErrorMessage(getString(R.string.google_play_service_error));
- }
- }
-
- private void checkPurchase() {
- ((BasePresenter) getPresenter()).manageViewDisposable(RxBillingService.getInstance(this, BuildConfig.DEBUG)
- .getPurchases(ProductType.IN_APP)
- .subscribe((purchases, throwable) -> {
- if (purchases != null && !purchases.isEmpty()) {
- for (Purchase purchase : purchases) {
- String sku = purchase.sku();
- if (!InputHelper.isEmpty(sku)) {
- DonateActivity.Companion.enableProduct(sku, App.getInstance());
- }
- }
- }
- }));
- }
}
diff --git a/app/src/main/java/com/fastaccess/ui/modules/main/premium/PremiumActivity.kt b/app/src/main/java/com/fastaccess/ui/modules/main/premium/PremiumActivity.kt
index 95bee37c1..c3f715dc9 100644
--- a/app/src/main/java/com/fastaccess/ui/modules/main/premium/PremiumActivity.kt
+++ b/app/src/main/java/com/fastaccess/ui/modules/main/premium/PremiumActivity.kt
@@ -1,83 +1,52 @@
package com.fastaccess.ui.modules.main.premium
-import android.animation.Animator
import android.app.Activity
import android.content.Context
import android.content.Intent
-import android.support.transition.TransitionManager
+import android.os.Bundle
import android.view.View
-import android.widget.EditText
-import android.widget.FrameLayout
import butterknife.BindView
import butterknife.OnClick
-import butterknife.OnEditorAction
-import com.airbnb.lottie.LottieAnimationView
-import com.fastaccess.BuildConfig
import com.fastaccess.R
+import com.fastaccess.helper.AnimHelper
import com.fastaccess.helper.AppHelper
import com.fastaccess.helper.PrefGetter
-import com.fastaccess.helper.ViewHelper
import com.fastaccess.ui.base.BaseActivity
-import com.fastaccess.ui.modules.main.donation.DonateActivity
+import com.fastaccess.ui.base.mvp.presenter.BasePresenter
+import com.fastaccess.ui.modules.repos.RepoPagerActivity
/**
* Created by kosh on 13/07/2017.
*/
-class PremiumActivity : BaseActivity(), PremiumMvp.View {
+class PremiumActivity : BaseActivity>(), PremiumMvp.View {
+ @BindView(R.id.cardsHolder) lateinit var cardsHolder: View
- @BindView(R.id.editText) lateinit var editText: EditText
- @BindView(R.id.viewGroup) lateinit var viewGroup: FrameLayout
- @BindView(R.id.progressLayout) lateinit var progressLayout: View
- @BindView(R.id.successActivationView) lateinit var successActivationView: LottieAnimationView
- @BindView(R.id.successActivationHolder) lateinit var successActivationHolder: View
-
- override fun layout(): Int = R.layout.pro_features_layout
+ override fun layout(): Int = R.layout.support_development_layout
override fun isTransparent(): Boolean = true
- override fun providePresenter(): PremiumPresenter = PremiumPresenter()
+ override fun providePresenter(): BasePresenter = BasePresenter()
- override fun canBack(): Boolean = false
+ override fun canBack(): Boolean = true
override fun isSecured(): Boolean = true
- @OnClick(R.id.buyAll) fun onBuyAll() {
- if (!isGoogleSupported()) return
- DonateActivity.Companion.start(this, getString(R.string.fasthub_all_features_purchase))
- }
-
- @OnClick(R.id.buyPro) fun onBuyPro() {
- if (!isGoogleSupported()) return
- DonateActivity.Companion.start(this, getString(R.string.fasthub_pro_purchase))
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ AnimHelper.animateVisibility(cardsHolder, true)
}
- @OnClick(R.id.buyEnterprise) fun onBuyEnterprise() {
- if (!isGoogleSupported()) return
- DonateActivity.Companion.start(this, getString(R.string.fasthub_enterprise_purchase))
- }
-
- @OnClick(R.id.unlock) fun onUnlock() {
- if (!isGoogleSupported()) return
- if (BuildConfig.DEBUG) {
- PrefGetter.setProItems()
- PrefGetter.setEnterpriseItem()
- onSuccessfullyActivated()
- return
- }
- val isEmpty = editText.text.isNullOrBlank()
- editText.error = if (isEmpty) getString(R.string.required_field) else null
- if (!isEmpty) {
- presenter.onCheckPromoCode(editText.text.toString())
- }
+ @OnClick(R.id.two) fun onBuyAll() {
+ PrefGetter.setProItems()
+ PrefGetter.setEnterpriseItem()
+ showMessage(getString(R.string.success), "\"Pro\" features unlocked, but don't forget to support development!")
+ successResult()
}
- @OnEditorAction(R.id.editText) fun onEditorAction(): Boolean {
- onUnlock()
- return true
+ @OnClick(R.id.five) fun onShowUpstreamSupport() {
+ startActivity(RepoPagerActivity.createIntent(this, "FastHub", "k0shk0sh"))
}
- @OnClick(R.id.close) fun onClose() = finish()
-
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode == Activity.RESULT_OK) {
@@ -93,19 +62,8 @@ class PremiumActivity : BaseActivity(), Premi
override fun onSuccessfullyActivated() {
hideProgress()
- successActivationHolder.visibility = View.VISIBLE
- successActivationView.addAnimatorListener(object : Animator.AnimatorListener {
- override fun onAnimationRepeat(p0: Animator?) {}
- override fun onAnimationEnd(p0: Animator?) {
- showMessage(R.string.success, R.string.success)
- successResult()
- }
-
- override fun onAnimationCancel(p0: Animator?) {}
-
- override fun onAnimationStart(p0: Animator?) {}
- })
- successActivationView.playAnimation()
+ showMessage(R.string.success, R.string.success)
+ successResult()
}
override fun onNoMatch() {
@@ -113,17 +71,6 @@ class PremiumActivity : BaseActivity(), Premi
showErrorMessage(getString(R.string.not_match))
}
- override fun showProgress(resId: Int) {
- ViewHelper.hideKeyboard(editText)
- TransitionManager.beginDelayedTransition(viewGroup)
- progressLayout.visibility = View.VISIBLE
- }
-
- override fun hideProgress() {
- TransitionManager.beginDelayedTransition(viewGroup)
- progressLayout.visibility = View.GONE
- }
-
private fun isGoogleSupported(): Boolean {
if (AppHelper.isGoogleAvailable(this)) {
return true
diff --git a/app/src/main/java/com/fastaccess/ui/modules/main/premium/PremiumPresenter.kt b/app/src/main/java/com/fastaccess/ui/modules/main/premium/PremiumPresenter.kt
deleted file mode 100644
index 9750e59ef..000000000
--- a/app/src/main/java/com/fastaccess/ui/modules/main/premium/PremiumPresenter.kt
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.fastaccess.ui.modules.main.premium
-
-import com.fastaccess.data.dao.ProUsersModel
-import com.fastaccess.helper.PrefGetter
-import com.fastaccess.helper.RxHelper
-import com.fastaccess.ui.base.mvp.presenter.BasePresenter
-import com.github.b3er.rxfirebase.database.data
-import com.github.b3er.rxfirebase.database.rxUpdateChildren
-import com.google.firebase.database.FirebaseDatabase
-import com.google.firebase.database.GenericTypeIndicator
-import io.reactivex.Completable
-import io.reactivex.Observable
-
-
-/**
- * Created by kosh on 15/07/2017.
- */
-class PremiumPresenter : BasePresenter(), PremiumMvp.Presenter {
- override fun onCheckPromoCode(promo: String) {
- val ref = FirebaseDatabase.getInstance().reference
- manageDisposable(RxHelper.getObservable(ref.child("fasthub_pro").child(promo)
- .data()
- .toObservable())
- .doOnSubscribe { sendToView { it.showProgress(0) } }
- .flatMap {
- var user = ProUsersModel()
- if (it.exists() && it.hasChildren()) {
- val gti = object : GenericTypeIndicator() {}
- user = it.getValue(gti) ?: ProUsersModel()
- }
- return@flatMap Observable.just(user)
- }
- .subscribe({ user ->
- var completable: Completable? = null
- val isAllowed = user.isAllowed
- if (isAllowed && !user.isBlocked) {
- if (user.type == 1) {
- PrefGetter.setProItems()
- user.isAllowed = false
- user.count = user.count + 1
- completable = ref.child("fasthub_pro")
- .rxUpdateChildren(hashMapOf(Pair(promo, user)))
- } else {
- PrefGetter.setProItems()
- PrefGetter.setEnterpriseItem()
- user.count = user.count + 1
- completable = ref.child("fasthub_pro")
- .rxUpdateChildren(hashMapOf(Pair(promo, user)))
- }
- }
- if (completable != null) {
- manageDisposable(completable.doOnComplete({
- if (isAllowed) {
- sendToView { it.onSuccessfullyActivated() }
- } else {
- sendToView { it.onNoMatch() }
- }
- }).subscribe({}, { it.printStackTrace() }))
- } else {
- if (isAllowed) {
- sendToView { it.onSuccessfullyActivated() }
- } else {
- if (user.isBlocked) {
- PrefGetter.clearPurchases()
- }
- sendToView { it.onNoMatch() }
- }
- }
- }, { it.printStackTrace() }))
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/fastaccess/ui/modules/theme/fragment/ThemeFragment.kt b/app/src/main/java/com/fastaccess/ui/modules/theme/fragment/ThemeFragment.kt
index 6390f5123..5e3b0ba3d 100644
--- a/app/src/main/java/com/fastaccess/ui/modules/theme/fragment/ThemeFragment.kt
+++ b/app/src/main/java/com/fastaccess/ui/modules/theme/fragment/ThemeFragment.kt
@@ -17,7 +17,6 @@ import butterknife.Unbinder
import com.fastaccess.R
import com.fastaccess.helper.*
import com.fastaccess.ui.base.BaseFragment
-import com.fastaccess.ui.modules.main.donation.DonateActivity
import com.fastaccess.ui.modules.main.premium.PremiumActivity
import com.fastaccess.ui.widgets.SpannableBuilder
@@ -89,9 +88,9 @@ class ThemeFragment : BaseFragment setTheme(getString(R.string.amlod_theme_mode))
- getString(R.string.midnight_blue_theme_purchase) -> setTheme(getString(R.string.mid_night_blue_theme_mode))
- getString(R.string.theme_bluish_purchase) -> setTheme(getString(R.string.bluish_theme))
+ "placeholder" -> setTheme(getString(R.string.amlod_theme_mode))
+ "placeholder" -> setTheme(getString(R.string.mid_night_blue_theme_mode))
+ "placeholder" -> setTheme(getString(R.string.bluish_theme))
}
}
}
@@ -122,7 +121,7 @@ class ThemeFragment : BaseFragment
+ app:title="Unlock features">
-
-
-
-
-
@@ -69,11 +60,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
- android:drawableEnd="@drawable/ic_heart_full"
+ android:drawableEnd="@drawable/ic_lock"
android:drawablePadding="@dimen/spacing_normal"
android:paddingBottom="@dimen/spacing_normal"
android:paddingTop="@dimen/spacing_normal"
- android:text="@string/support_with_2_00"
+ android:text="Unlock"
app:drawableColor="@color/material_red_700"/>
@@ -94,85 +85,13 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
- android:drawableEnd="@drawable/ic_heart_full"
- android:drawablePadding="@dimen/spacing_normal"
- android:paddingBottom="@dimen/spacing_normal"
- android:paddingTop="@dimen/spacing_normal"
- android:text="@string/support_with_5_00"
- app:drawableColor="@color/material_red_700"/>
-
-
-
-
-
-
-
-
-
-
-
-
+ android:text="Visit upstream to find a way to support!"
+ app:drawableColor="@color/material_light_black"/>
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file