Implemented FeedInfoActivity
@ -15,7 +15,7 @@
|
|||||||
android:icon="@drawable/ic_launcher"
|
android:icon="@drawable/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:theme="@style/Theme.Sherlock.Light.ForceOverflow"
|
android:theme="@style/Theme.Sherlock.Light.ForceOverflow"
|
||||||
android:name="de.podfetcher.PodcastApp">
|
android:name="de.podfetcher.PodcastApp" android:logo="@drawable/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:name="de.podfetcher.activity.PodfetcherActivity" android:theme="@style/StyledIndicators">
|
android:name="de.podfetcher.activity.PodfetcherActivity" android:theme="@style/StyledIndicators">
|
||||||
@ -42,5 +42,6 @@
|
|||||||
<action android:name="android.intent.action.MEDIA_BUTTON"/>
|
<action android:name="android.intent.action.MEDIA_BUTTON"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
<activity android:name=".activity.FeedInfoActivity"></activity>
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
BIN
ic_launcher-web.png
Normal file
After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 3.0 KiB |
BIN
res/drawable-xhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
56
res/layout/feedinfo.xml
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical" >
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/header"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical" >
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imgvCover"
|
||||||
|
android:layout_width="70dp"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_margin="4dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtvTitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_margin="4dp"
|
||||||
|
android:layout_toRightOf="@id/imgvCover"
|
||||||
|
android:textSize="20dp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/divider"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/imgvCover"
|
||||||
|
android:background="@color/bright_blue" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:id="@+id/scrollView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1" >
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" >
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtvDescription"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -17,5 +17,6 @@
|
|||||||
<color name="blue">#0000FF</color>
|
<color name="blue">#0000FF</color>
|
||||||
<color name="navy">#000080</color>
|
<color name="navy">#000080</color>
|
||||||
<color name="black">#000000</color>
|
<color name="black">#000000</color>
|
||||||
|
<color name="bright_blue">#33B5E5</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
63
src/de/podfetcher/activity/FeedInfoActivity.java
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
package de.podfetcher.activity;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.actionbarsherlock.app.SherlockActivity;
|
||||||
|
import com.actionbarsherlock.view.Menu;
|
||||||
|
import com.actionbarsherlock.view.MenuItem;
|
||||||
|
|
||||||
|
import de.podfetcher.R;
|
||||||
|
import de.podfetcher.feed.Feed;
|
||||||
|
import de.podfetcher.feed.FeedManager;
|
||||||
|
|
||||||
|
/** Displays information about a feed. */
|
||||||
|
public class FeedInfoActivity extends SherlockActivity {
|
||||||
|
private static final String TAG = "FeedInfoActivity";
|
||||||
|
|
||||||
|
public static final String EXTRA_FEED_ID = "de.podfetcher.extra.feedId";
|
||||||
|
|
||||||
|
private ImageView imgvCover;
|
||||||
|
private TextView txtvTitle;
|
||||||
|
private TextView txtvDescription;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.feedinfo);
|
||||||
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
|
long feedId = getIntent().getLongExtra(EXTRA_FEED_ID, -1);
|
||||||
|
FeedManager manager = FeedManager.getInstance();
|
||||||
|
Feed feed = manager.getFeed(feedId);
|
||||||
|
if (feed != null) {
|
||||||
|
imgvCover = (ImageView) findViewById(R.id.imgvCover);
|
||||||
|
txtvTitle = (TextView) findViewById(R.id.txtvTitle);
|
||||||
|
txtvDescription = (TextView) findViewById(R.id.txtvDescription);
|
||||||
|
|
||||||
|
imgvCover.setImageBitmap(feed.getImage().getImageBitmap());
|
||||||
|
txtvTitle.setText(feed.getTitle());
|
||||||
|
txtvDescription.setText(feed.getDescription());
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "Activity was started with invalid arguments");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home:
|
||||||
|
finish();
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -10,6 +10,7 @@ import com.actionbarsherlock.view.MenuInflater;
|
|||||||
import com.actionbarsherlock.view.MenuItem;
|
import com.actionbarsherlock.view.MenuItem;
|
||||||
|
|
||||||
import de.podfetcher.R;
|
import de.podfetcher.R;
|
||||||
|
import de.podfetcher.activity.FeedInfoActivity;
|
||||||
import de.podfetcher.feed.Feed;
|
import de.podfetcher.feed.Feed;
|
||||||
import de.podfetcher.feed.FeedItem;
|
import de.podfetcher.feed.FeedItem;
|
||||||
import de.podfetcher.feed.FeedManager;
|
import de.podfetcher.feed.FeedManager;
|
||||||
@ -34,6 +35,11 @@ public class FeedMenuHandler {
|
|||||||
Feed selectedFeed) {
|
Feed selectedFeed) {
|
||||||
FeedManager manager = FeedManager.getInstance();
|
FeedManager manager = FeedManager.getInstance();
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
|
case R.id.show_info_item:
|
||||||
|
Intent startIntent = new Intent(context, FeedInfoActivity.class);
|
||||||
|
startIntent.putExtra(FeedInfoActivity.EXTRA_FEED_ID, selectedFeed.getId());
|
||||||
|
context.startActivity(startIntent);
|
||||||
|
break;
|
||||||
case R.id.mark_all_read_item:
|
case R.id.mark_all_read_item:
|
||||||
manager.markFeedRead(context, selectedFeed);
|
manager.markFeedRead(context, selectedFeed);
|
||||||
break;
|
break;
|
||||||
|