appbarlayout

Android CoordinatorLayout + AppBarLayout(向上滚动隐藏指定的View)

ⅰ亾dé卋堺 提交于 2020-03-22 03:58:51
在新的Android Support Library里面,新增了CoordinatorLayout, AppBarLayout等. 实现的效果: 向下滚动RecylerView,Tab会被隐藏,向上滚动RecylerView,Tab恢复出现. 这么做的好处在于,用户能有更多的空间位置去看列表里面的内容. 实现步骤: <?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" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation=

AppBarLayout折叠时候的阴影

≡放荡痞女 提交于 2019-12-03 21:27:43
最近在项目中遇到一个需求,AppBarLayout在完全展开时没有阴影,在完全收缩时展示阴影,这个功能可以通过设置StateListAnimator的轻松的实现。 首先,在res/animator目录下建立appbar_elevation.xml文件,如下: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <!--折叠状态下的阴影--> <item app:state_collapsed="true"> <objectAnimator android:propertyName="elevation" android:valueTo="5dp" android:valueType="floatType" /> </item> <!--展开状态下的阴影--> <item app:state_collapsed="false"> <objectAnimator android:propertyName="elevation" android:valueTo="0dp" android:valueType=

requestLayout() improperly called by CollapsingToolbarLayout

匿名 (未验证) 提交于 2019-12-03 08:52:47
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a collapsing toolbar layout which contains an image and on collapse shows the toolbar title. I needed to change the toolbar title font so I added a textview inside toolbar layout. Now I'm getting the following error generated repeatedly whenever I collapse the toolbar. 08-12 13:14:19.604 2263-2263/com.panoroma.admin W/View: requestLayout() improperly called by android.support.design.widget.CollapsingToolbarLayout{2d353cd6 V.ED.... ........ 0,0-1080,390 #7f0c0070 app:id/collapsing_toolbar} during second layout pass: posting in next

AppBarLayout elevation hides toolbar

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to disable the shadow below a transparent AppBarLayout/Toolbar. Here's the layout: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:background="#000"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true" android:background="@android:color

Android: CollapsingToolbarLayout and SwipeRefreshLayout get stuck

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use CollapsingToolbarLayout, RecyclerView and SwipeRefreshLayout together: Xml: Code: swipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container); swipeRefreshLayout.setOnRefreshListener(this); How to allow swipe refresh action only when collapsing toolbar layout is fully expanded and scrollview (recyclerview) on top ? The similar behavior like in Google+ or Inbox application. Wrong: Good: 回答1: Update: This issue has been resolved in the latest version of the support library (23.1.1+). If you are using an older version of

How to reset the Toolbar position controlled by the CoordinatorLayout?

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: The app I'm working on consists of a Navigation Drawer which is implemented in an Activity. The activity layout is as follows: This is a very common pattern, only thing that changes frequently is the Fragment inside the container layout. If any of the Fragment has a scrolling element, upon scrolling, the CoordinatorLayout will happily make position translations, including the Toolbar/AppBarLayout. The real problem here is, when the Fragment gets replaced, the position for the Toolbar remains the same, i.e., if the Toolbar is hidden, it will

CoordinatorLayout/AppBarLayout ExpandableListView being rendered off screen

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Yet more problem in using CoordinatorLayout and AppBarLayout. I'm trying to achieve the basic functionality of having the Toolbar scroll off screen when scrolling down and coming back on screen when scrolling up. However, my current set up is showing a problem: Not only is the Toolbar not scrolling off, the ListView seems to be rendering off screen at the bottom. It's almost as if it's been offset by the AppBarLayout height. Here is a gif describing the issue, note that the final item is cut off also the ScrollBar is off screen: My layout is

CoordinatorLayout布局的使用方式

﹥>﹥吖頭↗ 提交于 2019-12-03 02:27:46
作为Android的控件, CoordinatorLayout已经加入最新的HelloWorld项目中, 也是Material风格的重要组件, 协调(Coordinate)其他组件, 实现联动. 那么让我们来看看这个动画效果怎么用吧? 本文源码的GitHub 下载地址 联动效果 1. 准备 首先新建HelloWorld项目. 在项目的build.gradle文件中, 引入头像控件库和CardView库, 在本例中会使用. compile 'de.hdodenhof:circleimageview:1.3.0' compile 'com.android.support:cardview-v7:23.1.0' compile 'com.jakewharton:butterknife:7.0.1' 2. 页面 在 activity_main.xml 中, 保留CoordinatorLayout和AppBarLayout, 重新编写页面. android:fitsSystemWindows="true" 这句也需要去掉, 本例需要保留最上面的状态栏(status bar), 这个属性会导致重叠, 默认false. activity_main.xml代码 <android.support.design.widget.CoordinatorLayout xmlns:android="http:

Overlaying content above AppBarLayout using new Material Design

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to achieve something like that. (not the FAB or the Snackbar). How can i create a layout, overlaying the AppBarLayout? Like this! (For Example) Like Play Store: My AppBarLayout with CoordinatorLayout and NestedScrollView with RelativeLayout as content looks like this: It would be awesome if someone could help me out. I can not find anything on the internet... Thanks in advance! 回答1: Just add something like app:behavior_overlapTop="64dp" to your NestedScrollView and it will be placed above the expanded toolbar. In addition, you should

Binary XML file line #1: Error inflating class android.support.design.widget.AppBarLayout

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hello Everyone There are many threads avilable in this case ... I was tried everything but no luck . I was new to android background..Iam c# guy,now iam work with xamarin droid...So can anyone explain what is the error.this solution not working only **PRE lolipop devices **. My 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" android:id="@+id/quickreturn_coordinator" android:layout_width