Skip to content

Commit

Permalink
Remove jetifier and update UI classes to add methods from base class
Browse files Browse the repository at this point in the history
Signed-off-by: Sarah Koop <[email protected]>
  • Loading branch information
jaxdesmarais authored and sarahkoop committed Mar 29, 2022
1 parent 2f744bb commit 45bd13b
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 11 deletions.
1 change: 1 addition & 0 deletions SamsungPay/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies {
api project(':Card')

api deps.samsungPay
implementation deps.annotation

testImplementation deps.robolectric
testImplementation deps.junitTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@

import androidx.annotation.Nullable;

import com.cardinalcommerce.shared.userinterfaces.Customization;

/**
* Base customization options for 3D Secure 2 flows.
*/
// TODO: Deprecate
public class ThreeDSecureV2BaseCustomization implements Parcelable {

private String textFontName;
private String textColor;
private int textFontSize;
protected Customization cardinalValue;

ThreeDSecureV2BaseCustomization() {}

Expand All @@ -24,23 +22,20 @@ public class ThreeDSecureV2BaseCustomization implements Parcelable {
*/
public void setTextFontName(@Nullable String textFontName) {
this.textFontName = textFontName;
cardinalValue.setTextFontName(textFontName);
}

/**
* @param textColor Color code in Hex format. For example, the color code can be “#999999”.
*/
public void setTextColor(@Nullable String textColor) {
this.textColor = textColor;
cardinalValue.setTextColor(textColor);
}

/**
* @param textFontSize Font size for the UI element.
*/
public void setTextFontSize(int textFontSize) {
this.textFontSize = textFontSize;
cardinalValue.setTextFontSize(textFontSize);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,50 @@ public class ThreeDSecureV2ButtonCustomization extends ThreeDSecureV2BaseCustomi
private final ButtonCustomization cardinalButtonCustomization = new ButtonCustomization();

public ThreeDSecureV2ButtonCustomization() {
super.cardinalValue = cardinalButtonCustomization;
}

/**
* @param textFontName Font type for the UI element.
*/
public void setTextFontName(@Nullable String textFontName) {
cardinalButtonCustomization.setTextFontName(textFontName);
}

/**
* @param textColor Color code in Hex format. For example, the color code can be “#999999”.
*/
public void setTextColor(@Nullable String textColor) {
cardinalButtonCustomization.setTextColor(textColor);
}

/**
* @param textFontSize Font size for the UI element.
*/
public void setTextFontSize(int textFontSize) {
cardinalButtonCustomization.setTextFontSize(textFontSize);
}

/**
* @return Font type for the UI element.
*/
@Nullable
public String getTextFontName() {
return cardinalButtonCustomization.getTextFontName();
}

/**
* @return Color code in Hex format.
*/
@Nullable
public String getTextColor() {
return cardinalButtonCustomization.getTextColor();
}

/**
* @return Font size for the UI element.
*/
public int getTextFontSize() {
return cardinalButtonCustomization.getTextFontSize();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,50 @@ public class ThreeDSecureV2LabelCustomization extends ThreeDSecureV2BaseCustomiz
private final LabelCustomization cardinalLabelCustomization = new LabelCustomization();

public ThreeDSecureV2LabelCustomization() {
super.cardinalValue = cardinalLabelCustomization;
}

/**
* @param textFontName Font type for the UI element.
*/
public void setTextFontName(@Nullable String textFontName) {
cardinalLabelCustomization.setTextFontName(textFontName);
}

/**
* @param textColor Color code in Hex format. For example, the color code can be “#999999”.
*/
public void setTextColor(@Nullable String textColor) {
cardinalLabelCustomization.setTextColor(textColor);
}

/**
* @param textFontSize Font size for the UI element.
*/
public void setTextFontSize(int textFontSize) {
cardinalLabelCustomization.setTextFontSize(textFontSize);
}

/**
* @return Font type for the UI element.
*/
@Nullable
public String getTextFontName() {
return cardinalLabelCustomization.getTextFontName();
}

/**
* @return Color code in Hex format.
*/
@Nullable
public String getTextColor() {
return cardinalLabelCustomization.getTextColor();
}

/**
* @return Font size for the UI element.
*/
public int getTextFontSize() {
return cardinalLabelCustomization.getTextFontSize();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,50 @@ public class ThreeDSecureV2TextBoxCustomization extends ThreeDSecureV2BaseCustom
private final TextBoxCustomization cardinalTextBoxCustomization = new TextBoxCustomization();

public ThreeDSecureV2TextBoxCustomization() {
super.cardinalValue = cardinalTextBoxCustomization;
}

/**
* @param textFontName Font type for the UI element.
*/
public void setTextFontName(@Nullable String textFontName) {
cardinalTextBoxCustomization.setTextFontName(textFontName);
}

/**
* @param textColor Color code in Hex format. For example, the color code can be “#999999”.
*/
public void setTextColor(@Nullable String textColor) {
cardinalTextBoxCustomization.setTextColor(textColor);
}

/**
* @param textFontSize Font size for the UI element.
*/
public void setTextFontSize(int textFontSize) {
cardinalTextBoxCustomization.setTextFontSize(textFontSize);
}

/**
* @return Font type for the UI element.
*/
@Nullable
public String getTextFontName() {
return cardinalTextBoxCustomization.getTextFontName();
}

/**
* @return Color code in Hex format.
*/
@Nullable
public String getTextColor() {
return cardinalTextBoxCustomization.getTextColor();
}

/**
* @return Font size for the UI element.
*/
public int getTextFontSize() {
return cardinalTextBoxCustomization.getTextFontSize();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,50 @@ public class ThreeDSecureV2ToolbarCustomization extends ThreeDSecureV2BaseCustom
private final ToolbarCustomization cardinalToolbarCustomization = new ToolbarCustomization();

public ThreeDSecureV2ToolbarCustomization() {
super.cardinalValue = cardinalToolbarCustomization;
}

/**
* @param textFontName Font type for the UI element.
*/
public void setTextFontName(@Nullable String textFontName) {
cardinalToolbarCustomization.setTextFontName(textFontName);
}

/**
* @param textColor Color code in Hex format. For example, the color code can be “#999999”.
*/
public void setTextColor(@Nullable String textColor) {
cardinalToolbarCustomization.setTextColor(textColor);
}

/**
* @param textFontSize Font size for the UI element.
*/
public void setTextFontSize(int textFontSize) {
cardinalToolbarCustomization.setTextFontSize(textFontSize);
}

/**
* @return Font type for the UI element.
*/
@Nullable
public String getTextFontName() {
return cardinalToolbarCustomization.getTextFontName();
}

/**
* @return Color code in Hex format.
*/
@Nullable
public String getTextColor() {
return cardinalToolbarCustomization.getTextColor();
}

/**
* @return Font size for the UI element.
*/
public int getTextFontSize() {
return cardinalToolbarCustomization.getTextFontSize();
}

/**
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
android.enableJetifier=true
android.useAndroidX=true

# Ref: https://stackoverflow.com/a/50673210
Expand Down

0 comments on commit 45bd13b

Please sign in to comment.