support showing article author (requires api 5)

bump version
This commit is contained in:
Andrew Dolgov 2013-03-30 19:30:47 +04:00
parent f7c533d5d9
commit 5792022b55
21 changed files with 424 additions and 103 deletions

View File

@ -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="150" android:versionCode="151"
android:versionName="1.4.2" > android:versionName="1.4.3" >
<uses-sdk <uses-sdk
android:minSdkVersion="8" android:minSdkVersion="8"
@ -44,10 +44,6 @@
android:name=".CommonActivity" android:name=".CommonActivity"
android:label="@string/app_name" > android:label="@string/app_name" >
</activity> </activity>
<activity
android:name=".ArticleActivity"
android:label="@string/app_name" >
</activity>
<activity <activity
android:name=".offline.OfflineActivity" android:name=".offline.OfflineActivity"
android:label="@string/app_name" > android:label="@string/app_name" >

View File

@ -27,18 +27,36 @@
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold" /> android:textStyle="bold" />
<LinearLayout
android:id="@+id/feed_and_author"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView <TextView
android:id="@+id/feed_title" android:id="@+id/feed_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_weight="0"
android:ellipsize="end" android:ellipsize="end"
android:gravity="right" android:layout_weight="0.5"
android:singleLine="true" android:singleLine="true"
android:text="{Feed title...}" android:text="{Feed title...}"
android:textColor="?headlineExcerptTextColor" android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" /> android:textSize="10sp" />
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="{Author}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
</LinearLayout>
<TextView <TextView
android:id="@+id/excerpt" android:id="@+id/excerpt"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -26,18 +26,36 @@
android:textSize="16sp" android:textSize="16sp"
android:textStyle="normal" /> android:textStyle="normal" />
<LinearLayout
android:id="@+id/feed_and_author"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView <TextView
android:id="@+id/feed_title" android:id="@+id/feed_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_weight="0" android:ellipsize="end"
android:layout_weight="0.5"
android:singleLine="true"
android:text="{Feed title...}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:ellipsize="end" android:ellipsize="end"
android:gravity="right" android:gravity="right"
android:singleLine="true" android:singleLine="true"
android:text="{Feed title...}" android:text="{Author}"
android:textColor="?headlineSelectedExcerptTextColor" android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" /> android:textSize="10sp" />
</LinearLayout>
<TextView <TextView
android:id="@+id/excerpt" android:id="@+id/excerpt"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -27,18 +27,36 @@
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold" /> android:textStyle="bold" />
<LinearLayout
android:id="@+id/feed_and_author"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView <TextView
android:id="@+id/feed_title" android:id="@+id/feed_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_weight="0" android:ellipsize="end"
android:layout_weight="0.5"
android:singleLine="true"
android:text="{Feed title...}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:ellipsize="end" android:ellipsize="end"
android:gravity="right" android:gravity="right"
android:singleLine="true" android:singleLine="true"
android:text="{Feed title...}" android:text="{Author}"
android:textColor="?headlineSelectedExcerptTextColor" android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" /> android:textSize="10sp" />
</LinearLayout>
<TextView <TextView
android:id="@+id/excerpt" android:id="@+id/excerpt"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -27,18 +27,36 @@
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold" /> android:textStyle="bold" />
<LinearLayout
android:id="@+id/feed_and_author"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView <TextView
android:id="@+id/feed_title" android:id="@+id/feed_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_weight="0"
android:ellipsize="end" android:ellipsize="end"
android:gravity="right" android:layout_weight="0.5"
android:singleLine="true" android:singleLine="true"
android:text="{Feed title...}" android:text="{Feed title...}"
android:textColor="?headlineExcerptTextColor" android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" /> android:textSize="10sp" />
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="{Author}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
</LinearLayout>
<TextView <TextView
android:id="@+id/excerpt" android:id="@+id/excerpt"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -44,6 +44,36 @@
</TextView> </TextView>
<LinearLayout
android:id="@+id/feed_and_author"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/feed_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ellipsize="end"
android:layout_weight="0.5"
android:singleLine="true"
android:text="{Feed title...}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="{Author}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
</LinearLayout>
<TextView <TextView
android:id="@+id/excerpt" android:id="@+id/excerpt"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -42,6 +42,36 @@
android:textStyle="normal" > android:textStyle="normal" >
</TextView> </TextView>
<LinearLayout
android:id="@+id/feed_and_author"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/feed_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ellipsize="end"
android:layout_weight="0.5"
android:singleLine="true"
android:text="{Feed title...}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="{Author}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
</LinearLayout>
<TextView <TextView
android:id="@+id/excerpt" android:id="@+id/excerpt"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -42,6 +42,36 @@
android:textStyle="bold" > android:textStyle="bold" >
</TextView> </TextView>
<LinearLayout
android:id="@+id/feed_and_author"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/feed_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ellipsize="end"
android:layout_weight="0.5"
android:singleLine="true"
android:text="{Feed title...}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="{Author}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
</LinearLayout>
<TextView <TextView
android:id="@+id/excerpt" android:id="@+id/excerpt"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -44,6 +44,36 @@
</TextView> </TextView>
<LinearLayout
android:id="@+id/feed_and_author"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/feed_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ellipsize="end"
android:layout_weight="0.5"
android:singleLine="true"
android:text="{Feed title...}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="{Author}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
</LinearLayout>
<TextView <TextView
android:id="@+id/excerpt" android:id="@+id/excerpt"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -36,6 +36,20 @@
android:textColor="?linkColor" android:textColor="?linkColor"
android:textSize="13sp" /> android:textSize="13sp" />
<TextView
android:id="@+id/author"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:singleLine="true"
android:gravity="right"
android:textStyle="italic"
android:text="{Author}"
android:textColor="?headlineExcerptTextColor"
android:textSize="13sp" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -22,7 +22,6 @@
android:paddingRight="6dip" > android:paddingRight="6dip" >
</CheckBox> </CheckBox>
<LinearLayout <LinearLayout
android:id="@+id/linearLayout1" android:id="@+id/linearLayout1"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -31,7 +30,6 @@
android:orientation="vertical" android:orientation="vertical"
android:padding="3dp" > android:padding="3dp" >
<TextView <TextView
android:id="@+id/title" android:id="@+id/title"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -42,20 +40,38 @@
android:textColor="?headlineTextColor" android:textColor="?headlineTextColor"
android:textSize="16sp" android:textSize="16sp"
android:textStyle="bold" > android:textStyle="bold" >
</TextView> </TextView>
<LinearLayout
android:id="@+id/feed_and_author"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView <TextView
android:id="@+id/feed_title" android:id="@+id/feed_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center_horizontal" android:layout_weight="0.5"
android:singleLine="true" android:singleLine="true"
android:text="{Feed title...}" android:text="{Feed title...}"
android:textColor="?headlineExcerptTextColor" android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" /> android:textSize="10sp" />
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="{Author}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
</LinearLayout>
<TextView <TextView
android:id="@+id/excerpt" android:id="@+id/excerpt"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -65,7 +81,6 @@
android:textSize="13sp" > android:textSize="13sp" >
</TextView> </TextView>
<TextView <TextView
android:id="@+id/date" android:id="@+id/date"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -75,11 +90,8 @@
android:textColor="?headlineExcerptTextColor" android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" android:textSize="10sp"
android:textStyle="italic" /> android:textStyle="italic" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/linearLayout4" android:id="@+id/linearLayout4"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -8,6 +8,7 @@
android:padding="5dp" android:padding="5dp"
android:orientation="horizontal" > android:orientation="horizontal" >
<ProgressBar <ProgressBar
android:id="@+id/loadmore_progress" android:id="@+id/loadmore_progress"
style="?android:attr/progressBarStyleSmall" style="?android:attr/progressBarStyleSmall"

View File

@ -45,17 +45,36 @@
</TextView> </TextView>
<LinearLayout
android:id="@+id/feed_and_author"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView <TextView
android:id="@+id/feed_title" android:id="@+id/feed_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center_horizontal|right" android:layout_weight="0.5"
android:singleLine="true" android:singleLine="true"
android:text="{Feed title...}" android:text="{Feed title...}"
android:textColor="?headlineSelectedExcerptTextColor" android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" /> android:textSize="10sp" />
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="{Author}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
</LinearLayout>
<TextView <TextView
android:id="@+id/excerpt" android:id="@+id/excerpt"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -45,17 +45,36 @@
</TextView> </TextView>
<LinearLayout
android:id="@+id/feed_and_author"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView <TextView
android:id="@+id/feed_title" android:id="@+id/feed_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center_horizontal|right" android:layout_weight="0.5"
android:singleLine="true" android:singleLine="true"
android:text="{Feed title...}" android:text="{Feed title...}"
android:textColor="?headlineSelectedExcerptTextColor" android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" /> android:textSize="10sp" />
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="{Author}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
</LinearLayout>
<TextView <TextView
android:id="@+id/excerpt" android:id="@+id/excerpt"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -47,17 +47,55 @@
</TextView> </TextView>
<LinearLayout
android:id="@+id/feed_and_author"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="@+id/feed_and_author"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView <TextView
android:id="@+id/feed_title" android:id="@+id/feed_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center_horizontal" android:layout_weight="0.5"
android:singleLine="true" android:singleLine="true"
android:text="{Feed title...}" android:text="{Feed title...}"
android:textColor="?headlineExcerptTextColor" android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" /> android:textSize="10sp" />
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="{Author}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
</LinearLayout>
<TextView
android:id="@+id/author"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.5"
android:ellipsize="end"
android:gravity="right"
android:singleLine="true"
android:text="{Author}"
android:textColor="?headlineExcerptTextColor"
android:textSize="10sp" />
</LinearLayout>
<TextView <TextView
android:id="@+id/excerpt" android:id="@+id/excerpt"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -3,6 +3,7 @@
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="fill_parent" > android:layout_height="fill_parent" >
<ProgressBar <ProgressBar
android:id="@+id/progressBar1" android:id="@+id/progressBar1"
style="?android:attr/progressBarStyleLarge" style="?android:attr/progressBarStyleLarge"

View File

@ -26,6 +26,7 @@
android:hint="@string/share_url_hint" android:hint="@string/share_url_hint"
android:singleLine="true" /> android:singleLine="true" />
<EditText <EditText
android:id="@+id/content" android:id="@+id/content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -41,6 +42,7 @@
<requestFocus /> <requestFocus />
</EditText> </EditText>
<Button <Button
android:id="@+id/share_button" android:id="@+id/share_button"
android:layout_width="100dp" android:layout_width="100dp"

View File

@ -292,6 +292,16 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl
tagv.setVisibility(View.GONE); tagv.setVisibility(View.GONE);
} }
} }
TextView author = (TextView)view.findViewById(R.id.author);
if (author != null) {
if (m_article.author != null && m_article.author.length() > 0) {
author.setText(m_article.author);
} else {
author.setVisibility(View.GONE);
}
}
} }
return view; return view;

View File

@ -664,6 +664,14 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
} }
} }
String articleAuthor = article.author != null ? article.author : "";
TextView author = (TextView)v.findViewById(R.id.author);
if (author != null) {
author.setText(articleAuthor);
}
/* ImageView separator = (ImageView)v.findViewById(R.id.headlines_separator); /* ImageView separator = (ImageView)v.findViewById(R.id.headlines_separator);
if (separator != null && m_onlineServices.isSmallScreen()) { if (separator != null && m_onlineServices.isSmallScreen()) {

View File

@ -280,6 +280,12 @@ public class OfflineArticleFragment extends Fragment implements GestureDetector.
tagv.setText(tagsStr); tagv.setText(tagsStr);
} }
} }
TextView author = (TextView)view.findViewById(R.id.author);
if (author != null) {
author.setVisibility(View.GONE);
}
} }
return view; return view;

View File

@ -25,6 +25,7 @@ public class Article implements Parcelable {
public int comments_count; public int comments_count;
public String comments_link; public String comments_link;
public boolean always_display_attachments; public boolean always_display_attachments;
public String author;
public Article(Parcel in) { public Article(Parcel in) {
readFromParcel(in); readFromParcel(in);
@ -64,6 +65,7 @@ public class Article implements Parcelable {
out.writeInt(comments_count); out.writeInt(comments_count);
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);
} }
public void readFromParcel(Parcel in) { public void readFromParcel(Parcel in) {
@ -90,6 +92,7 @@ public class Article implements Parcelable {
comments_count = in.readInt(); comments_count = in.readInt();
comments_link = in.readString(); comments_link = in.readString();
always_display_attachments = in.readInt() == 1; always_display_attachments = in.readInt() == 1;
author = in.readString();
} }
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")