aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/fragments
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-04 10:49:22 -0700
committerAllan Wang <me@allanwang.ca>2017-06-04 10:49:22 -0700
commit5aac1cda7b1ad561131de109d1f29e8e7b730e82 (patch)
treecb0e0387782c24a667a51bb3583af704c9266f4c /app/src/main/kotlin/com/pitchedapps/frost/fragments
parent4b78e433e1f55b278623c84d1223e42cab875be6 (diff)
downloadfrost-5aac1cda7b1ad561131de109d1f29e8e7b730e82.tar.gz
frost-5aac1cda7b1ad561131de109d1f29e8e7b730e82.tar.bz2
frost-5aac1cda7b1ad561131de109d1f29e8e7b730e82.zip
Remove positions in WebFragment
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/fragments')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/fragments/BaseFragment.kt31
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt8
2 files changed, 4 insertions, 35 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/fragments/BaseFragment.kt b/app/src/main/kotlin/com/pitchedapps/frost/fragments/BaseFragment.kt
deleted file mode 100644
index 4ca45d86..00000000
--- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/BaseFragment.kt
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.pitchedapps.frost.fragments
-
-import android.support.annotation.CallSuper
-import android.support.v4.app.Fragment
-import com.pitchedapps.frost.utils.putInt
-import com.pitchedapps.frost.utils.refWatch
-
-/**
- * Created by Allan Wang on 2017-05-29.
- */
-interface BaseFragmentContract {
- fun onBackPressed(): Boolean
-}
-
-abstract class BaseFragment : Fragment(), BaseFragmentContract {
- val position: Int by lazy { arguments.getInt(ARG_POSITION) }
-
- companion object {
- val ARG_POSITION = "arg_position"
-
- fun <T : BaseFragment> newInstance(fragment: T, position: Int): T {
- fragment.putInt(ARG_POSITION, position)
- return fragment
- }
- }
-
-// override fun onDestroyView() {
-// super.onDestroyView()
-// refWatch()
-// }
-} \ No newline at end of file
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 3c8094aa..3882260e 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt
@@ -2,6 +2,7 @@ package com.pitchedapps.frost.fragments
import android.content.Context
import android.os.Bundle
+import android.support.v4.app.Fragment
import android.support.v4.widget.SwipeRefreshLayout
import android.view.LayoutInflater
import android.view.View
@@ -18,11 +19,11 @@ import io.reactivex.disposables.Disposable
*/
-class WebFragment : BaseFragment() {
+class WebFragment:Fragment() {
companion object {
private const val ARG_URL = "arg_url"
- fun newInstance(position: Int, url: String) = BaseFragment.newInstance(WebFragment(), position).putString(ARG_URL, url)
+ fun newInstance(url: String) = WebFragment().putString(ARG_URL, url)
}
// val refresh: SwipeRefreshLayout by lazy { frostWebView.refresh }
@@ -40,7 +41,6 @@ class WebFragment : BaseFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
super.onCreateView(inflater, container, savedInstanceState)
frostWebView = FrostWebView(context)
- frostWebView.position = position
frostWebView.baseUrl = url
return frostWebView
}
@@ -78,5 +78,5 @@ class WebFragment : BaseFragment() {
super.onDetach()
}
- override fun onBackPressed() = frostWebView.onBackPressed()
+ fun onBackPressed() = frostWebView.onBackPressed()
} \ No newline at end of file