android-recyclerview

RecyclerView not calling onScrolled at the bottom

北城余情 提交于 2020-01-15 05:38:06
问题 I'm trying to create a RecyclerView with pagination and I have a problem with showing progress bar when I try to scroll down being already at the very end of the list. There's a callback RecyclerView.OnScrollListener which has a method onScrolled for handling scroll events, but it's not working when no actual scrolling has happened. There's onScrollStateChanged method that works when I try to scroll down from the bottom, but my logic requires me to know direction of the gesture (up/down), so

update position of recyclerview when scrolling (android)

久未见 提交于 2020-01-15 03:12:46
问题 How can i update position on scroll. right now the position gets updated every time i click on item. i want to update the position every time i scroll. What i wanna do is have a text view which will get updated when scrolling through the items. recyclerView.addOnItemTouchListener(new GalleryAdapter.RecyclerTouchListener(this, recyclerView, new GalleryAdapter.ClickListener() { @Override public void onClick(View view, int position) { Intent intent = new Intent(mainActivityCarasoul.this,

ItemTouchHelper - The drop is forced after the first jumped line

让人想犯罪 __ 提交于 2020-01-14 09:42:08
问题 I am using ItemTouchHelper and ItemTouchHelper.SimpleCallback to allow the user to reorder a vertical list Recycler View. The drag and drop works but the drop is forced after the first jumped line even though I don't leave up my finger from the dragged cell. Please find below the SimpleCallback : private void initSwipeAndDrap() { ItemTouchHelper.SimpleCallback simpleItemTouchCallback = new ItemTouchHelper.SimpleCallback( ItemTouchHelper.UP | ItemTouchHelper.DOWN, 0) { //========== Swipe (Not

android nested recyclerview

杀马特。学长 韩版系。学妹 提交于 2020-01-14 08:53:30
问题 I m trying to display nested recyclerview but the child items does not display. I want to display different items in all child view. I don't get a error, but the view is not refreshed. Here is my code can any one help. Thanks public class MainActivity extends ActionBarActivity { RecyclerView recyclerView; RootAdapter adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); adapter = new RootAdapter(this

Is there a way to sort the firebaserecyclerview after I calculate value after retrieving data?

Deadly 提交于 2020-01-14 06:49:46
问题 I'm using firebase database to store lat and lng of users. In this manner, Now when I retrieve them in my recyclerview I calculate the distance from my current location to that users location using the following code, private void loadLocationForThisUser(Double lat, Double lng, Double lat1, Double lng1) { //Create location from user coordinates currentUser1 = new Location(""); currentUser1.setLatitude(lat); currentUser1.setLongitude(lng); //Create location from friend coordinates friend1 =

Is there a way to sort the firebaserecyclerview after I calculate value after retrieving data?

烈酒焚心 提交于 2020-01-14 06:48:34
问题 I'm using firebase database to store lat and lng of users. In this manner, Now when I retrieve them in my recyclerview I calculate the distance from my current location to that users location using the following code, private void loadLocationForThisUser(Double lat, Double lng, Double lat1, Double lng1) { //Create location from user coordinates currentUser1 = new Location(""); currentUser1.setLatitude(lat); currentUser1.setLongitude(lng); //Create location from friend coordinates friend1 =

Android, on finish loading data from firebase

故事扮演 提交于 2020-01-14 06:34:15
问题 How to show the Progressbar on start of the activity that contains recycler view which should be hidden once the recycler view loads the data from firebase database? In onCreate method I am showing my ProgressBar but I don't know when should I hide it. Can you guys give me some ideas? Thanks 回答1: Assuming you are using a FirestoreRecyclerAdapter , to solve this, create a new object of ProgressBar and start showing it in the onCreate() method, or if you want add it directly in your .XML file

Android, on finish loading data from firebase

半城伤御伤魂 提交于 2020-01-14 06:34:07
问题 How to show the Progressbar on start of the activity that contains recycler view which should be hidden once the recycler view loads the data from firebase database? In onCreate method I am showing my ProgressBar but I don't know when should I hide it. Can you guys give me some ideas? Thanks 回答1: Assuming you are using a FirestoreRecyclerAdapter , to solve this, create a new object of ProgressBar and start showing it in the onCreate() method, or if you want add it directly in your .XML file

Android, on finish loading data from firebase

我的梦境 提交于 2020-01-14 06:34:05
问题 How to show the Progressbar on start of the activity that contains recycler view which should be hidden once the recycler view loads the data from firebase database? In onCreate method I am showing my ProgressBar but I don't know when should I hide it. Can you guys give me some ideas? Thanks 回答1: Assuming you are using a FirestoreRecyclerAdapter , to solve this, create a new object of ProgressBar and start showing it in the onCreate() method, or if you want add it directly in your .XML file

how to prevent recyclerview auto scroll to bottom when insert new items?

有些话、适合烂在心里 提交于 2020-01-14 05:26:09
问题 I am using RecyclerView to view my data, but when there are many items , RecyclerView will auto scroll to the bottom everytime a new item is inserted. how to prevent it ? this is the insert code: @Override public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) { getOneMessage(dataSnapshot.getKey(), new OneMessageCallBack() { @Override public void OnCallBack(Object_Message message) { Object_Conversation conversation=new Object_Conversation(dataSnapshot.getKey()