fastadapter

FastAdapter Position

≯℡__Kan透↙ 提交于 2020-02-28 18:46:32
问题 I am using fast adapter of the mike penz where I am trying to remove the item from the adapter . Its like when I press the accept button then the item must be removed from the list but to remove the like I need to pass the position variable in it but I am not able to get the position variable from the adapter . MainActivity.class public class Doc_Appointment_Req extends BaseActivity { @BindView(R.id.doc_app_req_recyclerview) RecyclerView doc_app_req_recyclerview; FastItemAdapter<Doc

FastAdapter Position

自作多情 提交于 2020-02-28 18:46:13
问题 I am using fast adapter of the mike penz where I am trying to remove the item from the adapter . Its like when I press the accept button then the item must be removed from the list but to remove the like I need to pass the position variable in it but I am not able to get the position variable from the adapter . MainActivity.class public class Doc_Appointment_Req extends BaseActivity { @BindView(R.id.doc_app_req_recyclerview) RecyclerView doc_app_req_recyclerview; FastItemAdapter<Doc

Implement OnClickListener on FastAdapter implementing IItem

99封情书 提交于 2020-01-05 08:17:09
问题 I am learning to use FastAdapter with Realm . Here is my model and this is how I implement OnClick in a Fragment : fastAdapter.withOnClickListener(new FastAdapter.OnClickListener<ProductsModel>() { @Override public boolean onClick(View v, IAdapter<ProductsModel> adapter, ProductsModel item, int position) { Toast.makeText(getActivity(), "got it", Toast.LENGTH_SHORT).show(); return false; } }); But I don't get the Toast appearing. Can anybody please tell me what am I missing? Update: Here is my

Unable to write an algorithm for filtering out items in a RecyclerView based on a long saved with each item

流过昼夜 提交于 2020-01-03 08:53:23
问题 I have several items in a RecyclerView and each item has a long value saved with it. I'm using FastAdapter as the adapter for my RecyclerView . Suppose there are 7 items in the RecyclerView with the long values: 11122 , 12321 , -98811 , 8870 , -88009 , 3398 , and -22113 . So, what I want to do is, I want to filter the items based on the above given long values using this logic: if (l <= 1000) { // show items with long value <=1000 } else if (l > 1000) { // show items with long value >1000 } I

Unable to write an algorithm for filtering out items in a RecyclerView based on a long saved with each item

て烟熏妆下的殇ゞ 提交于 2020-01-03 08:52:51
问题 I have several items in a RecyclerView and each item has a long value saved with it. I'm using FastAdapter as the adapter for my RecyclerView . Suppose there are 7 items in the RecyclerView with the long values: 11122 , 12321 , -98811 , 8870 , -88009 , 3398 , and -22113 . So, what I want to do is, I want to filter the items based on the above given long values using this logic: if (l <= 1000) { // show items with long value <=1000 } else if (l > 1000) { // show items with long value >1000 } I

FastAdapter flickers after loading from LiveData even though the data stays same

…衆ロ難τιáo~ 提交于 2019-12-24 16:17:59
问题 For the question I have prepared a simple and working example at Github: My example app downloads a JSON array containing top 30 players in a game using okhttp and stores them into SQLite Room. In the fragment I observe the corresponding LiveData<List<TopEntity>> object and update the FastAdapter instance: public class TopFragment extends Fragment { private final ItemAdapter<TopItem> mItemAdapter = new ItemAdapter<>(); private final FastAdapter<TopItem> mFastAdapter = FastAdapter.with

Android Room: Is it possible to use bounded type parameters in an entity?

大兔子大兔子 提交于 2019-12-13 02:56:22
问题 I am currently combining Mike Penz Fastadapter with Android Room. The expandable model class needs to be implemented like this: public class MyClass<Parent extends IItem & IExpandable, SubItem extends IItem & ISubItem> extends AbstractExpandableItem<MyClass<Parent, SubItem>, MyClass.ViewHolder, SubItem> { I want to use the model also as a room entity. The first problem was easy to solve - I created a custom version of AbstractExpandableItem where the fields would be annoteted with @Ignore

ViewHolder not setting the string as text of a TextView. Please see details

冷暖自知 提交于 2019-12-07 18:58:10
问题 I am using FastAdapter in my android project. This is how I am using it: public class HRequest extends AbstractItem<HRequest, HRequest.ViewHolder> { public String imageURL; public HRequest() { } public HRequest(String imageURL) { this.imageURL = imageURL; } // Fast Adapter methods @Override public int getType() { return R.id.recycler_view; } @Override public int getLayoutRes() { return R.layout.h_request_list_row; } @Override public void bindView(ViewHolder holder) { super.bindView(holder);

FastAdapter Position

和自甴很熟 提交于 2019-12-06 15:01:22
I am using fast adapter of the mike penz where I am trying to remove the item from the adapter . Its like when I press the accept button then the item must be removed from the list but to remove the like I need to pass the position variable in it but I am not able to get the position variable from the adapter . MainActivity.class public class Doc_Appointment_Req extends BaseActivity { @BindView(R.id.doc_app_req_recyclerview) RecyclerView doc_app_req_recyclerview; FastItemAdapter<Doc_Appointment_Req_Adapter> doctorreqappadapter; @Override protected void onCreate(@Nullable Bundle

ViewHolder not setting the string as text of a TextView. Please see details

前提是你 提交于 2019-12-06 05:54:05
I am using FastAdapter in my android project. This is how I am using it: public class HRequest extends AbstractItem<HRequest, HRequest.ViewHolder> { public String imageURL; public HRequest() { } public HRequest(String imageURL) { this.imageURL = imageURL; } // Fast Adapter methods @Override public int getType() { return R.id.recycler_view; } @Override public int getLayoutRes() { return R.layout.h_request_list_row; } @Override public void bindView(ViewHolder holder) { super.bindView(holder); holder.imageURL.setText(imageURL); } // Manually create the ViewHolder class protected static class