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
b0095744
authored
Apr 21, 2019
by
Paktalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed fragment_editable_word
parent
dc5e6c99
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
158 deletions
app/src/main/java/com/paktalin/vocabularynotebook/ui/fragments/AddWordFragment.kt
app/src/main/java/com/paktalin/vocabularynotebook/ui/recycler_view/ViewHolder.kt
app/src/main/java/com/paktalin/vocabularynotebook/utils/ActivityUtil.kt
app/src/main/res/layout/fragment_editable_word.xml
app/src/main/res/layout/word_item.xml
app/src/main/res/values/dimens.xml
app/src/main/java/com/paktalin/vocabularynotebook/ui/fragments/AddWordFragment.kt
View file @
b0095744
...
@@ -10,14 +10,14 @@ import com.paktalin.vocabularynotebook.firestoreitems.WordPojo
...
@@ -10,14 +10,14 @@ import com.paktalin.vocabularynotebook.firestoreitems.WordPojo
import
com.paktalin.vocabularynotebook.ui.activities.MainActivity
import
com.paktalin.vocabularynotebook.ui.activities.MainActivity
import
com.paktalin.vocabularynotebook.utils.gone
import
com.paktalin.vocabularynotebook.utils.gone
import
com.paktalin.vocabularynotebook.utils.visible
import
com.paktalin.vocabularynotebook.utils.visible
import
kotlinx.android.synthetic.main.fragment_editable_word.*
import
kotlinx.android.synthetic.main.submit.*
import
kotlinx.android.synthetic.main.submit.*
import
kotlinx.android.synthetic.main.word_item.*
open
class
AddWordFragment
:
Fragment
()
{
open
class
AddWordFragment
:
Fragment
()
{
private
lateinit
var
mainActivity
:
MainActivity
private
lateinit
var
mainActivity
:
MainActivity
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
{
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
{
return
inflater
.
inflate
(
R
.
layout
.
fragment_editable_word
,
container
,
false
)
return
inflater
.
inflate
(
R
.
layout
.
word_item
,
container
,
false
)
}
}
override
fun
onActivityCreated
(
savedInstanceState
:
Bundle
?)
{
override
fun
onActivityCreated
(
savedInstanceState
:
Bundle
?)
{
...
...
app/src/main/java/com/paktalin/vocabularynotebook/ui/recycler_view/ViewHolder.kt
View file @
b0095744
...
@@ -5,6 +5,7 @@ import android.widget.EditText
...
@@ -5,6 +5,7 @@ import android.widget.EditText
import
androidx.recyclerview.selection.ItemDetailsLookup
import
androidx.recyclerview.selection.ItemDetailsLookup
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
com.paktalin.vocabularynotebook.firestoreitems.WordPojo
import
com.paktalin.vocabularynotebook.firestoreitems.WordPojo
import
com.paktalin.vocabularynotebook.utils.visible
import
kotlinx.android.synthetic.main.word_item.view.*
import
kotlinx.android.synthetic.main.word_item.view.*
class
ViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
class
ViewHolder
(
itemView
:
View
)
:
RecyclerView
.
ViewHolder
(
itemView
)
{
...
@@ -15,6 +16,7 @@ class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
...
@@ -15,6 +16,7 @@ class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
fun
bind
(
wordPojo
:
WordPojo
,
position
:
Int
,
isActivated
:
Boolean
,
showPopupMenu
:
(
View
,
Int
)
->
Unit
)
{
fun
bind
(
wordPojo
:
WordPojo
,
position
:
Int
,
isActivated
:
Boolean
,
showPopupMenu
:
(
View
,
Int
)
->
Unit
)
{
tvWord
.
setText
(
wordPojo
.
word
)
tvWord
.
setText
(
wordPojo
.
word
)
tvTranslation
.
setText
(
wordPojo
.
translation
)
tvTranslation
.
setText
(
wordPojo
.
translation
)
visible
(
itemView
.
clickable_view
)
itemView
.
clickable_view
.
setOnClickListener
{
showPopupMenu
(
itemView
,
position
)
}
itemView
.
clickable_view
.
setOnClickListener
{
showPopupMenu
(
itemView
,
position
)
}
itemView
.
isActivated
=
isActivated
itemView
.
isActivated
=
isActivated
}
}
...
...
app/src/main/java/com/paktalin/vocabularynotebook/utils/ActivityUtil.kt
View file @
b0095744
...
@@ -74,10 +74,6 @@ fun visible(view: View) {
...
@@ -74,10 +74,6 @@ fun visible(view: View) {
view
.
visibility
=
View
.
VISIBLE
view
.
visibility
=
View
.
VISIBLE
}
}
fun
invisible
(
view
:
View
)
{
view
.
visibility
=
View
.
INVISIBLE
}
fun
gone
(
view
:
View
)
{
fun
gone
(
view
:
View
)
{
view
.
visibility
=
View
.
GONE
view
.
visibility
=
View
.
GONE
}
}
...
@@ -85,9 +81,4 @@ fun gone(view: View) {
...
@@ -85,9 +81,4 @@ fun gone(view: View) {
fun
showKeyboard
(
activity
:
AppCompatActivity
)
{
fun
showKeyboard
(
activity
:
AppCompatActivity
)
{
val
imm
=
activity
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
?
val
imm
=
activity
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
?
imm
!!
.
toggleSoftInput
(
InputMethodManager
.
SHOW_FORCED
,
InputMethodManager
.
HIDE_IMPLICIT_ONLY
)
imm
!!
.
toggleSoftInput
(
InputMethodManager
.
SHOW_FORCED
,
InputMethodManager
.
HIDE_IMPLICIT_ONLY
)
}
fun
hideKeyboard
(
activity
:
AppCompatActivity
)
{
val
imm
=
activity
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
?
imm
!!
.
toggleSoftInput
(
InputMethodManager
.
RESULT_HIDDEN
,
InputMethodManager
.
RESULT_HIDDEN
)
}
}
\ No newline at end of file
app/src/main/res/layout/fragment_editable_word.xml
deleted
100644 → 0
View file @
dc5e6c99
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/editable_word_layout"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:src=
"@drawable/line"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
android:layout_marginBottom=
"8dp"
android:layout_marginRight=
"8dp"
android:layout_marginEnd=
"8dp"
android:layout_marginLeft=
"8dp"
android:layout_marginStart=
"8dp"
tools:ignore=
"ContentDescription"
/>
<LinearLayout
android:id=
"@+id/editable_word"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@android:color/transparent"
android:orientation=
"horizontal"
android:paddingStart=
"16dp"
android:paddingLeft=
"16dp"
android:paddingTop=
"8dp"
android:paddingEnd=
"16dp"
android:paddingRight=
"16dp"
android:paddingBottom=
"8dp"
app:layout_constraintTop_toTopOf=
"parent"
>
<EditText
android:id=
"@+id/word"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:background=
"@android:color/transparent"
android:hint=
"@string/hint_word"
android:inputType=
"textMultiLine"
android:paddingEnd=
"@dimen/word_margin"
android:paddingRight=
"@dimen/word_margin"
android:textColor=
"@color/text_color"
android:textSize=
"@dimen/text_size"
app:fontFamily=
"@font/neucha"
tools:ignore=
"LabelFor,RtlSymmetry"
/>
<EditText
android:id=
"@+id/translation"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:background=
"@android:color/transparent"
android:hint=
"@string/hint_translation"
android:inputType=
"textMultiLine"
android:paddingEnd=
"16dp"
android:paddingRight=
"16dp"
android:textColor=
"@color/text_color"
android:textSize=
"@dimen/text_size"
app:fontFamily=
"@font/neucha"
tools:ignore=
"LabelFor,RtlSymmetry"
/>
</LinearLayout>
<ImageButton
android:id=
"@+id/btnClear"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"8dp"
android:layout_marginEnd=
"8dp"
android:layout_marginRight=
"8dp"
android:layout_marginTop=
"8dp"
android:background=
"@android:color/transparent"
android:visibility=
"gone"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:srcCompat=
"@drawable/ic_close_blue"
tools:ignore=
"ContentDescription"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/layout/word_item.xml
View file @
b0095744
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/word_item_layout"
android:id=
"@+id/word_item_layout"
...
@@ -11,69 +10,70 @@
...
@@ -11,69 +10,70 @@
android:id=
"@+id/line"
android:id=
"@+id/line"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/line"
android:layout_gravity=
"bottom"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
android:layout_marginBottom=
"8dp"
android:layout_marginRight=
"8dp"
android:layout_marginEnd=
"8dp"
android:layout_marginLeft=
"8dp"
android:layout_marginStart=
"8dp"
android:layout_marginStart=
"8dp"
android:layout_marginLeft=
"8dp"
android:layout_marginEnd=
"8dp"
android:layout_marginRight=
"8dp"
android:layout_marginBottom=
"8dp"
android:src=
"@drawable/line"
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
<FrameLayout
<LinearLayout
android:id=
"@+id/layout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toTopOf=
"parent"
>
android:background=
"@drawable/selector"
android:orientation=
"horizontal"
android:paddingStart=
"16dp"
android:paddingLeft=
"16dp"
android:paddingTop=
"8dp"
android:paddingEnd=
"16dp"
android:paddingRight=
"16dp"
android:paddingBottom=
"8dp"
>
<
LinearLayou
t
<
EditTex
t
android:id=
"@+id/
layout
"
android:id=
"@+id/
word
"
android:layout_width=
"
match_parent
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/selector"
android:layout_weight=
"1"
android:orientation=
"horizontal"
android:background=
"@android:color/transparent"
android:paddingStart=
"16dp"
android:hint=
"@string/hint_word"
android:paddingLeft=
"16dp"
android:inputType=
"textMultiLine"
android:paddingTop=
"8dp"
android:paddingStart=
"@dimen/small_padding"
android:paddingEnd=
"16dp"
android:paddingLeft=
"@dimen/small_padding"
android:paddingRight=
"16dp"
android:paddingEnd=
"@dimen/small_padding"
android:paddingBottom=
"8dp"
>
android:paddingRight=
"@dimen/small_padding"
android:textColor=
"@color/text_color"
<EditText
android:textSize=
"@dimen/text_size"
android:id=
"@+id/word"
app:fontFamily=
"@font/neucha"
android:layout_width=
"0dp"
tools:ignore=
"LabelFor,RtlSymmetry"
/>
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:background=
"@android:color/transparent"
android:paddingEnd=
"@dimen/word_margin"
android:paddingRight=
"@dimen/word_margin"
android:textColor=
"@color/text_color"
android:textSize=
"@dimen/text_size"
app:fontFamily=
"@font/neucha"
tools:ignore=
"LabelFor,RtlSymmetry"
/>
<EditText
android:id=
"@+id/translation"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:background=
"@android:color/transparent"
android:textColor=
"@color/text_color"
android:textSize=
"@dimen/text_size"
app:fontFamily=
"@font/neucha"
tools:ignore=
"LabelFor"
/>
</LinearLayout>
<View
<EditText
android:id=
"@+id/clickable_view"
android:id=
"@+id/translation"
android:layout_width=
"match_parent"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:background=
"@android:color/transparent"
android:background=
"@android:color/transparent"
android:clickable=
"true"
android:hint=
"@string/hint_translation"
android:focusable=
"true"
/>
android:inputType=
"textMultiLine"
android:paddingStart=
"@dimen/small_padding"
android:paddingLeft=
"@dimen/small_padding"
android:paddingEnd=
"@dimen/small_padding"
android:paddingRight=
"@dimen/small_padding"
android:textColor=
"@color/text_color"
android:textSize=
"@dimen/text_size"
app:fontFamily=
"@font/neucha"
tools:ignore=
"LabelFor"
/>
</
Frame
Layout>
</
Linear
Layout>
</androidx.constraintlayout.widget.ConstraintLayout>
<View
\ No newline at end of file
android:id=
"@+id/clickable_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@android:color/transparent"
android:clickable=
"true"
android:focusable=
"true"
android:visibility=
"gone"
/>
</FrameLayout>
\ No newline at end of file
app/src/main/res/values/dimens.xml
View file @
b0095744
<resources>
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen
name=
"small_margin"
>
8dp
</dimen>
<dimen
name=
"small_margin"
>
8dp
</dimen>
<dimen
name=
"small_padding"
>
8dp
</dimen>
<dimen
name=
"button_text_size"
>
24sp
</dimen>
<dimen
name=
"button_text_size"
>
24sp
</dimen>
<dimen
name=
"medium_padding"
>
16dp
</dimen>
<dimen
name=
"medium_padding"
>
16dp
</dimen>
<dimen
name=
"medium_margin"
>
16dp
</dimen>
<dimen
name=
"medium_margin"
>
16dp
</dimen>
<dimen
name=
"text_size"
>
22sp
</dimen>
<dimen
name=
"text_size"
>
22sp
</dimen>
<dimen
name=
"word_margin"
>
8dp
</dimen>
<dimen
name=
"word_margin"
>
8dp
</dimen>
<dimen
name=
"small_padding"
>
4dp
</dimen>
</resources>
</resources>
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