1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-25 13:52:08 +01:00

Removed unnecessary and buggy collapsableToolbarLayout

This commit is contained in:
vanitasvitae 2016-08-07 01:51:07 +02:00
parent 6534a89721
commit e1b02c42d2
3 changed files with 4 additions and 23 deletions

View file

@ -40,7 +40,6 @@ import android.os.StrictMode;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.design.widget.AppBarLayout; import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.NavigationView; import android.support.design.widget.NavigationView;
import android.support.design.widget.Snackbar; import android.support.design.widget.Snackbar;
import android.support.v4.content.LocalBroadcastManager; import android.support.v4.content.LocalBroadcastManager;
@ -158,8 +157,6 @@ public class MainActivity extends AppCompatActivity
@BindView(R.id.main__layout) @BindView(R.id.main__layout)
DrawerLayout navDrawer; DrawerLayout navDrawer;
@BindView(R.id.collapsing_toolbar)
CollapsingToolbarLayout toolbarTopCollapsing;
// NavHeader cannot be bound by Butterknife // NavHeader cannot be bound by Butterknife
@ -251,7 +248,7 @@ public class MainActivity extends AppCompatActivity
} }
if (!appSettings.isIntellihideToolbars()) { if (!appSettings.isIntellihideToolbars()) {
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbarTopCollapsing.getLayoutParams(); AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbarTop.getLayoutParams();
params.setScrollFlags(0); // clear all scroll flags params.setScrollFlags(0); // clear all scroll flags
} }

View file

@ -44,12 +44,10 @@ public class BottomBarBehavior extends CoordinatorLayout.Behavior<LinearLayout>
if (defaultDependencyTop == -1) { if (defaultDependencyTop == -1) {
defaultDependencyTop = dependency.getTop(); defaultDependencyTop = dependency.getTop();
} }
Log.d("BOTTOMBAR", "c.h"+child.getHeight()+" c.top"+child.getTop()
+" c.tran_y"+child.getTranslationY()
+" d.h"+dependency.getHeight()+" d.top"+dependency.getTop()
+"d.tran_y"+dependency.getTranslationY());
if(dependency.getTop()<0) if(dependency.getTop()<0)
child.setTranslationY(-dependency.getTop() + defaultDependencyTop); child.setTranslationY(-dependency.getTop() + defaultDependencyTop);
else
child.setTranslationY(defaultDependencyTop);
return true; return true;
} }

View file

@ -4,25 +4,13 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".activity.MainActivity"> tools:context=".activity.MainActivity">
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout android:theme="@style/AppTheme.AppBarOverlay">
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="81dp"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|enterAlways|snap"
app:titleEnabled="false">
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
@ -32,8 +20,6 @@
app:layout_scrollFlags="scroll|enterAlways" app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay" /> app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
<include layout="@layout/main__content" /> <include layout="@layout/main__content" />