implement published articles

This commit is contained in:
Andrew Dolgov 2011-11-27 15:47:38 +03:00
parent 973138935d
commit 45b7bff423
10 changed files with 161 additions and 26 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -16,7 +16,30 @@
android:layout_width="wrap_content" android:gravity="center" android:padding="3dip"
android:layout_height="wrap_content" android:orientation="vertical">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#909090" android:textSize="13sp" android:id="@+id/date" android:text="Jan 01"></TextView>
<ImageView android:clickable="true" android:id="@+id/marked" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/star_off"></ImageView>
<LinearLayout
android:id="@+id/linearLayout4"
android:layout_width="wrap_content"
android:gravity="center"
android:paddingRight="2sp"
android:layout_height="wrap_content" >
<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>
<ImageView
android:id="@+id/published"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:src="@drawable/ic_rss_bw" >
</ImageView>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@ -1,24 +1,95 @@
<?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:gravity="center_vertical"
android:layout_height="wrap_content"
android:background="?headlineSelectedBackground"
android:id="@+id/headlines_row" android:orientation="horizontal" android:layout_height="wrap_content">
<ImageView android:background="?headlineSeparatorSelected" android:paddingRight="4dip" android:layout_height="match_parent" android:layout_width="wrap_content"></ImageView>
<CheckBox android:focusable="false"
android:paddingLeft="6dip" android:paddingRight="6dip" android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/selected"></CheckBox>
<LinearLayout android:layout_weight="1" android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:orientation="vertical" android:layout_width="match_parent">
<TextView android:singleLine="true" android:ellipsize="end" android:id="@+id/title" android:textSize="16sp" android:text="{Title...}" android:layout_width="match_parent" android:layout_height="match_parent"></TextView>
<TextView android:id="@+id/excerpt" android:textSize="13sp" android:textColor="#909090" android:text="{Content excerpt...}" android:layout_width="match_parent" android:layout_height="match_parent"></TextView>
</LinearLayout>
<LinearLayout
android:id="@+id/linerLayout3" android:padding="3dip"
android:layout_width="wrap_content" android:gravity="center"
android:layout_height="wrap_content" android:orientation="vertical">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#909090" android:textSize="13sp" android:id="@+id/date" android:text="Jan 01"></TextView>
<ImageView android:clickable="true" android:id="@+id/marked" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/star_off"></ImageView>
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?headlineSeparatorSelected"
android:paddingRight="4dip" >
</ImageView>
<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="true"
android:text="{Title...}"
android:textSize="16sp" >
</TextView>
<TextView
android:id="@+id/excerpt"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="{Content excerpt...}"
android:textColor="#909090"
android:textSize="13sp" >
</TextView>
</LinearLayout>
<LinearLayout
android:id="@+id/linerLayout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:padding="3dip" >
<TextView
android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Jan 01"
android:textColor="#909090"
android:textSize="13sp" >
</TextView>
<LinearLayout
android:id="@+id/linearLayout4"
android:layout_width="wrap_content"
android:gravity="center"
android:paddingRight="2sp"
android:layout_height="wrap_content" >
<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>
<ImageView
android:id="@+id/published"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:src="@drawable/ic_rss_bw" >
</ImageView>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@ -18,7 +18,30 @@
android:layout_width="wrap_content" android:gravity="center" android:padding="3dip"
android:layout_height="wrap_content" android:orientation="vertical">
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#909090" android:textSize="13sp" android:id="@+id/date" android:text="Jan 01"></TextView>
<ImageView android:clickable="true" android:id="@+id/marked" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@android:drawable/star_off"></ImageView>
<LinearLayout
android:id="@+id/linearLayout4"
android:layout_width="wrap_content"
android:gravity="center"
android:paddingRight="2sp"
android:layout_height="wrap_content" >
<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>
<ImageView
android:id="@+id/published"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:src="@drawable/ic_rss_bw" >
</ImageView>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@ -1,6 +1,11 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/preferences"
android:icon="@android:drawable/ic_menu_preferences"
android:title="@string/preferences"
android:showAsAction=""/>
<item android:id="@+id/login"
android:icon="@android:drawable/ic_menu_rotate"
android:title="@string/login"
@ -32,22 +37,18 @@
android:title="@string/update_feeds"
android:showAsAction=""/>
<item android:id="@+id/preferences"
android:icon="@android:drawable/ic_menu_preferences"
android:title="@string/preferences"
android:showAsAction=""/>
<item android:id="@+id/share_article"
android:icon="@android:drawable/ic_menu_share"
android:title="@string/share_article"
android:showAsAction="ifRoom"/>
<item android:id="@+id/toggle_marked"
android:icon="@android:drawable/star_off"
android:title="@string/toggle_marked"
android:showAsAction=""/>
<item android:id="@+id/toggle_published"
android:icon="@drawable/ic_menu_rss"
android:title="@string/toggle_published"
android:showAsAction=""/>

View File

@ -332,6 +332,23 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener {
});
}
ImageView published = (ImageView)v.findViewById(R.id.published);
if (published != null) {
published.setImageResource(article.published ? R.drawable.ic_rss : R.drawable.ic_rss_bw);
published.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
article.published = !article.published;
m_adapter.notifyDataSetChanged();
m_articleOps.saveArticlePublished(article);
}
});
}
TextView te = (TextView)v.findViewById(R.id.excerpt);
if (te != null) {