Skip to content

Separate title and description typeface#167

Merged
xiphirx merged 2 commits intoKeepSafe:masterfrom
danimahardhika:patch
May 6, 2017
Merged

Separate title and description typeface#167
xiphirx merged 2 commits intoKeepSafe:masterfrom
danimahardhika:patch

Conversation

@danimahardhika
Copy link
Copy Markdown
Contributor

Added textTypeface(titleTypeface, descriptionTypeface)

- Added textTypeface(titleTypeface, descriptionTypeface)
import android.support.annotation.ColorRes;
import android.support.annotation.DimenRes;
import android.support.annotation.IdRes;
import android.support.annotation.NonNull;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary. The project assumes non null wherever there isn't a nullable annotation


/** Specify the typeface for title and description text **/
public TapTarget textTypeface(@NonNull Typeface titleTypeface, @NonNull Typeface descriptionTypeface) {
this.titleTypeface = titleTypeface;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a friendly API, it is forcing users to specify both, even though a large amount of cases don't need different typefaces between the title and description. This should be split up into titleTypeface and descriptionTypeface builder methods instead.

Additionally these methods need the null check that you removed from the original textTypeface

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's needed when using typeface from assets folder. I'm going to change tit.

- titleTypeface(Typeface)
- descriptionTypeface(Typeface)
@xiphirx xiphirx merged commit 729cd17 into KeepSafe:master May 6, 2017
@danimahardhika danimahardhika deleted the patch branch May 6, 2017 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants