diff options
author | Andrew Dolgov <[email protected]> | 2019-07-30 07:30:28 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-07-30 07:30:28 +0300 |
commit | 350564c5c01a6d77cda26a4d7c2db72470799676 (patch) | |
tree | fcc2d26b8874e2824f58663b57642a3797cab016 /org.fox.ttrss/src/main/java | |
parent | 5488be3c587274888b54fb09acee09b740e03f6a (diff) | |
parent | 43d9869fdb89cdbcdec15fa4dc7f1e6a5de8fa93 (diff) |
Merge branch 'master' of git.fakecake.org:tt-rss-android
Diffstat (limited to 'org.fox.ttrss/src/main/java')
-rwxr-xr-x | org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java | 57 |
1 files changed, 36 insertions, 21 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java index f513ce98..1b638d48 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/MasterActivity.java @@ -7,6 +7,7 @@ import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; +import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.preference.PreferenceManager; @@ -464,27 +465,41 @@ public class MasterActivity extends OnlineActivity implements HeadlinesEventList public void onArticleSelected(Article article, boolean open) { if (open) { - HeadlinesFragment hf = (HeadlinesFragment)getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES); - - Intent intent = new Intent(MasterActivity.this, DetailActivity.class); - intent.putExtra("feed", hf.getFeed()); - //intent.putExtra("article", article); - intent.putExtra("searchQuery", hf.getSearchQuery()); - //intent.putExtra("articles", (Parcelable)hf.getAllArticles()); - Application.getInstance().tmpArticleList = hf.getAllArticles(); - Application.getInstance().tmpArticle = article; - - /* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - startActivityForResult(intent, HEADLINES_REQUEST, ActivityOptions.makeSceneTransitionAnimation(this).toBundle()); - } else { - startActivityForResult(intent, HEADLINES_REQUEST); - } */ - - // mysterious crashes somewhere in gl layer (?) on some feeds if we use activitycompat transitions here on LP so welp - startActivityForResult(intent, HEADLINES_REQUEST); - overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); - - + boolean alwaysOpenUri = m_prefs.getBoolean("always_open_uri", false); + if (alwaysOpenUri) { + if (article.unread) { + article.unread = false; + saveArticleUnread(article); + } + + HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES); + if (hf != null) { + hf.setActiveArticle(article); + } + + openUri(Uri.parse(article.link)); + } + else { + HeadlinesFragment hf = (HeadlinesFragment) getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES); + + Intent intent = new Intent(MasterActivity.this, DetailActivity.class); + intent.putExtra("feed", hf.getFeed()); + //intent.putExtra("article", article); + intent.putExtra("searchQuery", hf.getSearchQuery()); + //intent.putExtra("articles", (Parcelable)hf.getAllArticles()); + Application.getInstance().tmpArticleList = hf.getAllArticles(); + Application.getInstance().tmpArticle = article; + + /* if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + startActivityForResult(intent, HEADLINES_REQUEST, ActivityOptions.makeSceneTransitionAnimation(this).toBundle()); + } else { + startActivityForResult(intent, HEADLINES_REQUEST); + } */ + + // mysterious crashes somewhere in gl layer (?) on some feeds if we use activitycompat transitions here on LP so welp + startActivityForResult(intent, HEADLINES_REQUEST); + overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left); + } } else { invalidateOptionsMenu(); |