Skip to content

Commit

Permalink
Refactored.
Browse files Browse the repository at this point in the history
  • Loading branch information
ksoichiro committed Jun 1, 2015
1 parent 5aa73be commit e85cc3f
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public class FlexibleSpaceToolbarWebViewActivity extends BaseActivity implements
private View mToolbarView;
private TextView mTitleView;
private int mFlexibleSpaceHeight;
private WebView mWebView;
private View mWebViewContainer;


Expand All @@ -57,20 +56,20 @@ protected void onCreate(Bundle savedInstanceState) {
setTitle(null);
mToolbarView = findViewById(R.id.toolbar);

mWebView = (WebView) findViewById(R.id.webView);
mWebViewContainer = findViewById(R.id.webViewContainer);

final ObservableScrollView scrollView = (ObservableScrollView) findViewById(R.id.scroll);
scrollView.setScrollViewCallbacks(this);

mWebView.loadUrl("file:///android_asset/lipsum.html");
WebView webView = (WebView) findViewById(R.id.webView);
webView.loadUrl("file:///android_asset/lipsum.html");

mFlexibleSpaceHeight = getResources().getDimensionPixelSize(R.dimen.flexible_space_height);
int flexibleSpaceAndToolbarHeight = mFlexibleSpaceHeight + getActionBarSize();

final FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) mWebView.getLayoutParams();
final FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) webView.getLayoutParams();
layoutParams.topMargin = flexibleSpaceAndToolbarHeight;
mWebView.setLayoutParams(layoutParams);
webView.setLayoutParams(layoutParams);

mFlexibleSpaceView.getLayoutParams().height = flexibleSpaceAndToolbarHeight;

Expand Down

0 comments on commit e85cc3f

Please sign in to comment.