straw/app/src/main/res/layout/drawer_header.xml
Stypox ea43b28f74
Use vector drawables instead of PNGs for material icons
For all manually-created images PNG have been kept.
- rename all icon attrs to have a `ic_` prefix
- always use `_24dp` icons, because there is no real difference, since they are vector drawables
- always use the original name found on material.io for icon drawables, as to not create confusion and possibly duplicates. Icon names can still be different from real drawable names, though I have made some of them compliant to this or maybe more meaningul.
- remove duplicate `getIconByAttr()` in ThemeHelper (use `resolveResourceIdFromAttr()`
- use standard icons for `expand_more` and `expand_less` instead of triangles
- use `play_button_outline` instead of custom PNG as play button in VideoDetailFragment (questionable, as there is no shadow anymore)
2020-05-21 15:39:35 +02:00

122 lines
No EOL
5.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?colorPrimary"
android:nextFocusDown="@+id/drawer_header_action_button">
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:scaleType="centerCrop"
android:src="@drawable/background_header"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:ignore="ContentDescription" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/drawer_header_padding_top"
android:fitsSystemWindows="true"
android:gravity="bottom"
android:minHeight="@dimen/drawer_header_content_min_height"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="72dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:gravity="center"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<ImageView
android:id="@+id/drawer_header_newpipe_icon"
android:layout_width="@dimen/drawer_header_newpipe_icon_size"
android:layout_height="@dimen/drawer_header_newpipe_icon_size"
android:layout_marginEnd="@dimen/drawer_header_newpipe_icon_title_space"
app:srcCompat="@drawable/splash_foreground"
tools:ignore="ContentDescription" />
<TextView
android:id="@+id/drawer_header_newpipe_title"
android:layout_width="@dimen/drawer_header_newpipe_title_default_width"
android:layout_height="match_parent"
android:layout_marginEnd="@dimen/drawer_header_newpipe_icon_title_space"
android:ellipsize="end"
android:gravity="start|center_vertical"
android:hyphenationFrequency="full"
android:maxLines="1"
android:text="@string/app_name"
android:textColor="@color/drawer_header_font_color"
android:textStyle="bold"
app:autoSizeMaxTextSize="@dimen/drawer_header_newpipe_title_max_text_size"
app:autoSizeMinTextSize="@dimen/drawer_header_newpipe_title_min_text_size"
app:autoSizeTextType="uniform"
tools:ignore="UnusedAttribute"
tools:text="NewPipe" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:background="@drawable/drawer_header_bottom_background"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="6dp"
android:paddingRight="6dp">
<LinearLayout
android:layout_width="0dp"
android:layout_height="32dp"
android:layout_weight="1"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/drawer_header_service_icon"
android:layout_width="@dimen/drawer_header_service_icon_size"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:scaleType="fitCenter"
app:tint="@color/drawer_header_font_color"
tools:ignore="ContentDescription"
tools:srcCompat="@drawable/place_holder_youtube" />
<TextView
android:id="@+id/drawer_header_service_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/drawer_header_font_color"
android:textSize="@dimen/drawer_header_service_title_text_size"
tools:text="YouTube" />
</LinearLayout>
<ImageView
android:id="@+id/drawer_arrow"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="4dp"
app:srcCompat="@drawable/ic_expand_more_white_24dp"
tools:ignore="ContentDescription" />
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/drawer_header_action_button"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="?selectableItemBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>