Skip to content

Commit

Permalink
Basic theming with Material Components (#2)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniele Ricci <daniele@casaricci.it>
  • Loading branch information
daniele-athome committed Jul 7, 2020
1 parent 3eab4cf commit d028278
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
15 changes: 9 additions & 6 deletions app/src/main/res/layout/activity_result.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@

<TextView
android:id="@+id/text_specialty"
style="@style/TextAppearance.AppCompat.Large"
style="@style/TextAppearance.MaterialComponents.Headline5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
tools:text="@string/specialty0" />

<TextView
android:id="@+id/text_result_passed"
style="@style/TextAppearance.AppCompat.Display3"
style="@style/TextAppearance.MaterialComponents.Headline3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
Expand All @@ -56,7 +56,7 @@
android:gravity="center_horizontal">

<TextView
style="@style/TextAppearance.AppCompat.Body1"
style="@style/TextAppearance.MaterialComponents.Body1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
Expand All @@ -81,7 +81,7 @@
android:gravity="center_horizontal">

<TextView
style="@style/TextAppearance.AppCompat.Body1"
style="@style/TextAppearance.MaterialComponents.Body1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
Expand All @@ -107,7 +107,7 @@
android:gravity="center_horizontal">

<TextView
style="@style/TextAppearance.AppCompat.Body1"
style="@style/TextAppearance.MaterialComponents.Body1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
Expand All @@ -128,7 +128,10 @@
</LinearLayout>

<TextView
style="?android:attr/borderlessButtonStyle"
style="@style/TextAppearance.MaterialComponents.Button"
android:gravity="center"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:focusable="false"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/item_recap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:id="@+id/text_question"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:textAppearance="@style/TextAppearance.Exam.QuestionText"
tools:text="Per un ultraleggero monomotore, il gruppo motoelica, oltre a formare la trazione, determina effetti secondari?" />

<com.inthecheesefactory.thecheeselibrary.widget.AdjustableImageView
Expand All @@ -45,11 +45,11 @@
<RadioButton
android:id="@+id/radio_answer1"
android:tag="0"
style="@style/AppTheme.RadioButton.ItemRecap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="@dimen/question_answers_margin"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:visibility="gone"
android:clickable="false"
tools:visibility="visible"
Expand All @@ -59,10 +59,10 @@
<RadioButton
android:id="@+id/radio_answer2"
android:tag="1"
style="@style/AppTheme.RadioButton.ItemRecap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/question_answers_margin"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:visibility="gone"
android:clickable="false"
tools:visibility="visible"
Expand All @@ -71,10 +71,10 @@
<RadioButton
android:id="@+id/radio_answer3"
android:tag="2"
style="@style/AppTheme.RadioButton.ItemRecap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/question_answers_margin"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:visibility="gone"
android:clickable="false"
tools:visibility="visible"
Expand All @@ -83,10 +83,10 @@
<RadioButton
android:id="@+id/radio_answer4"
android:tag="3"
style="@style/AppTheme.RadioButton.ItemRecap"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/question_answers_margin"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:visibility="gone"
android:clickable="false"
tools:visibility="visible"
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,9 @@
<item name="android:textSize">22sp</item>
</style>

<style name="AppTheme.RadioButton.ItemRecap" parent="Widget.MaterialComponents.CompoundButton.RadioButton">
<item name="android:minHeight">0dp</item>
<item name="android:textAppearance">@style/TextAppearance.MaterialComponents.Body2</item>
</style>

</resources>

0 comments on commit d028278

Please sign in to comment.