add open article in web browser to headline context menu
This commit is contained in:
parent
8f38f2f7a3
commit
e3280a06ab
@ -18,6 +18,10 @@
|
||||
android:id="@+id/headlines_share_article"
|
||||
android:showAsAction=""
|
||||
android:title="@string/share_article"/>
|
||||
<item
|
||||
android:id="@+id/headlines_article_link_open"
|
||||
android:showAsAction=""
|
||||
android:title="@string/open_article_in_web_browser"/>
|
||||
<item
|
||||
android:id="@+id/headlines_article_link_copy"
|
||||
android:showAsAction=""
|
||||
|
@ -216,4 +216,5 @@
|
||||
<string name="unsubscribe">Unsubscribe</string>
|
||||
<string name="unsubscribe_from_prompt">Unsubscribe from %1$s?</string>
|
||||
<string name="toggle_sidebar">Toggle sidebar</string>
|
||||
<string name="open_article_in_web_browser">Open in web browser</string>
|
||||
</resources>
|
||||
|
@ -17,11 +17,13 @@ import uk.co.senab.actionbarpulltorefresh.library.PullToRefreshAttacher.OnRefres
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Resources.Theme;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.app.Fragment;
|
||||
@ -135,6 +137,21 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
}
|
||||
}
|
||||
return true;
|
||||
case R.id.headlines_article_link_open:
|
||||
if (true) {
|
||||
Article article = getArticleAtPosition(info.position);
|
||||
|
||||
if (article != null) {
|
||||
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(article.link));
|
||||
startActivity(browserIntent);
|
||||
|
||||
if (article.unread) {
|
||||
article.unread = false;
|
||||
m_activity.saveArticleUnread(article);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
case R.id.selection_toggle_marked:
|
||||
if (true) {
|
||||
ArticleList selected = getSelectedArticles();
|
||||
|
Loading…
Reference in New Issue
Block a user