diff --git a/libs/universal-image-loader-1.9.3.jar b/libs/universal-image-loader-1.9.3.jar new file mode 100644 index 00000000..e8ca33b7 Binary files /dev/null and b/libs/universal-image-loader-1.9.3.jar differ diff --git a/res/layout/headlines_row.xml b/res/layout/headlines_row.xml index 326ff49c..1d40e1bf 100644 --- a/res/layout/headlines_row.xml +++ b/res/layout/headlines_row.xml @@ -74,6 +74,24 @@ android:textSize="12sp" /> + + + + + - - - + + + + + + - - + + + + + - - > + android:paddingBottom="2dp" + android:paddingLeft="6dp" + android:paddingRight="6dp" + android:paddingTop="6dp" > + + + + + - - @@ -105,30 +119,30 @@ android:layout_height="match_parent" android:layout_weight="1" android:ellipsize="end" + android:fontFamily="sans-serif-light" android:gravity="center_vertical" android:singleLine="true" android:text="by Author" - android:fontFamily="sans-serif-light" - android:textStyle="italic" android:textColor="?headlineSecondaryTextColor" - android:textSize="12sp" /> + android:textSize="12sp" + android:textStyle="italic" /> = android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) { + try { + File httpCacheDir = new File(getApplicationContext().getCacheDir(), "http"); + long httpCacheSize = 10 * 1024 * 1024; // 10 MiB + HttpResponseCache.install(httpCacheDir, httpCacheSize); + } catch (IOException e) { + e.printStackTrace(); + } + } + } */ + protected void setSmallScreen(boolean smallScreen) { Log.d(TAG, "m_smallScreenMode=" + smallScreen); m_smallScreenMode = smallScreen; @@ -128,11 +149,14 @@ public class CommonActivity extends ActionBarActivity { } initDatabase(); - + m_compatMode = android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB; Log.d(TAG, "m_compatMode=" + m_compatMode); + ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext()).build(); + ImageLoader.getInstance().init(config); + super.onCreate(savedInstanceState); } @@ -225,5 +249,4 @@ public class CommonActivity extends ActionBarActivity { return display.getWidth(); } } - } diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java index 66202e3c..9a47328e 100644 --- a/src/org/fox/ttrss/HeadlinesFragment.java +++ b/src/org/fox/ttrss/HeadlinesFragment.java @@ -1,5 +1,10 @@ package org.fox.ttrss; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.text.DateFormat; @@ -24,10 +29,14 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Resources.Theme; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Typeface; import android.net.Uri; +import android.net.http.HttpResponseCache; +import android.os.AsyncTask; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.v4.app.Fragment; @@ -57,6 +66,10 @@ import android.widget.ListView; import android.widget.TextView; import com.google.gson.JsonElement; +import com.nostra13.universalimageloader.core.DisplayImageOptions; +import com.nostra13.universalimageloader.core.ImageLoader; +import com.nostra13.universalimageloader.core.assist.FailReason; +import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; public class HeadlinesFragment extends Fragment implements OnItemClickListener, OnScrollListener { public static enum ArticlesSelection { ALL, NONE, UNREAD }; @@ -781,98 +794,92 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, } }); } - - TextView te = (TextView)v.findViewById(R.id.excerpt); String articleContent = article.content != null ? article.content : ""; - /* if (m_prefs.getBoolean("headlines_full_content", false)) { - final WebView content = (WebView)v.findViewById(R.id.content); - - if (content != null) { - - Document doc = Jsoup.parse(articleContent); - - if (doc != null) { - // thanks webview for crashing on