android-recyclerview

Android toolbar elevation when scrolling

泪湿孤枕 提交于 2021-02-17 08:44:56
问题 I try to implement a search bar like in google maps android app: When the recycler view is in its initial state, the toolbar has no elevation. Only when the users starts scrolling the elevation becomes visible. And the search bar (toolbar) never collapses. Here is what I tried to replicate this: <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.v7.widget.RecyclerView

Can help me to delete data from firebase and recyclerView?

痴心易碎 提交于 2021-02-17 07:14:09
问题 I did recyclerView retrieve data from firebase real-time database, and created button for delete item from recycelerView and from database I have 2 questions 1- after i add new item in recyclerView and then try delete it not delete directly , just when add item and run code again then i can delete it public class WorkerRecyclerViewAdapter extends RecyclerView.Adapter<WorkerRecyclerViewAdapter.ViewHolder> { private Context context; private ArrayList<Worker> workersList; private

Changes made to RecyclerView does not save

我的未来我决定 提交于 2021-02-17 06:00:33
问题 I used firebase database to load information into the recyclerview. By using itemtouchhelper, I was able to relocate the items in the recyclerview. However, the changes made to the recyclerview doesn't save and always goes back to its original state when I end the activity. How can I fix my code to make the changes last permanently? ItemTouchHelper.SimpleCallback simpleCallback = new ItemTouchHelper.SimpleCallback(ItemTouchHelper.UP | ItemTouchHelper.DOWN | ItemTouchHelper.START |

how to store recyclerview data on onSaveInstanceState

拥有回忆 提交于 2021-02-16 18:21:06
问题 I want to save data from the API in the RecyclerView so that when rotating the screen is not reloaded I think I can use onSaveInstanceState but still don't really understand how to use it @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); final RecyclerView rvTVShow = view.findViewById(R.id.rv_shows); rvTVShow.setHasFixedSize(true); rvTVShow.setLayoutManager(new LinearLayoutManager(getActivity()));

ListAdapter submitList() - How to scroll to beginning

橙三吉。 提交于 2021-02-16 04:09:58
问题 I have an issue with my RecyclerView and ListAdapter. Through an API, I receive items in a ascending order from older to newer. My list is then being refreshed by calling the submitList(items) method. However, since everything is asynchronous, after receiving the first item, the RecyclerView remains on the position of the first item received and showed. Since in the ListAdapter class there is no callback when the submitList() method completed, I cannot find a way to scroll after the updates

Remaking TikTok's comments UI: Sticky EditText at the bottom

青春壹個敷衍的年華 提交于 2021-02-11 15:42:58
问题 Problem: I am trying to remake TikTok's comments UI using a BottomSheetDialogFragment and a RecyclerView . This is how it looks like (ORIGINAL): This is what I have tried for now: Basically, I have a FrameLayour whose first child contains eveerything other than the EditText and the second child is, of course, the EditText. <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/relativeLayout" android:layout_width

Remaking TikTok's comments UI: Sticky EditText at the bottom

隐身守侯 提交于 2021-02-11 15:41:49
问题 Problem: I am trying to remake TikTok's comments UI using a BottomSheetDialogFragment and a RecyclerView . This is how it looks like (ORIGINAL): This is what I have tried for now: Basically, I have a FrameLayour whose first child contains eveerything other than the EditText and the second child is, of course, the EditText. <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/relativeLayout" android:layout_width

My List is being sorted by the alphabetical order after sorting by date while I'm adding the 4-5 items in my List

廉价感情. 提交于 2021-02-11 15:14:33
问题 My List is being sorted by the alphabetical order after sorting by date while I am adding extra 4-5 items in my List with different names. I want to sort my List by date and time only. here I have shared my code please help me to do so. thanks in advance. // Filters All patient to keep only single latest record of each patient id private List<PatientData> filterPatients(List<PatientData> allPatientData) throws ParseException { HashMap<String ,Pair<PatientData,Date>> filtered = new HashMap<>()

My List is being sorted by the alphabetical order after sorting by date while I'm adding the 4-5 items in my List

我的梦境 提交于 2021-02-11 15:14:23
问题 My List is being sorted by the alphabetical order after sorting by date while I am adding extra 4-5 items in my List with different names. I want to sort my List by date and time only. here I have shared my code please help me to do so. thanks in advance. // Filters All patient to keep only single latest record of each patient id private List<PatientData> filterPatients(List<PatientData> allPatientData) throws ParseException { HashMap<String ,Pair<PatientData,Date>> filtered = new HashMap<>()

BottomNavigationView overlaps the last item of RecycleView

吃可爱长大的小学妹 提交于 2021-02-11 14:49:12
问题 I have two cases. Both with bug. Root element is ConstraintLayout . Fragment element with NavHostFragment ( RecycleView inside). BottomNavigationView connect to bottom . Bug: doesn't work animation of scrolling by CollapsingToolbarLayout . Root element is CoordinatorLayout . The animation by CollapsingToolbarLayout is work. Bug: BottomNavigationView covers last item of RecycleView . Two gifs. Attention the AppBar and date 5 August 2019 (in the bottom). Please help to fix the layout so that