Skip to content

Commit

Permalink
Merge pull request #671 from DroidKaigi/feature/set_sponsor_backgroun…
Browse files Browse the repository at this point in the history
…d_color_on_dark_theme

fit sponsor item design on dark theme
  • Loading branch information
takahirom authored Feb 5, 2020
2 parents 9a8b1c1 + 326863e commit 198249e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 11 deletions.
8 changes: 4 additions & 4 deletions feature/sponsor/src/main/res/layout/item_sponsor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@

<com.google.android.material.card.MaterialCardView
android:id="@+id/card"
style="@style/Widget.DroidKaigi.Card.Sponsor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
app:cardCornerRadius="8dp"
app:cardElevation="3dp"
android:theme="@style/ThemeOverlay.DroidKaigi.Card.Sponsor"
>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
>

<ImageView
android:id="@+id/image"
android:layout_width="0dp"
android:layout_height="72dp"
android:contentDescription="@null"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -31,4 +31,4 @@

</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</layout>
</layout>
19 changes: 12 additions & 7 deletions feature/sponsor/src/main/res/layout/item_sponsor_large.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>

<com.google.android.material.card.MaterialCardView
android:id="@+id/card"
style="@style/Widget.DroidKaigi.Card.Sponsor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
app:cardCornerRadius="8dp"
app:cardElevation="3dp">
android:theme="@style/ThemeOverlay.DroidKaigi.Card.Sponsor"
>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
>

<ImageView
android:id="@+id/image"
android:layout_width="0dp"
android:layout_height="112dp"
android:contentDescription="@null"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
/>

</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</layout>
</layout>
8 changes: 8 additions & 0 deletions feature/sponsor/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Widget.DroidKaigi.Card.Sponsor" parent="Widget.MaterialComponents.CardView">
<item name="cardCornerRadius">8dp</item>
<item name="cardElevation">3dp</item>
</style>
</resources>
8 changes: 8 additions & 0 deletions feature/sponsor/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="ThemeOverlay.DroidKaigi.Card.Sponsor" parent="Theme.MaterialComponents.Light">
<item name="colorPrimary">@color/black</item>
<item name="colorSurface">@color/white</item>
</style>
</resources>

0 comments on commit 198249e

Please sign in to comment.