android-recyclerview

Displaying Content Menu When Image on RecyclerView Item Clicked

偶尔善良 提交于 2019-12-13 08:56:46
问题 I have design my RecyclerView to display something like this: I want to show context menu when user clicked and ImageView (the vertical 3 dots image) in RecyclerView item. @Override public void onBindViewHolder(final VendorViewHolder holder, final int position) { holder.nameText.setText(this.vendors.get(position).getName()); holder.contextMenuBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { // Code to show ContextMenu here } }); } 回答1: Put that 3

How to nest a RadioGroup with dynamic lists of RadioButton inside each row/item of a RecyclerView

爷,独闯天下 提交于 2019-12-13 08:47:18
问题 I need a layout like this: The Red titles are the first level array from dish_options and the RadioButtons are a populated from an array items inside dish_options of the json: As you may notice the dish_options is an array, which might have many more object inside one of the keys of this dish_options might store an items arrays. I tried using getItemViewType() and set different layouts for first level dish_options (red title) and implemented a different layout for the RadioButton in each row

Firebase Recycler Adapter is not showing my Recyclerview in Fragments

时光怂恿深爱的人放手 提交于 2019-12-13 08:44:44
问题 Basically i followed the accepted answer of this with few changes in my Activity and it worked perfect. My problem is that I wrote the exact same codes for my Fragment. when I open my app, it doesn't show anything. Before I changed my code in my fragment from a custom Adapter to the FirebaseRecyclerAdapter, everything worked fine. This is my Fragment class public class HomeFragment extends BaseFragment { public Button buttonsrch, openFreezer, openRef, openPantry, scrollToFreezer, scrollToRef,

items in RecyclerView doesn't take the full width

£可爱£侵袭症+ 提交于 2019-12-13 08:44:30
问题 I am new in android development i make a recyclerview but I have a problem when using the RecyclerView , an item doesn't take the full width in the screen I don't know what's the problem here 's a screen shot of the problem here's the mainActivity.xml mainActivity.xml is the layout that contain the recyclerview <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk

Recyclerview setOnClickListener on Textview changes background of another row Textview

只愿长相守 提交于 2019-12-13 08:44:27
问题 My RecyclerView is like this When I Clicked on F-0 and S-0 for selection and changed background. It is also changed background color F-15 and S-15. My Code is here. MyRecyclerViewAdapter.java public class MyRecyclerViewAdapter extends RecyclerView .Adapter<MyRecyclerViewAdapter .DataObjectHolder> { private static String LOG_TAG = "MyRecyclerViewAdapter"; private ArrayList<DataObject> mDataset; private static MyClickListener myClickListener; public static class DataObjectHolder extends

Android Retrofit2: How can I create expandable recycler view for categories and subcategories?

ε祈祈猫儿з 提交于 2019-12-13 08:37:47
问题 I am trying to archive this functionality for my grocery app https://imgur.com/Ugj4BIO But I am failed to do so! I am showing you what I am able to archive. if you have any Better Solution let me know. Here is my Json code from which I am fetching my data from web server right now its localhost {"cats": [{"sub_cats": [{ "sub_id":"1", "sub_title":"Charger", "sub_img":"http:\/\/localhost\/adminPohanch\/public\/img\/img23.jpg" }, { "sub_id":"2", "sub_title":"Dummy", "sub_img":"https:\/\

Best approach to communicate between Fragment/Activity and RecyclerView.Adapter?

…衆ロ難τιáo~ 提交于 2019-12-13 08:30:06
问题 My fragment: public class FragmentSort extends Fragment { @BindView(R.id.sortRecyclerView) RecyclerView sortRecyclerView; protected RecyclerView.Adapter adapter; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View rootView = inflater.inflate(layoutResId, container, false); adapter = new StoreListItemAdapter(getActivity(), collection); sortRecyclerView.setAdapter((RecyclerView.Adapter) adapter); return

RecyclerView Not Displaying Any CardView Items

谁说胖子不能爱 提交于 2019-12-13 08:25:45
问题 I have switched from ListView to RecyclerView and am not seeing any items displayed on my mobile device. I know for a fact that it doesn't have to do with the getItemCount() method as I have hardcoded a number to that return to test it. Here is my initialization, I used Firebase to pull new data: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Firebase.setAndroidContext(this); setContentView(R.layout.activity_discussion); toolbar = (Toolbar)

No adapter attached; skipping layout : RecyclerView [duplicate]

孤街醉人 提交于 2019-12-13 08:19:11
问题 This question already has answers here : recyclerview No adapter attached; skipping layout (30 answers) Closed 2 years ago . MainActivity.class public class MainActivity extends AppCompatActivity { private static final String TAG = "ERROR"; private final static String API_KEY = "xxxxxxxxxxxxxx"; int totalpage; int page; int firstVisibleItem, visibleItemCount, totalItemCount; ProgressBar progressBar; RecyclerView recyclerView; MoviesAdapter moviesAdapter; private boolean makeCall = false;

Call contacts from a list in Android Studio

别说谁变了你拦得住时间么 提交于 2019-12-13 08:16:29
问题 I have an Android application where I used Linear Layout that shows a list of contacts. Now what I want is that when selecting the contacts, call the indicated number. For now, all it do is show the contacts, but when I click on call, it does not take any action. I do not know how to make to mark I tried with setOnClickListener() .But Unsuccessful My code: public class ContactsAdapter extends RecyclerView.Adapter<ContactsAdapter.ContactViewHolder>{ Dialog myDialog; private List<ContactModel>