From 52ef935acb850c755b6c2afe3db10b0d93e072b4 Mon Sep 17 00:00:00 2001 From: Cristian Luis Duarte Date: Mon, 23 Apr 2018 21:43:27 -0300 Subject: [PATCH] Android - Search - Ripple effect on items and rounded corners using CardView --- android/app/build.gradle | 1 + .../app/src/main/res/drawable/domain_bg.xml | 10 --- .../app/src/main/res/layout/activity_home.xml | 2 +- .../app/src/main/res/layout/domain_view.xml | 67 +++++++++++-------- android/app/src/main/res/values/colors.xml | 4 +- android/app/src/main/res/values/dimens.xml | 1 + 6 files changed, 43 insertions(+), 42 deletions(-) delete mode 100644 android/app/src/main/res/drawable/domain_bg.xml diff --git a/android/app/build.gradle b/android/app/build.gradle index b2b3bcd772..c63f481f8c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -104,6 +104,7 @@ dependencies { implementation 'com.android.support:design:26.1.0' implementation 'com.android.support:appcompat-v7:26.1.0' compile 'com.android.support:recyclerview-v7:26.1.0' + compile 'com.android.support:cardview-v7:26.1.0' compile 'com.squareup.retrofit2:retrofit:2.4.0' compile 'com.squareup.retrofit2:converter-gson:2.4.0' diff --git a/android/app/src/main/res/drawable/domain_bg.xml b/android/app/src/main/res/drawable/domain_bg.xml deleted file mode 100644 index d30d6413e1..0000000000 --- a/android/app/src/main/res/drawable/domain_bg.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/android/app/src/main/res/layout/activity_home.xml b/android/app/src/main/res/layout/activity_home.xml index ea24faf823..c399ac16ec 100644 --- a/android/app/src/main/res/layout/activity_home.xml +++ b/android/app/src/main/res/layout/activity_home.xml @@ -18,7 +18,7 @@ android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:background="?attr/colorPrimary" + android:background="?attr/colorPrimaryDark" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> diff --git a/android/app/src/main/res/layout/domain_view.xml b/android/app/src/main/res/layout/domain_view.xml index ebcc831f05..2c2a36665f 100644 --- a/android/app/src/main/res/layout/domain_view.xml +++ b/android/app/src/main/res/layout/domain_view.xml @@ -1,35 +1,44 @@ - - + android:layout_marginStart="14dp" + android:layout_marginEnd="14dp" + android:layout_marginTop="4dp" + android:layout_marginBottom="4dp" + android:foreground="@drawable/rippleable" + android:clickable="true" + android:focusable="true" + android:elevation="0dp" + app:cardElevation="0dp" + app:cardCornerRadius="@dimen/item_corner_radius"> - - - \ No newline at end of file + android:layout_height="match_parent"> + + + + + + + \ No newline at end of file diff --git a/android/app/src/main/res/values/colors.xml b/android/app/src/main/res/values/colors.xml index 92e9f859ee..4dfc98d3ad 100644 --- a/android/app/src/main/res/values/colors.xml +++ b/android/app/src/main/res/values/colors.xml @@ -2,7 +2,7 @@ #ffffff @color/backgroundLight - #000000 + @color/backgroundDark #54D7FD #E3E3E3 #575757 @@ -15,5 +15,5 @@ #9e9e9e #F2F2F2 #FF7171 - #7F000000 + #99000000 diff --git a/android/app/src/main/res/values/dimens.xml b/android/app/src/main/res/values/dimens.xml index 440adcf6b9..fdf2141094 100644 --- a/android/app/src/main/res/values/dimens.xml +++ b/android/app/src/main/res/values/dimens.xml @@ -11,4 +11,5 @@ 12dp 12dp 8dp + 4dp \ No newline at end of file