scrolleffect on toolbar

This commit is contained in:
danijoo
2015-11-07 21:01:40 +01:00
parent 6ad0b80502
commit 8c0d97d038
4 changed files with 15 additions and 52 deletions

View File

@@ -29,6 +29,7 @@ dependencies {
compile 'com.android.support:palette-v7:23.1.0' compile 'com.android.support:palette-v7:23.1.0'
compile 'com.android.support:recyclerview-v7:23.1.0' compile 'com.android.support:recyclerview-v7:23.1.0'
compile 'com.android.support:cardview-v7:23.1.0' compile 'com.android.support:cardview-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.squareup.okhttp:okhttp:1.1.0' compile 'com.squareup.okhttp:okhttp:1.1.0'
compile files('libs/volley.jar') compile files('libs/volley.jar')
} }

View File

@@ -1,8 +1,7 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent">
android:orientation="vertical">
<android.support.v4.widget.SwipeRefreshLayout <android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout" android:id="@+id/swipe_refresh_layout"
@@ -15,24 +14,23 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:clipToPadding="false" android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay" android:scrollbarStyle="outsideOverlay"
android:paddingTop="116dp"
android:paddingLeft="@dimen/list_side_margin" android:paddingLeft="@dimen/list_side_margin"
android:paddingRight="@dimen/list_side_margin" android:paddingRight="@dimen/list_side_margin"
android:paddingBottom="28dp" /> android:paddingBottom="28dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
<FrameLayout <android.support.design.widget.AppBarLayout
android:theme="@style/ThemeOverlay.AppCompat.Light"
android:id="@+id/toolbar_container" android:id="@+id/toolbar_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="112dp" android:layout_height="wrap_content"
android:background="?colorPrimary"
android:elevation="8dp"> android:elevation="8dp">
<android.support.v7.widget.Toolbar <android.support.v7.widget.Toolbar
app:layout_scrollFlags="scroll|enterAlways"
android:id="@+id/toolbar" android:id="@+id/toolbar"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" android:theme="@style/ThemeOverlay.AppCompat.Light"
android:layout_marginLeft="@dimen/list_toolbar_side_margin"
android:layout_marginRight="@dimen/list_toolbar_side_margin"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?actionBarSize" android:layout_height="?actionBarSize"
android:layout_gravity="bottom"> android:layout_gravity="bottom">
@@ -44,6 +42,6 @@
android:contentDescription="@string/app_name" /> android:contentDescription="@string/app_name" />
</android.support.v7.widget.Toolbar> </android.support.v7.widget.Toolbar>
</FrameLayout> </android.support.design.widget.AppBarLayout>
</FrameLayout> </android.support.design.widget.CoordinatorLayout>

View File

@@ -1,23 +1,5 @@
<!-- File created by the Android Action Bar Style Generator
Copyright (C) 2012 readyState Software Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources> <resources>
<color name="photo_placeholder">#ccc</color> <color name="photo_placeholder">#ccc</color>
<color name="theme_primary">#04561A</color> <color name="theme_primary">#04561A</color>
<color name="theme_primary_dark">#04561A</color> <color name="theme_primary_dark">#04561A</color>
<color name="theme_accent">#04561A</color> <color name="theme_accent">#04561A</color>

View File

@@ -1,28 +1,10 @@
<!-- File created by the Android Action Bar Style Generator
Copyright (C) 2012 readyState Software Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources> <resources>
<style name="Theme.Bacon" parent="@style/Theme.AppCompat.Light.NoActionBar"> <style name="Theme.Bacon" parent="@style/Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/theme_primary</item>
<item name="colorPrimaryDark">@color/theme_primary_dark</item>
<item name="colorAccent">@color/theme_accent</item>
</style> </style>
<style name="Theme.Bacon.Detail">
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources> </resources>