FAQ Database Discussion Community


How to use scrollTo() with Spinner?

java,android,android-scrollview,numberpicker
I'm working on my first Android project, which means that I'm not that familiar with Android and Java, and I want to move scroll of ScrollView after a user presses the button for next action (IME_ACTION_SEND). My codes are as follows. activity_add.xml It basically consists of TextView, EditText, NumberPicker, Spinner,...

Android ScrollView not scrolling in Activity with Drawer Layout

android,android-layout,navigation-drawer,android-scrollview,drawerlayout
Let me introduce you to my activity: <RelativeLayout 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"> <include android:id="@+id/toolbar_actionbar" layout="@layout/toolbar_default" android:layout_width="match_parent" android:layout_height="wrap_content"/> <FrameLayout android:id="@+id/main_fragment_container" android:layout_width="match_parent"...

android - MapFragment inside ScrollView inside Fragment

java,android,android-fragments,android-scrollview,supportmapfragment
My goal is to let MapFragment handle touch event instead of ScrollView. MapFragment is being added programmatically inside of ScrollView which is inside of Fragment. <ScrollView android:id="@+id/scrollview_event" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@id/button_create" android:layout_alignParentTop="true" > <LinearLayout android:id="@+id/linearlayout_event" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/bg_light"...

3 way scroll in Android

android,android-layout,android-scrollview,android-scroll
I have 3 views: an ImageView, a RelativeLayout and a ListView. When the user scrolls down, I have to hide the ImageView first. When the top of the RelativeLayout touches the top of the screen it has to fix itself there and the scroll must be done by the ListView....

firstVisibleItem, visibleItemCount, totalItemCount do not change even Scroll event happened

android,android-layout,listview,android-scrollview
Im having a ScrollView which contains a Listview, However even if I scroll the listview, the three parameters in onscroll() method do not change, they remain the same as the initial state. Here's my layout Also my code for handling the scroll event,noted the contentlist is the listview not the...

Keyboard and scrollviews

android,keyboard,scrollview,android-scrollview
I have an activity with a form. I put all views in a ScrollView because when the keyboard opens, I would scroll through the fields. When the keyboard opens, the first field goes over the top of the scrollview ad becomes unreachable. This is the layout: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"...

Android scroll up

android,android-scrollview
I have two buttons Button 1, Button 2 placed horizontally like tabs. On Click of these button I am adding Linear Layout in Scroll View. Now suppose I am clicking Button 1 and scroll down and immediately switch or click to Button 2 that scroll applies on newly added layout....

ScrollView not sizing itself correctly

android,android-layout,android-scrollview
I'm trying to get a ScrollView to take up as much screen space as it needs until it would start pushing items below (outside) it off the screen, then it needs to stop expanding and become scrolly. <?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" > <ScrollView android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#ff0000"...

ScrollView including ListView in Android

android,android-layout,android-listview,android-scrollview
I would like to have a ScrollView that contains a ListView, which is obviously undesirable since a ListView has its own scroll bar. Essentially I would like to have a RelativeLayout with a number of views forming the header of the page, followed by a ListView, similar to Facebook's profile...

Scrolling over listview items not working on device

android,android-layout,scroll,android-scrollview
I want to scroll a portion of data in the screen, for which I added scrollview in the layout, but the listview is not getting scrolled, its working fine in emulator. I read all articles related to which says listview scrolling is not possible and tried alternatives designing custom scroll...

Android : can't add view programmatically in linearLayout android

android,view,android-linearlayout,android-scrollview
i have fragment that has scrollview as a parent of layout and in scrollview i have a LinearLayout . when i'm trying to programmatically add view to that LinearLayout but i get the error " The specified child already has a parent. You must call removeView() on the child's parent...

how to disable recycler view scrolling so that it listens to Scrollview layout?

android,android-scrollview,recyclerview
I have a recycler view inside a ScrollView. I want to disable the recycler view scroll so that it listens to its parent layout, A ScrollView!

Adding layout to the bottom of screen in Android [closed]

android,android-layout,android-linearlayout,android-scrollview,android-layout-weight
I want to add a layout like this: <header layout>(Fixed) | | <ScrollView> | | <Footer Layout>(Fixed) Here's what I've tried so far: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <ScrollView android:id="@+id/container" android:layout_width="fill_parent" android:layout_height="fill_parent"...

ScrollView doesn't work

android,android-scrollview
My Layout has a few complex layouts and they are pretty big. That's why I need a ScrollView. But whatever I try it doesn't work. Here is my layout file: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="fill_parent" android:fillViewport="true" android:layout_weight="1" android:orientation="vertical" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true"> <LinearLayout...

Best way to create a header and footer for webview in Android

android,android-webview,android-4.0,android-scrollview
I want to create news like activity that has title and date and some share and favorite buttons in the beginning at the top, the article text (and maybe some images and headers titles) is in html that I get from server, and at the end a list of related...

Toolbar will not collapse with Scrollview as child of CoordinatorLayout

android,toolbar,android-scrollview,android-toolbar,coordinator-layout
I am trying to follow the Google Docs on using the CoordinatorLayout but i am having an issue with the ScrollView inside the CoordinatorLayout. Basically, the Toolbar normally would collapse with a RecyclerView or a Listview when scrolling down. Now with a ScrollView it will not collapse. <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent">...

How to detect ScrollView scroll by desired pixel value

android,android-scrollview
I'm extending ScrollView to detect if it was scrolled up or down. I want to add option to detect scroll only if it was scrolled by let's say 50 pixels. How to do that? My current code of scrollview overrides onScrollChanged: public interface OnDetectScrollListener { void onUpScroll(); void onDownScroll(); }...

When using the CoordinatorLayout my ScrollView has an incorrect size

android,android-support-library,material-design,android-scrollview,android-design-library
I'm using a ScrollView in a layout, and am attempting to use the new CoordinatorLayout from the design support library. My layout file 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"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"...

overScrollBy doesn't always bounce back in Lollipop (5.x) platform

android,android-scrollview
I have overridden overScrollBy method in ScrollView based on the following post: http://jasonfry.co.uk/blog/android-overscroll-revisited/ It is working fine on other platform version, but Lollipop is unable to bounce back if fling motion is applied to the ScrollView. Anyone encountered this issue and found a workaround? Called in constructorsetOverScrollMode(OVER_SCROLL_ALWAYS); Here relevant code...

ListView header instead of being in scrollview

android,listview,android-fragments,android-scrollview
I'm having a fragment that shows the image and the name of my items and below that I want to show a list of comments on that item. However it seems I cannot use a listview inside my Scrollview. People are suggesting to use header for my listview. But I'm...

Android ScrollView, check if currently scrolling

java,android,android-listview,android-view,android-scrollview
Is there a way to check if a standard ScrollView is currently being scrolled? Doesn't matter if the direction is upwards or downwards, i only need to check whether it's currently being scrolled at all....

ListFragment inside a ScrollView Android

android,android-layout,android-listview,android-listfragment,android-scrollview
Here is my current layout: <RelativeLayout> <ListFragment/> </RelativeLayout> I want to add a picture just before the fragment, something like this: <ScrollView> <RelativeLayout> <ImageView/> <ListFragment/> </RelativeLayout> </ScrollView> But, ListFragment use a ListView, and I want the picture to moves with the ListView. It must work if we replace the ListView...

Android : Zoom by center pinch

android,scale,android-scrollview,horizontalscrollview
So, I have ScrollView, HorizantalScrollView and BoardView for TicTacToe game. When user zooms, while i redraw scale into categories of cells through ScalegestureDetector zoom pinch is allocated on top, left of the screen, not at the centre of pinches, how can I allocate it to the center? here is my...

ScrollView Overlaps Toolbar

android,android-layout,android-scrollview
I'm trying to use ScrollView and Toolbar as the only childs of LinearLayout but they overlap each other. Searched a bit but didn't find anything useful, any idea how to solve this rather than giving padding/margin to ScrollView? <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:float="http://schemas.android.com/apk/res-auto" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center"...

How to scroll to a location in a scrollView without animating?

java,android,scrollview,android-scrollview
I've been doing some research and haven't found a functional solution. In short, I need to programmatically scrollTo a position in a scrollView (horizontal if anyone wants to know), without animating/seeing the animation. scrollTo performs the animation. Everything I have tried thus far is visibly scrolling the scrollView. I want...

How to add gridView in a scrollView in android

android,gridview,android-scrollview
Before the question is voted as a possible duplicate of this ,this or this I have a material design navigation drawer.On the main activity i have the following elements as seen from images A and B. I wanted to add a scrollview feature so that scrolling the items will enable...

Scrollview (findviewby id) returns null

android,android-layout,android-wear,android-scrollview
There is an imageview within a scrollview with an extra long image which is currently scrollable. I am trying to get this image to scroll by itself, however the findViewById keeps returning null on the scroll view. EDIT: This is on the android wear @Override protected void onCreate(Bundle savedInstanceState) {...