android-scroll

Android: Make view on top of listview scroll together with the listview

∥☆過路亽.° 提交于 2019-12-03 03:24:42
I have a listview which is obviously scrollable. The listview contains some form questions. Once the user submitts the form we put a stamp-like looking custom view on top of the listview (and prevent user from answering questions, but it doesn't matter here). The stamp should appear at the top of the listview (as in top of the screen) and be scrollable at the same speed as the listview, i.e. it should disappear when the listview items which were initially underneath it disappear at the top of the screen when scrolled. Any idea how to achieve this? Maria I found a solution. Not sure if it is

Is there really no clean way to programmatically add scrollbars to a custom view?

若如初见. 提交于 2019-12-02 21:57:54
问题 I want to add scrollbars to my custom view programmatically. Before Lollipop, this was done in the constructor like so: setHorizontalScrollBarEnabled(true); setVerticalScrollBarEnabled(true); TypedArray a = context.obtainStyledAttributes(R.styleable.View); initializeScrollbars(a); a.recycle(); (see here) Now with the introduction of Lollipop, Google made the initializeScrollbars() API private so it's no longer available (see here) So people have suggested to just manually import

List View Scroll Not Smooth

五迷三道 提交于 2019-12-01 18:39:40
i have a custom list view, which displays users, and there photos i retrieve the data from API, Which gives JSON Output, My Issue is that the list view is not scrolling smoothly, it hangs for a sec and scrolls, it repeats the same till we reach the end. i thought it might me because i am running network related operation on the UI thread, but it continues to do that even after it completes loading? the structure of my custom Listview is <TextView style="@style/photo_post_text" android:id="@+id/photo_post_text" android:layout_width="match_parent" android:layout_height="wrap_content" android

Start my RecyclerView Horizontal Carousel from the center item

橙三吉。 提交于 2019-12-01 05:03:01
问题 I'm creating a carousel Horizontal RecyclerView with Zoom on focused item that is starting from the first item of the RecyclerView. Code for custom CenterZoomLayoutManager: public class CenterZoomLayoutManager extends LinearLayoutManager { private final float mShrinkAmount = 0.15f; private final float mShrinkDistance = 0.9f; public CenterZoomLayoutManager(Context context, int orientation, boolean reverseLayout) { super(context, orientation, reverseLayout); } @Override public int

Detect when ListView has reached the bottom - onScroll() or onScrollStateChanged()?

岁酱吖の 提交于 2019-11-30 20:24:01
This seems a question with many answers already; however, I can't find a common approach to this. I'm trying to add data to a ListView when the bottom is reached; data are retrieved from Internet using an AsyncTask . ListView already has an adapter attached to it. So, searching for a good way to accomplish this, I arrived at two different approaches. The first one, the onScrollStateChanged() approach, is basically related to this page. However, it use parameters that don't have correspondence in the actual API. At the same time, this link use the right API, but I don't know if in the right way

Is it possible to add a scrollable TextView to a ListView?

陌路散爱 提交于 2019-11-30 15:26:40
I have a ListView where each row has a fixed height. Every row contains, next to some images, a TextView. Sometimes, the text I want to display is too large and hence I would like to make it scrollable. So I added (based on Making TextView scrollable on Android ) the following lines to my TextView text.setMaxLines(5); text.setVerticalScrollBarEnabled(true); text.setMovementMethod(ScrollingMovementMethod.getInstance()); This works fine if I use the TextView in isolation but not when I put the TextView inside a ListView: as soon as I do a vertical scroll, the events seem to be consumed by the

How to use Scroll View In Android

偶尔善良 提交于 2019-11-30 10:12:55
问题 I have use two scroll views for two different layout. And those two layouts are inside a Linear Layout. Here is my XML file. I don't why ScrollView is not working for me <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="horizontal" > <LinearLayout android:id="@+id/flightResultData" android:layout_width="fill_parent" android:layout_height="wrap

Detect when ListView has reached the bottom - onScroll() or onScrollStateChanged()?

回眸只為那壹抹淺笑 提交于 2019-11-30 04:44:07
问题 This seems a question with many answers already; however, I can't find a common approach to this. I'm trying to add data to a ListView when the bottom is reached; data are retrieved from Internet using an AsyncTask . ListView already has an adapter attached to it. So, searching for a good way to accomplish this, I arrived at two different approaches. The first one, the onScrollStateChanged() approach, is basically related to this page. However, it use parameters that don't have correspondence

How do I completely prevent a TextView from scrolling?

耗尽温柔 提交于 2019-11-30 02:47:25
问题 I have a TextView with a lot of text. This TextView has maxLines set, so it only shows the first 8 or so lines. I also have a "Read More" button so I handle expanding the TextView on my own. My problem is that sometimes the TextView scrolls a little (just half a line at a time), even though I never specified any scroll bars. This issue is made worse because the TextView is inside a ListView, so when the user scrolls the main ListView, the TextView sometimes scrolls a little, like this: How do

How to use Scroll View In Android

穿精又带淫゛_ 提交于 2019-11-29 18:26:39
I have use two scroll views for two different layout. And those two layouts are inside a Linear Layout. Here is my XML file. I don't why ScrollView is not working for me <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:orientation="horizontal" > <LinearLayout android:id="@+id/flightResultData" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="8dp" android:orientation="vertical" > <LinearLayout android:layout