Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

Commit

Permalink
bugfix and add TypeFace for title and content text
Browse files Browse the repository at this point in the history
  • Loading branch information
mreram committed Jan 21, 2018
1 parent b278252 commit 3d32847
Showing 1 changed file with 22 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,6 @@ public void show() {

}

public void setGravity(Gravity gravity) {
this.mGravity = gravity;
}

public void setTitle(String str) {
mMessageView.setTitle(str);
}
Expand All @@ -243,12 +239,12 @@ public void setContentSpan(Spannable span) {
mMessageView.setContentSpan(span);
}

public void setTitleTypeFace(Typeface span) {
mMessageView.setTitleTypeFace(span);
public void setTitleTypeFace(Typeface typeFace) {
mMessageView.setTitleTypeFace(typeFace);
}

public void setContentTypeFace(Typeface span) {
mMessageView.setContentTypeFace(span);
public void setContentTypeFace(Typeface typeFace) {
mMessageView.setContentTypeFace(typeFace);
}


Expand All @@ -258,17 +254,9 @@ public void setTitleTextSize(int size) {


public void setContentTextSize(int size) {
mMessageView.setTitleTextSize(size);
mMessageView.setContentTextSize(size);
}

public class CustomDialog extends Dialog {

CustomDialog(Context context, int resId) {
super(context, resId);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().getDecorView().setBackgroundColor(Color.TRANSPARENT);
}
}


public static class Builder {
Expand All @@ -279,6 +267,7 @@ public static class Builder {
private int titleTextSize;
private int contentTextSize;
private Spannable contentSpan;
private Typeface titleTypeFace,contentTypeFace;

public Builder(Context context) {
this.context = context;
Expand Down Expand Up @@ -309,6 +298,16 @@ public Builder setContentSpan(Spannable span) {
return this;
}

public Builder setContentTypeFace(Typeface typeFace) {
this.contentTypeFace = typeFace;
return this;
}

public Builder setTitleTypeFace(Typeface typeFace) {
this.titleTypeFace = typeFace;
return this;
}

/**
* the defined text size overrides any defined size in the default or provided style
*
Expand Down Expand Up @@ -343,6 +342,12 @@ public GuideView build() {
guideView.setContentTextSize(contentTextSize);
if (contentSpan != null)
guideView.setContentSpan(contentSpan);
if(titleTypeFace!=null){
guideView.setTitleTypeFace(titleTypeFace);
}
if(contentTypeFace!=null){
guideView.setContentTypeFace(contentTypeFace);
}
return guideView;
}

Expand Down

0 comments on commit 3d32847

Please sign in to comment.