CoordinatorLayout - View disappears after RecyclerView item click - android

Title says it all. The search view in this layout hides behind the toolbar and looks great.
The top level toolbar is the one supplied to the support actionbar
The search view toolbar is just used as a view
The last item in the recyclerview loads more results and calls 'notifyItemRangeInserted'. Once you do that, the toolbar shadow disappears and when you scroll up, the search view is completely blank.
Any ideas why?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:actionBarSize" />
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="#+id/app_bar"
android:layout_width="match_parent"
android:layout_height="?android:listPreferredItemHeight"
android:fitsSystemWindows="true">
<android.support.v7.widget.Toolbar
android:id="#+id/search_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="12dp"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:layout_marginTop="12dp"
android:background="#drawable/search_background"
android:gravity="center_vertical"
android:orientation="horizontal"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
app:layout_scrollFlags="scroll|enterAlways">
<ImageView
android:id="#+id/search_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingBottom="9dp"
android:paddingEnd="12dp"
android:paddingLeft="13dp"
android:paddingRight="12dp"
android:paddingStart="13dp"
android:paddingTop="9dp"
android:src="#drawable/search_icon" />
<EditText
android:id="#+id/search_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/transparent"
android:focusable="true"
android:focusableInTouchMode="true"
android:fontFamily="#string/roboto_light"
android:gravity="center_vertical"
android:hint="#string/action_search"
android:imeOptions="actionGo"
android:maxLines="1"
android:minLines="1"
android:paddingBottom="9dp"
android:paddingTop="9dp"
android:textColor="#666666"
android:textSize="15sp" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/search_results"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingBottom="?android:listPreferredItemHeightSmall"
android:paddingTop="4dp"
app:layout_behavior="#string/appbar_scrolling_view_behavior" />
<TextView
android:id="#+id/search_results_count"
android:layout_width="match_parent"
android:layout_height="?android:listPreferredItemHeightSmall"
android:layout_gravity="bottom"
android:background="#color/light_gray"
android:gravity="center"
android:textColor="#color/medium_grey"
tools:text="results results" />
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>

Related

only show toolbar when enterAlways in CollapsingToolbarLayout with other view

Layout structure.
<android.support.v4.widget.DrawerLayout .... >
<android.support.design.widget.CoordinatorLayout .... >
<android.support.design.widget.AppBarLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:fresco="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed">
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="#dimen/toolbar_height"
android:background="#color/appbar"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
app:layout_collapseMode="parallax">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="#+id/imv_back"
android:layout_width="#dimen/toolbar_height"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:padding="#dimen/toolbar_icon_padding"
android:src="#drawable/icons8_back" />
</RelativeLayout>
</android.support.v7.widget.Toolbar>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="#dimen/toolbar_height"
android:background="#color/background"
android:orientation="vertical"
app:layout_collapseMode="parallax">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.facebook.drawee.view.SimpleDraweeView
android:id="#+id/imv_tour_cover"
android:layout_width="match_parent"
android:layout_height="#dimen/cover_height"
fresco:actualImageScaleType="centerCrop" />
<TextView
android:id="#+id/txv_tour_area"
android:layout_width="wrap_content"
android:layout_height="#dimen/cover_height"
android:layout_centerHorizontal="true"
android:layout_marginTop="-14dp"
android:gravity="center"
android:text="Test string."
android:textColor="#000000"
android:textSize="28sp" />
</RelativeLayout>
<TextView
android:id="#+id/txv_tour_title"
style="#style/row_marginHorizontal_12"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-34dp"
android:text="Test string."
android:textColor="#color/text_primary"
android:textSize="#dimen/text_size_6" />
</LinearLayout>
</android.support.design.widget.CollapsingToolbarLayout>
<android.support.design.widget.TabLayout
android:id="#+id/tbl_tour"
android:layout_width="match_parent"
android:layout_height="#dimen/tablayout_height"
android:background="#color/tab">
<android.support.design.widget.TabItem
android:id="#+id/tbi_tour_stroke"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Text string." />
</android.support.design.widget.TabLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView .... />
<android.support.design.widget.BottomNavigationView .... />
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.DrawerLayout>
First look like this.
When scroll down...TabLayout will set on top.
Then scroll up a little, will expand part of CollapsingToolbarLayout (should be the toolbar's height).
Continue scrolling to the top, finally just like the first image.
My purpose is to show only Toolbar but not whole CollapsingToolbarLayout when enterAlways, the LinearLayout's content is still hide until top when scroll, is it possible?

android whitespace at bottom of recyclerview appears when toolbar added to layout

In my application im using CoordinatorLayout,AppBarLayout and CollapsingToolbarLayout because i want my app to have top menu bar pinned and header which hides on scroll. I have recyclerview where my items are listed, and items are made in CardView.
Problem is that when i add toolbar as CollapsingToolbarLayouts child at bottom of screen,under recyclerview, on my phone whitespace appears. Also whitespaces dimensions are same like toolbars. When i remove toolbar whitespace also disappears.
here is my main xml code:
<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:layout_height="match_parent"
android:background="#color/GrayColour"
android:orientation="vertical"
tools:context=".MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_collapseMode="parallax">
<include
android:id="#+id/Header"
layout="#layout/header_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="53dp"/>
</RelativeLayout>
<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_collapseMode="pin"
android:contentInsetLeft="0dp"
android:contentInsetStart="0dp"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
android:contentInsetRight="0dp"
android:contentInsetEnd="0dp"
app:contentInsetRight="0dp"
app:contentInsetEnd="0dp">
<include
android:id="#+id/TopBar"
layout="#layout/top_navigation_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="#+id/Categories"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
tools:listitem="#layout/list_item"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
app:layout_constraintBottom_toBottomOf="parent"
/>
</android.support.design.widget.CoordinatorLayout>
and here is my xml code for items with who recyclerview is filled:
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/white_background_rounded_corners"
android:layout_margin="5dp">
<LinearLayout
android:layout_width="156dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:background="#drawable/white_background"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="#+id/ivCategory"
android:layout_width="156dp"
android:layout_height="100dp"
android:layout_marginTop="8dp"
android:background="#null"
android:clickable="true"
android:contentDescription="#string/category"
android:focusable="true"
android:scaleType="fitCenter"
android:src="#mipmap/android_icon" />
<TextView
android:id="#+id/tvCategoryName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="#string/text"
android:textColor="#color/mainColour"
android:textSize="20sp"
android:textStyle="bold" />
</LinearLayout>
</android.support.v7.widget.CardView

How to get rid of extra space next to hamburger icon navigation drawer

I Have the layout shown as in this image and this is how my xml looks like :
<?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:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
tools:context="pulsesecure.net.securewebbrowser.HomeActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dp"
android:theme="#style/AppTheme.AppBarOverlay"
>
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:paddingTop="10dp"
android:paddingBottom="5dp"
app:popupTheme="#style/AppTheme.PopupOverlay">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="#+id/frag_toolbar"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="9"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:id="#+id/frag_title"
android:layout_width="0dp"
android:layout_weight="9"
android:layout_height="match_parent"
android:textColor="#android:color/white"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium"
/>
<ImageButton
android:id="#+id/add_tab_btn"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:src="#mipmap/ic_add_white_24dp"
android:background="#color/colorPrimaryDark"
/>
</LinearLayout>
<LinearLayout
android:id="#+id/urlBar"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="9"
android:orientation="horizontal"
android:visibility="gone"
android:background="#color/colorPrimaryDark"
android:focusableInTouchMode="true"
>
<EditText
android:id="#+id/searchET"
android:layout_width="0dp"
android:layout_weight="9"
android:layout_height="match_parent"
android:textColor="#android:color/darker_gray"
android:layout_gravity="center"
android:imeOptions="actionGo"
android:singleLine="true"
android:hint="#string/hint_url"
android:selectAllOnFocus="true"
android:background="#drawable/rounded_edit_text"
/>
<ImageButton
android:id="#+id/delete_url"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:src="#mipmap/ic_clear_white_24dp"
android:background="#color/colorPrimaryDark"
/>
</LinearLayout>
<LinearLayout
android:id="#+id/select_url_bar"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="9"
android:orientation="horizontal"
android:visibility="gone"
android:background="#color/colorPrimaryDark"
android:focusableInTouchMode="true"
>
<TextView
android:id="#+id/url_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="5dp"
android:text="text view"
android:clickable="true"
android:singleLine="true"
android:gravity="center_vertical"
android:textColor="#android:color/black"
style="#style/PSFont"
android:background="#drawable/rounded_edit_text"/>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.Toolbar>
<ProgressBar
android:id="#+id/page_load_progress"
style="#android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="3dp"
android:progressTint="#color/colorAccent"
android:visibility="invisible"
/>
</android.support.design.widget.AppBarLayout>
<include layout="#layout/content_home" />
</android.support.design.widget.CoordinatorLayout>
I need to get rid of the space between hamburger icon and the Edittext (highlighted with orange arrow). I tried padding and inset, but no luck so far. Can someone give me pointers on this ? Thank you.
My Bad , I should have searched harder :
all I had to do was :
app:contentInsetStartWithNavigation="0dp" in my Toolbar layout.
Remove large padding after hamburger (menu) icon in Android Toolbar?
Try to add below attribute in your <android.support.v7.widget.Toolbar>.
app:contentInsetStartWithNavigation="0dp"
Adding this will work & if it is still not working then just add these two attributes as well
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"

Scrolling problems inside AppBarLayout

I have CoordinatorLayout:
<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:background="#color/background"
android:clickable="true"
android:focusableInTouchMode="true">
<android.support.v7.widget.RecyclerView
android:id="#+id/bottom_recycle_view"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:background="#drawable/border_gray_solid_background_nop"
app:layout_behavior="#string/appbar_scrolling_view_behavior"/>
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#color/background">
<com.app.views.textviews.OpSearchView
android:id="#+id/search_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/default_margin"
android:layout_marginRight="#dimen/default_margin"
android:layout_marginTop="#dimen/_20sdp"
app:hint="#string/filter_categories"
app:layout_scrollFlags="scroll"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="#dimen/_10sdp"
app:layout_scrollFlags="scroll">
<TextView
android:id="#+id/top_heading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/default_margin"
android:layout_marginLeft="#dimen/default_margin"
android:layout_marginRight="#dimen/default_margin"
android:layout_marginTop="#dimen/home_screen_sector_spacing"
android:gravity="left"
android:textColor="#color/heading_gray"
android:textSize="#dimen/_14sdp"
android:textStyle="bold"/>
<com.app.views.recycleview.HorizontalRecycleView
android:id="#+id/top_recycle_view"
android:layout_width="match_parent"
android:layout_height="#dimen/categories_row_height"
android:clipToPadding="false"
android:paddingLeft="#dimen/default_margin"/>
<TextView
android:id="#+id/bottom_heading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/default_margin"
android:layout_marginRight="#dimen/default_margin"
android:layout_marginTop="#dimen/home_screen_sector_spacing"
android:gravity="left"
android:textColor="#color/heading_gray"
android:textSize="#dimen/_14sdp"
android:textStyle="bold"/>
</LinearLayout>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
I would like to make OpSearchView sticky to the top of the layout.
I try to remove app:layout_scrollFlags="scroll" from OpSearchView but all childs from AppBarLayout became sticky.
If I move OpSearchView from the AppBarLayout under RecyclerView, the RecyclerView(with layout_behavior) became invisible.
How to make OpSearchView without scrolling behavior?
<?xml version="1.0" encoding="utf-8"?>
<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_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusableInTouchMode="true"
>
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#eeeeee"
>
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/collapsing_toolbar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="?android:actionBarSize"
android:paddingBottom="10dp"
app:layout_scrollFlags="scroll"
>
<TextView
android:id="#+id/top_heading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="#dimen/single_margin"
android:layout_marginLeft="#dimen/single_margin"
android:layout_marginRight="#dimen/single_margin"
android:gravity="start"
android:textStyle="bold"
android:text="top heading"
/>
<!-- com.app.views.recycleview.HorizontalRecycleView -->
<View
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#cccccc"
/>
<TextView
android:id="#+id/bottom_heading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="#dimen/single_margin"
android:layout_marginRight="#dimen/single_margin"
android:gravity="start"
android:textStyle="bold"
android:text="bottom heading"
/>
</LinearLayout>
<!-- toolbar with the searchview in it -->
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:actionBarSize"
android:background="#dddddd"
app:layout_scrollFlags="scroll|enterAlways"
app:layout_collapseMode="pin"
>
<SearchView
android:id="#+id/search_top"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:queryHint="Search"
app:layout_scrollFlags="scroll"
app:layout_collapseMode="pin"
/>
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<!-- scrolling contents -->
<android.support.v7.widget.RecyclerView
android:id="#+id/recycle_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>
This is the layout that I came up with working with your layout, I took a few liberties to make things work, you should make your own changes to get it back to your original layout, like your custom SearchView and HorizontalRecyclerView.
P.S. For layout_width and layout_height, match_parent and fill_parent are the same thing, and you should only use match_parent as per Google's documentation suggests.

open on-screen keyboard causes toolbar to scroll out of sight

In one of our Activitys scrolling is broken when the on-screen keyboard pops up.
If the content fits on the screen and no keyboard is visible the Activity looks like this:
If the keyboard is open and the user enters a few lines, the toolbar begins to scroll out of sight:
At some point the toolbar is completely gone:
If the keyboard is not open scrolling works fine:
The Activity contains only a FrameLayout, everything else is provided by a Fragment.
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/task_detail_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#android:color/white"
android:fitsSystemWindows="true"
tools:context=".TaskDetailActivity"
tools:ignore="MergeRootFrame" />
The Fragment uses a CoordinatorLayout and looks like this:
<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/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="0dp" >
<android.support.design.widget.CollapsingToolbarLayout
android:id="#+id/main.collapsing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"
android:minHeight="?attr/actionBarSize" >
<org.dmfs.tasks.widget.TaskView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/toolbar_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_collapseMode="parallax"
android:orientation="vertical"
android:paddingTop="?attr/actionBarSize" >
<org.dmfs.tasks.widget.TextFieldView
android:id="#+id/task_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
app:layout_scrollFlags="scroll|enterAlways"
android:gravity="center_vertical"
android:minHeight="?attr/actionBarSize"
android:paddingEnd="48dp"
android:paddingLeft="48dp"
android:paddingRight="48dp"
android:paddingStart="48dp"
app:fieldDescriptor="#id/task_field_title" >
<TextView
android:id="#+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="none"
android:ellipsize="end"
android:lineSpacingMultiplier="1.1"
android:maxLines="3"
android:textColor="#ffffffff"
android:textColorLink="#d0ffffff"
android:textSize="28sp" >
</TextView>
</org.dmfs.tasks.widget.TextFieldView>
<org.dmfs.tasks.widget.TimeFieldView
xmlns:android="http://schemas.android.com/apk/res/android"
style="#style/task_widget"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
app:layout_scrollFlags="scroll"
android:orientation="vertical"
android:paddingEnd="56dp"
android:paddingLeft="56dp"
android:paddingStart="56dp"
android:visibility="gone"
app:fieldDescriptor="#id/task_field_due" >
<TextView
android:id="#android:id/text1"
style="#style/field_view_text_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_tab_due"
android:drawablePadding="12dp"
android:drawableStart="#drawable/ic_tab_due"
android:gravity="center_vertical"
android:includeFontPadding="false"
android:textColor="#ffffffff"
android:textSize="18sp" >
</TextView>
<TextView
android:id="#android:id/text2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="44dp"
android:textColor="#ffffffff" >
</TextView>
<LinearLayout
android:id="#+id/buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="44dp"
android:orientation="horizontal"
android:visibility="gone" >
<TextView
android:id="#+id/button_add_one_day"
style="#style/time_forward_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="#drawable/ic_detail_delay_1d"
android:drawablePadding="8dp"
android:drawableStart="#drawable/ic_detail_delay_1d"
android:text="#string/button_add_one_day"
android:textColor="#a0ffffff" />
<TextView
android:id="#+id/button_add_one_hour"
style="#style/time_forward_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:drawableLeft="#drawable/ic_detail_delay_1h"
android:drawablePadding="8dp"
android:drawableStart="#drawable/ic_detail_delay_1h"
android:text="#string/button_add_one_hour"
android:textColor="#a0ffffff" />
</LinearLayout>
</org.dmfs.tasks.widget.TimeFieldView>
</org.dmfs.tasks.widget.TaskView>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
app:layout_behavior="#string/appbar_scrolling_view_behavior" >
<LinearLayout
android:id="#+id/content"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<android.support.design.widget.FloatingActionButton
android:id="#+id/floating_action_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="16dp"
app:layout_anchor="#id/appbar"
app:layout_anchorGravity="bottom|right|end"
android:src="#drawable/ic_action_complete" />
<android.support.v7.widget.Toolbar
android:id="#+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_anchor="#id/toolbar_content"
android:theme="#style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light" >
<TextView
android:id="#+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:singleLine="true"
android:text=""
android:textColor="#android:color/white"
android:textSize="24sp" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CoordinatorLayout>
The #+id/content LinearLayout is populated at runtime.
We have another Activity that uses neither CoordinatorLayout nor a Toolbar, but a ScrollView instead and which shows exactly the same symptoms. You can see it here: https://github.com/dmfs/opentasks/blob/master/res/layout/activity_task_editor.xml and https://github.com/dmfs/opentasks/blob/master/res/layout/fragment_task_edit_detail.xml
We use the following dependencies:
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
Any hint what could cause this is appreciated.

Categories

Resources