Repository navigation
feat(coinbase): add coinbase to portal screen - #833
Conversation
…hadia/coinbase # Conflicts: # build.gradle # common/build.gradle # common/src/main/java/org/dash/wallet/common/ui/ListDividerDecorator.kt # common/src/main/java/org/dash/wallet/common/ui/segmented_picker/PickerOptionsAdapter.kt # common/src/main/java/org/dash/wallet/common/ui/segmented_picker/SegmentedPicker.kt # common/src/main/java/org/dash/wallet/common/util/NavigationExtensions.kt # common/src/main/res/drawable/ic_popup_close.xml # common/src/main/res/drawable/rounded_background.xml # common/src/main/res/drawable/segmented_picker_background.xml # common/src/main/res/drawable/segmented_picker_divider.xml # common/src/main/res/layout/segmented_picker.xml # common/src/main/res/values-v28/styles.xml # common/src/main/res/values/colors.xml # common/src/main/res/values/styles.xml # wallet/build.gradle # wallet/res/drawable/ic_search_light_gray.xml
# Conflicts: # build.gradle # common/build.gradle # common/src/main/java/org/dash/wallet/common/services/analytics/AnalyticsConstants.kt # common/src/main/java/org/dash/wallet/common/services/analytics/AnalyticsService.kt # common/src/main/java/org/dash/wallet/common/ui/ListDividerDecorator.kt # common/src/main/java/org/dash/wallet/common/ui/OffsetDialogFragment.kt # common/src/main/java/org/dash/wallet/common/ui/radio_group/IconifiedViewItem.kt # common/src/main/java/org/dash/wallet/common/ui/radio_group/OptionPickerDialog.kt # common/src/main/java/org/dash/wallet/common/ui/radio_group/RadioGroupAdapter.kt # common/src/main/java/org/dash/wallet/common/ui/segmented_picker/PickerOptionsAdapter.kt # common/src/main/java/org/dash/wallet/common/ui/segmented_picker/SegmentedPicker.kt # common/src/main/java/org/dash/wallet/common/util/NavigationExtensions.kt # common/src/main/res/color/button_text.xml # common/src/main/res/color/radiobutton_text_color.xml # common/src/main/res/drawable/checkbox.xml # common/src/main/res/drawable/checkbox_checked.xml # common/src/main/res/drawable/checkbox_unchecked.xml # common/src/main/res/drawable/ic_checkmark.xml # common/src/main/res/drawable/ic_checkmark_blue.xml # common/src/main/res/drawable/ic_close.xml # common/src/main/res/drawable/ic_popup_close.xml # common/src/main/res/drawable/ic_search.xml # common/src/main/res/drawable/list_divider.xml # common/src/main/res/drawable/rounded_background.xml # common/src/main/res/drawable/rounded_ripple_transparent.xml # common/src/main/res/drawable/segmented_picker_background.xml # common/src/main/res/drawable/segmented_picker_divider.xml # common/src/main/res/layout/dialog_option_picker.xml # common/src/main/res/layout/radiobutton_row.xml # common/src/main/res/layout/segmented_picker.xml # common/src/main/res/layout/segmented_picker_option_view.xml # common/src/main/res/values-v28/styles.xml # common/src/main/res/values/styles.xml # wallet/src/de/schildbach/wallet/di/ConfigurationModule.kt
| val loginUrl = | ||
| "https://www.coinbase.com/oauth/authorize?client_id=1ca2946d789bf6d986f26df03f4a52a8c6f1fe80e469eb1d3477e7c90768559a&redirect_uri=https://coin.base.test/callback&response_type=code&account=all&scope=wallet:accounts:read,wallet:user:read,wallet:transactions:transfer" | ||
|
|
||
| binding.webView.loadUrl(loginUrl) |
There was a problem hiding this comment.
We are using a webview rather than a custom tab? Uphold and Liquid use a CustomTab. Not sure which is better.
What happens when the autologout is triggered? It appears that this Activity will finish, since it is derived from InteractionAwareActivity rather than LockScreenActivity
There was a problem hiding this comment.
Derive CoinBaseWebClientActivity from LockScreenActivity, otherwise this activity will finish() when the autologout timer expires (default is 1 minute)
Syn-McJ
left a comment
There was a problem hiding this comment.
Looks good, but there are some minor changes that would be nice to have.
| <item name="android:textColor">@color/gray_400</item> | ||
| </style> | ||
|
|
||
| <style name="Caption.Gray400.13"> |
There was a problem hiding this comment.
Caption has text size 12 per our design system. Let's not add confusion to the typography styles. 13 text is probably a button caption.
Edit: actually Ros seemed to add Footnote text style which is 13, but I cleared this up and he agreed we should just use Caption instead.
| <item name="android:textColor">@color/gray_700</item> | ||
| </style> | ||
| <style name="Caption.Gray700.12"> | ||
| <item name="android:textSize">12sp</item> |
There was a problem hiding this comment.
No need for Caption.12 since Caption is already 12.
| <string name="last_known_balance" >Last known balance</string> | ||
| <string name="coinbase_dash_wallet_error_title">We didn\'t find a Dash Wallet on your Coinbase account.</string> | ||
| <string name="coinbase_dash_wallet_error_message"> Please create a Dash Wallet on Coinbase to proceed.</string> | ||
| <string name="CreateـDashـAccount">Create Dash Account</string> |
There was a problem hiding this comment.
Naming is a bit untidy, let's stick with snake case for strings
| import de.schildbach.wallet.ui.coinbase.CoinbaseActivity | ||
| import de.schildbach.wallet_test.R | ||
| import kotlinx.android.synthetic.main.activity_buy_and_sell_liquid_uphold.* | ||
| import kotlinx.android.synthetic.main.item_coinbase_integration_item.* |
There was a problem hiding this comment.
Maybe we should get rid of kotlin synthetics while we're at it
There was a problem hiding this comment.
Ideally new fragments/activities should not use synthetics. BuyAndSellLiquidUpholdActivity is not new and may still use synthetics.
| import javax.inject.Inject | ||
|
|
||
| @HiltViewModel | ||
| class CoinbaseActivityViewModel @Inject constructor( |
There was a problem hiding this comment.
Not sure why the viewModel is also in the wallet module? Should be in coinbase-integration so that we're able to communicate between integration module and the wallet.
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="2dp" | ||
| android:lineSpacingExtra="2sp" | ||
| android:text="Receive directly into Dash Wallet." |
There was a problem hiding this comment.
Shouldn't that be in strings.xml?
There was a problem hiding this comment.
This is good work. Address the items listed above. Also when I tried to run this branch locally, I got these errors.
integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/network/RemoteDataSource.kt: (28, 48):
Type mismatch: inferred type is Context but CoinBaseTokenRefreshApi was expected
integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/network/RemoteDataSource.kt: (28, 57):
Type mismatch: inferred type is CoinBaseTokenRefreshApi but Configuration was expected
integrations/coinbase-integration/src/main/java/org/dash/wallet/integration/coinbase_integration/network/RemoteDataSource.kt: (28, 73):
Too many arguments for public constructor TokenAuthenticator(tokenApi: CoinBaseTokenRefreshApi, userPreferences: Configuration) defined in org.dash.wallet.integration.coinbase_integration.repository.remote.TokenAuthenticator
HashEngineering
left a comment
There was a problem hiding this comment.
My compile issues were resolved in the last commit. There are some other issues that need to be addressed and then we can merge this.
Syn-McJ
left a comment
There was a problem hiding this comment.
Fixes look good, however, there is a missed hardcoded string, and the license should be GPL v3 instead of Apache. Here is an example. It's better to add it into Android Studio templates to be appended in new files automatically.
There are also small inconsistencies with styles, but I can clean those up while working on buy UI.
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="20dp" | ||
| android:gravity="center" | ||
| android:text="Balance on Coinbase" |
There was a problem hiding this comment.
Should this also go into strings.xml?
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 |
There was a problem hiding this comment.
The license should be GPL v3 and not Apache
NMA-1051:Portal
Issue being fixed or feature implemented
As a user who has logged into my Coinbase account, I would like to see my balance clearly.
Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
https://dashpay.atlassian.net/browse/NMA-1051?focusedCommentId=41208
Checklist: