diff --git a/app/src/main/java/com/tangem/tap/features/disclaimer/ui/DisclaimerFragment.kt b/app/src/main/java/com/tangem/tap/features/disclaimer/ui/DisclaimerFragment.kt index 62a0161bb8..8856bd5040 100644 --- a/app/src/main/java/com/tangem/tap/features/disclaimer/ui/DisclaimerFragment.kt +++ b/app/src/main/java/com/tangem/tap/features/disclaimer/ui/DisclaimerFragment.kt @@ -3,6 +3,7 @@ package com.tangem.tap.features.disclaimer.ui import android.os.Bundle import android.view.View import android.view.View.OVER_SCROLL_NEVER +import android.webkit.WebView import androidx.transition.TransitionInflater import by.kirich1409.viewbindingdelegate.viewBinding import com.tangem.core.ui.fragments.setStatusBarColor @@ -111,16 +112,17 @@ class DisclaimerFragment : BaseFragment(R.layout.fragment_disclaimer), StoreSubs } ProgressState.Error -> { root.beginDelayedTransition() - webView.hide() - groupAccept.hide() + webView.show() + groupAccept.show() groupLoading.hide() - groupError.show() + groupError.hide() + webView.loadLocalTermsOfServices() } - else -> {} + else -> Unit } } - override fun handleOnBackPressed() { - store.dispatch(DisclaimerAction.OnBackPressed) + private fun WebView.loadLocalTermsOfServices() { + loadData(localTermsOfServices, "text/html", "UTF-8") } } \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/disclaimer/ui/LocalTermOfServices.kt b/app/src/main/java/com/tangem/tap/features/disclaimer/ui/LocalTermOfServices.kt new file mode 100644 index 0000000000..6651d0fa75 --- /dev/null +++ b/app/src/main/java/com/tangem/tap/features/disclaimer/ui/LocalTermOfServices.kt @@ -0,0 +1,66 @@ +package com.tangem.tap.features.disclaimer.ui + +internal val localTermsOfServices = """ + + + + + + + Legal Disclaimer + + +

Legal Disclaimer

+

    1. Tangem application (Software)

+

    The Software is intended for usage only with Tangem hardware wallets (Cards) via NFC interface. The + Software DOES NOT:

+

    a) Generate, store, transmit, or have access to private (secret) cryptographic keys to blockchain + wallets holding digital assets, including crypto-currency.

+

    b) Generate, store, transmit, or have access to secret keys, passwords, passphrases, recovery phrases + that can be used to restore or to copy private (secret) keys to blockchain wallets holding digital assets, including + crypto-currency.

+

    c) Provide exchange, trading, investment services on behalf of Tangem AG.

+

    2. Risks related to the use of Software

+

    Tangem will not be responsible for any losses, damages or claims arising from events falling within the + scope of the following five categories:

+

    a) Mistakes made by the user of any cryptocurrency-related software or service, e.g., forgotten + passwords, payments sent to wrong addresses, and accidental deletion of blockchain wallets on Cards.

+

    b) Problems of Software and/or any blockchain- or cryptocurrency- related software or service, e.g., + corrupted files, incorrectly constructed transactions, unsafe cryptographic libraries, malware.

+

    c) Technical failures in the hardware of the user, including Cards, of any cryptocurrency-related + software or service, e.g., data loss due to a faulty or damaged storage device.

+

    d) Security problems experienced by the user of any cryptocurrency-related software or service, e.g., + unauthorized access to users' wallets and/or accounts.

+

    e) Actions or inactions of third parties and/or events experienced by third parties, e.g., bankruptcy + of service providers, information security attacks on service providers, and fraud conducted by third parties.

+

    3. Trading and Investment risks

+

    There is considerable exposure to risk in any crypto-currency or other digital asset exchange + transaction. Any transaction involving currencies involves risks including, but not limited to, the potential for + changing economic conditions that may substantially affect the price or liquidity of a currency. Investments in + crypto-currency exchange speculation may also be susceptible to sharp rises and falls as the relevant market values + fluctuate. It is for this reason that when speculating in such markets it is advisable to use only risk capital.

+

    4. Electronic Trading Risks

+

    Before you engage in transactions using an electronic system, you should carefully review the rules and + regulations of the exchanges offering the system and/or listing the instruments you intend to trade. Online trading + has inherent risk due to system response and access times that may vary due to market conditions, system + performance, and other factors. You should understand these and additional risks before trading.

+

    5. Compliance with tax obligations        

+

    The users of the Software are solely responsible to determinate what, if any, taxes apply to their + crypto-currency transactions. The owners of, or contributors to, the Software are NOT responsible for determining + the taxes that apply to crypto-currency transactions.        

+

    6. No warranties        

+

    The Software is provided on an "as is" basis without any warranties of any kind regarding the + Software and/or any content, data, materials and/or services provided on the Software.       +  

+

    7. Limitation of liability

+

    Unless otherwise required by law, in no event shall the owners of, or contributors to, the Software be + liable for any damages of any kind, including, but not limited to, loss of use, loss of profits, or loss of data + arising out of or in any way connected with the use of the Software. In no way are the owners of, or contributors + to, the Software responsible for the actions, decisions, or other behavior taken or not taken by you in reliance + upon the Software.

+

    8. Last amendment

+

    This disclaimer was amended for the last time on October 1st, 2020.

+ +""".trimIndent() \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/shop/ui/ShopFragment.kt b/app/src/main/java/com/tangem/tap/features/shop/ui/ShopFragment.kt index ad760cf53b..dccbe4d7b7 100644 --- a/app/src/main/java/com/tangem/tap/features/shop/ui/ShopFragment.kt +++ b/app/src/main/java/com/tangem/tap/features/shop/ui/ShopFragment.kt @@ -4,9 +4,6 @@ import android.animation.Animator import android.animation.AnimatorListenerAdapter import android.content.Context import android.os.Bundle -import android.text.Spannable -import android.text.SpannableString -import android.text.style.ForegroundColorSpan import android.view.View import android.view.View.OnFocusChangeListener import android.view.inputmethod.EditorInfo @@ -15,9 +12,7 @@ import androidx.activity.OnBackPressedCallback import by.kirich1409.viewbindingdelegate.viewBinding import com.tangem.tap.common.GlobalLayoutStateHandler import com.tangem.tap.common.KeyboardObserver -import com.tangem.tap.common.extensions.getColorCompat import com.tangem.tap.common.extensions.getQuantityString -import com.tangem.tap.common.extensions.hide import com.tangem.tap.common.extensions.show import com.tangem.tap.common.redux.navigation.NavigationAction import com.tangem.tap.common.shop.data.ProductType @@ -28,27 +23,14 @@ import com.tangem.tap.store import com.tangem.wallet.R import com.tangem.wallet.databinding.FragmentShopBinding import org.rekotlin.StoreSubscriber -import java.text.SimpleDateFormat -import java.util.Calendar -import java.util.Locale class ShopFragment : BaseStoreFragment(R.layout.fragment_shop), StoreSubscriber { - private val dateFormat = SimpleDateFormat("dd MMMM", Locale.getDefault()) private val binding: FragmentShopBinding by viewBinding(FragmentShopBinding::bind) - private val endPreorderTime = Calendar.getInstance() - private val isBuyAvailable: Boolean - private var cardTranslationY = 70f private lateinit var keyboardObserver: KeyboardObserver - init { - endPreorderTime.clear() - endPreorderTime.set(END_DATE_SOLD_OUT_YEAR, END_DATE_SOLD_OUT_MONTH, END_DATE_SOLD_OUT_DAY) - isBuyAvailable = System.currentTimeMillis() > endPreorderTime.timeInMillis - } - override fun subscribeToStore() { store.subscribe(this) { state -> state.skipRepeats { oldState, newState -> @@ -83,7 +65,6 @@ class ShopFragment : BaseStoreFragment(R.layout.fragment_shop), StoreSubscriber< setupCardsImages() setupProductSelection() setupPromoCodeEditText() - setupSoldOutDescription() binding.toolbar.setNavigationOnClickListener { requireActivity().onBackPressed() @@ -146,26 +127,6 @@ class ShopFragment : BaseStoreFragment(R.layout.fragment_shop), StoreSubscriber< } } - private fun setupSoldOutDescription() = with(binding) { - context?.let { cntx -> - if (!isBuyAvailable) { - val date = "${dateFormat.format(endPreorderTime.time)}!" - val soldOutTitle = cntx.getString(R.string.shop_sold_out_description_prefix) - val generalString = "$soldOutTitle $date" - val wordToSpan: Spannable = SpannableString(generalString) - wordToSpan.setSpan( - ForegroundColorSpan(cntx.getColorCompat(R.color.textBlack)), - generalString.length - date.length, - generalString.length, - Spannable.SPAN_EXCLUSIVE_EXCLUSIVE, - ) - tvSoldOutDesc.text = wordToSpan - } else { - tvSoldOutDesc.hide() - } - } - } - override fun newState(state: ShopState) { if (activity == null || view == null) return @@ -213,16 +174,9 @@ class ShopFragment : BaseStoreFragment(R.layout.fragment_shop), StoreSubscriber< } private fun handleButtonsState(state: ShopState) = with(binding) { - if (isBuyAvailable) { - btnPayGooglePay.root.show(state.isGooglePayAvailable) - btnAlternativePayment.show(state.isGooglePayAvailable) - btnMainAction.show(!state.isGooglePayAvailable) - } else { - btnPayGooglePay.root.hide() - btnAlternativePayment.hide() - btnMainAction.show() - btnMainAction.text = context?.getString(R.string.shop_pre_order_now) - } + btnPayGooglePay.root.show(state.isGooglePayAvailable) + btnAlternativePayment.show(state.isGooglePayAvailable) + btnMainAction.show(!state.isGooglePayAvailable) if (state.total != null) { btnAlternativePayment.setOnClickListener { store.dispatch(ShopAction.StartWebCheckout) } @@ -235,10 +189,4 @@ class ShopFragment : BaseStoreFragment(R.layout.fragment_shop), StoreSubscriber< store.dispatch(ShopAction.ResetState) super.handleOnBackPressed() } - - companion object { - private const val END_DATE_SOLD_OUT_YEAR = 2023 - private const val END_DATE_SOLD_OUT_MONTH = 5 // June, month start counting from zero! - private const val END_DATE_SOLD_OUT_DAY = 10 - } } \ No newline at end of file diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml index 848323812c..4d108a3d06 100644 --- a/core/res/src/main/res/values-ru/strings.xml +++ b/core/res/src/main/res/values-ru/strings.xml @@ -334,7 +334,6 @@ У меня есть промо-код… Tangem Wallet Другие способы оплаты - Сделать предзаказ Все распродано, но не огорчайтесь! Мы уже производим новые партии Tangem Wallet. Чтобы получить ваш кошелек скорее, оформите предзаказ сейчас. Отправка заказов начнется Итого Сеть Solana взимает арендную плату в размере %1$s каждые 2 дня. Аккаунты, которые не могут позволить себе арендную плату, удаляются из сети. Пополните свой счет более чем на %2$s, чтобы не платить арендную плату. diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 76dbb81143..00da984b81 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -330,8 +330,7 @@ I have a promo code… Tangem Wallet Other payment methods - Pre-order now - Sold out, but don\'t worry! We are working very hard to get more for you! Make sure to place a pre-order here. Deliveries start on + Due to the high volume of orders we are receiving, Shipping and Local Delivery orders may be delayed. Total Solana network charges a rent of %1$s every 2 days. Accounts that can\'t afford the rent are purged from the network. Deposit your account with more than %2$s to use it for free. Store your crypto assets secure while keeping private keys contained in your card