Skip to content

Commit

Permalink
Tag/1.0.0 beta06 (#181)
Browse files Browse the repository at this point in the history
* Security fixes
* Bug fixes
* UI and usability enhancements
  • Loading branch information
Peter Joseph Olamit authored Aug 19, 2020
1 parent a83de2d commit e363bef
Show file tree
Hide file tree
Showing 101 changed files with 2,715 additions and 1,782 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

[1.0.0-beta06](https://github.com/hyperwallet/hyperwallet-android-ui-sdk/releases/tag/1.0.0-beta06)
-------------------
* Security fixes
* Bug fixes
* UI and usability enhancements

[1.0.0-beta05](https://github.com/hyperwallet/hyperwallet-android-ui-sdk/releases/tag/1.0.0-beta05)
-------------------
* Added Analytics to Transfer Method Module
Expand All @@ -24,6 +30,3 @@ Changelog
- Initial release
* UI components to create Bank Account and Bank Card for United States (USD)
* UI components to list and deactivate accounts



42 changes: 28 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Note that this SDK is geared towards those who need both backend data and UI fea
To install Hyperwallet UI SDK, you just need to add the dependencies into your build.gradle file in Android Studio (or Gradle). For example:

```bash
api 'com.hyperwallet.android.ui:transfermethodui:1.0.0-beta05'
api 'com.hyperwallet.android.ui:receiptui:1.0.0-beta05'
api 'com.hyperwallet.android.ui:transferui:1.0.0-beta05'
api 'com.hyperwallet.android.ui:transfermethodui:1.0.0-beta06'
api 'com.hyperwallet.android.ui:receiptui:1.0.0-beta06'
api 'com.hyperwallet.android.ui:transferui:1.0.0-beta06'
```

## Initialization
Expand All @@ -33,8 +33,8 @@ HyperwalletReceiptUi.getInstance(hyperwalletAuthenticationTokenProvider);
HyperwalletTransferMethodUi.getInstance(hyperwalletAuthenticationTokenProvider);

// use UI SDK functions
mHyperwalletTransferMethodUi.getIntentListTransferMethodActivity(MainActivity.this);
mHyperwalletReceiptUi.getIntentListUserReceiptActivity(MainActivity.this);
mHyperwalletTransferMethodUi.getIntentListTransferMethodActivity(MainActivity.this, false);
mHyperwalletReceiptUi.getIntentListUserReceiptActivity(MainActivity.this, false);
```

## Authentication
Expand Down Expand Up @@ -104,37 +104,45 @@ protected void onCreate(Bundle savedInstanceState) {
```

### List the user's transfer methods
The second argument is boolean flag to control view orientation, <code>lockScreenToPortrait</code> set to <code>true</code>
will lock the screen to Portrait orientation otherwise it will just follow device orientation.
```java
@Override
public void onClick(View view) {
Intent intent = mHyperwalletTransferMethodUi.getIntentListTransferMethodActivity(MainActivity.this);
Intent intent = mHyperwalletTransferMethodUi.getIntentListTransferMethodActivity(MainActivity.this, false);
startActivity(intent);
}
```


### Select a transfer method type available by country and currency
The second argument is boolean flag to control view orientation, <code>lockScreenToPortrait</code> set to <code>true</code>
will lock the screen to Portrait orientation otherwise it will just follow device orientation.
```java
@Override
public void onClick(View view) {
Intent intent = mHyperwalletTransferMethodUi.getIntentSelectTransferMethodActivity(MainActivity.this);
Intent intent = mHyperwalletTransferMethodUi.getIntentSelectTransferMethodActivity(MainActivity.this, false);
startActivity(intent);
}
```

### Create a transfer using the logged in user as the source of funds
The second argument is boolean flag to control view orientation, <code>lockScreenToPortrait</code> set to <code>true</code>
will lock the screen to Portrait orientation otherwise it will just follow device orientation.
```java
public void onClick(View view) {
Intent intent = mHyperwalletTransferUi.getIntentCreateTransfer(MainActivity.this);
Intent intent = mHyperwalletTransferUi.getIntentCreateTransfer(MainActivity.this, false);
startActivity(intent);
}
```
### Create a transfer from a specific account as the source of funds
The two argument version allows you to choose the source of funds, typically used for EA to EA transfers or PPC to EA transfers.
Your configuration must support this as not all banks and currencies are compatible with each other.
The three argument version allows you to choose the source of funds, typically used for EA to EA transfers or PPC to EA transfers.
Your configuration must support this as not all banks and currencies are compatible with each other.
The third argument is boolean flag to control view orientation, <code>lockScreenToPortrait</code> set to <code>true</code>
will lock the screen to Portrait orientation otherwise it will just follow device orientation.
```java
public void onClick(View view) {
Intent intent = mHyperwalletTransferUi.getIntentCreateTransfer(MainActivity.this, "trm-12345");
Intent intent = mHyperwalletTransferUi.getIntentCreateTransfer(MainActivity.this, "trm-12345", false);
startActivity(intent);
}
```
Expand All @@ -149,23 +157,29 @@ public void onClick(View view) {
"US",
"USD",
"BANK_ACCOUNT",
"INDIVIDUAL");
"INDIVIDUAL",
false);
startActivity(intent);
}
```

### List the user's receipts
The second argument is boolean flag to control view orientation, <code>lockScreenToPortrait</code> set to <code>true</code>
will lock the screen to Portrait orientation otherwise it will just follow device orientation.
```java
public void onClick(View view) {
Intent intent = mHyperwalletReceiptUi.getIntentListUserReceiptActivity(MainActivity.this);
Intent intent = mHyperwalletReceiptUi.getIntentListUserReceiptActivity(MainActivity.this, false);
startActivity(intent);
}
```

### List the prepaid card's receipts
The second argument is a token that represents a Prepaid card.
The third argument is boolean flag to control view orientation, <code>lockScreenToPortrait</code> set to <code>true</code>
will lock the screen to Portrait orientation otherwise it will just follow device orientation.
```java
public void onClick(View view) {
Intent intent = mHyperwalletReceiptUi.getIntentListPrepaidCardReceiptActivity(MainActivity.this, "trm-12345");
Intent intent = mHyperwalletReceiptUi.getIntentListPrepaidCardReceiptActivity(MainActivity.this, "trm-12345", false);
startActivity(intent);
}
```
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ allprojects {

}

project.version = "1.0.0-beta06-SNAPSHOT"
project.version = "1.0.0-beta06"

}

Expand All @@ -38,7 +38,7 @@ subprojects {
targetVersion = 28
codeVersion = 1

hyperwalletCoreVersion = '1.0.0-beta06-SNAPSHOT'
hyperwalletCoreVersion = '1.0.0-beta06'
hyperwalletInsightVersion = '1.0.0-beta02'
//
androidMaterialVersion = '1.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,10 @@ private HyperwalletIntent() {
* SDK Broadcast error action
*/
public static final String AUTHENTICATION_ERROR_ACTION = "HYPERWALLET_AUTHENTICATION_ERROR_ACTION";


/**
* Transfer method added, extra activity parcelable transfer method payload
*/
public static final String EXTRA_TRANSFER_METHOD_ADDED = "EXTRA_TRANSFER_METHOD_ADDED";
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import android.content.Context;
import android.content.res.Resources;
import android.text.TextUtils;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
Expand Down Expand Up @@ -154,14 +155,14 @@ public static String getTransferMethodDetail(@NonNull Context context,
return getFourDigitsIdentification(context,
transferMethod,
CARD_NUMBER,
R.string.transfer_method_list_item_description);
R.string.endingIn);
case BANK_ACCOUNT:
case WIRE_ACCOUNT:
return getFourDigitsIdentification(context, transferMethod, BANK_ACCOUNT_ID,
R.string.transfer_method_list_item_description);
R.string.endingIn);
case PAYPAL_ACCOUNT:
final String transferIdentification = transferMethod.getField(EMAIL);
return transferIdentification != null ? transferIdentification : "";
final String email = transferMethod.getField(EMAIL);
return context.getString(R.string.to, email != null ? email : "");
default:
return "";
}
Expand All @@ -174,9 +175,9 @@ private static String getFourDigitsIdentification(@NonNull final Context context
final String transferIdentification = transferMethod.getField(fieldKey);

final String identificationText =
transferIdentification != null && transferIdentification.length() > LAST_FOUR_DIGIT
!TextUtils.isEmpty(transferIdentification) && transferIdentification.length() > LAST_FOUR_DIGIT
? transferIdentification.substring(transferIdentification.length() - LAST_FOUR_DIGIT)
: "";
: !TextUtils.isEmpty(transferIdentification) ? transferIdentification : "";

return context.getString(stringResId, identificationText);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private AlertDialog buildDialog(@NonNull final Error error) {
switch (ErrorTypes.getErrorType(error.getCode())) {
case ErrorTypes.SDK_ERROR:
builder.setTitle(requireContext().getString(R.string.error_dialog_unexpected_title))
.setPositiveButton(getResources().getString(R.string.close_button_label),
.setPositiveButton(getResources().getString(R.string.ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Expand All @@ -142,7 +142,7 @@ public void onClick(DialogInterface dialog, int which) {
break;
case ErrorTypes.CONNECTION_ERROR:
builder.setTitle(requireContext().getString(R.string.error_dialog_connectivity_title))
.setNegativeButton(getResources().getString(R.string.cancel_button_label),
.setNegativeButton(getResources().getString(R.string.cancelButtonLabel),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Expand All @@ -163,7 +163,7 @@ public void onClick(DialogInterface dialog, int which) {
break;
case ErrorTypes.AUTH_TOKEN_ERROR:
builder.setTitle(requireContext().getString(R.string.authentication_error_header))
.setPositiveButton(getResources().getString(R.string.close_button_label),
.setPositiveButton(getResources().getString(R.string.ok),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Expand All @@ -176,7 +176,7 @@ public void onClick(DialogInterface dialog, int which) {
break;
default: // normal rest errors, we will give the user a chance to fix input values from form
builder.setTitle(requireContext().getString(R.string.error_dialog_title))
.setPositiveButton(getResources().getString(R.string.close_button_label), null);
.setPositiveButton(getResources().getString(R.string.ok), null);
}
AlertDialog dialog = builder.create();
dialog.setCanceledOnTouchOutside(false);
Expand Down
Binary file not shown.
Binary file removed commonui/src/main/res/font/icomoon.ttf
Binary file not shown.
4 changes: 4 additions & 0 deletions commonui/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<color name="colorButtonDisabled">#DBDBDB</color>
<color name="colorButtonTextDisabled">#ACACAC</color>
<color name="colorInputFormBackground">#F7F7F7</color>
<color name="colorBackgroundDisabled">#F8F8F8</color>
<color name="colorLabelDisabled">#2C2E2F</color>

<!-- Regular Colors -->
<color name="regularColorPrimary">#FFFFFF</color>
Expand All @@ -24,5 +26,7 @@
<!-- Icon decoration color -->
<color name="fontIconBackground">#E5F7FA</color>
<color name="iconCircleWhite">#737373</color>

<color name="statusBarColor">@color/colorPrimaryDark</color>
</resources>

13 changes: 13 additions & 0 deletions commonui/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<dimen name="font_caption">12sp</dimen>
<dimen name="font_overline">10sp</dimen>
<dimen name="font_default_icon_size">24sp</dimen>
<dimen name="font_currency_symbol">26sp</dimen>
<dimen name="font_currency_code">17sp</dimen>

<!-- vertical grid -->
<dimen name="grid_column_gutter">16dp</dimen>
Expand Down Expand Up @@ -52,6 +54,11 @@
<dimen name="widget_default_margin">8dp</dimen>
<dimen name="widget_start_margin">12dp</dimen>

<!-- row height dimension -->
<dimen name="row_height_single_entry">60dp</dimen>
<dimen name="row_height_double_entry">80dp</dimen>
<dimen name="row_height_triple_entry">88dp</dimen>

<!-- specificity -->
<dimen name="collapsing_header_size">136dp</dimen>
<dimen name="divider_height">1dp</dimen>
Expand Down Expand Up @@ -79,4 +86,10 @@
<dimen name="circle_white_density">3dp</dimen>
<dimen name="component_elevation">4dp</dimen>
<dimen name="negative_padding">3dp</dimen>
<dimen name="negative_margin">-8dp</dimen>
<dimen name="edit_text_offset">20dp</dimen>
<dimen name="edit_text_top_offset">35dp</dimen>
<dimen name="image_offset">32dp</dimen>
<dimen name="divider_offset">58dp</dimen>
<dimen name="margin_top_header_value">10dp</dimen>
</resources>
27 changes: 17 additions & 10 deletions commonui/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,35 @@
<string name="error_dialog_title">Error</string>
<string name="error_dialog_connectivity_title">Connectivity Issue</string>
<string name="error_dialog_unexpected_title">Unexpected Error</string>
<string name="cancel_button_label">Cancel</string>
<string name="close_button_label">Close</string>
<string name="ok">OK</string>
<string name="try_again_button_label">Try again</string>
<string name="not_available">Not Available</string>

<!-- title and font icon -->
<string name="bank_account">Bank Account</string>
<string name="bank_card">Debit Card</string>
<string name="wire_account">Wire Transfer</string>
<string name="wire_account">Wire Transfer Account</string>
<string name="paper_check">Paper Check</string>
<string name="prepaid_card">Prepaid Card</string>
<string name="paypal_account">PayPal</string>
<string name="venmo_account">Venmo</string>
<string name="cash_pickup_mg">MoneyGram</string>

<string name="bank_account_font_icon">\uE000</string>
<string name="bank_card_font_icon">\uE005</string>
<string name="wire_account_font_icon">\uE00D</string>
<string name="paper_check_font_icon">\uE002</string>
<string name="prepaid_card_font_icon">\uE00A</string>
<string name="paypal_account_font_icon">\uE021</string>
<string name="bank_account_font_icon">\ue900</string>
<string name="bank_card_font_icon">\ue903</string>
<string name="wire_account_font_icon">\ue90a</string>
<string name="paper_check_font_icon">\ue902</string>
<string name="prepaid_card_font_icon">\ue901</string>
<string name="paypal_account_font_icon">\ue906</string>
<string name="venmo_account_font_icon">\ue909</string>
<string name="cash_pickup_mg_font_icon">\ue905</string>

<string name="transfer_method_list_item_description">Ending on %s</string>
<string name="endingIn">ending in %s</string>
<string name="to">to %s</string>
<string name="not_translated_in_braces">(not translated)</string>

<string name="authentication_error_header">Authentication Error</string>
<string name="cancelButtonLabel">Cancel</string>
<string name="remove">Remove</string>
<string name="mobileAreYouSure">Are you sure?</string>
</resources>
Loading

0 comments on commit e363bef

Please sign in to comment.