diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-23 21:53:50 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-23 21:53:50 -0700 |
commit | 0aac77d2bbce0629f9522d0854bd7c8068ec5e8b (patch) | |
tree | f01e5efa38be6858feec44cc8e697a12a812fd38 /app/src/main/kotlin/com/pitchedapps/frost/fragments | |
parent | 8c1ff3e546e205e85a0d7e7df0ca5d11bd167582 (diff) | |
download | frost-0aac77d2bbce0629f9522d0854bd7c8068ec5e8b.tar.gz frost-0aac77d2bbce0629f9522d0854bd7c8068ec5e8b.tar.bz2 frost-0aac77d2bbce0629f9522d0854bd7c8068ec5e8b.zip |
Add keys and header reload
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/fragments')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt index dfc3eaad..cd15c2c3 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt @@ -9,6 +9,8 @@ import android.view.ViewGroup import ca.allanwang.kau.utils.withBundle import com.pitchedapps.frost.MainActivity import com.pitchedapps.frost.facebook.FbTab +import com.pitchedapps.frost.facebook.FeedSort +import com.pitchedapps.frost.utils.Prefs import com.pitchedapps.frost.web.FrostWebView import com.pitchedapps.frost.web.FrostWebViewCore import io.reactivex.android.schedulers.AndroidSchedulers @@ -29,7 +31,15 @@ class WebFragment : Fragment() { operator fun invoke(data: FbTab, position: Int) = WebFragment().withBundle { putString(ARG_URL, data.url) putInt(ARG_POSITION, position) - putSerializable(ARG_URL_ENUM, data) + putSerializable(ARG_URL_ENUM, when (data) { + //If is feed, check if sorting method is specified + FbTab.FEED -> when (FeedSort(Prefs.feedSort)) { + FeedSort.DEFAULT -> data + FeedSort.MOST_RECENT -> FbTab.FEED_MOST_RECENT + FeedSort.TOP -> FbTab.FEED_TOP_STORIES + } + else -> data + }) } } |