Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
likorn
/
vocabulary_notebook
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7fb927f7
authored
Apr 25, 2019
by
Paktalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the bug with starting tag state when being in edit mode
parent
f0081656
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletions
app/src/main/java/com/paktalin/vocabularynotebook/ui/activities/MainActivity.kt
app/src/main/java/com/paktalin/vocabularynotebook/ui/fragments/SubmitEditedFragment.kt
app/src/main/java/com/paktalin/vocabularynotebook/ui/recycler_view/State.kt
app/src/main/java/com/paktalin/vocabularynotebook/ui/activities/MainActivity.kt
View file @
7fb927f7
...
...
@@ -136,7 +136,8 @@ class MainActivity : AppCompatActivity() {
private
fun
whenSelectionChanges
(
selection
:
Selection
<
Long
>)
{
vocabularyAdapter
?.
let
{
if
(!
selection
.
isEmpty
&&
it
.
state
.
notAddOrEdit
())
{
if
(
it
.
state
.
notAddOrEdit
())
{
if
(!
selection
.
isEmpty
)
{
vocabularyAdapter
?.
state
=
State
.
TAG
tagFragment
.
setSelection
(
selection
.
toList
())
addFragment
(
supportFragmentManager
,
tagFragment
,
R
.
id
.
main_activity_container
)
...
...
@@ -146,6 +147,7 @@ class MainActivity : AppCompatActivity() {
}
}
}
}
override
fun
onPause
()
{
super
.
onPause
()
...
...
app/src/main/java/com/paktalin/vocabularynotebook/ui/fragments/SubmitEditedFragment.kt
View file @
7fb927f7
...
...
@@ -22,6 +22,7 @@ class SubmitEditedFragment : SubmitFragment() {
scrollToPositionWithOffset
(
recyclerViewPosition
,
2
)
isScrollEnabled
=
false
}
mainActivity
.
vocabularyAdapter
?.
state
=
State
.
EDIT
gone
(
clickableView
)
wordEt
.
requestFocus
()
...
...
app/src/main/java/com/paktalin/vocabularynotebook/ui/recycler_view/State.kt
View file @
7fb927f7
package
com.paktalin.vocabularynotebook.ui.recycler_view
import
com.paktalin.vocabularynotebook.ui.activities.MainActivity
enum
class
State
{
EDIT
,
ADD
,
TAG
,
NONE
;
fun
notAddOrEdit
():
Boolean
{
return
this
!=
ADD
&&
this
!=
EDIT
}
companion
object
{
private
val
TAGG
=
"VN/"
+
MainActivity
::
class
.
simpleName
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment