Android Open Source - lffl-feed-reader Article Fragment






From Project

Back to project page lffl-feed-reader.

License

The source code is released under:

GNU General Public License

If you think the Android project lffl-feed-reader 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.iven.lfflfeedreader.mainact;
/* w w w.j av  a2  s . c  om*/
import com.iven.lfflfeedreader.R;
import com.iven.lfflfeedreader.domparser.RSSFeed;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebSettings.LayoutAlgorithm;
import android.widget.ScrollView;
import android.widget.TextView;

public class ArticleFragment extends Fragment {
  private int fPos;
  RSSFeed fFeed;
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    fFeed = (RSSFeed) getArguments().getSerializable("feed");
    fPos = getArguments().getInt("pos");
  }

  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle savedInstanceState) {
    View view = inflater
        .inflate(R.layout.article_fragment, container, false);
    
    TextView title = (TextView) view.findViewById(R.id.title);
    WebView wb = (WebView) view.findViewById(R.id.desc);

    ScrollView sv = (ScrollView) view.findViewById(R.id.sv);
    sv.setVerticalFadingEdgeEnabled(true);

    // Set webview settings
    WebSettings ws = wb.getSettings();
    ws.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
    

    // Set the views
    title.setText(fFeed.getItem(fPos).getTitle());
    
    wb.loadData(fFeed.getItem(fPos).getDescription(), "text/html; charset=utf-8", "UTF-8");
    
    
    
    return view;
  }
}




Java Source Code List

com.iven.lfflfeedreader.domparser.DOMParser.java
com.iven.lfflfeedreader.domparser.RSSFeed.java
com.iven.lfflfeedreader.domparser.RSSItem.java
com.iven.lfflfeedreader.imageparserutils.FileCache.java
com.iven.lfflfeedreader.imageparserutils.ImageLoader.java
com.iven.lfflfeedreader.imageparserutils.MemoryCache.java
com.iven.lfflfeedreader.imageparserutils.Utils.java
com.iven.lfflfeedreader.infoact.InfoActivity.java
com.iven.lfflfeedreader.mainact.ArticleActivity.java
com.iven.lfflfeedreader.mainact.ArticleFragment.java
com.iven.lfflfeedreader.mainact.ListActivity.java
com.iven.lfflfeedreader.mainact.SplashActivity.java