Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ecdf3fe9 authored by narinder Rana's avatar narinder Rana
Browse files

update code for Billing manager and build

parent c32e3a86
Loading
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -22,19 +22,18 @@ package com.moez.QKSMS.manager
import android.app.Activity
import io.reactivex.Observable


interface BillingManager {

    companion object {
        const val SKU_PLUS = "remove_ads"
        const val SKU_PLUS_DONATE = "qksms_plus_donate"
    }

    data class Product(
            val sku: String,
            val price: String,
            val priceCurrencyCode: String
    )

    val products: Observable<List<Product>>
    val upgradeStatus: Observable<Boolean>

+2 −3
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import android.graphics.BitmapFactory
import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.core.content.ContextCompat
import androidx.core.view.iterator
import androidx.lifecycle.Lifecycle
import com.moez.QKSMS.R
@@ -100,7 +99,7 @@ abstract class QkThemedActivity : QkActivity() {

    @SuppressLint("InlinedApi")
    override fun onCreate(savedInstanceState: Bundle?) {
        setTheme(R.style.AppTheme)
        setTheme(getActivityThemeRes(prefs.black.get()))
        super.onCreate(savedInstanceState)

        // When certain preferences change, we need to recreate the activity
@@ -134,7 +133,7 @@ abstract class QkThemedActivity : QkActivity() {
        super.onPostCreate(savedInstanceState)

        // Set the color for the overflow and navigation icon
        val textSecondary = ContextCompat.getColor(this, R.color.colorAccent)
        val textSecondary = resolveThemeColor(android.R.attr.textColorSecondary)
        toolbar?.overflowIcon = toolbar?.overflowIcon?.apply { setTint(textSecondary) }

        // Update the colours of the menu items
+0 −47
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020 Moez Bhatti <moez.bhatti@gmail.com>
 *
 * This file is part of QKSMS.
 *
 * QKSMS is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * QKSMS is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with QKSMS.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.moez.QKSMS.manager

import android.app.Activity
import io.reactivex.Observable

interface BillingManager {

    companion object {
        const val SKU_PLUS = "remove_ads"
        const val SKU_PLUS_DONATE = "qksms_plus_donate"
    }

    data class Product(
            val sku: String,
            val price: String,
            val priceCurrencyCode: String
    )

    val products: Observable<List<Product>>
    val upgradeStatus: Observable<Boolean>

    suspend fun checkForPurchases()

    suspend fun queryProducts()

    suspend fun initiatePurchaseFlow(activity: Activity, sku: String)

}
 No newline at end of file
+0 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import com.moez.QKSMS.common.base.QkPresenter
import com.moez.QKSMS.common.util.DateFormatter
import com.moez.QKSMS.common.util.extensions.makeToast
import com.moez.QKSMS.interactor.PerformBackup
import com.moez.QKSMS.manager.BillingManager
import com.moez.QKSMS.manager.PermissionManager
import com.moez.QKSMS.repository.BackupRepository
import com.uber.autodispose.android.lifecycle.scope
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ import java.util.*
import javax.inject.Inject
import kotlin.collections.HashMap

class ComposeActivity(override val selectPreferredSIM: Observable<*>) : QkThemedActivity(), ComposeView {
class ComposeActivity : QkThemedActivity(), ComposeView {

    companion object {
        private const val SelectContactRequestCode = 0
Loading