android-recyclerview

Android Floating Action Button doesn't get fixed at the bottom

Deadly 提交于 2020-01-07 03:53:09
问题 I have a fragment wich renders a recycleview with an floating action buttom. The problem is that when the list is empty, the fab keeps on the right top, when the list has few items, the fab keeps bellow the list but not at the bottom, and it only keeps totatly at the bottom when the list fill the screen with items. Could somebody help me please? Bellow is my code: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com

What is the best pattern to sync data between two recycler view with two activities?

假装没事ソ 提交于 2020-01-07 02:51:07
问题 I have two activities where they have almost same data, I am using same Adapter, But the problem is how to sync data. E.g. Activity A has recyclerview where it has like buttons in each row with unique id. Activity B also have same recyclerview but with some filter mechanism so it is not going to show all row, my question is how to handle like button state in Activity A and Activity B , such that if I click on activity B's like button than activity A's like button will automatically gets

Android: how do I setEnabled(true) on a CardView in onResume?

廉价感情. 提交于 2020-01-07 02:48:14
问题 I have a RecyclerView list with CardViews. I added the following code below to launch an activity (ActActivity) that allows the user to edit the CardView. The setEnabled(false) code is used to keep multiple instances of the activity from opening if the user clicks multiple times in rapid succession on the CardView. I only want one instance of the activity to be open at one time so that the user is only editing the single CardView that they clicked on. My problem is that when I add the

Android - RecyclerView Data not showing up

那年仲夏 提交于 2020-01-07 02:28:32
问题 I am using one RecyclerView to display two adjacent lists, so far so good but the problem I am facing is : I am storing the data in a public void method but when I call that method to initialize the lists it does not work in other words the items do not show up # This is the method public void InitData(){ DataHolder item1 = new DataHolder(); item1.setEnglish("word in eng"); item1.setGerman("word in ger"); list.add(item1); DataHolder item2 = new DataHolder(); item2.setEnglish("word in eng");

Android - RecyclerView Data not showing up

左心房为你撑大大i 提交于 2020-01-07 02:28:24
问题 I am using one RecyclerView to display two adjacent lists, so far so good but the problem I am facing is : I am storing the data in a public void method but when I call that method to initialize the lists it does not work in other words the items do not show up # This is the method public void InitData(){ DataHolder item1 = new DataHolder(); item1.setEnglish("word in eng"); item1.setGerman("word in ger"); list.add(item1); DataHolder item2 = new DataHolder(); item2.setEnglish("word in eng");

how to get LinearLayoutManager from RecyclerView..?

时间秒杀一切 提交于 2020-01-07 02:26:27
问题 so I had my RecyclerView In fragment tab, as usual using LinearLayoutManager and I also want to use for Endless scroll ScrollListener ,the problem is if I make a variable LinearLayoutManager in OnCreate method as below public override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); mLayoutManager = new LinearLayoutManager(Context); } public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View row = inflater

RecyclerView Adapter Methods not being called

风流意气都作罢 提交于 2020-01-06 19:47:06
问题 My RecyclerView's Adapter's methods are not being called. Only getItemCount() and class Constructor are called (List is not empty, i have checked that). Methods onCreateViewHolder() and onBindViewHolder() are not called. I have Other fragments in the same activity, using nearly same procedure but they are working perfectly fine. I tried creating a new Adapter class but that also didn't work. Method getItemCount() is called 2 times I am using same XML file for Adapter View for 2 different

RecycleView do not displaying the data

梦想与她 提交于 2020-01-06 19:36:24
问题 I have very popular question - why the data not showing in the RecycleView. That is my Adapter: public class CommentsAdapter extends RecyclerView.Adapter<CommentsAdapter.ViewHolder> { private static final String TAG = "CommentsAdapter"; public ImageView mThumbView; private List<PostComment> postCommentList; public CommentsAdapter(List<PostComment> postCommentList) { this.postCommentList = postCommentList; } @Override public CommentsAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int

How to place views exactly in the center in coordinator layout?

杀马特。学长 韩版系。学妹 提交于 2020-01-06 18:34:13
问题 I have a fragment with recycler view and a textview which will be shown when no data is available. fragment is hosted in the activity which is having coordinator layout. Now the problem is that text view is not exactly in center of screen but when toolbar collapse it comes in center. I want the textview exactly in the center. How to do that. state]2]2 Activity's Layout <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http:/

How to place views exactly in the center in coordinator layout?

大城市里の小女人 提交于 2020-01-06 18:34:08
问题 I have a fragment with recycler view and a textview which will be shown when no data is available. fragment is hosted in the activity which is having coordinator layout. Now the problem is that text view is not exactly in center of screen but when toolbar collapse it comes in center. I want the textview exactly in the center. How to do that. state]2]2 Activity's Layout <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http:/