diff --git a/libraries/toolbar/README.md b/libraries/toolbar/README.md
index 92b2b835..277e0882 100644
--- a/libraries/toolbar/README.md
+++ b/libraries/toolbar/README.md
@@ -46,6 +46,8 @@ To customize **Toolbar** you can set [ToolbarViewState](src/main/java/com/trendy
| `app:hideLeftImage` | Hide flag for left image. | false | `app:hideLeftImage="true"` |
| `app:leftImageContentDescription` | Text for Left Image of Talkback | "" | `app:hideLeftImage="Back"` |
| `app:rightImageContentDescription` | Text for Right Image of Talkback | "" | `app:hideLeftImage="Add"` |
+| `app:rightImageDrawableVerticalMargin` | Vertical margin for right drawable | 0 | `app:rightImageDrawableVerticalMargin="12dp"`|
+| `app:enableDotPoint` | Right drawable's dots point enabled status | false | `app:enableDotPoint="true"` |
Sample usage with attributes:
diff --git a/libraries/toolbar/src/main/java/com/trendyol/uicomponents/toolbar/Extensions.kt b/libraries/toolbar/src/main/java/com/trendyol/uicomponents/toolbar/Extensions.kt
index b2453b1e..5547f924 100644
--- a/libraries/toolbar/src/main/java/com/trendyol/uicomponents/toolbar/Extensions.kt
+++ b/libraries/toolbar/src/main/java/com/trendyol/uicomponents/toolbar/Extensions.kt
@@ -35,6 +35,11 @@ internal fun View.setEndMargin(endMargin: Int?) {
}
}
+internal fun AppCompatImageView.setVerticalPadding(padding: Int?) {
+ if (padding == null) return
+ this.setPadding(0, padding, 0, padding)
+}
+
/**
* Set debounce time(millis) to onClickListener for prevent multiple clicks.
* @param debounceMillis: Millis time that gives delay between clicks.
diff --git a/libraries/toolbar/src/main/java/com/trendyol/uicomponents/toolbar/Toolbar.kt b/libraries/toolbar/src/main/java/com/trendyol/uicomponents/toolbar/Toolbar.kt
index d595dd8e..638e043a 100644
--- a/libraries/toolbar/src/main/java/com/trendyol/uicomponents/toolbar/Toolbar.kt
+++ b/libraries/toolbar/src/main/java/com/trendyol/uicomponents/toolbar/Toolbar.kt
@@ -6,6 +6,7 @@ import android.view.LayoutInflater
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import com.trendyol.uicomponents.toolbar.databinding.ViewToolbarBinding
+import androidx.core.view.isVisible
class Toolbar : ConstraintLayout {
@@ -103,6 +104,10 @@ class Toolbar : ConstraintLayout {
)
val rightImageDrawableMarginEnd =
getDimensionPixelOffset(R.styleable.Toolbar_rightImageDrawableMarginEnd, 0)
+ val rightImageDrawableVerticalMargin =
+ getDimensionPixelOffset(R.styleable.Toolbar_rightImageDrawableVerticalMargin, 0)
+ val enableDotPoint =
+ getBoolean(R.styleable.Toolbar_enableDotPoint, false)
val leftImageDrawableMarginStart =
getDimensionPixelOffset(R.styleable.Toolbar_leftImageDrawableMarginStart, 0)
val hideLeftImage = getBoolean(R.styleable.Toolbar_hideLeftImage, false)
@@ -127,6 +132,8 @@ class Toolbar : ConstraintLayout {
lowerRightTextMarginEndInPixel = lowerRightTextMarginEnd,
rightImageDrawableMarginEndInPixel = rightImageDrawableMarginEnd,
leftImageDrawableMarginStartInPixel = leftImageDrawableMarginStart,
+ rightImageDrawableVerticalMarginInPixel = rightImageDrawableVerticalMargin,
+ enableDotPoint = enableDotPoint,
hideLeftImage = hideLeftImage,
leftImageContentDescription = leftImageContentDescription,
rightImageContentDescription = rightImageContentDescription
@@ -148,6 +155,9 @@ class Toolbar : ConstraintLayout {
binding.imageRight.setDrawableResource(rightImageDrawableResId)
binding.imageRight.setEndMargin(rightImageDrawableMarginEndInPixel)
binding.imageRight.contentDescription = rightImageContentDescription
+ binding.imageRight.setVerticalPadding(rightImageDrawableVerticalMarginInPixel)
+
+ binding.imageViewDot.isVisible = enableDotPoint
binding.textLeftUp.text = upperLeftTextValue
binding.textLeftUp.visibility = upperLeftTextVisibility
diff --git a/libraries/toolbar/src/main/java/com/trendyol/uicomponents/toolbar/ToolbarViewState.kt b/libraries/toolbar/src/main/java/com/trendyol/uicomponents/toolbar/ToolbarViewState.kt
index b2043b20..3328ad0c 100644
--- a/libraries/toolbar/src/main/java/com/trendyol/uicomponents/toolbar/ToolbarViewState.kt
+++ b/libraries/toolbar/src/main/java/com/trendyol/uicomponents/toolbar/ToolbarViewState.kt
@@ -30,6 +30,8 @@ data class ToolbarViewState(
@Px val lowerRightTextMarginEndInPixel: Int? = null,
@Px val rightImageDrawableMarginEndInPixel: Int? = null,
@Px val leftImageDrawableMarginStartInPixel: Int? = null,
+ @Px val rightImageDrawableVerticalMarginInPixel: Int? = null,
+ val enableDotPoint: Boolean = false,
val isUpperRightTextEnabled: Boolean = true,
val hideLeftImage: Boolean = false,
val leftImageContentDescription: String = "",
diff --git a/libraries/toolbar/src/main/res/drawable/orange_dot.xml b/libraries/toolbar/src/main/res/drawable/orange_dot.xml
new file mode 100644
index 00000000..eceed98e
--- /dev/null
+++ b/libraries/toolbar/src/main/res/drawable/orange_dot.xml
@@ -0,0 +1,4 @@
+