android-recyclerview

HorizontalScrollView inside a ScrollView android

跟風遠走 提交于 2019-12-23 04:37:09
问题 I have a HorizontalScrollView inside a VerticalScrollView. If I scroll Horizontally , the scrolling is smooth. But if I scroll Vertically , the scroll is not smooth, it is getting scrolled horizontally sometimes. How to make the vertical scroll smooth ? Here is my xml , <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match

Getting previous RadioButton value from RadioGroup inside a RecyclerView

早过忘川 提交于 2019-12-23 04:32:30
问题 In the above value when I check the option "salt" it gives me the value of same position from the above item. So in this case it gives me "CH6" Like this when i check "Water" it gives me "CH4". So here is my RecyclerView , public class QuestionsAdapter extends RecyclerView.Adapter<QuestionsAdapter.ViewHolder> { List<String> names = new ArrayList<>(); Context c; String username; Map<String,Object> map = new HashMap<>(); ArrayList<QuestionData> questions = new ArrayList<>(); public

start Fragment from RecycleView Adapter Onclick

安稳与你 提交于 2019-12-23 04:26:49
问题 Hi I have A RecycleView Adapter and A button. I want that button to start a Fragment. I can start an activity but not a fragment. I have tried this Onclick method for my Button @Override public void onClick(View v) { Bundle bundle = new Bundle(); bundle.putParcelable("event", events.get(getLayoutPosition())); Fragment fragment = new EditEventDetailFragment(); fragment.setArguments(bundle); fragment.getFragmentManager().beginTransaction().replace(R.id.contentMainDrawer,fragment).commit(); }

Deleting a single SQlite row RecyclerView onSwiped

本小妞迷上赌 提交于 2019-12-23 04:20:42
问题 I'm storing text items in a RecyclerView adapter and in a Content Provider. The list is accessible from the menu option. Items are deleted by swiping. Currently, the items are being saved, but not deleted. I've debugged and it shows that the "id" is 0(isn't being retrieved in the Main Activity): int id = (int) viewHolder.itemView.getTag(); The selected item isn't being swiped off the screen. I'm basing my code on this structure: https://www.javatips.net/api/ud851-Exercises-master/ud851

Dynamic buttons added to a GridLayout using RecyclerView are added on top of each other

送分小仙女□ 提交于 2019-12-23 04:17:08
问题 I want to add dynamic buttons to a grid layout as shown below. Each button is added one at a time , and the layout must update itself to have the buttons in rows. My problem is that when a new button is added it appears on top of the last button added, and is not placed in a row format. In this image below I show what I want and what is currently happening, where the squares labeled with numbers are my buttons. In the image of what I have, I have added 6 buttons to the layout, but they are

onClickListener in RecyclerView adapter?

主宰稳场 提交于 2019-12-23 03:01:30
问题 I want to set up an onClickListener within my RecyclerView adapter so I can easily refer to the other views to retrieve their tags. Is it possible to set up an onClickListener in a RecyclerView adapter? How would I do it? Would it affect performance? Here is my RecyclerView adapter: public class PostRecyclerAdapter extends RecyclerView.Adapter<PostRecyclerAdapter.ViewHolder> { private Context context; private List<Post> mDataset; public static class ViewHolder extends RecyclerView.ViewHolder

onClickListener in RecyclerView adapter?

☆樱花仙子☆ 提交于 2019-12-23 03:01:14
问题 I want to set up an onClickListener within my RecyclerView adapter so I can easily refer to the other views to retrieve their tags. Is it possible to set up an onClickListener in a RecyclerView adapter? How would I do it? Would it affect performance? Here is my RecyclerView adapter: public class PostRecyclerAdapter extends RecyclerView.Adapter<PostRecyclerAdapter.ViewHolder> { private Context context; private List<Post> mDataset; public static class ViewHolder extends RecyclerView.ViewHolder

how to sort in the new Firebase database reference (Recyclerview)

♀尐吖头ヾ 提交于 2019-12-23 02:48:05
问题 I am pulling data from a username structure and I would like to sort by name or username. Is this possible with the new firebase database reference. I have been looking around and I cannot find anything about it. here is my code: databaseReference = FirebaseDatabase.getInstance().getReference().child("Users"); } @Override protected void onStart() { super.onStart(); FirebaseRecyclerAdapter<addFriends,addFriendsViewHolder> firebaseRecyclerAdapter = new FirebaseRecyclerAdapter<addFriends,

sorting in recycler view by size,date,name .etc and remember choice

倖福魔咒の 提交于 2019-12-23 02:42:13
问题 I am making gallery app and I want to add sorting to it I can sort item at run time by using Comparator but problem is whenever I quit app the list came form database again and all the list is unsorted I want to give option in my app to sort by date,size, name etc can you guys help how can i ahcevie this and remmeber user's choice if he next time run the app I have also read about sorted-list please tell me what is solution to my problem or any sample code currently I am doing this like this

RecyclerView scrolling to the bottom

一世执手 提交于 2019-12-23 02:32:29
问题 I have a recyclerView with 100+ items. When user will open the activity containing the recyclerView, recyclerView's bottom should be visible without any scrolling effect. Directly last page of the adapter should be shown like whatsapp's chatting page. I have tried by following way, but it is showing the scrolling effect when user opens the activity. recyclerView.smoothScrollToPosition(list.size()); 回答1: You can scroll to last position of recycler view by adding this line recyclerView