From c84b866bade7ea9aba03e3df5726b7985712d5bf Mon Sep 17 00:00:00 2001 From: Saul M Date: Wed, 26 Aug 2015 01:22:00 +0200 Subject: [PATCH] Minor refactorizations --- app/src/main/AndroidManifest.xml | 2 +- .../saulmm/myapplication/AvatarImageBehavior.java | 14 +++++--------- .../java/saulmm/myapplication/MainActivity.java | 2 ++ app/src/main/res/layout/activity_main.xml | 1 + app/src/main/res/values/example_resources.xml | 4 ++-- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 2935a78..6651a24 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,10 +9,10 @@ android:theme="@style/AppTheme" > - diff --git a/app/src/main/java/saulmm/myapplication/AvatarImageBehavior.java b/app/src/main/java/saulmm/myapplication/AvatarImageBehavior.java index 32ba923..c237b7f 100644 --- a/app/src/main/java/saulmm/myapplication/AvatarImageBehavior.java +++ b/app/src/main/java/saulmm/myapplication/AvatarImageBehavior.java @@ -45,15 +45,11 @@ public boolean layoutDependsOn(CoordinatorLayout parent, CircleImageView child, return dependency instanceof Toolbar; } - int mStartYPosition = 0; - - int mFinalYPosition = 0; - - int finalHeight = 130; - - int mStartHeight = 0; - - int mFinalXPosition = 0; + private int mStartYPosition = 0; + private int mFinalYPosition = 0; + private int finalHeight = 0; + private int mStartHeight = 0; + private int mFinalXPosition = 0; @Override public boolean onDependentViewChanged(CoordinatorLayout parent, CircleImageView child, View dependency) { diff --git a/app/src/main/java/saulmm/myapplication/MainActivity.java b/app/src/main/java/saulmm/myapplication/MainActivity.java index 9331292..82f8ead 100644 --- a/app/src/main/java/saulmm/myapplication/MainActivity.java +++ b/app/src/main/java/saulmm/myapplication/MainActivity.java @@ -39,6 +39,7 @@ protected void onCreate(Bundle savedInstanceState) { bindActivity(); + mToolbar.setTitle(""); setSupportActionBar(mToolbar); startAlphaAnimation(mTitle, 0, View.INVISIBLE); mAppBarLayout.addOnOffsetChangedListener(this); @@ -53,6 +54,7 @@ private void bindActivity() { mAppBarLayout = (AppBarLayout) findViewById(R.id.main_appbar); mImageparallax = (ImageView) findViewById(R.id.main_imageview_placeholder); mFrameParallax = (FrameLayout) findViewById(R.id.main_framelayout_title); + } private void initParallaxValues() { diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 536c472..6156a8d 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -116,6 +116,7 @@ android:background="@color/primary" app:layout_anchor="@id/main.framelayout.title" app:theme="@style/ThemeOverlay.AppCompat.Dark" + app:title="" > 120dp 300dp - 56dp + 48dp - + Coordinator example Quila I love bones and slippers Quila!