Android Open Source - RSSNewsReaderApp Main Custom Array Adapter






From Project

Back to project page RSSNewsReaderApp.

License

The source code is released under:

GNU General Public License

If you think the Android project RSSNewsReaderApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.romanostrechlis.rssnews.legacy;
/* w  ww . j  a  v  a2  s .c o  m*/
import java.util.List;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.romanostrechlis.rssnews.R;
import com.romanostrechlis.rssnews.content.RssFeed;

/**
 * Manages the appearance of {@link ListView} in NodeListActivity.
 * 
 * @author Romanos Trechlis
 * @deprecated
 */
public class MainCustomArrayAdapter extends ArrayAdapter<RssFeed> {

  private final Context context;
  private final List<RssFeed> objects;

  public MainCustomArrayAdapter(Context context, int resource, List<RssFeed> objects) {
    super(context, resource, objects);
    this.context = context;
    this.objects = objects;
  }

  /**
   * Sets the layout of NodeListActivity.
   */
  @SuppressLint("ViewHolder")
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View rowView = inflater.inflate(R.layout.activity_manage_listview_layout, parent, false);
    TextView textView = (TextView) rowView.findViewById(R.id.tvLabel);
    ImageView imageView = (ImageView) rowView.findViewById(R.id.ivIcon);
    
    RssFeed feed = objects.get(position);
    textView.setText(feed.getName());
    if (feed.getNewContent()) {
      imageView.setImageResource(android.R.drawable.button_onoff_indicator_on);
    } else {
      imageView.setImageResource(android.R.drawable.button_onoff_indicator_off);
    }
    return rowView;
  }
}




Java Source Code List

com.romanostrechlis.rssnews.DetailActivity.java
com.romanostrechlis.rssnews.MainActivity.java
com.romanostrechlis.rssnews.auxiliary.DatabaseHandler.java
com.romanostrechlis.rssnews.auxiliary.ExpCustomListAdapter.java
com.romanostrechlis.rssnews.auxiliary.Helper.java
com.romanostrechlis.rssnews.auxiliary.ManageCustomArrayAdapter.java
com.romanostrechlis.rssnews.auxiliary.OnSwipeTouchListener.java
com.romanostrechlis.rssnews.auxiliary.RetrieveFeedTask.java
com.romanostrechlis.rssnews.auxiliary.UpdateService.java
com.romanostrechlis.rssnews.content.RssFeed.java
com.romanostrechlis.rssnews.content.RssItem.java
com.romanostrechlis.rssnews.legacy.MainCustomArrayAdapter.java
com.romanostrechlis.rssnews.legacy.NodeDetailActivity.java
com.romanostrechlis.rssnews.legacy.NodeDetailFragment.java
com.romanostrechlis.rssnews.legacy.NodeListActivity.java
com.romanostrechlis.rssnews.legacy.NodeListFragment.java
com.romanostrechlis.rssnews.managefeeds.EditRssFeedActivity.java
com.romanostrechlis.rssnews.managefeeds.ManageActivity.java
com.romanostrechlis.rssnews.managefeeds.NewFeedsActivity.java
com.romanostrechlis.rssnews.settings.SettingsActivity.java