android-recyclerview

Make RecyclerView to wrap its content when using CardView with square ImageView

余生颓废 提交于 2019-12-09 23:39:22
问题 I am trying to achieve following structure (image below). As you can see there are two sections with RecyclerView s and CardView s in it. These two sections are divided by two TextView s with Button s. Each section should match screen width (minus indent between cards). Each CardView has square ImageView in it. So the height of CardView itself depend on screen width: card_height = screen_width - indent_between_cards + space_for_card_text . To achieve this behaviour I use simple

How to push up the whole view when a keyboard comes up, what layout changes needed? [duplicate]

懵懂的女人 提交于 2019-12-09 20:48:32
问题 This question already has answers here : Move layout up when soft keyboard is shown (7 answers) Closed 3 years ago . I am having trouble pushing up the entire recycler view when the keyboard is diplayed, it cuts off the message that is previous. I am create a chat view that looks like this xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/commentsParentLayout" android:layout_width="match_parent" android

How to scroll the user at the exact position, which is somewhere between two views.?

走远了吗. 提交于 2019-12-09 19:10:24
问题 Actually i am implementing a recyclerview in android now i am facing a problem that when i do pagination(scrolling) then i want to scroll the user to the exact position where user was before pagination but what happens is that when i use scrollto() method it scroll to some pixels above or sometimes some pixels beow but not at the exact position. As in order to restructure my problem i want to ask is, is there any possible way by which i can check how many pixel down was the user at any

RecyclerView disappearing images

♀尐吖头ヾ 提交于 2019-12-09 16:42:53
问题 What I am trying to create is a horizontal scrolling image gallery. I have a RecyclerView (support 22.0.0). The problem I am having is that when I scroll to the end and then scroll back, usually one image will be missing sometimes two. Strangely when I keep swiping back and forth, a different image could be missing. Here is the layout for the item: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="160dp">

Viewpager is being pushed out of the screen [CoordinatorLayout] [Design Library]

◇◆丶佛笑我妖孽 提交于 2019-12-09 16:11:17
问题 I have a simple app with a viewpager containing 3 fragments. In one of the fragments I have Recyclerview list. When scrolling down, the toolbar is collapsed and when scrolling up is shown. My problem is when the toolbar is collapsed and I scroll left/right I am expanding it programmatically and it pushes the viewpager down doing so instead of just overlapping it. This results in an not pleasing displacement of the views of the screen. How can I have the toolbar to overlap my viewpager instead

Recyclerview onBindViewHolder called for all items when inside LinearLayout with weights

穿精又带淫゛_ 提交于 2019-12-09 14:14:34
问题 I recently updated from support library recyclerview-v7:23.1.1 to recyclerview-v7:25.1.0. My Layout contains 2 recylerviews splitted 50% on the screen. The xml code is as follows: <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <android.support.v7.widget.RecyclerView android:id="@+id/recyclerView1" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:scrollbars="none"/>

Spring animation in Recyclerview Items

↘锁芯ラ 提交于 2019-12-09 13:53:14
问题 Need to implement Spring animation in Recyclerview item when Swipe up is done to the item in the Recyclerview . I have tried the spring animation but somehow not able to achieve the animation. Any suggestion or any other library is appreciated. I am sharing the design template. Only I need to do is when swipe up is done to the item the item will move up a bit with little elevation and come back to its initial position. I have tried with this animation library provided by Google but not able

RecyclerView - get Position inside Activity rather than RecyclerViewAdapter

自古美人都是妖i 提交于 2019-12-09 13:44:13
问题 It is my third day now dealing with the handling of my view clicks. I originally was using ListView , then I switched to RecyclerView . I have added android:onclick elements to every control on my row_layout and I am handling them in my MainActivity like this: public void MyMethod(View view) {} In my old ListView implementation, I have done setTag(position) to be able to get it in MyMethod by doing this inside it: Integer.parseInt(view.getTag().toString()) This worked nicely without problems.

Android L: Fast scroll for the RecyclerView

元气小坏坏 提交于 2019-12-09 13:35:14
问题 I'm trying to use RecyclerView in my application with lots of data in it and would like to make a fast scroll for it, just like for the ListView . Approach from this answer worked for me with ListView , but does not work for the RecyclerView . Even if I set fast scroll to true in RecyclerView layout, it still does not work: <android.support.v7.widget.RecyclerView android:id="@+id/recycler_view" android:scrollbars="vertical" android:layout_width="match_parent" android:layout_height="match

RecyclerView corrupts view using notifyItemMoved()

左心房为你撑大大i 提交于 2019-12-09 10:34:21
问题 I'm having a problem with using the notifyItemMoved() method. It seems to be incorrectly displaying unmoved views. My list has 4 element in it. What I want to do is animate a swap between item 1 and item 3. Items 1 and 3 swap correctly, but item 2 displays what was at item 3! So the list starts off looking something like this: Item 0 Item 1 Item 2 Item 3 And ends like this: Item 0 Item 3 Item 3 <!-- What the heck has this changed for? Item 1 My adapter is backed by a List mProductList . I