android-design-library

CoordinatorLayout using the ViewPager's RecyclerView

扶醉桌前 提交于 2019-11-26 12:55:47
问题 I am using the view CoordinatorLayout from android.support.design . I want to attach the app:layout_behavior to the fragment\'s RecyclerView ? In the example given by Google, they only attach it in the RecyclerView of the same XML file where the CoordinatorLayout was attached. Is there a way to attach CoordinatorLayout to the fragment\'s RecyclerView within the ViewPager ? The sample is in this blog post at Android Developers blog. 回答1: Chris Banes has posted a sample on Github which shows

How to create a simple divider in the new NavigationView?

狂风中的少年 提交于 2019-11-26 12:46:16
Google introduced the NavigationView in the Design Support Library version 22.2.0 with which you can create a drawer very easily using a menu resource. How can I create a simple divider line between two items? Grouping the items didn't work. Creating a sub items section does create a divider line, but it requires a title, which I don't want. Any help would be appreciated. N J All you need to do is define a group with an unique ID , I have checked the implementation if group has different id's it will create a divider. Example menu, creating the separator: <menu xmlns:android="http://schemas

How to use a TabLayout with Toolbar inside CollapsingToolbarLayout?

安稳与你 提交于 2019-11-26 12:16:43
问题 I am looking at the chrisbanes/cheesesquare and I am trying to put TabLayout with a Toolbar inside a CollapsingToolbarLayout, and here is my code <android.support.design.widget.CoordinatorLayout xmlns:android=\"http://schemas.android.com/apk/res/android\" xmlns:app=\"http://schemas.android.com/apk/res-auto\" android:id=\"@+id/main_content\" android:layout_width=\"match_parent\" android:layout_height=\"match_parent\" android:fitsSystemWindows=\"true\"> <android.support.v4.view.ViewPager

onClick method not working properly after NestedScrollView scrolled

此生再无相见时 提交于 2019-11-26 12:05:40
问题 I used NestedScrollView with CoordinatorLayout to enable scroll animation for Toolbar (by app:layout_scrollFlags=\"scroll|enterAlways\"). NestedScrollView contain the LinearLayout as the root child, I put the 2 TextViews into LinearLayout to enable expand/collapse animation. The one was set Visible and other one was set to Gone. And switching visibility by onClick event of LinearLayout Normally, everything work as expected but when I scrolled the NestedScrollView the onClick event not working

Error when using any Android Design Support Library Elements

北城以北 提交于 2019-11-26 10:57:58
问题 Error inflating anything from the design support library xml <android.support.design.widget.FloatingActionButton android:layout_width=\"wrap_content\" android:layout_height=\"wrap_content\"/> build.gradle dependencies { compile \'com.android.support:support-v4:22.2.0\' compile \'com.android.support:design:22.2.0\' compile \'com.android.support:multidex:1.0.1\' compile \'com.android.support:support-v13:22.2.0\' compile \'com.android.support:appcompat-v7:22.2.0\' project build.gradle

Set starting height of CollapsingToolbarLayout

孤街浪徒 提交于 2019-11-26 10:29:31
问题 I want to be able to scroll on the ImageView inside the CollapsingToolbarLayout. So how that would be possible, and How to set a starting height of that Image view? My ImageView height is 280p, at the start of the activity I want to show 200p and then I can scroll down to see the rest of the Image. I have seen something similar in WhatsApp application. Here is a link to see what I want : My code : <?xml version=\"1.0\" encoding=\"utf-8\"?> <android.support.design.widget.CoordinatorLayout

Android TabLayout Android Design

我是研究僧i 提交于 2019-11-26 09:17:46
问题 I\'m trying to get the new TabLayout in the android design library working. I\'m following this post: http://android-developers.blogspot.com/2015/05/android-design-support-library.html and the documentation: http://developer.android.com/reference/android/support/design/widget/TabLayout.html And have come up with the following code in my activity but the tablayout isn\'t showing up when I run the activity. I tried adding in the activity layout file, but it says it can\'t find that xml tag.

Overlap scrolling view with AppBarLayout

三世轮回 提交于 2019-11-26 08:57:37
问题 I want to implement the \'Flexible Space with overlapping content\' pattern from the Material design scrolling techniques, such as in this video: My XML layout right now looks like: <android.support.design.widget.CoordinatorLayout android:layout_width=\"match_parent\" android:layout_height=\"match_parent\"> <android.support.design.widget.AppBarLayout android:layout_width=\"match_parent\" android:layout_height=\"192dp\" android:theme=\"@style/ThemeOverlay.AppCompat.Dark.ActionBar\"> <android

How to add shadow to the FAB provided with the android support design library?

给你一囗甜甜゛ 提交于 2019-11-26 08:19:59
问题 The title is pretty self explaining. The following code does not render shadow below the Floating Action Button. What can be done to render shadow? Is this feature really not supported even on API 21+? <android.support.design.widget.FloatingActionButton android:layout_height=\"wrap_content\" android:layout_width=\"wrap_content\" android:src=\"@drawable/ic_add\" android:clickable=\"true\" /> Note: Adding android:elevation does not add shadow on API 21. Screenshot taken from the example by

Changing the background color of a Tab in TabLayout (Android design support library) doesn&#39;t occupy the entire tab space

和自甴很熟 提交于 2019-11-26 07:29:28
问题 I have a TabLayout (design support library) which is tied up to a ViewPager containing three tabs. I have designed a custom layout and set that to each tab in the TabLayout. I have been trying to change the background color of the currently selected tab. The color only wraps up around the text in the tab but doesn\'t occupy the entire tab space. Below are the code snippets of my activity and the custom layout file. Activity code public class CustomTabLayoutActivity extends AppCompatActivity {