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
efc2d1fa
authored
Sep 08, 2018
by
Paktalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now a word can be deleted from WordItemInfoActivity
parent
ddbdaae8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
app/src/main/java/com/paktalin/vocabularynotebook/activities/WordItemInfoActivity.kt
app/src/main/java/com/paktalin/vocabularynotebook/activities/WordItemInfoActivity.kt
View file @
efc2d1fa
package
com.paktalin.vocabularynotebook.activities
import
android.content.Intent
import
android.os.Bundle
import
android.support.v7.app.AppCompatActivity
import
android.view.Menu
import
android.view.MenuItem
import
com.paktalin.vocabularynotebook.R
import
com.paktalin.vocabularynotebook.WordItem
import
kotlinx.android.synthetic.main.activity_word_info.*
...
...
@@ -24,10 +26,28 @@ class WordItemInfoActivity: AppCompatActivity() {
return
true
}
override
fun
onOptionsItemSelected
(
item
:
MenuItem
?):
Boolean
{
when
(
item
!!
.
itemId
)
{
R
.
id
.
item_delete
->
{
wordItem
.
delete
()
cancel
()
}
R
.
id
.
item_edit
->
{
}
}
return
true
}
private
fun
setData
()
{
tvWord
.
text
=
wordItem
.
pojo
!!
.
word
tvTranslation
.
text
=
wordItem
.
pojo
!!
.
translation
}
private
fun
cancel
()
{
val
intentMainActivity
=
Intent
(
this
,
MainActivity
::
class
.
java
)
startActivity
(
intentMainActivity
)
}
companion
object
{
private
val
TAG
=
"VN/"
+
WordItemInfoActivity
::
class
.
java
.
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