android-recyclerview

Images from google api are getting cached and I need to figure out how to remove them when the app closes

梦想的初衷 提交于 2019-12-11 17:25:35
问题 I built a recyclerview that gets data from Google places api and displays it. I didn't notice that the photos are being cached every time I open the app. According to google, that is illegal so I need to get rid of caching. I initially thought it was because i used the Picasso library but i added code for that, and now I'm stuck. I get the data from google in a bitmap then send it through to the recyclerview . I pass it through a URI creator to be able to use it with the Picasso Library and I

Why layout is not attach in RecyclerView Adapter class?

牧云@^-^@ 提交于 2019-12-11 17:14:39
问题 I have the following setup for a recyclerview. Now the problem is my layout is not attached with the recyclerview adapter, meaning it is not showing when I enter the layout name in the recyclerview adapter class. fragment_service.xml <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v4.view.ViewPager android:id="@+id/viewPager" android:layout_width="match_parent" android:layout_height="150dp" android:layout

Lag with asynctask when load data from firebase

99封情书 提交于 2019-12-11 17:08:59
问题 I'm trying to use asink task to download the data from the background firebase and use them to create a non-proprietary firebase recyclerview. However, lags after the postexecute remain the same. I do not know if what I did is right. What am I doing wrong? public class FriendFragmentFollow extends Fragment { FriendHoldAdapter3 adapter; RecyclerView recyclerView; ArrayList<FriendItem> username; ArrayList<String> uid, url; DatabaseReference mDatabase; @Override public View onCreateView

Create a CardView only if object have a specific value in Firebase

巧了我就是萌 提交于 2019-12-11 17:07:45
问题 I have objects in my firebase database called userForm . Each userForm have an instance variable called isPassedInspection that is either set to true or false in my firebase. users can send Form object to my firebase, therefore I manually set isPassedInspection to true once I consider the form they send as "approved" by my standards. I would like that my RecyclerView only create CardViews for userForm that it's isPassedInspection is true, otherwise, don't create a CardView (return null). This

Recycler view arrange items in a grid that scrolls horizontally

寵の児 提交于 2019-12-11 16:57:46
问题 I have set of icons that I need to display in a RecyclerView arranged in a grid, and make that grid scroll horizontally. Normally I would use GridLayoutManager for something like this, but my requirements are preventing me from doing this. Namely, not only that the items have to be arranged in a grid, but they also need to be added to the grid row by row and not column by column (this is how GridLayoutManager does it). So for example, if the grid is is 3x3 and I have 4 items, they shouldn't

Testing a RecyclerView: RecyclerViewActions isn't scrolling far enough

断了今生、忘了曾经 提交于 2019-12-11 16:47:45
问题 I want my espresso test to scroll a RecyclerView down until it's sees a certain view and clicks it. Therefore I am using RecyclerViewActions : onView(withId(R.id.recycler)).perform( RecyclerViewActions.scrollTo<RecyclerView.ViewHolder>( hasDescendant(withText(R.string.title_item_x)) ) ) Thread.sleep(2000) onView(withId(R.id.recycler)).perform( RecyclerViewActions.actionOnItem<RecyclerView.ViewHolder>( hasDescendant(withText(R.string.title_item_x)), click() ) ) The test scrolls the

DiffCallback not called in listadapter

和自甴很熟 提交于 2019-12-11 16:32:58
问题 Hi i'm trying to use listadapter and diffcallback in my app. Somehow the view not update at all, when i do something. When i put some log inside my "areItemsTheSame" and "areContentsTheSame" inside callback, it's not called at all. Here is my mainActivity class MainActivity : AppCompatActivity() { private lateinit var recyclerView: RecyclerView private lateinit var viewAdapter: TodoAdapter private lateinit var viewManager: RecyclerView.LayoutManager private lateinit var viewModel :

Fragment won't open on RecyclerView item click

我是研究僧i 提交于 2019-12-11 16:30:54
问题 This project uses Navigation Drawer , RecyclerView and an Interface to detect the clicks on RecyclerView items. Problem is when I click on the items nothing happens. I tried to open an activity that works fine. so i think there's no problem with the interface. I found some similar questions how to open a different fragment on recyclerview OnClick but none of them helped to solve this specific problem. What is it I am doing wrong? HomeFragment.java public class HomeFragment extends Fragment

How to implement RecyclerView on a FrameLayout?

帅比萌擦擦* 提交于 2019-12-11 16:27:16
问题 I am learning RecyclerView and stuck in activity. I have a bottomNavigationView and a frame layout above the bottomNavigationView I want to show a RecyclerView on that FrameLayout. How can I do that? There is no error in my program and i don't know why its not showing the RecyclerView. This is the xml <RelativeLayout 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

v7 RecyclerView.computeVerticalScrollRange() gives NullPointerException

只愿长相守 提交于 2019-12-11 16:24:24
问题 i am getting Fatal Exception: java.lang.NullPointerException at android.support.v7.widget.RecyclerView.computeVerticalScrollRange(SourceFile:1654) at android.view.View.onDrawScrollBars(View.java:12160) at android.view.View.draw(View.java:14742) at android.support.v7.widget.RecyclerView.draw(SourceFile:3097) at android.view.View.getDisplayList(View.java:13588) at android.view.View.getDisplayList(View.java:13635) at android.view.View.draw(View.java:14430) at android.view.ViewGroup.drawChild