android-collapsingtoolbarlayout

How to implement snapping in CollapsingToolbarLayout?

半腔热情 提交于 2019-12-23 10:08:27
问题 I have a collapsing toolbar layout, below that a tab layout and below that the corresponding viewpager. I want to implement snapping such that when I collapse the collapsing toolbar layout more than half and leave it, it should snap and collapse completely. How do I do it? Here is my actual 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

Disable CollapsingToolbarLayout

为君一笑 提交于 2019-12-23 04:45:47
问题 my application provide different contents, some of them is with image and others not. For those which have image i am using CollapsingToolbarLayout it works fine but for those which have not image I want collapse CollapsingToolbarLayout and prevent expanding, disable it. Here is my item activity code: public class ItemActivity extends BaseActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_item);

How to correctly implement view content behind statusbar when using fragments

大兔子大兔子 提交于 2019-12-23 02:32:57
问题 I'm trying put my ImageBackdrop from the collapsing toolbar behind the statusBar, I've done it right with the Drawer and the navigationView but I can't do it with my fragments, In the cheesequare demo, Chris did it, and I can do it that way, but it's not using a single activity app and fragment transitions, so that's not quite what I'm looking for. My style: <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color

How to show SearchView Outside/Below toolbar

倖福魔咒の 提交于 2019-12-22 18:36:07
问题 LIKE THIS SCREENSHOT - the SearchBar outside/below-toolbar in snapdeal, flipkart app... How to add searchbar below or outside the toolbar.. Please suggest with a layout... 回答1: This is most likely a custom component, you can use a button and switch it to an EditText with the icons you prefer or use a button directly to launch the search view: For example to achieve this you can: 1) Have a drawable with radius of 2dp and use it as the background of your component <?xml version="1.0" encoding=

CollapsingToolbarLayout expand programmatically animation duration

℡╲_俬逩灬. 提交于 2019-12-21 20:55:32
问题 I'm using CollapsingToolbarLayout in my application in Android. My app's minimum requirement API is 9. I need the collapsed toolbar to be expanded when the user clicks in the collapsed one, just like in latest Gmail Calendar's app. So I set an onClickListener and inside it I do the following: public void onClick(View v) { if(toolbarExpanded) { mAppBar.setExpanded(false, true); } else { mAppBar.setExpanded(true, true); } toolbarExpanded = !toolbarExpanded; } Which is working quite well but my

How to have a textview transition to the title in a collapsing toolbar?

回眸只為那壹抹淺笑 提交于 2019-12-21 05:32:15
问题 I have a CollapsingToolbarLayout that contains a TextView and a RatingBar under the TextView . Would it be possible to have the TextView somehow transition to the title? My current layout looks like this: I want "Title" to transition up as the toolbar collapses. There will also be a back button, so how would I ensure that the textview transitions to the proper place (to the right side of the back button)? EDIT: Here is my XML <android.support.design.widget.CoordinatorLayout android:id="@+id

How to change toolbar icons color on collapsing

好久不见. 提交于 2019-12-21 04:04:43
问题 I'm using CoordinatorLayout in my project . It works fine but there is a problem I need to fix .I'm using white actionbar icons and When the CoordinatorLayout is expanded and the background color is white, I can't see any of those icons . I saw this in an application . when the CoordinatorLayout is expanded , the icons are dark and when scrolling down, they begin to change into white . as you can see, when it's expanded the icons are dark and when it closes , the icons becomes white . it

Collapsible Toolbar: Set how much the toolbar should be collapsed in onCreate

帅比萌擦擦* 提交于 2019-12-21 03:36:34
问题 I'm creating a ListView and its corresponding DetailView application. My ListView has items which if clicked take the user to the DetailViewActivity . On the DetailViewActivity , I've implemented a Collapsible Toolbar. Now, every time the DetailViewActivity is opened, a different image (with different dimensions) is set onto the ImageView within the Collapsible Toolbar. I want that the Toolbar should be open up to a certain height by default (say 256dp), but if the image height is greater

Collapsing toolbar and nestedscrollview not scrolling smoothly

大兔子大兔子 提交于 2019-12-21 03:25:36
问题 Nested scroll view scrolls smoothly on scrolling down but on scroll up it is sluggish.Collapsing toolbar(with an image view and framelayout) upon scrolling up doesn't renders its content(remains blank). I have tried every flag in collapsing toolbar. <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:id="@+id/coordinatorLayout"

Dealing With RecyclerView, NestedScrollView, and CardView

淺唱寂寞╮ 提交于 2019-12-21 01:57:13
问题 I'm going to achieve this UI in my App: Well, Some ways that I tried before: 1. Using CollapsingToolbarLayout I put my CardView insid of CollapsingToolbarLayout and put them all in AppBarLAyout. <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="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">