I'm using Recyclerview to load more than 200 datas to display in home page.
Volley taking 3 minutes loader initially.then after three to four seconds, recycler view loading more than 200 datas in adapter.So totally it takes seven seconds to load the image contents to display it into UI in home page.
But I have to load images in only three seconds.is it possible to do? If I get any suggestion regarding to this it will be helpful to me.
HomeActivity.java:
if(createdBy.equals("event")){
String eventName = jsonObject.getString("name");
String eventDate = jsonObject.getString("event_date");
String eventMonthYear = jsonObject.getString("event_date_year");
String eventLocation = jsonObject.getString("location");
homePostItems.setEventPost(createdBy);
homePostItems.setEventName(eventName);
homePostItems.setEventDate(eventDate);
homePostItems.setEventMonthYear(eventMonthYear);
homePostItems.setEventLocation(eventLocation);
}
if(createdBy.equals("post")){
homePostItems.setPostData(createdBy);
}
homePostItems.setSharePopup("socialAndGolive");
homePostItemsList.add(homePostItems);
homePostitemsAdapter.notifyDataSetChanged();
HomeAdapter.java:
@Override
public void onBindViewHolder(final MyViewHolder holder, int position) {
if (rowItem.getEventPost() != null) {
if (rowItem.getEventPost().equals("event")) {
holder.rlPostItems.setVisibility(View.GONE);
holder.ivPostFlag.setVisibility(View.GONE);
holder.userMenuImage.setVisibility(View.GONE);
holder.ivPostedImage.setClickable(false);
holder.rlEventDetails.setVisibility(View.VISIBLE);
holder.tvSubtitle.setText("Event");
holder.tvDateEvent.setText(rowItem.getEventDate());
holder.tvMonthYearEvent.setText(rowItem.getEventMonthYear());
holder.tvNameEvent.setText(rowItem.getEventName());
holder.tvAddressEvent.setText(rowItem.getEventLocation());
Typeface typeDate = Typeface.createFromAsset(context.getAssets(), "kausan.otf");
holder.tvDateEvent.setTypeface(typeDate);
Typeface typeName = Typeface.createFromAsset(context.getAssets(), "abz.ttf");
holder.tvMonthYearEvent.setTypeface(typeName);
} else {
holder.rlEventDetails.setVisibility(View.GONE);
}
} else {
holder.rlEventDetails.setVisibility(View.GONE);
}
}