From e9b5c79a1e8870ab66410eb2578601d4f27f26de Mon Sep 17 00:00:00 2001 From: Omar Hatem Date: Tue, 20 Jun 2023 15:27:07 +0300 Subject: [PATCH] V4.6.7 v1.3.8 (#971) * - Replace payfura widget with direct browser link - Remove Payfura widget class as it is duplicate for the web view page * Revert removing swipe to delete wallet feature * Pump app versions and update release notes --- assets/text/Monerocom_Release_Notes.txt | 9 +-- assets/text/Release_Notes.txt | 10 ++-- lib/di.dart | 4 -- lib/entities/main_actions.dart | 11 +--- lib/router.dart | 6 -- lib/routes.dart | 1 - lib/src/screens/buy/payfura_page.dart | 58 ------------------- .../screens/wallet_list/wallet_list_page.dart | 40 ++++++------- scripts/android/app_env.sh | 8 +-- scripts/ios/app_env.sh | 8 +-- scripts/macos/app_env.sh | 4 +- 11 files changed, 40 insertions(+), 119 deletions(-) delete mode 100644 lib/src/screens/buy/payfura_page.dart diff --git a/assets/text/Monerocom_Release_Notes.txt b/assets/text/Monerocom_Release_Notes.txt index 178fa45ea..d95478116 100644 --- a/assets/text/Monerocom_Release_Notes.txt +++ b/assets/text/Monerocom_Release_Notes.txt @@ -1,6 +1,3 @@ -Opt-in to Cake 2FA for security. More info: https://guides.cakewallet.com/docs/advanced-features/authentication/#cake-2fa -Auto generate restore height for Monero restore QR codes -Hausa and Yoruba languages -Additional privacy settings -Update Monero to 0.18.2.2 -Refactoring and bug fixes \ No newline at end of file +Enable iPad/Tablet separate layout from mobile UI +SideShift update and fixes +Bug Fixes \ No newline at end of file diff --git a/assets/text/Release_Notes.txt b/assets/text/Release_Notes.txt index 178fa45ea..38e3e21df 100644 --- a/assets/text/Release_Notes.txt +++ b/assets/text/Release_Notes.txt @@ -1,6 +1,4 @@ -Opt-in to Cake 2FA for security. More info: https://guides.cakewallet.com/docs/advanced-features/authentication/#cake-2fa -Auto generate restore height for Monero restore QR codes -Hausa and Yoruba languages -Additional privacy settings -Update Monero to 0.18.2.2 -Refactoring and bug fixes \ No newline at end of file +Enable iPad/Tablet separate layout from mobile UI +SideShift update and fixes +Add MoonPay sell +Bug Fixes \ No newline at end of file diff --git a/lib/di.dart b/lib/di.dart index 0e4eb2a1a..76813f475 100644 --- a/lib/di.dart +++ b/lib/di.dart @@ -1,7 +1,6 @@ import 'package:cake_wallet/anonpay/anonpay_api.dart'; import 'package:cake_wallet/anonpay/anonpay_info_base.dart'; import 'package:cake_wallet/anonpay/anonpay_invoice_info.dart'; -import 'package:cake_wallet/buy/moonpay/moonpay_buy_provider.dart'; import 'package:cake_wallet/buy/onramper/onramper_buy_provider.dart'; import 'package:cake_wallet/buy/payfura/payfura_buy_provider.dart'; import 'package:cake_wallet/core/yat_service.dart'; @@ -14,7 +13,6 @@ import 'package:cake_wallet/ionia/ionia_tip.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/anonpay_details/anonpay_details_page.dart'; import 'package:cake_wallet/src/screens/buy/webview_page.dart'; -import 'package:cake_wallet/src/screens/buy/payfura_page.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_dashboard_page.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart'; @@ -685,8 +683,6 @@ Future setup({ wallet: getIt.get().wallet!, )); - getIt.registerFactory(() => PayFuraPage(getIt.get())); - getIt.registerFactory(() => ExchangeViewModel( getIt.get().wallet!, _tradesSource, diff --git a/lib/entities/main_actions.dart b/lib/entities/main_actions.dart index 5fb46d1d8..0cf3cead4 100644 --- a/lib/entities/main_actions.dart +++ b/lib/entities/main_actions.dart @@ -1,12 +1,10 @@ import 'package:cake_wallet/buy/moonpay/moonpay_buy_provider.dart'; import 'package:cake_wallet/buy/onramper/onramper_buy_provider.dart'; -import 'package:cake_wallet/buy/payfura/payfura_buy_provider.dart'; import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; import 'package:cake_wallet/utils/device_info.dart'; -import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:cw_core/wallet_type.dart'; @@ -60,12 +58,9 @@ class MainActions { break; case WalletType.monero: if (viewModel.isEnabledBuyAction) { - if (DeviceInfo.instance.isMobile) { - Navigator.of(context).pushNamed(Routes.payfuraPage); - } else { - final uri = getIt.get().requestUrl(); - await launchUrl(uri); - } + // final uri = getIt.get().requestUrl(); + final uri = Uri.parse("https://monero.com/trade"); + await launchUrl(uri); } break; default: diff --git a/lib/router.dart b/lib/router.dart index ecb4f72c4..39dd75628 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -9,7 +9,6 @@ import 'package:cake_wallet/src/screens/backup/backup_page.dart'; import 'package:cake_wallet/src/screens/backup/edit_backup_password_page.dart'; import 'package:cake_wallet/src/screens/buy/buy_webview_page.dart'; import 'package:cake_wallet/src/screens/buy/webview_page.dart'; -import 'package:cake_wallet/src/screens/buy/payfura_page.dart'; import 'package:cake_wallet/src/screens/buy/pre_order_page.dart'; import 'package:cake_wallet/src/screens/restore/sweeping_wallet_page.dart'; import 'package:cake_wallet/src/screens/receive/anonpay_invoice_page.dart'; @@ -97,8 +96,6 @@ import 'package:cake_wallet/ionia/ionia_any_pay_payment_info.dart'; import 'package:cw_core/crypto_currency.dart'; import 'package:cw_core/node.dart'; -import 'buy/moonpay/moonpay_buy_provider.dart'; - late RouteSettings currentRouteSettings; Route createRoute(RouteSettings settings) { @@ -528,9 +525,6 @@ Route createRoute(RouteSettings settings) { param1: title, param2: url)); - case Routes.payfuraPage: - return CupertinoPageRoute(builder: (_) => getIt.get()); - case Routes.advancedPrivacySettings: final type = settings.arguments as WalletType; diff --git a/lib/routes.dart b/lib/routes.dart index 10c2fef57..a7a50c433 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -81,7 +81,6 @@ class Routes { static const anonPayInvoicePage = '/anon_pay_invoice_page'; static const anonPayReceivePage = '/anon_pay_receive_page'; static const anonPayDetailsPage = '/anon_pay_details_page'; - static const payfuraPage = '/pay_fura_page'; static const desktop_actions = '/desktop_actions'; static const transactionsPage = '/transactions_page'; static const setup_2faPage = '/setup_2fa_page'; diff --git a/lib/src/screens/buy/payfura_page.dart b/lib/src/screens/buy/payfura_page.dart deleted file mode 100644 index a974aec25..000000000 --- a/lib/src/screens/buy/payfura_page.dart +++ /dev/null @@ -1,58 +0,0 @@ -import 'package:cake_wallet/buy/payfura/payfura_buy_provider.dart'; -import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/src/screens/base_page.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_inappwebview/flutter_inappwebview.dart'; -import 'package:permission_handler/permission_handler.dart'; - -class PayFuraPage extends BasePage { - PayFuraPage(this._PayfuraBuyProvider); - - final PayfuraBuyProvider _PayfuraBuyProvider; - - @override - String get title => S.current.buy; - - @override - Widget body(BuildContext context) { - return PayFuraPageBody(_PayfuraBuyProvider); - } -} - -class PayFuraPageBody extends StatefulWidget { - PayFuraPageBody(this._PayfuraBuyProvider); - - final PayfuraBuyProvider _PayfuraBuyProvider; - - Uri get uri => _PayfuraBuyProvider.requestUrl(); - - @override - PayFuraPageBodyState createState() => PayFuraPageBodyState(); -} - -class PayFuraPageBodyState extends State { - PayFuraPageBodyState(); - - @override - Widget build(BuildContext context) { - return InAppWebView( - initialOptions: InAppWebViewGroupOptions( - crossPlatform: InAppWebViewOptions(transparentBackground: true), - ), - initialUrlRequest: URLRequest(url: widget.uri), - androidOnPermissionRequest: (_, __, resources) async { - bool permissionGranted = await Permission.camera.status == PermissionStatus.granted; - if (!permissionGranted) { - permissionGranted = await Permission.camera.request().isGranted; - } - - return PermissionRequestResponse( - resources: resources, - action: permissionGranted - ? PermissionRequestResponseAction.GRANT - : PermissionRequestResponseAction.DENY, - ); - }, - ); - } -} diff --git a/lib/src/screens/wallet_list/wallet_list_page.dart b/lib/src/screens/wallet_list/wallet_list_page.dart index a9a4b894f..1a5433a2b 100644 --- a/lib/src/screens/wallet_list/wallet_list_page.dart +++ b/lib/src/screens/wallet_list/wallet_list_page.dart @@ -149,26 +149,12 @@ class WalletListBodyState extends State { return wallet.isCurrent ? row - : Row(children: [ - Expanded(child: row), - GestureDetector( - onTap: () => _removeWallet(wallet), - child: Container( - height: 40, - width: 44, - padding: EdgeInsets.only(right: 20), - child: Center( - child: Image.asset('assets/images/trash.png', - height: 16, - width: 16, - color: Theme.of(context) - .primaryTextTheme - .titleLarge! - .color), - ), - ), - ) - ]); + : Slidable( + key: Key('${wallet.key}'), + startActionPane: _actionPane(wallet), + endActionPane: _actionPane(wallet), + child: row, + ); }), ), ), @@ -291,4 +277,18 @@ class WalletListBodyState extends State { _progressBar = null; }); } + + ActionPane _actionPane(WalletListItem wallet) => ActionPane( + motion: const ScrollMotion(), + extentRatio: 0.3, + children: [ + SlidableAction( + onPressed: (_) => _removeWallet(wallet), + backgroundColor: Colors.red, + foregroundColor: Colors.white, + icon: CupertinoIcons.delete, + label: S.of(context).delete, + ), + ], + ); } diff --git a/scripts/android/app_env.sh b/scripts/android/app_env.sh index 119ddb56c..8e4a338ab 100644 --- a/scripts/android/app_env.sh +++ b/scripts/android/app_env.sh @@ -14,14 +14,14 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN) APP_ANDROID_TYPE=$1 MONERO_COM_NAME="Monero.com" -MONERO_COM_VERSION="1.3.7" -MONERO_COM_BUILD_NUMBER=50 +MONERO_COM_VERSION="1.3.8" +MONERO_COM_BUILD_NUMBER=51 MONERO_COM_BUNDLE_ID="com.monero.app" MONERO_COM_PACKAGE="com.monero.app" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="4.6.6" -CAKEWALLET_BUILD_NUMBER=160 +CAKEWALLET_VERSION="4.6.7" +CAKEWALLET_BUILD_NUMBER=161 CAKEWALLET_BUNDLE_ID="com.cakewallet.cake_wallet" CAKEWALLET_PACKAGE="com.cakewallet.cake_wallet" diff --git a/scripts/ios/app_env.sh b/scripts/ios/app_env.sh index 360b64770..114c9191f 100644 --- a/scripts/ios/app_env.sh +++ b/scripts/ios/app_env.sh @@ -13,13 +13,13 @@ TYPES=($MONERO_COM $CAKEWALLET $HAVEN) APP_IOS_TYPE=$1 MONERO_COM_NAME="Monero.com" -MONERO_COM_VERSION="1.3.7" -MONERO_COM_BUILD_NUMBER=48 +MONERO_COM_VERSION="1.3.8" +MONERO_COM_BUILD_NUMBER=49 MONERO_COM_BUNDLE_ID="com.cakewallet.monero" CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="4.6.6" -CAKEWALLET_BUILD_NUMBER=155 +CAKEWALLET_VERSION="4.6.7" +CAKEWALLET_BUILD_NUMBER=159 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" HAVEN_NAME="Haven" diff --git a/scripts/macos/app_env.sh b/scripts/macos/app_env.sh index 8f328465e..e05172bad 100755 --- a/scripts/macos/app_env.sh +++ b/scripts/macos/app_env.sh @@ -15,8 +15,8 @@ if [ -n "$1" ]; then fi CAKEWALLET_NAME="Cake Wallet" -CAKEWALLET_VERSION="1.0.5" -CAKEWALLET_BUILD_NUMBER=24 +CAKEWALLET_VERSION="1.0.6" +CAKEWALLET_BUILD_NUMBER=25 CAKEWALLET_BUNDLE_ID="com.fotolockr.cakewallet" if ! [[ " ${TYPES[*]} " =~ " ${APP_MACOS_TYPE} " ]]; then