Prabhakar
Prabhakar

Reputation: 1811

Is it possible to reduce the width of headerFragment in leanback android tv app

I am trying to reduce the header Fragment width. But I am able to change the text and icon inside the header Fragment not width.

I have tried to set the width inside item layout but unfortunately it doesn't work.

icon_header_item.xml

<RelativeLayout
    android:layout_width="100dp"
    android:layout_height="wrap_content">

<ImageView
    android:id="@+id/header_icon"
    android:layout_width="48dp"
    android:layout_height="48dp"
    android:layout_marginTop="20dp"/>

<TextView
    android:id="@+id/header_label"
    android:layout_width="140dp"
    android:layout_below="@id/header_icon"
    android:layout_centerHorizontal="true"
    android:layout_height="wrap_content"/>

</RelativeLayout> </android.support.v17.leanback.widget.NonOverlappingLinearLayout>

see in the pic

enter image description here

Upvotes: 1

Views: 1142

Answers (1)

cassiozen
cassiozen

Reputation: 269

You can override the original dimensions in your res/values/dimens.xml

<dimen name="lb_browse_headers_width">210dp</dimen><!--  Original: 270  -->
<dimen name="lb_browse_rows_margin_start">178dp</dimen><!--  Original: 238  -->

Upvotes: 11

Related Questions