android-recyclerview

Swipe one item at a time Recyclerview [duplicate]

北战南征 提交于 2019-12-17 17:46:08
问题 This question already has answers here : RecyclerView with only one item displayed on screen [duplicate] (2 answers) Closed 9 months ago . I tried adding on Scroll listener for recycler view and made some logic but i am not able to swipe one item at a time. I did some search on internet but i got some third party library which has custom recycler view. Can we implement one item swipe at a time in recycler view? If yes Please tell how? One item swipe at a time like this image. 回答1: This is

How to selectively decorate RecyclerView items

心不动则不痛 提交于 2019-12-17 17:39:23
问题 I am creating a subclass of ItemDecoration from this gist: https://gist.github.com/alexfu/0f464fc3742f134ccd1e How to make it only decorate items with certain condition? For instance, only decorate items with certain positions, type of ViewHolder, etc. I have modified the above mentioned gist (plus some changes on deprecated Android API) with this code, but all items get decorated anyway: public boolean isDecorated(View view, RecyclerView parent) { RecyclerView.ViewHolder holder = parent

Recyclerview not scrolling to end when keyboard opens

天大地大妈咪最大 提交于 2019-12-17 17:36:54
问题 I am using recylerview in my application and whenever new element is added to recyclerview, it scrolls to last element by using recyclerView.scrollToPosition(adapter.getCount()); But, whenever keyboard opens(because of editTextView), it resizes the view and recyclerview gets smaller, but couldn't scroll to last element. android:windowSoftInputMode="adjustResize" I even tried to used the following code to scroll to last element, but it didn't work editTextView.setOnFocusChangeListener(new View

Playing video using textureview in recyclerview

旧时模样 提交于 2019-12-17 17:33:40
问题 I am trying to implement a list with videos like vine or Instagram app. Where they play video plays when list item is shown or fully visible and video pauses when list item gets hided. I am using textureview with media player to play a video from url and added it as list item in recyclerview. Following is my code. VideosAdapter Class: public class VideosAdapter extends RecyclerView.Adapter<VideosAdapter.ViewHolder> { Context context; private ArrayList<String> urls; public static class

Android Support Library rev 23.2 and RecyclerView

删除回忆录丶 提交于 2019-12-17 17:10:11
问题 Updated to Android Support Library rev 23.2 and it added full screen spaces to RecyclerView between each item. Has anybody experienced this issue? 回答1: This occurs when your RecyclerView rows have their size set to match_parent in the scrolling direction. For example, if a RecyclerView with a vertical LinearLayoutManager has the following layout for each row, that row will now actually match the parent's height now. Before version 23.2.0 it would still simply wrap the content. <View android

How to parse an xml to java class with recycler view or in adapter of recyclerview

不问归期 提交于 2019-12-17 17:07:07
问题 I have an xml file which name it is Bookmark and it is into the xml folder. I want to parse xml to recycler view which I can show the list of the Bookmark in recycler view. The bookmark xml it is not in assets it is in res then xml folder. This is my code. Bookmark.xml in the xml folder <Bookmarks> <Bookmark id="1" icon="google.png" name="Google" searchUrl="https://www.google.com" hidden="true" /> <Bookmark id="2" icon="youtube_new.png" name="Youtube" searchUrl="http://m.youtube.com" />

How to show exact number of items in RecyclerView?

爷,独闯天下 提交于 2019-12-17 16:06:15
问题 I am trying to show exact (eg. 3 items) in RecyclerView. Our web application shows like this: If I move items: and release the mouse, it automatically comes to this: In Android, I am showing images using RecyclerView: How to show exactly 3 items in the visible area of RecyclerView? How to avoid to show "half" items? Is this possible? RecyclerView: <android.support.v7.widget.RecyclerView android:layout_width="wrap_content" android:layout_height="130dp" android:id="@+id/rvProducts" /> One item

RecyclerView is missing

放肆的年华 提交于 2019-12-17 15:59:18
问题 I just installed the new SDK tools (Android L Developer Preview), and I'm trying to use RecyclerView but it seems to be missing. From my understanding I should include the v7 support library, but I can't seem to do that... I can't seem to find the v7 library in the SDK folder (I did install the Android Support Library from the SDK Manager). 回答1: You have to update the android repository, the support library and you have to use this dependency: compile 'com.android.support:recyclerview-v7:+'

Recyclerview inside nested scroll view loading all datas instead of calling one by one image when scroll

折月煮酒 提交于 2019-12-17 15:57:34
问题 In my application, I'm using tabHost Activiy.In the tabhost first tab,I'm using TabActivity,I'm loading more than 500 images. Using Nested SCroll view: I have used nested scroll view inside recyclerview.When loading the home page, it is loading all 500 images initially, then showing the home page.So that it cause memory out of error. Without using nested SCroll view: If I remove nested scroll view, everything is working good.it loads image one by one when scrolling.it doesn't cause out of

Add a ListView or RecyclerView to new NavigationView

梦想与她 提交于 2019-12-17 15:43:30
问题 I am using the new NavigationView from revision 22.2.0 of the support library by Google. It works perfectly fine to generate a navigation drawer populated using a menu res. I was wondering is it possible to add a ListView or RecyclerView to the navigation drawer so that it can be populated using my custom adapter code, which allows for far greater flexibility than menu resources. Here is my current XML: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout android:id=