Commit 52cb61c2 by Paktalin

Removed redundant clickListeners from recyclerView

parent 8c089b2f
...@@ -29,10 +29,7 @@ class VocabularyAdapter(private val wordItems: MutableList<WordItem>, private va ...@@ -29,10 +29,7 @@ class VocabularyAdapter(private val wordItems: MutableList<WordItem>, private va
val wordItem = wordItems[position] val wordItem = wordItems[position]
holder.tvWord.text = wordItem.pojo!!.word holder.tvWord.text = wordItem.pojo!!.word
holder.tvTranslation.text = wordItem.pojo!!.translation holder.tvTranslation.text = wordItem.pojo!!.translation
holder.itemView.setOnClickListener { openWordItemInfo(wordItem) }
holder.layout.setOnClickListener { openWordItemInfo(wordItem) }
holder.tvWord.setOnClickListener { openWordItemInfo(wordItem) }
holder.tvTranslation.setOnClickListener { openWordItemInfo(wordItem) }
holder.btnPopupMenu.setOnClickListener { showPopupMenu(holder.btnPopupMenu, position) } holder.btnPopupMenu.setOnClickListener { showPopupMenu(holder.btnPopupMenu, position) }
//todo set click listener to menu //todo set click listener to menu
} }
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/img_background" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="@string/tv_word"
app:layout_constraintBottom_toBottomOf="@+id/etWord"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:text="@string/tv_translation"
app:layout_constraintBottom_toBottomOf="@+id/etTranslation"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/etTranslation" />
<EditText
android:id="@+id/etWord"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
android:ems="10"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
tools:ignore="LabelFor"
android:inputType="text" />
<EditText
android:id="@+id/etTranslation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
android:ems="10"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etWord"
tools:ignore="LabelFor"
android:inputType="text"/>
<Button
android:id="@+id/btnSubmitNewWord"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:text="@string/btn_save"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<Button
android:id="@+id/btnCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:text="@string/btn_cancel"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:padding="8dp"> android:padding="8dp">
<TextView <TextView
...@@ -19,8 +16,7 @@ ...@@ -19,8 +16,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="8" android:layout_weight="8"
android:textSize="22sp" android:textSize="22sp"
tools:ignore="LabelFor" tools:ignore="LabelFor" />
android:inputType="text" />
<TextView <TextView
android:id="@+id/etTranslation" android:id="@+id/etTranslation"
...@@ -28,8 +24,7 @@ ...@@ -28,8 +24,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="8" android:layout_weight="8"
android:textSize="22sp" android:textSize="22sp"
tools:ignore="LabelFor" tools:ignore="LabelFor" />
android:inputType="text"/>
<ImageButton <ImageButton
android:id="@+id/btnClear" android:id="@+id/btnClear"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment