summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-03-19 14:44:11 +0400
committerAndrew Dolgov <[email protected]>2013-03-19 14:44:11 +0400
commitef8fb0f7e8ea243484a5ce6d0bd63b075d78499e (patch)
treea580a80d1d832beedc194f5123efc536b3fb91d7
parent0be7d5eac54391bf6fe7878e194f4474a07d57ed (diff)
implement different resources for selected and selected+unread headlines
(refs #595)
-rw-r--r--AndroidManifest.xml4
-rw-r--r--res/layout-port/headlines_row_selected.xml3
-rw-r--r--res/layout-port/headlines_row_selected_unread.xml98
-rw-r--r--res/layout-sw600dp-port/headlines_row_selected.xml3
-rw-r--r--res/layout-sw600dp-port/headlines_row_selected_unread.xml81
-rw-r--r--res/layout-sw600dp/headlines_row_selected.xml2
-rw-r--r--res/layout-sw600dp/headlines_row_selected_unread.xml94
-rw-r--r--res/layout/headlines_row_selected.xml2
-rw-r--r--res/layout/headlines_row_selected_unread.xml106
-rw-r--r--src/org/fox/ttrss/HeadlinesFragment.java8
-rw-r--r--src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java10
11 files changed, 400 insertions, 11 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 1a97ecd5..8c700005 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss"
- android:versionCode="142"
- android:versionName="1.19" >
+ android:versionCode="143"
+ android:versionName="1.20" >
<uses-sdk
android:minSdkVersion="8"
diff --git a/res/layout-port/headlines_row_selected.xml b/res/layout-port/headlines_row_selected.xml
index 07119bf7..6ea9953f 100644
--- a/res/layout-port/headlines_row_selected.xml
+++ b/res/layout-port/headlines_row_selected.xml
@@ -14,7 +14,6 @@
android:layout_weight="1"
android:orientation="vertical"
android:padding="3dip" >
-
<TextView
android:id="@+id/title"
@@ -25,7 +24,7 @@
android:text="There are many variations of passages of Lorem Ipsum available"
android:textColor="?headlineSelectedTextColor"
android:textSize="16sp"
- android:textStyle="bold" />
+ android:textStyle="normal" />
<TextView
android:id="@+id/feed_title"
diff --git a/res/layout-port/headlines_row_selected_unread.xml b/res/layout-port/headlines_row_selected_unread.xml
new file mode 100644
index 00000000..07119bf7
--- /dev/null
+++ b/res/layout-port/headlines_row_selected_unread.xml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/headlines_row"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:background="?headlineSelectedBackgroundSolid"
+ android:gravity="center_vertical"
+ android:orientation="vertical" >
+
+ <LinearLayout
+ android:id="@+id/linearLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="vertical"
+ android:padding="3dip" >
+
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:ellipsize="end"
+ android:singleLine="false"
+ android:text="There are many variations of passages of Lorem Ipsum available"
+ android:textColor="?headlineSelectedTextColor"
+ android:textSize="16sp"
+ android:textStyle="bold" />
+
+ <TextView
+ android:id="@+id/feed_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="0"
+ android:ellipsize="end"
+ android:gravity="right"
+ android:singleLine="true"
+ android:text="{Feed title...}"
+ android:textColor="?headlineSelectedExcerptTextColor"
+ android:textSize="10sp" />
+
+ <TextView
+ android:id="@+id/excerpt"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
+ android:textColor="?headlineSelectedExcerptTextColor"
+ android:textSize="13sp" />
+
+
+ <LinearLayout
+ android:id="@+id/linearLayout4"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="0"
+ android:gravity="center"
+ android:orientation="horizontal"
+ android:paddingRight="4dp" >
+
+ <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/date"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:text="Jan 01, 00:00"
+ android:textColor="?headlineSelectedExcerptTextColor"
+ android:textSize="10sp"
+ android:textStyle="italic" />
+
+ <ImageView
+ android:id="@+id/marked"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="0"
+ android:clickable="true"
+ android:src="@android:drawable/star_off" />
+
+ <ImageView
+ android:id="@+id/published"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_weight="0"
+ android:clickable="true"
+ android:src="@drawable/ic_rss_bw" />
+ </LinearLayout>
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/res/layout-sw600dp-port/headlines_row_selected.xml b/res/layout-sw600dp-port/headlines_row_selected.xml
index 0805077d..cdcc20e7 100644
--- a/res/layout-sw600dp-port/headlines_row_selected.xml
+++ b/res/layout-sw600dp-port/headlines_row_selected.xml
@@ -29,7 +29,6 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
-
<TextView
android:id="@+id/title"
@@ -40,7 +39,7 @@
android:text="{Title...}"
android:textColor="?headlineSelectedTextColor"
android:textSize="16sp"
- android:textStyle="bold" >
+ android:textStyle="normal" >
</TextView>
diff --git a/res/layout-sw600dp-port/headlines_row_selected_unread.xml b/res/layout-sw600dp-port/headlines_row_selected_unread.xml
new file mode 100644
index 00000000..0805077d
--- /dev/null
+++ b/res/layout-sw600dp-port/headlines_row_selected_unread.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/headlines_row"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:background="?headlineSelectedBackgroundSolid"
+ android:padding="4sp"
+ android:orientation="vertical" >
+
+ <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="6dip"
+ android:paddingRight="6dip" >
+ </CheckBox>
+
+ <LinearLayout
+ android:id="@+id/linearLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="vertical" >
+
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:ellipsize="end"
+ android:singleLine="false"
+ android:text="{Title...}"
+ android:textColor="?headlineSelectedTextColor"
+ android:textSize="16sp"
+ android:textStyle="bold" >
+
+ </TextView>
+
+ <TextView
+ android:id="@+id/excerpt"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="{Content excerpt...}"
+ android:textColor="?headlineSelectedExcerptTextColor"
+ android:textSize="13sp" >
+ </TextView>
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/linearLayout4"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:paddingRight="15px" >
+
+ <ImageView
+ android:id="@+id/marked"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:clickable="true"
+ android:src="@android:drawable/star_off" />
+
+ <ImageView
+ android:id="@+id/published"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:clickable="true"
+ android:src="@drawable/ic_rss_bw" />
+ </LinearLayout>
+
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/res/layout-sw600dp/headlines_row_selected.xml b/res/layout-sw600dp/headlines_row_selected.xml
index 0157fb65..ed84f9f6 100644
--- a/res/layout-sw600dp/headlines_row_selected.xml
+++ b/res/layout-sw600dp/headlines_row_selected.xml
@@ -39,7 +39,7 @@
android:text="{Title...}"
android:textColor="?headlineSelectedTextColor"
android:textSize="16sp"
- android:textStyle="bold" >
+ android:textStyle="normal" >
</TextView>
<TextView
diff --git a/res/layout-sw600dp/headlines_row_selected_unread.xml b/res/layout-sw600dp/headlines_row_selected_unread.xml
new file mode 100644
index 00000000..0157fb65
--- /dev/null
+++ b/res/layout-sw600dp/headlines_row_selected_unread.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/headlines_row"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:background="?headlineSelectedBackground"
+ android:padding="4sp"
+ android:orientation="vertical" >
+
+ <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="6dip"
+ android:paddingRight="6dip" >
+ </CheckBox>
+
+ <LinearLayout
+ android:id="@+id/linearLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:ellipsize="end"
+ android:singleLine="false"
+ android:text="{Title...}"
+ android:textColor="?headlineSelectedTextColor"
+ android:textSize="16sp"
+ android:textStyle="bold" >
+ </TextView>
+
+ <TextView
+ android:id="@+id/excerpt"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="{Content excerpt...}"
+ android:textColor="?headlineSelectedExcerptTextColor"
+ android:textSize="13sp" >
+ </TextView>
+
+
+ <TextView
+ android:id="@+id/date"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Jan 01"
+ android:textColor="?headlineSelectedExcerptTextColor"
+ android:textSize="11sp"
+ android:textStyle="italic" />
+
+ </LinearLayout>
+
+
+
+
+
+
+ <LinearLayout
+ android:id="@+id/linearLayout4"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:paddingRight="15px" >
+
+ <ImageView
+ android:id="@+id/marked"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:clickable="true"
+ android:src="@android:drawable/star_off" />
+
+ <ImageView
+ android:id="@+id/published"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:clickable="true"
+ android:src="@drawable/ic_rss_bw" />
+ </LinearLayout>
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/res/layout/headlines_row_selected.xml b/res/layout/headlines_row_selected.xml
index c4423d57..eefe8639 100644
--- a/res/layout/headlines_row_selected.xml
+++ b/res/layout/headlines_row_selected.xml
@@ -41,7 +41,7 @@
android:text="{Title...}"
android:textColor="?headlineSelectedTextColor"
android:textSize="16sp"
- android:textStyle="bold" >
+ android:textStyle="normal" >
</TextView>
diff --git a/res/layout/headlines_row_selected_unread.xml b/res/layout/headlines_row_selected_unread.xml
new file mode 100644
index 00000000..c4423d57
--- /dev/null
+++ b/res/layout/headlines_row_selected_unread.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/headlines_row"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:background="?headlineSelectedBackgroundSolid"
+ android:orientation="vertical" >
+
+ <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="6dip"
+ android:paddingRight="6dip" >
+ </CheckBox>
+
+
+ <LinearLayout
+ android:id="@+id/linearLayout1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:orientation="vertical"
+ android:padding="3dp" >
+
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:ellipsize="end"
+ android:singleLine="false"
+ android:text="{Title...}"
+ android:textColor="?headlineSelectedTextColor"
+ android:textSize="16sp"
+ android:textStyle="bold" >
+
+ </TextView>
+
+ <TextView
+ android:id="@+id/feed_title"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:ellipsize="end"
+ android:gravity="center_horizontal|right"
+ android:singleLine="true"
+ android:text="{Feed title...}"
+ android:textColor="?headlineSelectedExcerptTextColor"
+ android:textSize="10sp" />
+
+ <TextView
+ android:id="@+id/excerpt"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="{Content excerpt...}"
+ android:textColor="?headlineSelectedExcerptTextColor"
+ android:textSize="13sp" >
+ </TextView>
+
+
+ <TextView
+ android:id="@+id/date"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal"
+ android:text="Jan 01"
+ android:textColor="?headlineSelectedExcerptTextColor"
+ android:textSize="10sp"
+ android:textStyle="italic" />
+
+ </LinearLayout>
+
+
+
+ <LinearLayout
+ android:id="@+id/linearLayout4"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:paddingRight="6dp" >
+
+ <ImageView
+ android:id="@+id/marked"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:clickable="true"
+ android:src="@android:drawable/star_off" />
+
+ <ImageView
+ android:id="@+id/published"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:clickable="true"
+ android:src="@drawable/ic_rss_bw" />
+ </LinearLayout>
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/src/org/fox/ttrss/HeadlinesFragment.java b/src/org/fox/ttrss/HeadlinesFragment.java
index 339da6cd..e8de1dbd 100644
--- a/src/org/fox/ttrss/HeadlinesFragment.java
+++ b/src/org/fox/ttrss/HeadlinesFragment.java
@@ -525,7 +525,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
public static final int VIEW_NORMAL = 0;
public static final int VIEW_UNREAD = 1;
public static final int VIEW_SELECTED = 2;
- public static final int VIEW_LOADMORE = 3;
+ public static final int VIEW_SELECTED_UNREAD = 3;
+ public static final int VIEW_LOADMORE = 4;
public static final int VIEW_COUNT = VIEW_LOADMORE+1;
@@ -544,6 +545,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
if (a.id == -1) {
return VIEW_LOADMORE;
+ } else if (m_activeArticle != null && a.id == m_activeArticle.id && a.unread) {
+ return VIEW_SELECTED_UNREAD;
} else if (m_activeArticle != null && a.id == m_activeArticle.id) {
return VIEW_SELECTED;
} else if (a.unread) {
@@ -573,6 +576,9 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
case VIEW_SELECTED:
layoutId = R.layout.headlines_row_selected;
break;
+ case VIEW_SELECTED_UNREAD:
+ layoutId = R.layout.headlines_row_selected_unread;
+ break;
}
LayoutInflater vi = (LayoutInflater)getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
diff --git a/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java b/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java
index 60858473..bfc6d64f 100644
--- a/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java
+++ b/src/org/fox/ttrss/offline/OfflineHeadlinesFragment.java
@@ -378,7 +378,8 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
public static final int VIEW_NORMAL = 0;
public static final int VIEW_UNREAD = 1;
public static final int VIEW_SELECTED = 2;
- public static final int VIEW_LOADMORE = 3;
+ public static final int VIEW_SELECTED_UNREAD = 3;
+ public static final int VIEW_LOADMORE = 4;
public static final int VIEW_COUNT = VIEW_LOADMORE+1;
@@ -393,7 +394,9 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
//Log.d(TAG, "@gIVT " + position + " " + c.getInt(0) + " vs " + m_activeArticleId);
- if (c.getInt(0) == m_activeArticleId) {
+ if (c.getInt(0) == m_activeArticleId && c.getInt(c.getColumnIndex("unread")) == 1) {
+ return VIEW_SELECTED_UNREAD;
+ } else if (c.getInt(0) == m_activeArticleId) {
return VIEW_SELECTED;
} else if (c.getInt(c.getColumnIndex("unread")) == 1) {
return VIEW_UNREAD;
@@ -420,6 +423,9 @@ public class OfflineHeadlinesFragment extends Fragment implements OnItemClickLis
case VIEW_UNREAD:
layoutId = R.layout.headlines_row_unread;
break;
+ case VIEW_SELECTED_UNREAD:
+ layoutId = R.layout.headlines_row_selected_unread;
+ break;
case VIEW_SELECTED:
layoutId = R.layout.headlines_row_selected;
break;