android-recyclerview

Draw multiple lines on a RecyclerView background

末鹿安然 提交于 2019-12-13 21:18:11
问题 I'm trying to draw multiple horizontal lines on a RecyclerView background. These lines have to be at a precise position, because there is a list of elements which have to fit between them. I could just add the lines to each element but I need those lines drawn, even if there are no elements added to the list. How can I draw lines on the background? (I can't do it from the .xml) Thank you for your time! Example image 回答1: It looks like you want to draw list dividers. I think you want to use

onLayout changed causes RecyclerView horizontal scroll to reset

▼魔方 西西 提交于 2019-12-13 21:15:54
问题 When the text is changed, the layout refreshed and the scrolling in the recyclerview is resets to position 0, 0. Here is my layout: <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <android.support.v7.widget.RecyclerView android:id="@+id/recyclerview1" android:layout_width="match_parent" android:layout_height="132dp" android:scrollbars="horizontal" /> <LinearLayout android:layout_width="match_parent" android:layout_height=

RecyclerView ItemDecoration onDraw

跟風遠走 提交于 2019-12-13 21:05:57
问题 The spec for RecyclerView.ItemDecoration says that onDraw(Canvas c, RecyclerView parent) is deprecated. Instead, they say to override onDraw(Canvas, RecyclerView, RecyclerView.State) . However, I don't understand what kind of State object I should pass to this method. I see State passed internally in RecyclerView's methods like: onLayoutChildren , scrollVerticallyBy , and onFocusSearchFailed . But I see no examples to use the State object programmatically to pass to onDraw method. Does

Does anyone know if Firebase can notify the adapter against a Query.

只愿长相守 提交于 2019-12-13 20:01:14
问题 Can I notify the adapter to change the query? As now it does nothing... anyone? 05-28 17:04:07.358 15585-15674/com.example.rasmusjosefsson.rjcar D/OpenGLRenderer: endAllStagingAnimators on 0x7ff46e405c00 (ListPopupWindow$DropDownListView) with handle 0x7ff46f3d1b00 onCreate() private DatabaseReference mUserRef; private String mTravelTypeSelected; private Query queryRefSelected; private FirebaseRecyclerAdapter<MyWaypoint, LatLngViewHolder> mFirebaseRecyclerViewAdapter; @Override protected void

How to filter Recyclerview with SearchView on multiple parameters

岁酱吖の 提交于 2019-12-13 19:07:55
问题 I have implemented the SearchView example given here. How to filter a RecyclerView with a SearchView ....to filter and list company names based on the parameter "Product name". In my project, I want to extend this to further filter on the parameter on "city name" The below is the code for the onQueryTextSubmit which filters on the parameter "productname". @Override public boolean onQueryTextSubmit(String query) { return false; } private List<ExampleModel> filter(List<ExampleModel> models,

Empty RecyclerView when using custom Adapter

假如想象 提交于 2019-12-13 19:01:58
问题 I am trying to populate my RecyclerView with data from cloud( parse.com ). However, The end result is an Empty RecyclerView . Though I am able to retrieve the data from cloud, I don't see any on the Screen. Here is the main Activity Code: public class BigBoard extends ActionBarActivity { private List<Person> persons; private RecyclerView rv; RVAdapter adapter; String a,b; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Parse.initialize(this,

Recyclerview is not showing data from Firebase Kotlin

◇◆丶佛笑我妖孽 提交于 2019-12-13 18:23:21
问题 As title says, I'm using since yesterday Kotlin . I want to populate a RecyclerView with data from Firebase . I tried something, I built an Adapter and tried to populate the RecyclerView , my data is going to Firebasebase but not showing in the RecyclerView and I get no errors. I couldn't find any tutorials for my problem with Kotlin language Here is my Adapter: class QuestionAdapter(var items : ArrayList<Question>): RecyclerView.Adapter<QuestionAdapter.ViewHolder>() { override fun

No adapter attach,skipping layout

好久不见. 提交于 2019-12-13 18:07:36
问题 I am getting an error saying no adapter attach skipping layout.and the list doesn't appear in when emulator runs.please help.I cant see anything in list.screen appears blank.other items in the activity are appearing.i have seen almost all answer on the internet but didn't get any solution this is the logcat error. E/RecyclerView: No adapter attached; skipping layout public class SongsTab extends Fragment { private ArrayList<songInfo> _songs = new ArrayList<>(); ; RecyclerView recyclerView;

Firebase Database Failed to convert value of type java.util.ArrayList to String

女生的网名这么多〃 提交于 2019-12-13 17:53:21
问题 I can not get my recycler view to work with the houses that I have on my firebase database. What I am trying to do is display all the houses on the starting activity but no luck for now. Here is what I have tried: Sorry for the many lines of code, but I wanted to show the complete code in order to explain it better. On the onStart() I try to populate the reyclerview: public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { private

Recyclerview ViewHolder : onCreateViewHolder , view binding and onBindViewHolder in the same class

会有一股神秘感。 提交于 2019-12-13 17:20:59
问题 In RecyclerView.ViewHolder , a view is passed to the constructor. This view is an inflated layout. The RecyclerView.ViewHolder only bind the views with findViewById . The RecyclerView.Adapter has the role to : inflate the layout in onCreateViewHolder bind the ViewHolder with the data set with onBindViewHolder I have several RecyclerViews displaying the same list of data. I want each RecyclerView to display differently with their respective ViewHolder. My goal is to use the same generic