Skip to content

Commit

Permalink
Reworking design and functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmmedrejowan committed Sep 21, 2022
1 parent 3004db0 commit 56a9cf1
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public CuteDialog setDesc(String descText, int textSizeInSP, int textColor, int
return this;
}

public CuteDialog setPositiveButtonStyle(int radiusOfButton, int bgColorOfButton, int outlineOfButton, int borderWidth, int textSizeInSP) {
public CuteDialog setPositiveButtonStyle(int radiusOfButton, int bgColorOfButton, int borderColor, int borderWidth, int textSizeInSP) {

if (radiusOfButton != 0) {
binding.positiveButton.setRadius(radiusOfButton * 4);
Expand All @@ -364,11 +364,11 @@ public CuteDialog setPositiveButtonStyle(int radiusOfButton, int bgColorOfButton
}
}

if (outlineOfButton != 0) {
if (borderColor != 0) {
try {
binding.positiveButton.setStrokeColor(ContextCompat.getColor(context, outlineOfButton));
binding.positiveButton.setStrokeColor(ContextCompat.getColor(context, borderColor));
} catch (Resources.NotFoundException e) {
binding.positiveButton.setStrokeColor(outlineOfButton);
binding.positiveButton.setStrokeColor(borderColor);
}
} else {
if (bgColorOfButton != 0) {
Expand All @@ -393,7 +393,7 @@ public CuteDialog setPositiveButtonStyle(int radiusOfButton, int bgColorOfButton
return this;
}

public CuteDialog setNegativeButtonStyle(int radiusOfButton, int bgColorOfButton, int outlineOfButton, int borderWidth, int textSizeInSP) {
public CuteDialog setNegativeButtonStyle(int radiusOfButton, int bgColorOfButton, int borderColor, int borderWidth, int textSizeInSP) {

if (radiusOfButton != 0) {
binding.negativeButton.setRadius(radiusOfButton * 4);
Expand All @@ -408,11 +408,11 @@ public CuteDialog setNegativeButtonStyle(int radiusOfButton, int bgColorOfButton
}
}

if (outlineOfButton != 0) {
if (borderColor != 0) {
try {
binding.negativeButton.setStrokeColor(ContextCompat.getColor(context, outlineOfButton));
binding.negativeButton.setStrokeColor(ContextCompat.getColor(context, borderColor));
} catch (Resources.NotFoundException e) {
binding.negativeButton.setStrokeColor(outlineOfButton);
binding.negativeButton.setStrokeColor(borderColor);
}
} else {
if (bgColorOfButton != 0) {
Expand Down

0 comments on commit 56a9cf1

Please sign in to comment.