Merge branch 'master' of git@github.com:gothfox/Tiny-Tiny-RSS-for-Honeycomb.git
This commit is contained in:
commit
cbae8a4dc2
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.fox.ttrss"
|
package="org.fox.ttrss"
|
||||||
android:versionCode="109"
|
android:versionCode="111"
|
||||||
android:versionName="0.8.8" >
|
android:versionName="0.8.10" >
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="8"
|
android:minSdkVersion="8"
|
||||||
|
@ -2,6 +2,7 @@ package org.fox.ttrss;
|
|||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -260,28 +261,30 @@ public class ArticleFragment extends Fragment {
|
|||||||
getActivity(), android.R.layout.simple_spinner_item, spinnerArray);
|
getActivity(), android.R.layout.simple_spinner_item, spinnerArray);
|
||||||
|
|
||||||
spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||||
|
|
||||||
|
String flatContent = articleContent.replaceAll("[\r\n]", "");
|
||||||
|
boolean hasImages = flatContent.matches(".*?<img[^>+].*?");
|
||||||
|
|
||||||
for (Attachment a : m_article.attachments) {
|
for (Attachment a : m_article.attachments) {
|
||||||
if (a.content_type != null && a.content_url != null) {
|
if (a.content_type != null && a.content_url != null) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
URL url = new URL(a.content_url.trim());
|
if (a.content_type.indexOf("image") != -1 &&
|
||||||
String strUrl = url.toString().trim();
|
(!hasImages || m_article.always_display_attachments)) {
|
||||||
|
|
||||||
String regex = String.format("<img.*?src=[\"']%1$[\"']", strUrl);
|
URL url = new URL(a.content_url.trim());
|
||||||
|
String strUrl = url.toString().trim();
|
||||||
if (a.content_type.indexOf("image") != -1 && !articleContent.matches(regex)) {
|
|
||||||
content += "<p><img src=\"" + strUrl.replace("\"", "\\\"") + "\"></p>";
|
content += "<p><img src=\"" + strUrl.replace("\"", "\\\"") + "\"></p>";
|
||||||
}
|
}
|
||||||
|
|
||||||
spinnerArray.add(a);
|
|
||||||
|
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
//
|
//
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spinnerArray.add(a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,11 @@ public class ArticlePager extends Fragment {
|
|||||||
|
|
||||||
if (article != null) {
|
if (article != null) {
|
||||||
ArticleFragment af = new ArticleFragment(article);
|
ArticleFragment af = new ArticleFragment(article);
|
||||||
|
|
||||||
|
if (m_prefs.getBoolean("dim_status_bar", false) && getView() != null) {
|
||||||
|
getView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
|
||||||
|
}
|
||||||
|
|
||||||
return af;
|
return af;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -127,11 +132,6 @@ public class ArticlePager extends Fragment {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (m_prefs.getBoolean("dim_status_bar", false)) {
|
|
||||||
view.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
|
|
||||||
}
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,6 +79,11 @@ public class OfflineArticlePager extends Fragment {
|
|||||||
Log.d(TAG, "getItem: " + position);
|
Log.d(TAG, "getItem: " + position);
|
||||||
|
|
||||||
if (m_cursor.moveToPosition(position)) {
|
if (m_cursor.moveToPosition(position)) {
|
||||||
|
|
||||||
|
if (m_prefs.getBoolean("dim_status_bar", false) && getView() != null) {
|
||||||
|
getView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
|
||||||
|
}
|
||||||
|
|
||||||
return new OfflineArticleFragment(m_cursor.getInt(m_cursor.getColumnIndex(BaseColumns._ID)));
|
return new OfflineArticleFragment(m_cursor.getInt(m_cursor.getColumnIndex(BaseColumns._ID)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ public class Article implements Parcelable {
|
|||||||
public String feed_title;
|
public String feed_title;
|
||||||
public int comments_count;
|
public int comments_count;
|
||||||
public String comments_link;
|
public String comments_link;
|
||||||
|
public boolean always_display_attachments;
|
||||||
|
|
||||||
public Article(Parcel in) {
|
public Article(Parcel in) {
|
||||||
readFromParcel(in);
|
readFromParcel(in);
|
||||||
@ -60,6 +61,9 @@ public class Article implements Parcelable {
|
|||||||
out.writeString(content);
|
out.writeString(content);
|
||||||
out.writeList(attachments);
|
out.writeList(attachments);
|
||||||
out.writeString(feed_title);
|
out.writeString(feed_title);
|
||||||
|
out.writeInt(comments_count);
|
||||||
|
out.writeString(comments_link);
|
||||||
|
out.writeInt(always_display_attachments ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readFromParcel(Parcel in) {
|
public void readFromParcel(Parcel in) {
|
||||||
@ -82,6 +86,10 @@ public class Article implements Parcelable {
|
|||||||
in.readList(attachments, Attachment.class.getClassLoader());
|
in.readList(attachments, Attachment.class.getClassLoader());
|
||||||
|
|
||||||
feed_title = in.readString();
|
feed_title = in.readString();
|
||||||
|
|
||||||
|
comments_count = in.readInt();
|
||||||
|
comments_link = in.readString();
|
||||||
|
always_display_attachments = in.readInt() == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
|
Loading…
Reference in New Issue
Block a user