35

First Image Second image Third imageukład Collapsing pasek z logo, tytuł, podtytuł w pasku

chcę to zrobić, ale z Collapsing układ paska narzędzi lub wyświetlanie logo i tytuł w pasku po zwoju.

<!-- Toolbars --> 
<android.support.design.widget.AppBarLayout 
    android:id="@+id/appbar" 
    android:layout_width="match_parent" 
    android:layout_height="@dimen/detail_backdrop_height" 
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
    android:fitsSystemWindows="true"> 

    <android.support.design.widget.CollapsingToolbarLayout 
     android:id="@+id/collapsing_toolbar_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_scrollFlags="scroll|exitUntilCollapsed" 
     app:contentScrim="?attr/colorPrimary" 
     app:expandedTitleMarginStart="48dp" 
     app:expandedTitleMarginEnd="64dp" 
     android:fitsSystemWindows="true"> 

     <ImageView 
      android:id="@+id/background_image" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:scaleType="centerCrop" 
      android:src="@drawable/background_1" 
      app:layout_collapseMode="parallax" 
      android:fitsSystemWindows="true"/> 

     <RelativeLayout 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:fitsSystemWindows="true"> 

      <ImageView 
       android:id="@+id/avatar_image" 
       android:layout_width="@dimen/circular_image_avatar" 
       android:layout_height="@dimen/circular_image_avatar" 
       android:gravity="center" 
       android:scaleType="centerCrop" 
       android:src="@drawable/ic_placerholder" 
       android:layout_centerVertical="true" 
       android:layout_centerHorizontal="true" 
       android:transitionName="image_toolbar"/> 

      <TextView 
       android:id="@+id/profile_title" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:text="Name title" 
       android:textAlignment="center" 
       android:layout_marginTop="@dimen/item_padding_top_bottom" 
       android:gravity="center" 
       style="@style/titleText_toolbar" 
       android:layout_below="@+id/avatar_image" 
       android:transitionName="title_toolbar"/> 
      <TextView 
       android:id="@+id/profile_subtitle" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:text="Subtitle" 
       android:textAlignment="center" 
       android:gravity="center" 
       style="@style/captionText_toolbar" 
       android:layout_below="@+id/profile_title" /> 

     </RelativeLayout> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar" 
      android:layout_height="?attr/actionBarSize" 
      android:layout_width="match_parent" 
      app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
      app:layout_collapseMode="pin"> 

      <!-- avatar image and title, subtitle --> 

     </android.support.v7.widget.Toolbar> 

    </android.support.design.widget.CollapsingToolbarLayout> 

</android.support.design.widget.AppBarLayout> 

Proszę mi pomóc

+0

Jaki kod próbowałeś? Jakie problemy napotykasz? Opisz to bardziej, a my (prawdopodobnie) pomożemy. –

+0

http://i.imgur.com/Yj7pe5Y.jpg http://i.imgur.com/AUVokgc.jpg http://i.imgur.com/dqWq3Fp.jpg Niestety nie mam ma 10 reputacji dla zdjęć pocztowych :( – tonilopezmr

+0

Kod jest nieistotny w tym przypadku, chcę wiedzieć jak to zrobić – tonilopezmr

Odpowiedz

2

smooth-app-bar-układ

zobaczyć Example

Instalacja

compile "me.henrytao:smooth-app-bar-layout:<latest-version>" 

enter image description here

enter image description here

Powiązane problemy