Thursday, 3 December 2015

XML : Collapsing toolbar layout Animation is slow/lagging/not fluid

I'm trying to recreate the WhatsApp profile Design and everything does what it should by the collapsing toolbar is very slow/lagging/not fluid. Does anyone had this problem before an knows how to fix it?

Thankful for any help!!!

Activity_mein_profil xml

  <?xml version="1.0" encoding="utf-8"?>  <android.support.design.widget.CoordinatorLayout 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="match_parent"      android:fitsSystemWindows="true"      tools:context="com.appmac.ron.profile.ScrollingActivity">        <android.support.design.widget.AppBarLayout          android:id="@+id/app_bar"          android:layout_width="match_parent"          android:layout_height="@dimen/app_bar_height"          android:fitsSystemWindows="true"          android:theme="@style/AppTheme.AppBarOverlay">            <android.support.design.widget.CollapsingToolbarLayout              android:id="@+id/toolbar_layout"              android:layout_width="match_parent"              android:layout_height="match_parent"              android:fitsSystemWindows="true"              app:contentScrim="?attr/colorPrimary"              app:layout_scrollFlags="scroll|exitUntilCollapsed">                <ImageView                  android:layout_width="match_parent"                  android:layout_height="350dp"                  android:scaleType="centerCrop"                  android:src="@drawable/mysquad"                  app:layout_collapseMode="parallax"                  />                <android.support.v7.widget.Toolbar                  android:id="@+id/toolbar"                  android:layout_width="match_parent"                  android:layout_height="?attr/actionBarSize"                  app:layout_collapseMode="pin"                  app:popupTheme="@style/AppTheme.PopupOverlay" />            </android.support.design.widget.CollapsingToolbarLayout>      </android.support.design.widget.AppBarLayout>        <include layout="@layout/content_mein_profil" />        <android.support.design.widget.FloatingActionButton          android:id="@+id/fab"          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:layout_margin="@dimen/fab_margin"          android:src="@drawable/ic_mode_edit_white_48dp"          app:backgroundTint="#ff4d00"          app:layout_anchor="@id/app_bar"          app:layout_anchorGravity="bottom|end" />    </android.support.design.widget.CoordinatorLayout>    

Content_mein_profil xml

  <?xml version="1.0" encoding="utf-8"?>  <android.support.v4.widget.NestedScrollView      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="match_parent"      app:layout_behavior="@string/appbar_scrolling_view_behavior"      tools:context="com.appmac.ron.profile.ScrollingActivity"      tools:showIn="@layout/activity_mein_profil">        <android.support.v7.widget.CardView          xmlns:card_view="http://schemas.android.com/apk/res-auto"          android:layout_width="match_parent"          android:layout_height="200dp"          android:id="@+id/cardViewMeineKarte"          card_view:cardCornerRadius="0dp"          android:layout_marginRight="10dp"          android:layout_marginLeft="10dp"          android:layout_marginTop="15dp">            <RelativeLayout              android:layout_width="match_parent"              android:layout_height="wrap_content">                <TextView                  android:layout_width="match_parent"                  android:layout_height="wrap_content"                  android:textAppearance="?android:attr/textAppearanceLarge"                  android:text="Profil Informationen"                  android:id="@+id/meinProfilProfilInformation"                  android:textColor="#0d567b"                  android:typeface="sans"                  android:textStyle="bold"                  android:textSize="14dp"                  android:layout_marginRight="10dp"                  android:layout_marginLeft="10dp"                  android:layout_marginTop="10dp"/>                <View                  android:layout_width="wrap_content"                  android:layout_height="1dp"                  android:background="#e4e4e4"                  android:id="@+id/meinProfilTrennstrich"                  android:layout_below="@+id/meinProfilProfilInformation"                  android:layout_marginTop="5dp"                  android:layout_marginRight="10dp"                  android:layout_marginLeft="10dp"/>                <TextView                  android:layout_width="match_parent"                  android:layout_height="match_parent"                  android:textAppearance="?android:attr/textAppearanceSmall"                  android:id="@+id/meinProfilNickname"                  android:textSize="14dp"                  android:text="Text 1"                  android:textColor="#6a6a6a"                  android:layout_marginLeft="10dp"                  android:layout_marginRight="10dp"                  android:layout_marginTop="5dp"                  android:layout_below="@+id/meinProfilTrennstrich"                  android:textStyle="bold" />                <TextView                  android:layout_width="match_parent"                  android:layout_height="match_parent"                  android:textAppearance="?android:attr/textAppearanceSmall"                  android:id="@+id/meinProfilAlter"                  android:textSize="14dp"                  android:text="Text 2"                  android:textColor="#6a6a6a"                  android:layout_marginLeft="10dp"                  android:layout_marginRight="10dp"                  android:layout_marginTop="5dp"                  android:layout_below="@+id/meinProfilNickname"/>                <TextView                  android:layout_width="match_parent"                  android:layout_height="match_parent"                  android:textAppearance="?android:attr/textAppearanceSmall"                  android:id="@+id/meinProfilWebsite"                  android:textSize="14dp"                  android:text="Text 3"                  android:textColor="#6a6a6a"                  android:layout_marginLeft="10dp"                  android:layout_marginRight="10dp"                  android:layout_marginTop="5dp"                  android:layout_below="@+id/meinProfilAlter"/>                <View                  android:layout_width="wrap_content"                  android:layout_height="1dp"                  android:background="#e4e4e4"                  android:id="@+id/meinProfilTrennstrich2"                  android:layout_below="@+id/meinProfilWebsite"                  android:layout_marginTop="5dp"                  android:layout_marginRight="10dp"                  android:layout_marginLeft="10dp"/>                <TextView                  android:layout_width="match_parent"                  android:layout_height="match_parent"                  android:textAppearance="?android:attr/textAppearanceSmall"                  android:id="@+id/meinProfilBiografie"                  android:textSize="14dp"                  android:text="@string/statusId"                  android:textColor="#6a6a6a"                  android:layout_marginLeft="10dp"                  android:layout_marginRight="10dp"                  android:layout_marginTop="5dp"                  android:layout_marginBottom="10dp"                  android:layout_below="@+id/meinProfilTrennstrich2"/>            </RelativeLayout>    </android.support.v7.widget.CardView>    </android.support.v4.widget.NestedScrollView>    

No comments:

Post a Comment