From a47e9ebfe7d7acf57f500ee9983dc8009217c431 Mon Sep 17 00:00:00 2001 From: polstianka Date: Fri, 31 May 2024 04:34:35 -0400 Subject: [PATCH] BigInteger for coins, token manager, wallets sorting --- .idea/.name | 2 +- .idea/gradle.xml | 1 - apps/signer/build.gradle.kts | 4 +- apps/signer/src/main/AndroidManifest.xml | 4 +- .../signer/screen/sign/SignViewModel.kt | 5 +- .../main/java/com/tonapps/wallet/api/API.kt | 10 +- .../wallet/api/entity/BalanceEntity.kt | 7 +- .../tonapps/wallet/api/entity/TokenEntity.kt | 10 ++ .../api/src/main/res/drawable/ic_usdt.xml | 12 ++ .../data/events/entities/ActionEntity.kt | 8 +- apps/wallet/data/rates/build.gradle.kts | 1 + .../wallet/data/rates/RatesRepository.kt | 12 +- .../wallet/data/rates/entity/RateEntity.kt | 17 +- .../wallet/data/rates/entity/RatesEntity.kt | 15 +- apps/wallet/data/settings/build.gradle.kts | 1 - .../data/settings/SettingsRepository.kt | 33 ++++ .../settings/entities/TokenPrefsEntity.kt | 7 + .../settings/entities/WalletPrefsEntity.kt | 5 + .../settings/folder/BaseSettingsFolder.kt | 45 +++++ .../data/settings/folder/TokenPrefsFolder.kt | 60 +++++++ .../data/settings/folder/WalletPrefsFolder.kt | 34 ++++ apps/wallet/data/tokens/build.gradle.kts | 1 + .../wallet/data/token/TokenRepository.kt | 14 +- .../data/token/entities/AccountTokenEntity.kt | 14 +- .../data/token/entities/TokenRateEntity.kt | 5 +- .../data/token/source/RemoteDataSource.kt | 27 ++- apps/wallet/instance/build.gradle.kts | 4 +- .../com/tonapps/tonkeeper/api/Extensions.kt | 12 +- .../core/entities/TokenExtendedEntity.kt | 52 ++++++ .../core/entities/WalletExtendedEntity.kt | 13 ++ .../tonkeeper/core/history/HistoryHelper.kt | 80 ++++----- .../widget/balance/WidgetBalanceProvider.kt | 4 +- .../core/widget/rate/WidgetRateProvider.kt | 2 +- .../tonkeeper/extensions/Navigation.kt | 2 +- .../tonkeeper/fragment/send/SendScreen.kt | 15 +- .../fragment/send/TransactionData.kt | 18 +- .../fragment/send/amount/AmountScreen.kt | 9 +- .../send/amount/AmountScreenFeature.kt | 46 +++-- .../fragment/send/amount/AmountScreenState.kt | 3 +- .../send/confirm/ConfirmScreenFeature.kt | 25 +-- .../send/confirm/ConfirmScreenState.kt | 3 +- .../fragment/send/popup/SelectTokenPopup.kt | 2 +- .../fragment/send/view/AmountInput.kt | 7 +- .../com/tonapps/tonkeeper/koin/KoinModule.kt | 12 +- .../ui/screen/events/EventsViewModel.kt | 9 - .../tonkeeper/ui/screen/init/InitViewModel.kt | 8 +- .../tonkeeper/ui/screen/main/MainScreen.kt | 8 +- .../ui/screen/picker/PickerScreen.kt | 49 ----- .../tonkeeper/ui/screen/picker/list/Holder.kt | 111 ------------ .../screen/picker/list/WalletPickerAdapter.kt | 65 ------- .../tonkeeper/ui/screen/root/RootActivity.kt | 2 +- .../tonkeeper/ui/screen/root/RootEvent.kt | 3 +- .../tonkeeper/ui/screen/root/RootViewModel.kt | 33 ++-- .../settings/language/LanguageScreen.kt | 1 - .../tonkeeper/ui/screen/token/TokenData.kt | 5 +- .../ui/screen/token/TokenViewModel.kt | 6 +- .../screen/wallet/{ => main}/WalletScreen.kt | 6 +- .../screen/wallet/{ => main}/WalletTokens.kt | 2 +- .../wallet/{ => main}/WalletViewModel.kt | 60 ++++--- .../ui/screen/wallet/{ => main}/list/Item.kt | 68 +++---- .../wallet/{ => main}/list/WalletAdapter.kt | 19 +- .../{ => main}/list/holder/ActionsHolder.kt | 4 +- .../{ => main}/list/holder/BalanceHolder.kt | 6 +- .../wallet/{ => main}/list/holder/Holder.kt | 4 +- .../wallet/main/list/holder/ManageHolder.kt | 24 +++ .../{ => main}/list/holder/PushHolder.kt | 4 +- .../{ => main}/list/holder/SkeletonHolder.kt | 4 +- .../{ => main}/list/holder/SpaceHolder.kt | 4 +- .../{ => main}/list/holder/TitleHolder.kt | 4 +- .../{ => main}/list/holder/TokenHolder.kt | 4 +- .../wallet/manage/TokensManageScreen.kt | 72 ++++++++ .../wallet/manage/TokensManageViewModel.kt | 109 +++++++++++ .../ui/screen/wallet/manage/list/Adapter.kt | 63 +++++++ .../ui/screen/wallet/manage/list/Item.kt | 51 ++++++ .../wallet/manage/list/holder/Holder.kt | 11 ++ .../wallet/manage/list/holder/SpaceHolder.kt | 12 ++ .../wallet/manage/list/holder/TitleHolder.kt | 24 +++ .../wallet/manage/list/holder/TokenHolder.kt | 79 ++++++++ .../ui/screen/wallet/picker/PickerScreen.kt | 119 ++++++++++++ .../{ => wallet}/picker/PickerViewModel.kt | 17 +- .../screen/{ => wallet}/picker/list/Item.kt | 5 +- .../wallet/picker/list/WalletPickerAdapter.kt | 104 +++++++++++ .../wallet/picker/list/holder/AddHolder.kt | 24 +++ .../wallet/picker/list/holder/Holder.kt | 18 ++ .../picker/list/holder/SkeletonHolder.kt | 20 +++ .../wallet/picker/list/holder/WalletHolder.kt | 87 +++++++++ .../res/layout/fragment_wallet_picker.xml | 20 --- .../src/main/res/layout/view_wallet_item.xml | 29 +++ .../main/res/layout/view_wallet_manage.xml | 16 ++ .../res/layout/view_wallet_manage_space.xml | 4 + .../res/layout/view_wallet_manage_title.xml | 22 +++ .../res/layout/view_wallet_manage_token.xml | 66 +++++++ .../src/main/res/values-ru/strings.xml | 4 + .../src/main/res/values/strings.xml | 5 + lib/blockchain/build.gradle.kts | 1 + .../main/java/com/tonapps/blockchain/Coin.kt | 110 ------------ .../main/java/com/tonapps/blockchain/Coins.kt | 125 +++++++++++++ .../tonapps/extensions/SharedPreferences.kt | 8 + .../java/com/tonapps/icu/CurrencyFormatter.kt | 169 ++++-------------- .../main/java/uikit/base/BaseListFragment.kt | 19 +- .../src/main/java/uikit/widget/HeaderView.kt | 5 + .../src/main/java/uikit/widget/ModalView.kt | 4 +- .../src/main/res/layout/fragment_list.xml | 11 +- .../res/drawable/ic_eye_closed_outline_28.xml | 16 ++ .../main/res/drawable/ic_eye_outline_28.xml | 10 ++ .../res/drawable/ic_pencil_outline_28.xml | 13 ++ .../icon/src/main/res/drawable/ic_pin_28.xml | 13 ++ .../src/main/res/drawable/ic_reorder_28.xml | 15 ++ 108 files changed, 1860 insertions(+), 816 deletions(-) create mode 100644 apps/wallet/api/src/main/res/drawable/ic_usdt.xml create mode 100644 apps/wallet/data/settings/src/main/java/com/tonapps/wallet/data/settings/entities/TokenPrefsEntity.kt create mode 100644 apps/wallet/data/settings/src/main/java/com/tonapps/wallet/data/settings/entities/WalletPrefsEntity.kt create mode 100644 apps/wallet/data/settings/src/main/java/com/tonapps/wallet/data/settings/folder/BaseSettingsFolder.kt create mode 100644 apps/wallet/data/settings/src/main/java/com/tonapps/wallet/data/settings/folder/TokenPrefsFolder.kt create mode 100644 apps/wallet/data/settings/src/main/java/com/tonapps/wallet/data/settings/folder/WalletPrefsFolder.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/core/entities/TokenExtendedEntity.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/core/entities/WalletExtendedEntity.kt delete mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/picker/PickerScreen.kt delete mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/picker/list/Holder.kt delete mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/picker/list/WalletPickerAdapter.kt rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/{ => main}/WalletScreen.kt (92%) rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/{ => main}/WalletTokens.kt (95%) rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/{ => main}/WalletViewModel.kt (89%) rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/{ => main}/list/Item.kt (82%) rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/{ => main}/list/WalletAdapter.kt (57%) rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/{ => main}/list/holder/ActionsHolder.kt (93%) rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/{ => main}/list/holder/BalanceHolder.kt (96%) rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/{ => main}/list/holder/Holder.kt (64%) create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/main/list/holder/ManageHolder.kt rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/{ => main}/list/holder/PushHolder.kt (91%) rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/{ => main}/list/holder/SkeletonHolder.kt (64%) rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/{ => main}/list/holder/SpaceHolder.kt (62%) rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/{ => main}/list/holder/TitleHolder.kt (74%) rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/{ => main}/list/holder/TokenHolder.kt (95%) create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/manage/TokensManageScreen.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/manage/TokensManageViewModel.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/manage/list/Adapter.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/manage/list/Item.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/manage/list/holder/Holder.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/manage/list/holder/SpaceHolder.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/manage/list/holder/TitleHolder.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/manage/list/holder/TokenHolder.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/picker/PickerScreen.kt rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/{ => wallet}/picker/PickerViewModel.kt (69%) rename apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/{ => wallet}/picker/list/Item.kt (89%) create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/picker/list/WalletPickerAdapter.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/picker/list/holder/AddHolder.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/picker/list/holder/Holder.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/picker/list/holder/SkeletonHolder.kt create mode 100644 apps/wallet/instance/src/main/java/com/tonapps/tonkeeper/ui/screen/wallet/picker/list/holder/WalletHolder.kt delete mode 100644 apps/wallet/instance/src/main/res/layout/fragment_wallet_picker.xml create mode 100644 apps/wallet/instance/src/main/res/layout/view_wallet_manage.xml create mode 100644 apps/wallet/instance/src/main/res/layout/view_wallet_manage_space.xml create mode 100644 apps/wallet/instance/src/main/res/layout/view_wallet_manage_title.xml create mode 100644 apps/wallet/instance/src/main/res/layout/view_wallet_manage_token.xml delete mode 100644 lib/blockchain/src/main/java/com/tonapps/blockchain/Coin.kt create mode 100644 lib/blockchain/src/main/java/com/tonapps/blockchain/Coins.kt create mode 100644 ui/uikit/icon/src/main/res/drawable/ic_eye_closed_outline_28.xml create mode 100644 ui/uikit/icon/src/main/res/drawable/ic_eye_outline_28.xml create mode 100644 ui/uikit/icon/src/main/res/drawable/ic_pencil_outline_28.xml create mode 100644 ui/uikit/icon/src/main/res/drawable/ic_pin_28.xml create mode 100644 ui/uikit/icon/src/main/res/drawable/ic_reorder_28.xml diff --git a/.idea/.name b/.idea/.name index d0206d0f3..72af3841f 100644 --- a/.idea/.name +++ b/.idea/.name @@ -1 +1 @@ -Tonkeeper R \ No newline at end of file +TON Apps \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index a3c9f9ba2..41c918331 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -39,7 +39,6 @@