Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

Generate method to edit programmatically Typeface for CenterTextView #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions swipe-button/src/main/java/com/ebanx/swipebtn/SwipeButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
Expand Down Expand Up @@ -403,7 +404,7 @@ public void onAnimationUpdate(ValueAnimator animation) {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
if (layer!=null) {
if (layer != null) {
layer.setVisibility(View.GONE);
}
}
Expand Down Expand Up @@ -449,7 +450,7 @@ public void onAnimationEnd(Animator animation) {
if (onStateChangeListener != null) {
onStateChangeListener.onStateChange(active);
}
if (layer!=null) {
if (layer != null) {
layer.setVisibility(View.GONE);
}
}
Expand Down Expand Up @@ -519,4 +520,18 @@ public void toggleState() {
public void setCenterTextColor(Context context, int color) {
centerText.setTextColor(context.getResources().getColor(color));
}

/**
* Method for change Typeface for Text on Swipe Control
*/
public void setTypeface(Typeface typeface, int style) {
this.centerText.setTypeface(typeface, style);
}

/**
* Method for change Typeface for Text on Swipe Control
*/
public void setTypeface(Typeface typeface) {
this.centerText.setTypeface(typeface);
}
}