You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Toolbar is alternative implementation of Toolbar component on Android.
@@ -26,28 +26,32 @@ dependencies {
26
26
27
27
To customize **Toolbar** you can set [ToolbarViewState](src/main/java/com/trendyol/uicomponents/toolbar/ToolbarViewState.kt) via calling `Toolbar.setViewState` or use attributes listed below. All given text attributes will be formatted as [HTML](https://developer.android.com/reference/android/text/Html).
|`app:rightImageDrawable`| Right image drawable resource. | 0 |`app:rightImageDrawable="@drawable/ic_close"`|
34
-
|`app:upperLeftText`| Upper left text resource. | null |`app:upperLeftText="@string/list_title"`|
35
-
|`app:lowerLeftText`| Lower left text resource. If upper left text is set and this is not set, upper left text would be centered vertically. | null |`app:lowerLeftText="@string/list_item_description"`|
36
-
|`app:middleText`| Middle text resource. | null |`app:middleText="@string/app_name"`|
37
-
|`app:upperRightText`| Upper right text resource. | null |`app:upperRightText="@string/action_select_all"`|
38
-
|`app:lowerRightText`| Lower right text resource. If upper left text is set and this is not set, upper left text would be centered vertically. | null |`app:lowerRightText="@string/action_clear"`|
39
-
|`app:toolbarBackground`| Background color or drawable resource. | android.R.color.white |`app:toolbarBackground="@drawable/toolbar_background"`|
40
-
|`app:upperLeftTextMarginStart`| Start margin for upper left text. | trendyol_uicomponents_toolbar_margin_left_side_text |`app:upperLeftTextMarginStart="@dimen/trendyol_uicomponents_toolbar_margin_left_side_text"`|
41
-
|`app:lowerLeftTextMarginStart`| Start margin for lower left text. | trendyol_uicomponents_toolbar_margin_left_side_text |`app:lowerLeftTextMarginStart="@dimen/trendyol_uicomponents_toolbar_margin_left_side_text"`|
42
-
|`app:upperRightTextMarginEnd`| End margin for upper right text. | trendyol_uicomponents_toolbar_margin_outer |`app:upperLeftTextMarginStart="@dimen/trendyol_uicomponents_toolbar_margin_left_side_text"`|
43
-
|`app:lowerRightTextMarginEnd`| End margin for upper right text. | trendyol_uicomponents_toolbar_margin_outer |`app:upperLeftTextMarginStart="@dimen/trendyol_uicomponents_toolbar_margin_left_side_text"`|
44
-
|`app:leftImageDrawableMarginStart`| Start margin for left drawable. | 0 |`app:upperLeftTextMarginStart="@dimen/trendyol_uicomponents_toolbar_margin_left_side_text"`|
45
-
|`app:rightImageDrawableMarginEnd`| End margin for left drawable. | 0 |`app:rightImageDrawableMarginEnd="@dimen/trendyol_uicomponents_toolbar_margin_right_side_icon"`|
46
-
|`app:hideLeftImage`| Hide flag for left image. | false |`app:hideLeftImage="true"`|
47
-
|`app:leftImageContentDescription`| Text for Left Image of Talkback | "" |`app:hideLeftImage="Back"`|
48
-
|`app:rightImageContentDescription`| Text for Right Image of Talkback | "" |`app:hideLeftImage="Add"`|
49
-
|`app:rightImageDrawableVerticalMargin`| Vertical margin for right drawable | 0 |`app:rightImageDrawableVerticalMargin="12dp"`|
50
-
|`app:enableDotPoint`| Right drawable's dots point enabled status | false |`app:enableDotPoint="true"`|
29
+
:warning: Starting from the `toolbar-2.2.0` version, namings are updated from "left-right" to
30
+
"start-end" on both ToolbarViewState and resource attributes. Component will still support older
31
+
values but its highly recommended to update usages.
|`app:endImageDrawable`~~`app:rightImageDrawable`~~| End image drawable resource. | 0 |`app:endImageDrawable="@drawable/ic_close"`|
38
+
|`app:upperStartText`~~`app:upperLeftText`~~| Upper start text resource. | null |`app:upperStartText="@string/list_title"`|
39
+
|`app:lowerStartText`~~`app:lowerLeftText`~~| Lower start text resource. If upper start text is set and this is not set, upper start text would be centered vertically. | null |`app:lowerStartText="@string/list_item_description"`|
40
+
|`app:middleText`| Middle text resource. | null |`app:middleText="@string/app_name"`|
41
+
|`app:upperEndText`~~`app:upperRightText`~~| Upper end text resource. | null |`app:upperE dText="@string/action_select_all"`|
42
+
|`app:lowerEndText`~~`app:lowerRightText`~~| Lower end text resource. If upper start text is set and this is not set, upper start text would be centered vertically. | null |`app:lowerE dText="@string/action_clear"`|
43
+
|`app:toolbarBackground`| Background color or drawable resource. | android.R.color.white - #FFFFFF |`app:toolbarBackground="@drawable/toolbar_background"`|
|`app:upperEndTextMarginEnd`~~`app:upperRightTextMarginEnd`~~| End margin for upper end text. | trendyol_uicomponents_toolbar_margin_outer - 8dp |`app:upperEndTextMarginEnd="@dimen/my_margin"`|
47
+
|`app:lowerEndTextMarginEnd`~~`app:lowerRightTextMarginEnd`~~| End margin for upper end text. | trendyol_uicomponents_toolbar_margin_outer - 8dp |`app:lowerEndTextMarginEnd="16dp"`|
48
+
|`app:startImageDrawableMarginStart`~~`app:leftImageDrawableMarginStart`~~| Start margin for start drawable. | 0 |`app:startImageDrawableMarginStart="@dimen/my_margin"`|
49
+
|`app:endImageDrawableMarginEnd`~~`app:rightImageDrawableMarginEnd`~~| End margin for start drawable. | 0 |`app:endImageDrawableMarginEnd="32dp"`|
50
+
|`app:hideStartImage`~~`app:hideLeftImage`~~| Hide flag for start image. | false |`app:hideStartImage="true"`|
51
+
|`app:startImageContentDescription`~~`app:leftImageContentDescription`~~| Text for start Image of Talkback | "" |`app:startImageContentDescription="Back"`|
52
+
|`app:endImageContentDescription`~~`app:rightImageContentDescription`~~| Text for end Image of Talkback | "" |`app:endImageContentDescription="Add"`|
53
+
|`app:endImageDrawableVerticalMargin`~~`app:rightImageDrawableVerticalMargin`~~| Vertical margin for end drawable | 0 |`app:endImageDrawableVerticalMargin="12dp"`|
54
+
|`app:enableDotPoint`| End drawable's dots point enabled status | false |`app:enableDotPoint="true"`|
51
55
52
56
Sample usage with attributes:
53
57
@@ -59,7 +63,7 @@ Sample usage with attributes:
59
63
android:layout_height="?attr/actionBarSize"
60
64
app:toolbarBackground="@color/background"
61
65
app:middleText="@string/app_name"
62
-
app:upperRightText="@string/clear_all" />
66
+
app:upperEndText="@string/clear_all" />
63
67
64
68
```
65
69
@@ -73,7 +77,7 @@ To set click listener, you can use **Toolbar** instance fields like below.
0 commit comments