android-collapsingtoolbarlayout

create typeface from font resource id

喜夏-厌秋 提交于 2019-12-09 14:00:34
问题 I have tried using Typeface.createFromAsset(getAssets(),"font/myfont.ttf")); I know font directory should be in assets but in my case, I have an existing font resource directory so I thought asset manager will read from font resource directory but I was wrong. I am creating Typeface to set custom font for collapsingToolbarLayout. I found this answer but it requires me to keep font in assets 回答1: This worked Typeface typeface = ResourcesCompat.getFont(this, R.font.app_font); Found this in the

Expand appbarlayout when recyclerview is scrolled/fling to top

血红的双手。 提交于 2019-12-09 08:56:14
问题 I implemented a collapsingtoolbar layout with a recyclerview as shown in the sample code attached. My issue is that, when I fling the list downward, it does not go all the way to the top. What happens is that, the scrolling stops right at the point where the AppBarLayout is supposed to end. The effect that I want is upon flinging the list downward, the list will go all the way to the top AND reveal/expand the AppBarLayout My minSdk is 14. Any help or suggestion is greatly appreciated. <?xml

Menu item on bottom of CollapsingToolbarLayout when expanded

不羁岁月 提交于 2019-12-09 06:54:55
问题 I've been searching for a while as shown on the following images but unfortunately I was not able to find anything similar edit menu item is moving to bottom of CollapsingToolbarLayout when it is expanded I tried a long combination of atributes for menu item but without success This is my attempt My screen xml <?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

Stop scroll on CollapsingToolbarLayout so it doesn't completely collapse

自作多情 提交于 2019-12-08 23:03:33
问题 I have a CollapsingToolbarLayout setup and im placing a wallpaper there. I want to be able to stop it from collapsing all the way. I have tried minheight and many other things but can't figure it out. How can i get it to stop collapsing to the second screenshot? View when activity is loaded Desired Stopping Point Current Stopping Point 回答1: CollapsingToolbarLayout works really closely with Toolbar and as such the collapsed height depends on the toolbar. I was able to solve your problem using

Collapsing toolBar Layout with Viewpager inside NestedScrollView

三世轮回 提交于 2019-12-08 17:21:07
问题 I am using Collapsing ToolBar Layout with NestedScrollView and Viewpager inside nested Scrollview. I am having 3 tabs and having 3 fragments for these tabs. These fragments are using RecyclerView to set data. Now with the nestedScrollView and viewpager, when I scroll the RecyclerView content, the collapsing effect is not working with this. I need to put NestedScrollView also, as I am having some info that I need to show above Tabs. Here is my code: <android.support.design.widget.AppBarLayout

How to correctly implement view content behind statusbar when using fragments

喜你入骨 提交于 2019-12-08 16:28:31
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/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name=

When not collapsed some part of the the toolbar is visible over the ImageView of CollapsingToolbarLayout

被刻印的时光 ゝ 提交于 2019-12-08 16:14:38
The CollapsingToolbarView works perfectly fine, but there is this unwanted strip on the ImageView of the collapsing toolbar. As you can see below there is a red strip (possibly toolbar) after the status bar. How do I get rid of it? Below is the relevant xml file: fragment_movie.xml <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_height="match_parent" android:layout_width="match_parent" android:fitsSystemWindows="true"

Appbar fitsSystemWindows - Inside a ViewPager

僤鯓⒐⒋嵵緔 提交于 2019-12-08 13:09:19
问题 I have an Activity that contains a ViewPager : activity.xml: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"/> </FrameLayout> The fragments this pager contains – which are all generated from the same

CollapsingToolbarLayout & NestedScrollView don't work together

南楼画角 提交于 2019-12-08 10:28:19
问题 I'm trying to make CollapsingToolbarLayout work with NestedScrollView , but it doesn't follow the scrolling of NestedScrollView correctly. It moves a little bit when the NestedScrollView reaches the top or bottom end, but that's clearly not the intended behavior. Oh, and the contentScrim covers the ImageView immediately as well. Here's a video of what happens: https://youtu.be/1GlTJq5fd0U And here's the xml: <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas

Snackbar and CollapsingToolbarLayout with TranslucentNavigation

为君一笑 提交于 2019-12-08 07:35:30
I have Created an app with Scrolling Activity from the Android Studio Templets to test my coding of my main App affects that behavior or not, so I have just add to the code : <item name="android:windowTranslucentNavigation" tools:targetApi="kitkat">true</item> that shows the Snackbar behind the navigation bar as this screenshot (PS : I am using Xstane for redesigning my Navigation bar on my mobile but I think that does not affect the code cuz i have tried TranslucentNavigation with Snackbar Without CollapsingToolbarLayout and that works well) the App is supporting windowTranslucentNavigation