support displaying article notes (requires API 8)
This commit is contained in:
parent
87d75a0d6c
commit
3b3b79ade2
@ -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="223"
|
android:versionCode="224"
|
||||||
android:versionName="1.27" >
|
android:versionName="1.28" >
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="8"
|
android:minSdkVersion="8"
|
||||||
|
@ -92,12 +92,26 @@
|
|||||||
android:textColor="?headlineSecondaryTextColor"
|
android:textColor="?headlineSecondaryTextColor"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/note"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="?articleNoteBackground"
|
||||||
|
android:textColor="?articleNoteTextColor"
|
||||||
|
android:textSize="13sp"
|
||||||
|
android:padding="2dp"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:text="[Article note]" />
|
||||||
|
|
||||||
<org.fox.ttrss.util.LessBrokenWebView
|
<org.fox.ttrss.util.LessBrokenWebView
|
||||||
android:id="@+id/content"
|
android:id="@+id/content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</org.fox.ttrss.util.NoChildFocusScrollView>
|
</org.fox.ttrss.util.NoChildFocusScrollView>
|
||||||
|
|
||||||
|
@ -25,4 +25,6 @@
|
|||||||
<attr name="loadingBackground" format="reference|color" />
|
<attr name="loadingBackground" format="reference|color" />
|
||||||
<attr name="unreadCounterBackground" format="reference|color" />
|
<attr name="unreadCounterBackground" format="reference|color" />
|
||||||
<attr name="unreadSelectedCounterBackground" format="reference|color" />
|
<attr name="unreadSelectedCounterBackground" format="reference|color" />
|
||||||
|
<attr name="articleNoteBackground" format="reference|color" />
|
||||||
|
<attr name="articleNoteTextColor" format="reference|color" />
|
||||||
</resources>
|
</resources>
|
@ -25,6 +25,8 @@
|
|||||||
<item name="loadingBackground">@android:color/white</item>
|
<item name="loadingBackground">@android:color/white</item>
|
||||||
<item name="unreadCounterBackground">@drawable/counter_background</item>
|
<item name="unreadCounterBackground">@drawable/counter_background</item>
|
||||||
<item name="unreadSelectedCounterBackground">@drawable/counter_background_selected_light</item>
|
<item name="unreadSelectedCounterBackground">@drawable/counter_background_selected_light</item>
|
||||||
|
<item name="articleNoteTextColor">#9a8c59</item>
|
||||||
|
<item name="articleNoteBackground">#fff7d5</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="SepiaTheme" parent="LightTheme">
|
<style name="SepiaTheme" parent="LightTheme">
|
||||||
@ -70,6 +72,8 @@
|
|||||||
<item name="loadingBackground">@android:color/black</item>
|
<item name="loadingBackground">@android:color/black</item>
|
||||||
<item name="unreadCounterBackground">@drawable/counter_background_dark</item>
|
<item name="unreadCounterBackground">@drawable/counter_background_dark</item>
|
||||||
<item name="unreadSelectedCounterBackground">@drawable/counter_background_dark</item>
|
<item name="unreadSelectedCounterBackground">@drawable/counter_background_dark</item>
|
||||||
|
<item name="articleNoteTextColor">@android:color/secondary_text_dark</item>
|
||||||
|
<item name="articleNoteBackground">#303030</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="SystemTheme" parent="Theme.Sherlock.DeviceDefault">
|
<style name="SystemTheme" parent="Theme.Sherlock.DeviceDefault">
|
||||||
@ -98,6 +102,8 @@
|
|||||||
<item name="loadingBackground">@android:color/black</item>
|
<item name="loadingBackground">@android:color/black</item>
|
||||||
<item name="unreadCounterBackground">@drawable/counter_background_dark</item>
|
<item name="unreadCounterBackground">@drawable/counter_background_dark</item>
|
||||||
<item name="unreadSelectedCounterBackground">@drawable/counter_background_dark</item>
|
<item name="unreadSelectedCounterBackground">@drawable/counter_background_dark</item>
|
||||||
|
<item name="articleNoteTextColor">@android:color/secondary_text_dark</item>
|
||||||
|
<item name="articleNoteBackground">#303030</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="DarkGrayTheme" parent="DarkTheme">
|
<style name="DarkGrayTheme" parent="DarkTheme">
|
||||||
@ -115,8 +121,7 @@
|
|||||||
<item name="headlineTextColor">@android:color/secondary_text_dark</item>
|
<item name="headlineTextColor">@android:color/secondary_text_dark</item>
|
||||||
<item name="actionBarStyle">@style/ActionBarDarkGray</item>
|
<item name="actionBarStyle">@style/ActionBarDarkGray</item>
|
||||||
<item name="android:actionBarStyle">@style/ActionBarDarkGray</item>
|
<item name="android:actionBarStyle">@style/ActionBarDarkGray</item>
|
||||||
<item name="headlineSelectedSecondaryTextColor">#a0a0a0</item>
|
<item name="headlineSelectedSecondaryTextColor">#a0a0a0</item>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ActionBarDarkGray" parent="Widget.Sherlock.ActionBar.Solid">
|
<style name="ActionBarDarkGray" parent="Widget.Sherlock.ActionBar.Solid">
|
||||||
|
@ -162,6 +162,17 @@ public class ArticleFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextView note = (TextView)view.findViewById(R.id.note);
|
||||||
|
|
||||||
|
if (note != null) {
|
||||||
|
if (m_article.note != null && !"".equals(m_article.note)) {
|
||||||
|
note.setText(m_article.note);
|
||||||
|
} else {
|
||||||
|
note.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
final WebView web = (WebView)view.findViewById(R.id.content);
|
final WebView web = (WebView)view.findViewById(R.id.content);
|
||||||
|
|
||||||
if (web != null) {
|
if (web != null) {
|
||||||
|
@ -1060,8 +1060,12 @@ public class OnlineActivity extends CommonActivity {
|
|||||||
|
|
||||||
builder.setPositiveButton(R.string.article_set_note, new Dialog.OnClickListener() {
|
builder.setPositiveButton(R.string.article_set_note, new Dialog.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
saveArticleNote(article, topicEdit.getText().toString().trim());
|
String note = topicEdit.getText().toString().trim();
|
||||||
article.published = true;
|
|
||||||
|
saveArticleNote(article, note);
|
||||||
|
article.published = true;
|
||||||
|
article.note = note;
|
||||||
|
|
||||||
saveArticlePublished(article);
|
saveArticlePublished(article);
|
||||||
|
|
||||||
HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
|
HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES);
|
||||||
|
@ -175,6 +175,12 @@ public class OfflineArticleFragment extends Fragment {
|
|||||||
comments.setVisibility(View.GONE);
|
comments.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TextView note = (TextView)view.findViewById(R.id.note);
|
||||||
|
|
||||||
|
if (note != null) {
|
||||||
|
note.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
final WebView web = (WebView)view.findViewById(R.id.content);
|
final WebView web = (WebView)view.findViewById(R.id.content);
|
||||||
|
|
||||||
if (web != null) {
|
if (web != null) {
|
||||||
|
@ -27,6 +27,7 @@ public class Article implements Parcelable {
|
|||||||
public String comments_link;
|
public String comments_link;
|
||||||
public boolean always_display_attachments;
|
public boolean always_display_attachments;
|
||||||
public String author;
|
public String author;
|
||||||
|
public String note;
|
||||||
|
|
||||||
public Article(Parcel in) {
|
public Article(Parcel in) {
|
||||||
readFromParcel(in);
|
readFromParcel(in);
|
||||||
@ -68,6 +69,7 @@ public class Article implements Parcelable {
|
|||||||
out.writeString(comments_link);
|
out.writeString(comments_link);
|
||||||
out.writeInt(always_display_attachments ? 1 : 0);
|
out.writeInt(always_display_attachments ? 1 : 0);
|
||||||
out.writeString(author);
|
out.writeString(author);
|
||||||
|
out.writeString(note);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void readFromParcel(Parcel in) {
|
public void readFromParcel(Parcel in) {
|
||||||
@ -96,6 +98,7 @@ public class Article implements Parcelable {
|
|||||||
comments_link = in.readString();
|
comments_link = in.readString();
|
||||||
always_display_attachments = in.readInt() == 1;
|
always_display_attachments = in.readInt() == 1;
|
||||||
author = in.readString();
|
author = in.readString();
|
||||||
|
note = in.readString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user