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
c4f241ed
authored
Apr 21, 2019
by
Paktalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted recyclerView textViews to editTexts. Covered with clickable view
parent
9843c6ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
33 deletions
app/src/main/java/com/paktalin/vocabularynotebook/ui/recycler_view/ViewHolder.kt
app/src/main/res/layout/word_item.xml
app/src/main/java/com/paktalin/vocabularynotebook/ui/recycler_view/ViewHolder.kt
View file @
c4f241ed
...
...
@@ -15,7 +15,7 @@ class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
fun
bind
(
wordPojo
:
WordPojo
,
position
:
Int
,
isActivated
:
Boolean
,
showPopupMenu
:
(
View
,
Int
)
->
Unit
)
{
tvWord
.
text
=
wordPojo
.
word
tvTranslation
.
text
=
wordPojo
.
translation
itemView
.
setOnClickListener
{
showPopupMenu
(
itemView
,
position
)
}
itemView
.
clickable_view
.
setOnClickListener
{
showPopupMenu
(
itemView
,
position
)
}
itemView
.
isActivated
=
isActivated
}
...
...
app/src/main/res/layout/word_item.xml
View file @
c4f241ed
...
...
@@ -22,41 +22,58 @@
android:layout_marginStart=
"8dp"
tools:ignore=
"ContentDescription"
/>
<LinearLayout
android:id=
"@+id/layout"
<FrameLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:paddingStart=
"16dp"
android:paddingLeft=
"16dp"
android:paddingTop=
"8dp"
android:paddingEnd=
"16dp"
android:paddingRight=
"16dp"
android:paddingBottom=
"8dp"
android:background=
"@drawable/selector"
app:layout_constraintTop_toTopOf=
"parent"
>
<
TextView
android:id=
"@+id/
word
"
android:layout_width=
"
0dp
"
<
LinearLayout
android:id=
"@+id/
layout
"
android:layout_width=
"
match_parent
"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
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"
/>
<TextView
android:id=
"@+id/translation"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:textColor=
"@color/text_color"
android:textSize=
"@dimen/text_size"
app:fontFamily=
"@font/neucha"
tools:ignore=
"LabelFor"
/>
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"
>
<EditText
android:id=
"@+id/word"
android:layout_width=
"0dp"
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
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"
/>
</FrameLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ 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