Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit 2e8f4cb

Browse files
committed
[ADDDED] Material theme as base app theme.
1 parent ff6a0a2 commit 2e8f4cb

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

app/src/main/res/layout/demo_movie_details.xml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@
6363
app:layout_constraintStart_toStartOf="parent"
6464
app:layout_constraintTop_toTopOf="parent" />
6565

66-
<Button
66+
<com.google.android.material.button.MaterialButton
6767
android:id="@+id/movie_trailer"
68-
style="@style/Widget.AppCompat.Button.Borderless"
68+
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
6969
android:layout_width="wrap_content"
7070
android:layout_height="wrap_content"
7171
android:layout_marginTop="8dp"
72-
android:drawableStart="@drawable/ic_play_circle_outline_black_24dp"
73-
android:drawablePadding="5dp"
74-
android:drawableTint="@color/md_pink_300"
7572
android:text="Trailer"
7673
android:textColor="@color/md_grey_400"
74+
app:icon="@drawable/ic_play_circle_outline_black_24dp"
75+
app:iconPadding="5dp"
76+
app:iconTint="@color/md_pink_300"
7777
app:layout_constraintEnd_toEndOf="parent"
7878
app:layout_constraintStart_toStartOf="parent"
7979
app:layout_constraintTop_toTopOf="parent" />
@@ -128,8 +128,8 @@
128128
android:layout_gravity="center"
129129
android:layout_marginStart="16dp"
130130
android:drawableStart="@drawable/ic_people_black_18dp"
131-
android:drawablePadding="5dp"
132131
android:drawableEnd="@drawable/ic_baseline_4k_18dp"
132+
android:drawablePadding="5dp"
133133
android:drawableTint="@android:color/white"
134134
android:text="93%"
135135
app:layout_constraintLeft_toRightOf="@+id/user_rating"
@@ -187,21 +187,22 @@
187187
app:layout_constraintTop_toBottomOf="@+id/rating_thumbs_down" />
188188

189189
<!-- =========================== Begin Chained Button =========================== -->
190-
<Button
190+
<com.google.android.material.button.MaterialButton
191191
android:id="@+id/button_rent"
192-
style="@style/Widget.AppCompat.Button.Colored"
192+
style="@style/Widget.MaterialComponents.Button"
193193
android:layout_width="0dp"
194194
android:layout_height="wrap_content"
195195
android:layout_marginTop="16dp"
196+
android:layout_marginEnd="16dp"
196197
android:text="Rent from $4.99"
197198
app:layout_constraintEnd_toStartOf="@+id/button_buy"
198199
app:layout_constraintHorizontal_chainStyle="spread"
199200
app:layout_constraintStart_toStartOf="@+id/guideline_vertical_start"
200201
app:layout_constraintTop_toBottomOf="@+id/movie_storyline" />
201202

202-
<Button
203+
<com.google.android.material.button.MaterialButton
203204
android:id="@+id/button_buy"
204-
style="@style/Widget.AppCompat.Button.Colored"
205+
style="@style/Widget.MaterialComponents.Button"
205206
android:layout_width="0dp"
206207
android:layout_height="wrap_content"
207208
android:text="Buy from $19.99"

app/src/main/res/values/styles.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<resources>
22

3-
<!-- Base application theme. -->
4-
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
3+
<!--
4+
Base application theme.
5+
Use material theme for clean look.
6+
See
7+
- https://material.io/develop/android/docs/getting-started/
8+
- https://material.io/develop/android/components/
9+
-->
10+
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
511
<!-- Customize your theme here. -->
612
<item name="colorPrimary">@color/colorPrimary</item>
713
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>

0 commit comments

Comments
 (0)