add selectable background

This commit is contained in:
houxg
2016-11-30 15:15:05 +08:00
parent 9beba839c1
commit 5b51f14b79
8 changed files with 17 additions and 5 deletions

View File

@@ -59,7 +59,7 @@ public class TagAdapter extends RecyclerView.Adapter<TagAdapter.TagHolder> {
public void onBindViewHolder(TagHolder holder, int position) {
final Tag tag = mData.get(position);
holder.titleTv.setText(tag.getText());
holder.titleTv.setOnClickListener(new View.OnClickListener() {
holder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mListener != null) {

View File

@@ -109,6 +109,7 @@
android:id="@+id/ll_debug"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical">
<LinearLayout

View File

@@ -167,6 +167,7 @@
android:id="@+id/ll_clear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical">
<TextView

View File

@@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical"
android:padding="16dp">

View File

@@ -25,6 +25,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical|start"
android:paddingBottom="8dp"
android:paddingEnd="8dp"

View File

@@ -3,6 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:orientation="horizontal"
android:padding="8dp">
@@ -16,7 +18,7 @@
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="56dp"

View File

@@ -56,7 +56,8 @@
android:id="@+id/rl_recent_notes"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
android:padding="16dp"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:layout_width="wrap_content"
@@ -82,6 +83,7 @@
android:id="@+id/rl_notebook"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:padding="16dp">
<ImageView
@@ -131,6 +133,7 @@
android:id="@+id/rl_tag"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:padding="16dp">
<ImageView
@@ -178,7 +181,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:padding="16dp">
android:padding="16dp"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:layout_width="wrap_content"
@@ -203,7 +207,8 @@
android:id="@+id/rl_about"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
android:padding="16dp"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:layout_width="wrap_content"

View File

@@ -31,6 +31,7 @@
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:padding">16dp</item>
<item name="android:background">?android:attr/selectableItemBackground</item>
</style>
<style name="FormatButton">