headline style updates

This commit is contained in:
Andrew Dolgov 2013-05-23 15:59:05 +04:00
parent 2f428e843e
commit 75b10a845c
8 changed files with 135 additions and 220 deletions

View File

@ -1,58 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/feeds_row"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:background="?feedsSelectedBackground"
android:descendantFocusability="blocksDescendants"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingBottom="10dip"
android:paddingLeft="8dip"
android:paddingRight="8dip"
android:paddingTop="10dip" >
<ImageView
android:id="@+id/icon"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_weight="0"
android:scaleType="fitXY"
android:src="@drawable/ic_rss_bw" />
<TextView
android:id="@+id/title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:paddingLeft="6dip"
android:text="{FEED}"
android:textColor="?feedlistSelectedTextColor"
android:textSize="18dip" />
<TextView
android:id="@+id/unread_counter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="0"
android:gravity="right"
android:paddingRight="12dip"
android:text="{123}"
android:textColor="?unreadCounterColor"
android:textSize="13sp"
android:textStyle="bold" />
<ImageButton
android:id="@+id/feed_menu_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@null"
android:paddingLeft="6dp"
android:paddingTop="6dp"
android:src="@drawable/ic_mailbox_collapsed_holo_light"
android:visibility="gone" />
</LinearLayout>

View File

@ -3,7 +3,7 @@
android:id="@+id/feeds_row"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:background="?feedsSelectedBackgroundSolid"
android:background="?feedsSelectedBackground"
android:descendantFocusability="blocksDescendants"
android:gravity="center_vertical"
android:orientation="horizontal"

View File

@ -5,22 +5,17 @@
android:layout_height="wrap_content"
android:background="?headlineNormalBackground"
android:orientation="vertical"
android:paddingRight="6dp" >
android:paddingLeft="0dp"
android:paddingRight="6dp"
android:paddingTop="6dp" >
<LinearLayout
android:id="@+id/linearLayout6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<CheckBox
android:id="@+id/selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:paddingLeft="0dp"
android:paddingRight="0dp" />
android:orientation="horizontal"
android:paddingLeft="6dp" >
<TextView
android:id="@+id/title"
@ -30,10 +25,9 @@
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="false"
android:text="{Title...}"
android:text="Sample entry title"
android:textColor="?headlineTextColor"
android:textSize="18sp" />
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
@ -42,34 +36,36 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="6dp"
android:paddingTop="6dp" >
android:orientation="horizontal" >
<CheckBox
android:id="@+id/selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:focusable="false" />
<TextView
android:id="@+id/feed_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
android:text="{Feed title...}"
android:text="Example Feed"
android:textColor="?headlineSecondaryTextColor"
android:textSize="13sp"
android:textStyle="italic" />
android:textSize="12sp" />
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_weight="1"
android:gravity="right|center_vertical"
android:text="Jan 01"
android:text="Jan 01, 12:00"
android:textColor="?headlineSecondaryTextColor"
android:textSize="13sp"
android:textStyle="italic" />
android:textSize="12sp" />
</LinearLayout>
<TextView
@ -77,19 +73,15 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="6dp"
android:paddingRight="0dp"
android:paddingTop="6dp"
android:text="{Content excerpt...}"
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
android:textColor="?headlineExcerptTextColor"
android:textSize="16sp" />
android:textSize="13sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="6dp"
android:paddingRight="0dp"
android:paddingTop="0dp" >
android:paddingLeft="6dp" >
<TextView
android:id="@+id/author"
@ -99,9 +91,9 @@
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
android:text="{Author}"
android:text="by Author"
android:textColor="?headlineSecondaryTextColor"
android:textSize="13sp" />
android:textSize="12sp" />
<ImageView
android:id="@+id/marked"
@ -126,7 +118,7 @@
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@null"
android:paddingLeft="6dp"
android:paddingLeft="10dp"
android:paddingTop="6dp"
android:src="@drawable/ic_mailbox_collapsed_holo_light" />
</LinearLayout>

View File

@ -5,22 +5,17 @@
android:layout_height="wrap_content"
android:background="?headlineSelectedBackground"
android:orientation="vertical"
android:paddingRight="6dp" >
android:paddingLeft="0dp"
android:paddingRight="6dp"
android:paddingTop="6dp" >
<LinearLayout
android:id="@+id/linearLayout6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<CheckBox
android:id="@+id/selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:paddingLeft="0dp"
android:paddingRight="0dp" />
android:orientation="horizontal"
android:paddingLeft="6dp" >
<TextView
android:id="@+id/title"
@ -30,10 +25,10 @@
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="false"
android:text="{Title...}"
android:textColor="?headlineSelectedTextColor"
android:textSize="18sp" />
android:text="Sample entry title"
android:textColor="?headlineTextColor"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
@ -42,35 +37,36 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="6dp"
android:paddingTop="6dp" >
android:orientation="horizontal" >
<CheckBox
android:id="@+id/selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:focusable="false" />
<TextView
android:id="@+id/feed_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
android:text="{Feed title...}"
android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="13sp"
android:textStyle="italic" />
android:text="Example Feed"
android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" />
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_weight="1"
android:gravity="right|center_vertical"
android:paddingRight="12dp"
android:text="Jan 01"
android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="13sp"
android:textStyle="italic" />
android:text="Jan 01, 12:00"
android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" />
</LinearLayout>
<TextView
@ -78,19 +74,15 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="6dp"
android:paddingRight="0dp"
android:paddingTop="6dp"
android:text="{Content excerpt...}"
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
android:textColor="?headlineSelectedExcerptTextColor"
android:textSize="16sp" />
android:textSize="13sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="6dp"
android:paddingRight="0dp"
android:paddingTop="0dp" >
android:paddingLeft="6dp" >
<TextView
android:id="@+id/author"
@ -100,9 +92,9 @@
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
android:text="{Author}"
android:text="by Author"
android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="13sp" />
android:textSize="12sp" />
<ImageView
android:id="@+id/marked"
@ -127,10 +119,9 @@
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@null"
android:paddingLeft="6dp"
android:paddingLeft="10dp"
android:paddingTop="6dp"
android:src="@drawable/ic_mailbox_collapsed_holo_light" />
</LinearLayout>
</LinearLayout>

View File

@ -5,22 +5,17 @@
android:layout_height="wrap_content"
android:background="?headlineSelectedBackground"
android:orientation="vertical"
android:paddingRight="6dp" >
android:paddingLeft="0dp"
android:paddingRight="6dp"
android:paddingTop="6dp" >
<LinearLayout
android:id="@+id/linearLayout6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<CheckBox
android:id="@+id/selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:paddingLeft="0dp"
android:paddingRight="0dp" />
android:orientation="horizontal"
android:paddingLeft="6dp" >
<TextView
android:id="@+id/title"
@ -30,11 +25,10 @@
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="false"
android:text="{Title...}"
android:textColor="?headlineSelectedTextColor"
android:textSize="18sp"
android:text="Sample entry title"
android:textColor="?headlineUnreadTextColor"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
@ -43,35 +37,36 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="6dp"
android:paddingTop="6dp" >
android:orientation="horizontal" >
<CheckBox
android:id="@+id/selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:focusable="false" />
<TextView
android:id="@+id/feed_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
android:text="{Feed title...}"
android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="13sp"
android:textStyle="italic" />
android:text="Example Feed"
android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" />
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_weight="1"
android:gravity="right|center_vertical"
android:paddingRight="12dp"
android:text="Jan 01"
android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="13sp"
android:textStyle="italic" />
android:text="Jan 01, 12:00"
android:textColor="?headlineSecondaryTextColor"
android:textSize="12sp" />
</LinearLayout>
<TextView
@ -79,19 +74,15 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="6dp"
android:paddingRight="0dp"
android:paddingTop="6dp"
android:text="{Content excerpt...}"
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
android:textColor="?headlineSelectedExcerptTextColor"
android:textSize="16sp" />
android:textSize="13sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="6dp"
android:paddingRight="0dp"
android:paddingTop="0dp" >
android:paddingLeft="6dp" >
<TextView
android:id="@+id/author"
@ -101,9 +92,9 @@
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
android:text="{Author}"
android:text="by Author"
android:textColor="?headlineSelectedSecondaryTextColor"
android:textSize="13sp" />
android:textSize="12sp" />
<ImageView
android:id="@+id/marked"
@ -128,7 +119,7 @@
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@null"
android:paddingLeft="6dp"
android:paddingLeft="10dp"
android:paddingTop="6dp"
android:src="@drawable/ic_mailbox_collapsed_holo_light" />
</LinearLayout>

View File

@ -5,22 +5,17 @@
android:layout_height="wrap_content"
android:background="?headlineUnreadBackground"
android:orientation="vertical"
android:paddingRight="6dp" >
android:paddingLeft="0dp"
android:paddingRight="6dp"
android:paddingTop="6dp" >
<LinearLayout
android:id="@+id/linearLayout6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<CheckBox
android:id="@+id/selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:paddingLeft="0dp"
android:paddingRight="0dp" />
android:orientation="horizontal"
android:paddingLeft="6dp" >
<TextView
android:id="@+id/title"
@ -30,11 +25,10 @@
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="false"
android:text="{Title...}"
android:text="Sample entry title"
android:textColor="?headlineUnreadTextColor"
android:textSize="18sp"
android:textSize="16sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
@ -43,34 +37,36 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="6dp"
android:paddingTop="6dp" >
android:orientation="horizontal" >
<CheckBox
android:id="@+id/selected"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:focusable="false" />
<TextView
android:id="@+id/feed_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.25"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
android:text="{Feed title...}"
android:text="Example Feed"
android:textColor="?headlineSecondaryTextColor"
android:textSize="13sp"
android:textStyle="italic" />
android:textSize="12sp" />
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_weight="1"
android:gravity="right|center_vertical"
android:text="Jan 01"
android:text="Jan 01, 12:00"
android:textColor="?headlineSecondaryTextColor"
android:textSize="13sp"
android:textStyle="italic" />
android:textSize="12sp" />
</LinearLayout>
<TextView
@ -78,19 +74,15 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="6dp"
android:paddingRight="0dp"
android:paddingTop="6dp"
android:text="{Content excerpt...}"
android:text="Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
android:textColor="?headlineExcerptTextColor"
android:textSize="16sp" />
android:textSize="13sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingLeft="6dp"
android:paddingRight="0dp"
android:paddingTop="0dp" >
android:paddingLeft="6dp" >
<TextView
android:id="@+id/author"
@ -100,9 +92,9 @@
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
android:text="{Author}"
android:text="by Author"
android:textColor="?headlineSecondaryTextColor"
android:textSize="13sp" />
android:textSize="12sp" />
<ImageView
android:id="@+id/marked"
@ -127,10 +119,9 @@
android:layout_height="wrap_content"
android:layout_weight="0"
android:background="@null"
android:paddingLeft="6dp"
android:paddingLeft="10dp"
android:paddingTop="6dp"
android:src="@drawable/ic_mailbox_collapsed_holo_light" />
</LinearLayout>
</LinearLayout>

View File

@ -679,8 +679,10 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
TextView author = (TextView)v.findViewById(R.id.author);
if (author != null) {
if (author != null && articleAuthor.length() > 0) {
author.setText(getString(R.string.author_formatted, articleAuthor));
} else {
author.setText("");
}
/* ImageView separator = (ImageView)v.findViewById(R.id.headlines_separator);

View File

@ -532,8 +532,14 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
if (ta != null) {
int authorIndex = article.getColumnIndex("author");
if (authorIndex >= 0)
ta.setText(article.getString(authorIndex));
if (authorIndex >= 0) {
String author = article.getString(authorIndex);
if (author != null && author.length() > 0)
ta.setText(getString(R.string.author_formatted, author));
else
ta.setText("");
}
}
/* ImageView separator = (ImageView)v.findViewById(R.id.headlines_separator);