Posts

Showing posts with the label android-recyclerview

How to add Child and Parent items programmatically [ExpandableRecyclerView]?

How to add Child and Parent items programmatically [ExpandableRecyclerView]? Acutally i'm trying to implement in my app this Expandable Recycler View. So i made an project a part for make some test and just after i get how it's work impelent it in my app but i'm having some issues. I've used this classe's from the ERV github for build by app and i've added 2 EditText in the layout and 2 buttons , so that i would archive it if i write something in "GENRE" edittext and i press button ADD GENRE there will be added in RecyclerView an Item and if i put something in EditText Artist and i'll press ADD ARTIST i want that it will be added to the last added GENRE item in the RecyclerView . EditText buttons edittext RecyclerView EditText RecyclerView Here is my code from my MainActivity. public class MainActivity extends AppCompatActivity { public GenreAdapter adapter; List<Genre> parent; EditText artistTXT; EditText genreTXT; ...

No adapter attached; skipping layout when clicking back button and starting the app again

Image
No adapter attached; skipping layout when clicking back button and starting the app again Android Studio 3.2 Canary 18 kotlin_version = 1.2.50 I have a simple app that uses a recyclerview and adapter. When the app starts is load all the data. However, when I click the back button and start the app again. It won't display the data (blank). If I clear the app from memory and start the app. The data will load as normal. I am loading the data from sqlite and the data is loaded each time. as it populates the insectDataModelList . insectDataModelList After going into the RecyclerView.java source code the reason is the mAdapter is null. However, I have checked that the adapter is correct when I set it to the recyclerview. RecyclerView.java mAdapter void dispatchLayout() { if (mAdapter == null) { Log.e(TAG, "No adapter attached; skipping layout"); // leave the state in START return; } ... } My MainActivity.java is Java...

Stfalcon Chatkit Library

Stfalcon Chatkit Library First and foremost I will appreciate if any one have any tutorial or walkthrough on how to implement chatkit android library by stfalcon. My challenges are: How do I differentiate between the sender and the receiver if their is only one adapter and the sender or receiver is determined from there??? messagesList = (MessagesList) findViewById(R.id.messages_list); adapter = new MessagesListAdapter(this.senderId, null); messagesList.setAdapter(adapter); Secondly can I have an explanation on the Model part? The UserModel is a bit confusing to me! public class Message implements IMessage { public String text; public String id; public Date createdAt; public UserModel author = new UserModel(); public Message(String text, String id, Date createdAt) { this.text = text; this.id = id; this.createdAt = createdAt; } @Override public String getId() { return id; } @Override public Str...

RecycylerView with SortedList shows duplicate items

RecycylerView with SortedList shows duplicate items I use an SortedList with a RecyclerViewAdapter for my list. Therefore I send my items (loaded from my backend in a background thread) via an listener to my GameListAdapter . According to the implemented logic in my SortedListAdapterCallback items sent to the adapter with the same id should be replaced instead of being inserted multiple times. Unfortunately this is mainly, but not always the case. SortedList RecyclerViewAdapter GameListAdapter SortedListAdapterCallback This is the constructor of my GameListAdapter GameListAdapter public GameListAdapter(RecyclerView list) { this.list = list; gamelistItems = new SortedList<>(GameListItem.class, new SortedListAdapterCallback<GameListItem>(this) { @Override public int compare(GameListItem o1, GameListItem o2) { return o1.getDate().compareTo(o2.getDate()); } @Override public boolean areContentsTheSame(GameListItem ol...