Skip to content

Commit

Permalink
Fix toolbar height in landscape view
Browse files Browse the repository at this point in the history
  • Loading branch information
simonebortolin committed Dec 26, 2017
1 parent 9e1018e commit 1080c19
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.View;

/**
Expand All @@ -16,7 +17,12 @@ public class ScalingLayoutBehavior extends CoordinatorLayout.Behavior<ScalingLay

public ScalingLayoutBehavior(Context context, AttributeSet attrs) {
super(context, attrs);
toolbarHeightInPixel = context.getResources().getDimensionPixelSize(R.dimen.sl_toolbar_size);
//toolbarHeightInPixel = context.getResources().getDimensionPixelSize(R.dimen.sl_toolbar_size);
TypedValue tv = new TypedValue();
if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true))
{
toolbarHeightInPixel = TypedValue.complexToDimensionPixelSize(tv.data,context.getResources().getDisplayMetrics());
} else toolbarHeightInPixel = 0f;
}

@Override
Expand Down

0 comments on commit 1080c19

Please sign in to comment.