Skip to content

feat(coinbase): add coinbase to portal screen - #833

Merged
HashEngineering merged 26 commits into
feature-coinbase-integrationfrom
hadia/coinbase
Dec 13, 2021
Merged

HashEngineering merged 26 commits into
feature-coinbase-integrationfrom
hadia/coinbase

Conversation

@hadia

@hadia hadia commented Dec 9, 2021 •

Copy link
Copy Markdown
Contributor

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

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

hadia and others added 20 commits November 15, 2021 14:34
…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
@hadia
hadia requested a review from HashEngineering December 9, 2021 12:53
@hadia
hadia marked this pull request as ready for review December 9, 2021 13:02
Comment thread common/src/main/res/values/strings.xml Resolved
Comment thread uphold-integration/build.gradle Resolved
Comment on lines +52 to +55
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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@HashEngineering HashEngineering Dec 11, 2021 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Derive CoinBaseWebClientActivity from LockScreenActivity, otherwise this activity will finish() when the autologout timer expires (default is 1 minute)

Comment thread wallet/res/values/strings-extra.xml Resolved
@HashEngineering
HashEngineering self-requested a review December 9, 2021 17:31
@HashEngineering HashEngineering changed the title Hadia/coinbase feat(coinbase): add coinbase to portal screen Dec 9, 2021

@Syn-McJ Syn-McJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but there are some minor changes that would be nice to have.

Comment thread common/src/main/res/values/styles.xml Resolved
Comment thread common/src/main/res/values/styles.xml Outdated
<item name="android:textColor">@color/gray_400</item>
</style>

<style name="Caption.Gray400.13">

@Syn-McJ Syn-McJ Dec 10, 2021 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread common/src/main/res/values/styles.xml Outdated
<item name="android:textColor">@color/gray_700</item>
</style>
<style name="Caption.Gray700.12">
<item name="android:textSize">12sp</item>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should get rid of kotlin synthetics while we're at it

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that be in strings.xml?

@HashEngineering HashEngineering left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hadia
hadia changed the base branch from NMA-1049_Coinbase_Integration to feature-coinbase-integration December 10, 2021 18:47

@HashEngineering HashEngineering left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Syn-McJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The license should be GPL v3 and not Apache

@hadia
hadia requested a review from Syn-McJ December 13, 2021 10:57

@Syn-McJ Syn-McJ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great

@HashEngineering
HashEngineering merged commit c9d52af into feature-coinbase-integration Dec 13, 2021
@hadia
hadia deleted the hadia/coinbase branch December 22, 2021 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants