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
8eee40c0
authored
Sep 09, 2018
by
Paktalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Button addWord appears and disappears as expected
parent
56cd1959
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
10 deletions
app/src/main/AndroidManifest.xml
app/src/main/java/com/paktalin/vocabularynotebook/ui/NewWordFragment.kt
app/src/main/res/layout/activity_main.xml
app/src/main/res/layout/fragment_vocabulary.xml
app/src/main/AndroidManifest.xml
View file @
8eee40c0
...
...
@@ -15,7 +15,9 @@
android:roundIcon=
"@mipmap/ic_launcher_round"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".ui.MainActivity"
/>
<activity
android:name=
".ui.MainActivity"
android:windowSoftInputMode=
"adjustResize"
/>
<activity
android:name=
".ui.LogInActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
app/src/main/java/com/paktalin/vocabularynotebook/ui/NewWordFragment.kt
View file @
8eee40c0
...
...
@@ -8,6 +8,7 @@ import android.util.Log
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.widget.ImageButton
import
com.paktalin.vocabularynotebook.R
import
kotlinx.android.synthetic.main.fragment_new_word.*
...
...
@@ -35,6 +36,7 @@ class NewWordFragment : Fragment() {
etWord
.
text
.
clear
()
etTranslation
.
text
.
clear
()
}
activity
!!
.
findViewById
<
ImageButton
>(
R
.
id
.
btnAddWord
).
setOnClickListener
{
addWord
()
}
}
private
fun
textWatcher
(
setEmpty
:
()
->
Unit
):
TextWatcher
{
...
...
@@ -58,11 +60,12 @@ class NewWordFragment : Fragment() {
private
fun
showAddWordButton
()
{
Log
.
d
(
TAG
,
"showAddWordButton"
)
//todo show add word button
activity
!!
.
findViewById
<
ImageButton
>(
R
.
id
.
btnAddWord
).
visibility
=
View
.
VISIBLE
}
private
fun
hideAddWordButton
()
{
Log
.
d
(
TAG
,
"hideAddWordButton"
)
activity
!!
.
findViewById
<
ImageButton
>(
R
.
id
.
btnAddWord
).
visibility
=
View
.
GONE
}
private
fun
hideClearButton
()
{
...
...
@@ -73,7 +76,10 @@ class NewWordFragment : Fragment() {
private
fun
showClearButton
()
{
Log
.
d
(
TAG
,
"showClearButton"
)
btnClear
.
visibility
=
View
.
VISIBLE
//todo add button click listener
}
private
fun
addWord
()
{
//todo get word data from edit texts and save it
}
companion
object
{
private
val
TAG
=
"VN/"
+
NewWordFragment
::
class
.
java
.
simpleName
}
...
...
app/src/main/res/layout/activity_main.xml
View file @
8eee40c0
...
...
@@ -9,10 +9,9 @@
<include
layout=
"@layout/img_background"
/>
<
Linear
Layout
<
android.support.constraint.Constraint
Layout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
android:layout_height=
"match_parent"
>
<fragment
android:id=
"@+id/fragment_new_word"
...
...
@@ -32,9 +31,30 @@
android:id=
"@+id/fragment_vocabulary"
android:name=
"com.paktalin.vocabularynotebook.ui.VocabularyFragment"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"8dp"
android:layout_marginLeft=
"8dp"
android:layout_marginRight=
"8dp"
android:layout_marginStart=
"8dp"
android:layout_marginTop=
"8dp"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/fragment_new_word"
/>
<ImageButton
android:id=
"@+id/btnAddWord"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"8dp"
android:layout_marginEnd=
"8dp"
android:layout_marginRight=
"8dp"
android:background=
"@android:color/transparent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
android:visibility=
"invisible"
app:srcCompat=
"@drawable/ic_done_icon"
/>
</
Linear
Layout>
</
android.support.constraint.Constraint
Layout>
<android.support.design.widget.NavigationView
android:id=
"@+id/navigationView"
...
...
app/src/main/res/layout/fragment_vocabulary.xml
View file @
8eee40c0
...
...
@@ -10,7 +10,6 @@
<android.support.v7.widget.RecyclerView
android:id=
"@+id/recyclerView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"8dp"
/>
android:layout_height=
"wrap_content"
/>
</FrameLayout>
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