Set the first item's left padding to 0 in Horizontal Breadcrumb.

Bug: 29945773
Change-Id: I0493f463b9e82224372e2f21b1fc9062dfd005fb
(cherry picked from commit 77afda11780172e67f88c58467bf085c86119c24)
This commit is contained in:
Ben Lin
2016-07-06 11:58:05 -07:00
parent df5c966cac
commit d7bfa22c93
2 changed files with 4 additions and 2 deletions

View File

@@ -38,8 +38,6 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:paddingRight="@dimen/breadcrumb_item_padding"
android:paddingLeft="@dimen/breadcrumb_item_padding"
android:textAppearance="@android:style/TextAppearance.Material.Widget.ActionBar.Title"
android:background="@drawable/breadcrumb_item_background" />

View File

@@ -169,12 +169,16 @@ public final class HorizontalBreadcrumb extends RecyclerView
@Override
public void onBindViewHolder(BreadcrumbHolder holder, int position) {
final DocumentInfo doc = getItem(position);
final int horizontalPadding = (int) holder.itemView.getResources()
.getDimension(R.dimen.breadcrumb_item_padding);
if (position == 0) {
final RootInfo root = mEnv.getCurrentRoot();
holder.title.setText(root.title);
holder.title.setPadding(0, 0, horizontalPadding, 0);
} else {
holder.title.setText(doc.displayName);
holder.title.setPadding(horizontalPadding, 0, horizontalPadding, 0);
}
if (position == getItemCount() - 1) {