android-collapsingtoolbarlayout

CollapsingToolbarLayout cannot be cast to android.support.v7.widget.Toolbar

坚强是说给别人听的谎言 提交于 2021-02-16 19:03:11
问题 Working on this Collapsing Toolbar layout everything works fine but the moment I add code in the java class Main activity, error shows up and app crashes. Without java code it was working properly. 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/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android

BottomNavigationView overlaps the last item of RecycleView

吃可爱长大的小学妹 提交于 2021-02-11 14:49:12
问题 I have two cases. Both with bug. Root element is ConstraintLayout . Fragment element with NavHostFragment ( RecycleView inside). BottomNavigationView connect to bottom . Bug: doesn't work animation of scrolling by CollapsingToolbarLayout . Root element is CoordinatorLayout . The animation by CollapsingToolbarLayout is work. Bug: BottomNavigationView covers last item of RecycleView . Two gifs. Attention the AppBar and date 5 August 2019 (in the bottom). Please help to fix the layout so that

How to set initial height of CollapsingToolbar without flickering?

痴心易碎 提交于 2021-02-11 12:30:03
问题 I am using a CollapsingToolbar with a NestedScrollView in my layout and I want to display it with half its height when the activity is initially shown, i.e. I want to simulate a scrolling event. I achieved this by dispatching a nested scroll in my activity's onCreate() method. @Override protected void onCreate(Bundle savedInstanceState) { ... NestedScrollView nestedScrollView = findViewById(R.id.scroll_view); nestedScrollView.post(() -> { int appBarHeight = findViewById(R.id.app_bar)

CollapsingToolbarLayout without title animation

﹥>﹥吖頭↗ 提交于 2021-01-27 16:00:05
问题 I am working with CollapsingToolbarLayout . I don't know any methods to pin title in Toolbar. Is there any simple way to achieve this? 回答1: This solution works for me. <android.support.design.widget.CollapsingToolbarLayout app:titleEnabled="false" ... > 回答2: You have to set its title manually in code. CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar); collapsingToolbar.setTitle("Title"); 来源: https://stackoverflow.com/questions/32051529

CollapsingToolbarLayout without title animation

泪湿孤枕 提交于 2021-01-27 15:07:53
问题 I am working with CollapsingToolbarLayout . I don't know any methods to pin title in Toolbar. Is there any simple way to achieve this? 回答1: This solution works for me. <android.support.design.widget.CollapsingToolbarLayout app:titleEnabled="false" ... > 回答2: You have to set its title manually in code. CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar); collapsingToolbar.setTitle("Title"); 来源: https://stackoverflow.com/questions/32051529