Fixed selectable item background

pull/152/head
M66B 7 years ago
parent 7b81d8df1c
commit 5946904ee2

@ -58,7 +58,7 @@ public class AdapterAnswer extends RecyclerView.Adapter<AdapterAnswer.ViewHolder
ViewHolder(View itemView) {
super(itemView);
this.itemView = itemView;
this.itemView = itemView.findViewById(R.id.clItem);
tvName = itemView.findViewById(R.id.tvName);
}

@ -80,7 +80,7 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
ViewHolder(View itemView) {
super(itemView);
this.itemView = itemView;
this.itemView = itemView.findViewById(R.id.clItem);
ivDelete = itemView.findViewById(R.id.ivDelete);
tvName = itemView.findViewById(R.id.tvName);
tvType = itemView.findViewById(R.id.tvType);

@ -63,7 +63,7 @@ public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder>
ViewHolder(View itemView) {
super(itemView);
this.itemView = itemView;
this.itemView = itemView.findViewById(R.id.clItem);
image = itemView.findViewById(R.id.image);
caption = itemView.findViewById(R.id.caption);
}

@ -1,12 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:attr/selectableItemBackground" />
<item>
<selector>
<item
android:drawable="@color/darkColorItemSelected"
android:state_activated="true" />
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/darkColorItemSelected" android:state_activated="true" />
<item android:drawable="@android:color/transparent" />
</selector>
</item>
</layer-list>

@ -1,12 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:attr/selectableItemBackground" />
<item>
<selector>
<item
android:drawable="@color/lightColorItemSelected"
android:state_activated="true" />
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/lightColorItemSelected" android:state_activated="true" />
<item android:drawable="@android:color/transparent" />
</selector>
</item>
</layer-list>

@ -8,7 +8,8 @@
android:id="@+id/clItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/drawableItemBackground">
android:background="?attr/drawableItemBackground"
android:foreground="?attr/selectableItemBackground">
<View
android:id="@+id/vwColor"

@ -1,9 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/drawableItemBackground"
android:foreground="?attr/selectableItemBackground">
<TextView
android:id="@+id/tvName"
android:layout_width="0dp"
@ -29,3 +36,4 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvName" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

@ -1,10 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp">
android:background="?attr/drawableItemBackground"
android:foreground="?attr/selectableItemBackground"
android:paddingTop="6dp"
android:paddingBottom="6dp">
<ImageView
android:id="@+id/ivDelete"
@ -109,3 +116,4 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDebug" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

@ -8,7 +8,8 @@
android:id="@+id/clItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/drawableItemBackground">
android:background="?attr/drawableItemBackground"
android:foreground="?attr/selectableItemBackground">
<View
android:id="@+id/vwColor"

@ -8,7 +8,8 @@
android:id="@+id/clItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/drawableItemBackground">
android:background="?attr/drawableItemBackground"
android:foreground="?attr/selectableItemBackground">
<View
android:id="@+id/vwColor"

@ -1,8 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/drawableItemBackground"
android:foreground="?attr/selectableItemBackground"
android:padding="6dp">
<ImageView
@ -27,3 +34,4 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/image" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

@ -11,7 +11,8 @@
android:background="?attr/drawableItemBackground"
android:descendantFocusability="beforeDescendants"
android:focusable="true"
android:focusableInTouchMode="true">
android:focusableInTouchMode="true"
android:foreground="?attr/selectableItemBackground">
<TextView
android:id="@+id/tvDay"

@ -11,7 +11,8 @@
android:background="?attr/drawableItemBackground"
android:descendantFocusability="beforeDescendants"
android:focusable="true"
android:focusableInTouchMode="true">
android:focusableInTouchMode="true"
android:foreground="?attr/selectableItemBackground">
<TextView
android:id="@+id/tvDay"

@ -8,8 +8,9 @@
android:id="@+id/clItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:layout_marginBottom="3dp">
android:foreground="?attr/selectableItemBackground"
android:paddingTop="3dp"
android:paddingBottom="3dp">
<TextView
android:id="@+id/tvFolder"

@ -8,7 +8,8 @@
android:id="@+id/clItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/drawableItemBackground">
android:background="?attr/drawableItemBackground"
android:foreground="?attr/selectableItemBackground">
<TextView
android:id="@+id/tvName"

Loading…
Cancel
Save