Commit 1ebb1ee6 by Paktalin

Don't lock scrolling in edit mode

parent 17f05b7a
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<activity <activity
android:label="@string/app_name" android:label="@string/app_name"
android:name=".ui.activities.MainActivity" android:name=".ui.activities.MainActivity"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize|stateHidden">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.SEARCH" /> <action android:name="android.intent.action.SEARCH" />
</intent-filter> </intent-filter>
......
...@@ -32,7 +32,7 @@ class EditWordFragment : WordFragment() { ...@@ -32,7 +32,7 @@ class EditWordFragment : WordFragment() {
this.container = container this.container = container
hidePreviousViews() hidePreviousViews()
wordItem = arguments!!["wordItem"] as WordItem wordItem = arguments!!["wordItem"] as WordItem
(mainActivity.recyclerView.layoutManager as LockableLayoutManager).isScrollEnabled = false //(mainActivity.recyclerView.layoutManager as LockableLayoutManager).isScrollEnabled = false
return super.onCreateView(inflater, container, savedInstanceState) return super.onCreateView(inflater, container, savedInstanceState)
} }
...@@ -98,7 +98,6 @@ class EditWordFragment : WordFragment() { ...@@ -98,7 +98,6 @@ class EditWordFragment : WordFragment() {
removeFragment(mainActivity.supportFragmentManager, this) removeFragment(mainActivity.supportFragmentManager, this)
mainActivity.hideKeyboardNotFromActivity(mainActivity) mainActivity.hideKeyboardNotFromActivity(mainActivity)
gone(mainActivity.btnSubmitLayout) gone(mainActivity.btnSubmitLayout)
(mainActivity.recyclerView.layoutManager as LockableLayoutManager).isScrollEnabled = true
mainActivity.inEditMode = false mainActivity.inEditMode = false
} }
......
...@@ -5,7 +5,7 @@ import android.support.v7.widget.LinearLayoutManager ...@@ -5,7 +5,7 @@ import android.support.v7.widget.LinearLayoutManager
import com.paktalin.vocabularynotebook.ui.fragments.VocabularyFragment import com.paktalin.vocabularynotebook.ui.fragments.VocabularyFragment
class LockableLayoutManager(context: Context) : LinearLayoutManager(context) { class LockableLayoutManager(context: Context) : LinearLayoutManager(context) {
internal var isScrollEnabled = true private var isScrollEnabled = true
override fun canScrollVertically(): Boolean { override fun canScrollVertically(): Boolean {
return isScrollEnabled && super.canScrollVertically() return isScrollEnabled && super.canScrollVertically()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment