From 4a07d2ed10741e08895c9e9f03738656ddfc33f9 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 2 Jul 2017 17:24:17 -0700 Subject: Adding auto uploads --- .../com/pitchedapps/frost/fragments/WebFragment.kt | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt') 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 bd8b58ab..b76925f5 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt @@ -6,7 +6,7 @@ import android.support.v4.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import ca.allanwang.kau.utils.withBundle +import ca.allanwang.kau.utils.withArguments import com.pitchedapps.frost.MainActivity import com.pitchedapps.frost.facebook.FbTab import com.pitchedapps.frost.facebook.FeedSort @@ -28,19 +28,18 @@ class WebFragment : Fragment() { private const val ARG_URL_ENUM = "arg_url_enum" private const val ARG_POSITION = "arg_position" - operator fun invoke(data: FbTab, position: Int) = WebFragment().withBundle { - putString(ARG_URL, data.url) - putInt(ARG_POSITION, position) - 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 - }) - } + operator fun invoke(data: FbTab, position: Int) = WebFragment().withArguments( + ARG_URL to data.url, + ARG_POSITION to position, + ARG_URL_ENUM to 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 + }) } // val refresh: SwipeRefreshLayout by lazy { frostWebView.refresh } -- cgit v1.2.3