android-design-library

How to properly hide&show the actionbar using the new design library API?

↘锁芯ラ 提交于 2019-11-30 03:04:00
Background Suppose I have these elements in the activity: actionbar (actually a Toolbar) tabs (using TabLayout ) ViewPager, with fragments. each fragment has ListVIew/RecyclerView. I wish to have the same behavior as on many apps, that when scrolling, the action bar will hide or show. A perfect example for it is how the Play Store scrolling works. Something like this (but with ListView in the fragments of course) : The problem I've found the " Android-ObservableScrollView " library which shows how to do it for many types of scrolling views, but it doesn't handle the case of the new TabLayout

how to implement collapsing image view like Google IO 2015 App using Design Library

佐手、 提交于 2019-11-30 02:26:06
How to implement collapsing toolbar layout design like Google IO 2015 using Design Library In Open Source Code of Google IO 2015, it is not implemented using Design Library (CoordinatorLayout, CollapsingToolbarLayout etc) Note : In this the toolbar is at the bottom in upper section. I need the toolbar to be scrolling like this attached with the textview or any other view of upper section. Finally i was able to implement it. <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas

How to animate FloatingActionButton of new Design Support Library

北城余情 提交于 2019-11-30 02:05:38
I am using a TabLayout with 5 different fragments. On 3 of these fragments a android.support.design.widget.FloatingActionButton should appear. Right now I simply set the visibility of the FAB when the tab changes, but I would like to have an animation, where the FAB comes in and out. How can I achieve this in Android? The hide/show animation for shrink/pop are automatically handled by the new version of the Support Library.(22.2.1) Then OnTabChange listener show or hide the floating action button using show/hide methods provided by the new library. fab.show(); or fab.hide(); The design support

NestedScrollView and WebView height issue

扶醉桌前 提交于 2019-11-30 01:55:48
I use new android.support.v4.widget.NestedScrollView and I faced with issue. Here is my layout: <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="250dp"> <android.support.design.widget.CollapsingToolbarLayout android:layout_width="match_parent" android:layout_height="match_parent" app:contentScrim="?attr/colorPrimary" app:layout_scrollFlags="scroll|exitUntilCollapsed"> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_collapseMode="parallax" app:layout_collapseParallaxMultiplier="0.7"> <!--

How to make custom CoordinatorLayout.Behavior with parallax scrolling effect for google MapView?

旧街凉风 提交于 2019-11-29 22:52:02
问题 I try to make a parallax scrolling effect for google MapView and RecycleView using CoordinatorLayour . so base on some tutorials found on web I made below code. The layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools

How to use setDuration() method in SnackBar (Android Design Support Library)

此生再无相见时 提交于 2019-11-29 22:06:06
From Documentation: parameter duration - either be one of the predefined lengths: LENGTH_SHORT, LENGTH_LONG, or a custom duration in milliseconds . But I can't set custom duration. For example Snackbar .make(parentLayout, "Feed cat?", 8000) // try here .setAction("Yes", snackOnClickListener) .setActionTextColor(Color.MAGENTA) .setDuration(8000) // try here .show(); but instead of 8 seconds Snackbar gone quickly. CommonsWare Based on the implementation of Snackbar and SnackbarManager , I can confirm Eugene H's assessment: it's a bug. From SnackbarManager : private void scheduleTimeoutLocked

Using Support Design Library in Eclipse

会有一股神秘感。 提交于 2019-11-29 22:03:35
问题 I'm working on a project that unfortunately hasn't been migrated to Android Studio yet. I want to utilize the floating action button in Google's new support.design library but I can't manage to get it included in my project. I updated the support libraries in the Android SDK Manager. First, I tried importing the library into Eclipse and adding it as a dependency using Project → Properties → Android on my app but the design project isn't showing up as a library project. Then I tried copying

Using Google Design Library how to hide FAB button on Scroll down?

感情迁移 提交于 2019-11-29 20:26:58
Google have released Design library, I am using compile 'com.android.support:design:22.2.1' However I cant see any code examples of how to use this library and how to animate the FAB bar on scroll. I guess I can listen for scroll events on the ListView and then animate the button myself, but is this not baked into the API (is this not the point of this support library). Is there examples for this ? If you're using RecyclerView and you're looking for something simple, you can try this: recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener(){ @Override public void onScrolled

Android L - Floating Action Button (FAB)

孤街浪徒 提交于 2019-11-29 19:40:41
Did Google already released a defined style or a component for this new circular FAB button or should I implement the design on my own? The button is described here: Google Design | Floating Action Buttons EDIT (05/2015): Check Lukas' answer / Gabriele's answer showing an easy way to implement it with the design support library. Daniele Segato UPDATE : there's now an official widget for FAB: FloatingActionButton, see Gabriele Mariotti reply for full information. According to Adam Powell and Chet Haase they didn't create a widget for the FAB button cause it's a very easy component to reproduce.

NavigationView and ActionBarDrawerToggle

五迷三道 提交于 2019-11-29 18:45:41
问题 With the new NavigationView is it still recommended to use ActionBarDrawerToggle or is this not "Material Design"? For instance previously we were supposed to hide action bar items when the drawer was opened but now the guidelines say that they should stay. 回答1: With the new NavigationView is it still recommended to use ActionBarDrawerToggle No, it's not required. If you look at the "official" demo code for the new Design Library, ActionBarDrawerToggle is no longer used, since the new