Automatically scrolling of NestedScrollView inside CoordinatorLayout doesn't work - android

I have main layout:
<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:fitsSystemWindows="true"
android:focusableInTouchMode="true">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="250dp"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
android:src="#drawable/background"/>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
<android.support.design.widget.TabLayout
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="bottom"
style="#style/RegisterVendorTabLayout"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior"/>
ViewPager has a few fragments. Each fragment has a layout like this:
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#android:color/white"
android:orientation="vertical">
<EditText
android:id="#+id/et_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:imeOptions="actionNext"/>
.....
</LinearLayout>
The problem: if user click on the button Next and some fields are at the bottom of the screen, keyboard will hide these fields and automatically scrolling doesn't work.
In the AndroidManifest.xml is android:windowSoftInputMode="adjustResize" for activity which contains this code.
Version of Support Design Library is 23.1.1.

Solution: if some EditText gets focus, need to call the method AppBarLayout#setExpanded. So there will be enough place for scrolling NestedScrollView. Also it helped me https://github.com/mikepenz/MaterialDrawer/issues/95#issuecomment-80519589

Related

Collapsing Toolbar Layout is not expanded at first time and pin doesn't work

I have a bottom sheet in my app and I want to use of Collapsing Toolbar Layout in it. but when I open bottom sheet Collapsing Toolbar Layout will disappear and I have to scroll down to see it.
And another problem is about pin mode that doesn't work for my Linear layout that I want to be the pin in scroll mode.
and when I add Collapsing Toolbar Layout my bottom sheet will not open full screen too.
This is my 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"
android:id="#+id/coordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="#+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="360dp"
android:background="#ffffff"
app:elevation="5dp"
app:expanded="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsingToolbarLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:expanded="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7">
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="252dp"
app:layout_constraintBottom_toTopOf="#+id/indicator"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<me.relex.circleindicator.CircleIndicator
android:id="#+id/indicator"
android:layout_width="match_parent"
app:ci_drawable="#drawable/circleindicator_round"
android:layout_height="48dp"
android:layout_gravity="bottom"
android:gravity="bottom"
android:visibility="visible"/>
</LinearLayout>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
android:layout_gravity="bottom"
android:visibility="visible"
app:titleTextColor="#color/black">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="#+id/nestedScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#e9e7e7"
android:fillViewport="false"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
</android.support.v4.widget.NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
Thank you for your answer.
add android:fitsSystemWindows="true" in CoordinatorLayout and CollapsingToolbarLayout. app:elevation="5dp" app:expanded="true" is not necessary . remove LinearLayout and place a FrameLayout
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:title="ASDASD">
<android.support.v4.view.ViewPager
android:id="#+id/pager"
android:layout_width="match_parent"
android:layout_height="252dp"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_gravity="bottom"
android:layout_marginTop="230dp"
android:layout_height="wrap_content">
<me.relex.circleindicator.CircleIndicator
android:id="#+id/indicator"
android:layout_width="match_parent"
app:ci_drawable="#drawable/circleindicator_round"
android:layout_height="48dp"
android:layout_gravity="bottom"
android:gravity="bottom"
android:visibility="visible"/>
</FrameLayout>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
and remove android:fillViewport="false" in NestedScrollView
I found my mistake.
I used my code in normal Activity and it works fine. It doesn't work correctly in the BottomSheet.
The promblem is about the BottomSheet but I don't know how to fix that. Anyway, This problem is solved by using a Simple Activity.

ViewPager showing Scrolling issue inside CoordinatorLayout

An android newbie is here :-)
I am studying CoordinatorLanyout in material designing. So I tried to implement TabLayout inside CoordinatorLanyout and it worked fine. But I implemented the RecyclerView inside one fragment for ViewPager and faced a strange scrolling issue. The list is not scrolling now. I surfed and tried lot of solutions here but nothing can fix this issue. here am is my activity_main.xm
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:local="http://schemas.android.com/tools"
android:id="#+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="#+id/appbar"
android:layout_width="match_parent"
android:layout_height="#dimen/detail_backdrop_height"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:fitsSystemWindows="true"
android:elevation="8dp"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginStart="20dp"
app:expandedTitleMarginEnd="10dp">
<include
android:id="#+id/counter_id"
layout="#layout/counter_layout"/>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:elevation="8dp"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
app:layout_collapseMode="pin"/>
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.design.widget.TabLayout
android:id="#+id/pager_tab_id"
android:background="#color/colorPrimary"
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
android:layout_gravity="bottom"
app:tabMode="scrollable"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:fillViewport="true"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:id="#+id/container_body"
android:layout_height="match_parent">
</FrameLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
here the frame layout for replacing the fragments. so the viewpager will take this frame container.
Am using this xml for set the viewPager layout which will use the FrameLayout in the activity_main.xml that i mentioned above
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
tools:context="bodhi.electionpoll.ui.fragment.PanchayathHistoryFragment">
<android.support.v4.view.ViewPager
android:id="#+id/content_panchayath_hisory_pager"
android:background="#color/windowBackground"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
next i designed a xml for RecyclerView adapter
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/swipe_container_service"
android:layout_width="match_parent"
android:fitsSystemWindows="true"
android:layout_height="match_parent">
<SearchView
android:id="#+id/search"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:textSize="16sp"
android:hint="Search here"/>
<android.support.v7.widget.RecyclerView
android:id="#+id/recycler_list"
android:layout_below="#+id/search"
android:layout_width="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
android:layout_height="match_parent"
android:clipToPadding="false"
android:fillViewport="true"
android:layout_marginTop="4dp"
/>
</RelativeLayout>
i think no need to mention related java files
after implementation of these,
the scrolling is not working
Your structure should be like this ->
<CoordinatorLayout>
<AppBarLayout>
<CollapsingToolbarLayout>
<Layout/>
<Toolbar/>
</CollapsingToolbarLayout>
<TabLayout/>
</AppBarLayout>
<ViewPager/>
</CoordinatorLayout>
i think you will understand.

viewpager parallax scrolling and collapse toolbar on scroll

refer to the image, I want to create a parallax scrolling effect within a viewpager. the ImageView and the webview is the layout from the view pager fragment while the toolbar is on the activity that hold the viewpager.
I had my parallax scrolling effect working but not the show and hide toolbar below is my code for both activity and fragment.
main.xml
<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/htab_maincontent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="#+id/htab_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="#+id/htab_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/htab_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
fragment.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"
android:fitsSystemWindows="true"
android:id="#+id/htab_maincontent"
android:layout_height="match_parent"
android:layout_width="match_parent">
<android.support.design.widget.AppBarLayout
android:id="#+id/htab_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/htab_collapse_toolbar"
android:layout_width="match_parent"
android:layout_height="256dp"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="#+id/htab_header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:src="#drawable/tes"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical"
android:clipToPadding="false"
android:isScrollContainer="false"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<!--<TextView
android:id="#+id/pagename"
android:layout_width="match_parent"
android:layout_height="wrap_content" />-->
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="#+id/webview"
android:layout_width="match_parent"
android:layout_height="match_parent"></WebView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
so my question is how to make toolbar in activity get the scrolling behaviour in the fragment and show or hide when user scroll up and down
you will have to do it the following way
<CoordinatorLayout>
<AppBarLayout>
<Toolbar >
<ImageView
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
android:minHeight="100dp"/>
</Toolbar>
</AppBarLayout>
</CoordinatorLayout>
also refer this link https://guides.codepath.com/android/Handling-Scrolls-with-CoordinatorLayout
Try this
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<android.support.v4.view.ViewPager
android:id="#+id/htab_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</RelativeLayout>
Hope this will helps you

CollapsingToolbarLayout not scrolling with scrollview

So to get to this point, I've followed this tutorial:
http://blog.grafixartist.com/parallax-scrolling-tabs-design-support-library/
In the tutorial, a viewpager that is given fragments with a RecyclerView is used. I'm trying to give the ViewPager fragments with a Scrollview containing a LinearLayout instead.
My ViewPager and TabLayouts are working properly. The problem is, I don't think the CollapsingToolbarLayout is catching the scrolling behavior of the ScrollViews. I can collapse the toolbar by scrolling it up, and I can scroll in my scrollview, but the motions are not linked as they should be - Isn't the CoordinatorLayout supposed to take care of this? Maybe this is setup improperly? If anyone spots something please let me know - thanks ahead of time!!
Here is the layout code I'm using:
<?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/htab_maincontent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="#+id/htab_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/htab_collapse_toolbar"
android:layout_width="match_parent"
android:layout_height="256dp"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
<ImageView
android:id="#+id/htab_header"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/mountains"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="#+id/htab_toolbar"
android:layout_width="match_parent"
android:layout_height="104dp"
android:gravity="top"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"
app:titleMarginTop="13dp" />
<android.support.design.widget.TabLayout
android:id="#+id/htab_tabs"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_gravity="bottom"
app:tabIndicatorColor="#android:color/white" />
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/view_object_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
And here is the fragment that I set my ViewPager up with (both tabs are an instance of the same fragment for testing):
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".objectDetailsFragment"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<android.support.v7.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/activity_vertical_margin"
android:layout_marginBottom="#dimen/activity_vertical_margin"
android:layout_marginLeft="#dimen/activity_horizontal_margin"
android:layout_marginRight="#dimen/activity_horizontal_margin"
android:orientation="vertical">
...
</android.support.v7.widget.LinearLayoutCompat>
</ScrollView>
ScrollView doesn't work like this instead use NestedScrollView:
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".objectDetailsFragment"
app:layout_behavior="#string/appbar_scrolling_view_behavior">
<android.support.v7.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/activity_vertical_margin"
android:layout_marginBottom="#dimen/activity_vertical_margin"
android:layout_marginLeft="#dimen/activity_horizontal_margin"
android:layout_marginRight="#dimen/activity_horizontal_margin"
android:orientation="vertical">
...
</android.support.v7.widget.LinearLayoutCompat>
</android.support.v4.widget.NestedScrollView>
and add dependencies:
dependencies{
compile 'com.android.support:design:23.2.0'
}

RecyclerView wrapped inside CoordinatorLayout not resized when keyboard opens

Activity layout 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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax">
<ImageView
android:layout_width="match_parent"
android:layout_height="250dp"
android:scaleType="centerCrop"
android:src="#drawable/hospital_logo" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="******* ************* ********** ************"
android:textSize="18sp"
android:textColor="#android:color/black"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="***************************"
android:textSize="18sp"
android:textColor="#android:color/black"
android:textStyle="bold"/>
</LinearLayout>
</FrameLayout>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.design.widget.TabLayout
android:id="#+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="fixed" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="#+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
Here I am using CoordinatorLayout with CollapsingToolbarBar and ViewPager.
I have adding two fragment inside ViewPager with layout xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.RecyclerView
android:id="#+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical" />
</LinearLayout>
The cell of recycler_view contains EditText. When I selects EditText SoftKeyboard opens but EditText hides behind keyboard.
I have added following flags to activity:
android:windowSoftInputMode="adjustResize"
I am using 23.1.1 appcompat version of RecyclerView.
When I replace CoordinatorLayout with LinearLayout RecyclerView is getting resize to show last element correctly. So I thinks it is the issue with Coordinator layout.
I went through following issues https://code.google.com/p/android/issues/detail?id=176406 and https://code.google.com/p/android/issues/detail?id=176187 but it is nor related to this bug. Let me know if I can apply some path to solve this.
Waiting for reply. Thanks.
Let me know if more details needed.
Had a very similar issue and was able to fix it by using android:windowSoftInputMode="adjustPan"

Categories

Resources