android-recyclerview

Android layout advice (RecyclerView, ViewPager and CardView)

て烟熏妆下的殇ゞ 提交于 2020-01-06 02:37:06
问题 I need some advice to implement a design for my android application. I'm using a RecyclerView to display a list of CardView . No problem with that. But, I need a top section with a ViewPager that display other CardView with horizontal swipping: See http://i.stack.imgur.com/akg2i.png I've read that Viewpager is not very built to be in a RecyclerView , so maybe a better way is to create a ScrollView with a ViewPager inside then a RecyclerView below and disable the scrolling of the RecyclerView

Android - Preventing item duplication on RecyclerView

丶灬走出姿态 提交于 2020-01-06 02:25:51
问题 I have a problem regarding RecyclerView duplicating its items on scroll to top. My RecyclerView populates its View by taking values from an online database on scroll down to a certain threshold. I am well aware of RecyclerView 's behavior on reusing the Views , but I don't want that to happen as it'll get confusing due to having Views with different items inside. I've searched around SO for the solution. Some said that I have to override getItemId like : @Override public long getItemId(int id

RecyclerView not populating the first time I enter the activity but showing after i exit and re-enter the activity

风格不统一 提交于 2020-01-05 09:03:37
问题 As title describes, i need to enter the activity the first time to a blank screen. I then need to exit the activity by pressing back and re-enter the activity again to be able to see the recycler view. Fortunately, when the recycler view populates, everything is in order and it shows exactly how I want it to be shown on screen. This is my activity class: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.hosting_trip);

RecyclerView not populating the first time I enter the activity but showing after i exit and re-enter the activity

ε祈祈猫儿з 提交于 2020-01-05 09:02:12
问题 As title describes, i need to enter the activity the first time to a blank screen. I then need to exit the activity by pressing back and re-enter the activity again to be able to see the recycler view. Fortunately, when the recycler view populates, everything is in order and it shows exactly how I want it to be shown on screen. This is my activity class: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.hosting_trip);

How to set check box true if once checked in RecyclerView like flipkart price range

♀尐吖头ヾ 提交于 2020-01-05 07:12:54
问题 Hello can any one help me how to set checked true checkbox in RecyclerView if user checked it once and apply filter same as flipkart price filter here is my code :- final ResultGetCategory datum = moviesList.get(position); holder.label_category_name.setText(datum.getName()); //checkbox click event handling holder.checkbox.setChecked(datum.isSelected()); holder.checkbox.setTag(moviesList.get(position)); SharedPreferences prefsCheckBox = getContext().getSharedPreferences(String.valueOf(holder

Android RecyclerView - scrolling changes items

这一生的挚爱 提交于 2020-01-05 05:34:06
问题 I have a recyclerview with linear layout manager and it contains different items. one of the items have a button that hides or display the nested layout of this items. So I added something like 10 rows of the specific type, and when I click on specific item, it's nested layout is displayed, but I see that another item display it's own nested layout. Second try was to click on some button and scrolling, the nested layout was shown on a different items. As you can see from the code, I tried to

RecyclerView is not showing any item

£可爱£侵袭症+ 提交于 2020-01-05 05:33:08
问题 I have a RecyclerView which items I populate from json response. public class UserProfile extends AppCompatActivity { private UserData userData; private ProfileNewsFeedAdapter adapter; private ArrayList<ProgramModel> list; private RecyclerView profileNewsFeed; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.user_profile_activity); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar);

How to let Espresso click a specific RecyclerView item?

五迷三道 提交于 2020-01-05 05:27:27
问题 I am trying to write an instrumentation test with Espresso for my Android app which uses a RecyclerView . Here is the main layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:id="@+id/grid" android:layout_width="match

How to let Espresso click a specific RecyclerView item?

喜夏-厌秋 提交于 2020-01-05 05:27:05
问题 I am trying to write an instrumentation test with Espresso for my Android app which uses a RecyclerView . Here is the main layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:id="@+id/grid" android:layout_width="match

Android Firebase Database Adding items with keys to recycler view

狂风中的少年 提交于 2020-01-05 05:09:13
问题 I was trying to add & show messages dynamically in recycler view but I could not figure out how to send proper data type to it's adapter. In "getNewMessage(dataSnapshot) " function, I have to add all messages to list and send it to recycler view via adapter. I tried both MessageModel model = dataSnapshot.getValue(MessageModel.class) and creating a SampleModel that contains List<MessageModel> list , and SampleModel model = dataSnapshot.getValue(SampleModel.class); They didn't work. Here sample