Skip to content

Commit

Permalink
Modified sample
Browse files Browse the repository at this point in the history
  • Loading branch information
konifar committed Mar 15, 2018
1 parent c9bdbd4 commit 62e77a5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class MainActivity : AppCompatActivity() {
.setTitle("Second text")
.setDescription("This is the second text.")
.setMessageLayoutResId(R.layout.layout_instruction_simple_message_black)
.setHighlightHorizontalPadding(R.dimen.space_minus_16dp)
.setStartDelayMillis(200L)
.build()

Expand Down
1 change: 1 addition & 0 deletions example/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<dimen name="space_8dp">8dp</dimen>
<dimen name="space_16dp">16dp</dimen>
<dimen name="space_32dp">32dp</dimen>
<dimen name="space_minus_16dp">-16dp</dimen>
<dimen name="fab_margin">16dp</dimen>

<dimen name="simple_title">20sp</dimen>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,33 +82,33 @@ abstract class AbstractTargetBuilder<T : AbstractTargetBuilder<T, S>, S : Target
}
}

fun setHighlightPaddingVertical(padding: Float): T {
fun setHighlightVerticalPadding(padding: Float): T {
this.highlightPaddingTop = padding
this.highlightPaddingBottom = padding
return self()
}

fun setHighlightPaddingVertical(@DimenRes paddingResId: Int): T {
fun setHighlightVerticalPadding(@DimenRes paddingResId: Int): T {
val activity = activityWeakReference.get()
return if (activity == null) {
throw IllegalStateException("activity is null")
} else {
setHighlightPaddingVertical(activity.resources.getDimension(paddingResId))
setHighlightVerticalPadding(activity.resources.getDimension(paddingResId))
}
}

fun setPaddingHorizontal(padding: Float): T {
fun setHighlightHorizontalPadding(padding: Float): T {
this.hightlightPaddingLeft = padding
this.highlightPaddingRight = padding
return self()
}

fun setPaddingHorizontal(@DimenRes paddingResId: Int): T {
fun setHighlightHorizontalPadding(@DimenRes paddingResId: Int): T {
val activity = activityWeakReference.get()
return if (activity == null) {
throw IllegalStateException("activity is null")
} else {
setPaddingHorizontal(activity.resources.getDimension(paddingResId))
setHighlightHorizontalPadding(activity.resources.getDimension(paddingResId))
}
}

Expand Down

0 comments on commit 62e77a5

Please sign in to comment.