diff options
author | Stefan Niedermann <info@niedermann.it> | 2021-10-18 09:47:31 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2021-10-18 09:47:31 +0300 |
commit | 5b524bc0e28a0afde1a741f32687c065df0e72fc (patch) | |
tree | ad952207d0ef6b60629240cdcf72f08e5a36cf9d /app/src/main/res | |
parent | f9ef4482a4a6638d54bbac830cf72cee032e408f (diff) |
Adjust widget styling for Android S
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/drawable-v21/bg_navdrawer_item.xml | 37 | ||||
-rw-r--r-- | app/src/main/res/drawable-v21/bottom_sheet_rounded.xml | 9 | ||||
-rw-r--r-- | app/src/main/res/drawable/bg_navdrawer_item.xml | 33 | ||||
-rw-r--r-- | app/src/main/res/drawable/bottom_sheet_rounded.xml | 3 | ||||
-rw-r--r-- | app/src/main/res/drawable/widget_stack_entry_background.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/layout/widget_single_card.xml | 19 | ||||
-rw-r--r-- | app/src/main/res/layout/widget_stack.xml | 11 | ||||
-rw-r--r-- | app/src/main/res/layout/widget_upcoming.xml | 8 | ||||
-rw-r--r-- | app/src/main/res/values-v31/dimens.xml | 35 | ||||
-rw-r--r-- | app/src/main/res/values/dimens.xml | 6 |
10 files changed, 92 insertions, 71 deletions
diff --git a/app/src/main/res/drawable-v21/bg_navdrawer_item.xml b/app/src/main/res/drawable-v21/bg_navdrawer_item.xml deleted file mode 100644 index 0cdc61323..000000000 --- a/app/src/main/res/drawable-v21/bg_navdrawer_item.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<ripple xmlns:android="http://schemas.android.com/apk/res/android" - android:color="?colorControlHighlight"> - - <item - android:id="@android:id/mask" - android:left="@dimen/spacer_1x" - android:right="@dimen/spacer_1x"> - - <shape android:shape="rectangle"> - <!-- value of color is irrelevant, but solid needs to be defined for mask to work --> - <solid android:color="@color/bg_highlighted" /> - <corners android:radius="@dimen/spacer_1hx" /> - </shape> - </item> - - <item - android:left="@dimen/spacer_1x" - android:right="@dimen/spacer_1x"> - - <selector> - <item android:state_checked="true"> - <shape android:shape="rectangle"> - <corners android:radius="@dimen/spacer_1hx" /> - <solid android:color="@color/bg_highlighted" /> - </shape> - </item> - - <item> - <shape android:shape="rectangle"> - <corners android:radius="@dimen/spacer_1hx" /> - </shape> - </item> - </selector> - </item> - -</ripple>
\ No newline at end of file diff --git a/app/src/main/res/drawable-v21/bottom_sheet_rounded.xml b/app/src/main/res/drawable-v21/bottom_sheet_rounded.xml deleted file mode 100644 index ba266ed32..000000000 --- a/app/src/main/res/drawable-v21/bottom_sheet_rounded.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<shape xmlns:android="http://schemas.android.com/apk/res/android" - android:shape="rectangle"> - <solid android:color="?attr/colorSurface" /> - <corners - android:topLeftRadius="16dp" - android:topRightRadius="16dp" /> - -</shape>
\ No newline at end of file diff --git a/app/src/main/res/drawable/bg_navdrawer_item.xml b/app/src/main/res/drawable/bg_navdrawer_item.xml index 39e2c2f47..0cdc61323 100644 --- a/app/src/main/res/drawable/bg_navdrawer_item.xml +++ b/app/src/main/res/drawable/bg_navdrawer_item.xml @@ -1,14 +1,37 @@ <?xml version="1.0" encoding="utf-8"?> -<selector xmlns:android="http://schemas.android.com/apk/res/android" android:left="@dimen/spacer_1x" android:right="@dimen/spacer_1x"> +<ripple xmlns:android="http://schemas.android.com/apk/res/android" + android:color="?colorControlHighlight"> + + <item + android:id="@android:id/mask" + android:left="@dimen/spacer_1x" + android:right="@dimen/spacer_1x"> - <item android:state_checked="true"> <shape android:shape="rectangle"> + <!-- value of color is irrelevant, but solid needs to be defined for mask to work --> <solid android:color="@color/bg_highlighted" /> + <corners android:radius="@dimen/spacer_1hx" /> </shape> </item> - <item> - <shape android:shape="rectangle" /> + <item + android:left="@dimen/spacer_1x" + android:right="@dimen/spacer_1x"> + + <selector> + <item android:state_checked="true"> + <shape android:shape="rectangle"> + <corners android:radius="@dimen/spacer_1hx" /> + <solid android:color="@color/bg_highlighted" /> + </shape> + </item> + + <item> + <shape android:shape="rectangle"> + <corners android:radius="@dimen/spacer_1hx" /> + </shape> + </item> + </selector> </item> -</selector>
\ No newline at end of file +</ripple>
\ No newline at end of file diff --git a/app/src/main/res/drawable/bottom_sheet_rounded.xml b/app/src/main/res/drawable/bottom_sheet_rounded.xml index cef4c2314..ba266ed32 100644 --- a/app/src/main/res/drawable/bottom_sheet_rounded.xml +++ b/app/src/main/res/drawable/bottom_sheet_rounded.xml @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> - <solid android:color="@color/primary" /> + <solid android:color="?attr/colorSurface" /> <corners android:topLeftRadius="16dp" android:topRightRadius="16dp" /> + </shape>
\ No newline at end of file diff --git a/app/src/main/res/drawable/widget_stack_entry_background.xml b/app/src/main/res/drawable/widget_stack_entry_background.xml index 1d348b58e..62f9d4746 100644 --- a/app/src/main/res/drawable/widget_stack_entry_background.xml +++ b/app/src/main/res/drawable/widget_stack_entry_background.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/widget_background" /> - <corners android:radius="@dimen/widget_outer_radius" /> + <corners android:radius="@dimen/widget_inner_radius" /> <padding android:bottom="0dp" android:left="0dp" diff --git a/app/src/main/res/layout/widget_single_card.xml b/app/src/main/res/layout/widget_single_card.xml index cf3bac763..287841c46 100644 --- a/app/src/main/res/layout/widget_single_card.xml +++ b/app/src/main/res/layout/widget_single_card.xml @@ -6,23 +6,21 @@ android:layout_height="match_parent" android:background="@drawable/widget_single_card_background" android:orientation="vertical" - android:paddingTop="@dimen/spacer_1hx" - android:paddingBottom="@dimen/spacer_1x" - android:paddingStart="@dimen/spacer_2x" - android:paddingEnd="@dimen/spacer_2x" tools:layout_height="200dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="horizontal"> + android:orientation="horizontal" + android:paddingStart="@dimen/widget_inner_padding_horizontal" + android:paddingTop="@dimen/widget_inner_padding_vertical" + android:paddingEnd="@dimen/widget_inner_padding_horizontal"> <TextView android:id="@+id/title" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - android:paddingTop="@dimen/spacer_1hx" android:paddingBottom="@dimen/spacer_1hx" android:textColor="@color/widget_foreground" android:textSize="@dimen/widget_font_size_header" @@ -58,7 +56,9 @@ <FrameLayout android:layout_width="match_parent" android:layout_height="0dp" - android:layout_weight="1"> + android:layout_weight="1" + android:paddingStart="@dimen/widget_inner_padding_horizontal" + android:paddingEnd="@dimen/widget_inner_padding_horizontal"> <ListView android:id="@+id/description_lv" @@ -74,7 +74,10 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/spacer_1hx" - android:gravity="bottom"> + android:gravity="bottom" + android:paddingStart="@dimen/widget_inner_padding_horizontal" + android:paddingEnd="@dimen/widget_inner_padding_horizontal" + android:paddingBottom="@dimen/widget_inner_padding_vertical"> <ImageView android:id="@+id/card_count_comments_image" diff --git a/app/src/main/res/layout/widget_stack.xml b/app/src/main/res/layout/widget_stack.xml index c0e5887a8..b02e9a1db 100644 --- a/app/src/main/res/layout/widget_stack.xml +++ b/app/src/main/res/layout/widget_stack.xml @@ -10,9 +10,9 @@ <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingStart="@dimen/spacer_1x" - android:paddingTop="@dimen/spacer_1x" - android:paddingEnd="@dimen/spacer_1x"> + android:paddingStart="@dimen/widget_inner_padding_horizontal" + android:paddingTop="@dimen/widget_inner_padding_vertical" + android:paddingEnd="@dimen/widget_inner_padding_horizontal"> <RelativeLayout android:id="@+id/widget_stack_header_rl" @@ -55,7 +55,10 @@ android:layout_height="wrap_content" android:divider="@android:color/transparent" android:dividerHeight="@dimen/spacer_1x" - android:padding="@dimen/spacer_1x" + android:paddingStart="@dimen/widget_inner_padding_horizontal" + android:paddingTop="@dimen/spacer_1x" + android:paddingEnd="@dimen/widget_inner_padding_horizontal" + android:paddingBottom="@dimen/widget_inner_padding_vertical" tools:listitem="@layout/widget_stack_entry" /> <ImageView diff --git a/app/src/main/res/layout/widget_upcoming.xml b/app/src/main/res/layout/widget_upcoming.xml index 4ae9ca4ad..75aa09d9b 100644 --- a/app/src/main/res/layout/widget_upcoming.xml +++ b/app/src/main/res/layout/widget_upcoming.xml @@ -13,10 +13,10 @@ android:layout_height="wrap_content" android:divider="@android:color/transparent" android:dividerHeight="@dimen/spacer_1x" - android:paddingTop="@dimen/spacer_1x" - android:paddingStart="@dimen/spacer_1x" - android:paddingEnd="@dimen/spacer_1x" - android:paddingBottom="@dimen/spacer_1x" + android:paddingStart="@dimen/widget_inner_padding_horizontal" + android:paddingTop="@dimen/widget_inner_padding_vertical" + android:paddingEnd="@dimen/widget_inner_padding_horizontal" + android:paddingBottom="@dimen/widget_inner_padding_vertical" tools:listitem="@layout/widget_stack_entry" /> <ImageView diff --git a/app/src/main/res/values-v31/dimens.xml b/app/src/main/res/values-v31/dimens.xml new file mode 100644 index 000000000..a454cb9b8 --- /dev/null +++ b/app/src/main/res/values-v31/dimens.xml @@ -0,0 +1,35 @@ +<resources> + <dimen name="spacer_1qx">2dp</dimen> + <dimen name="spacer_1hx">4dp</dimen> + <dimen name="spacer_1x">8dp</dimen> + <dimen name="spacer_2x">16dp</dimen> + <dimen name="spacer_3x">24dp</dimen> + <dimen name="spacer_4x">32dp</dimen> + + <dimen name="compact_label_height">6dp</dimen> + <dimen name="attachments_bottom_navigation_height">64dp</dimen> + + <dimen name="font_size_description">18sp</dimen> + + <!-- Drawer header --> + <dimen name="drawer_header_height">100dp</dimen> + <dimen name="drawer_header_logo_size">42dp</dimen> + + <dimen name="fab_margin">@dimen/spacer_2x</dimen> + + <dimen name="avatar_size">40dp</dimen> + <dimen name="avatar_size_small">32dp</dimen> + <dimen name="avatar_size_small_overlapping">20dp</dimen> + <dimen name="avatar_size_small_overlapping_border">2dp</dimen> + + <dimen name="icon_size_details">24dp</dimen> + <dimen name="empty_content_font_size">26sp</dimen> + + <dimen name="widget_outer_radius">@android:dimen/system_app_widget_background_radius</dimen> + <dimen name="widget_inner_radius">@android:dimen/system_app_widget_inner_radius</dimen> + <dimen name="widget_inner_padding_vertical">@dimen/widget_inner_radius</dimen> + <dimen name="widget_inner_padding_horizontal">@dimen/spacer_1x</dimen> + <dimen name="widget_stack_card_padding">@dimen/spacer_1hx</dimen> + + <dimen name="widget_font_size_header">16sp</dimen> +</resources>
\ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index b9f6663ca..65db48fc3 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -25,8 +25,10 @@ <dimen name="icon_size_details">24dp</dimen> <dimen name="empty_content_font_size">26sp</dimen> - <dimen name="widget_outer_radius">@dimen/spacer_1x</dimen> - <dimen name="widget_inner_radius">@dimen/spacer_1hx</dimen> + <dimen name="widget_outer_radius">@dimen/spacer_4x</dimen> + <dimen name="widget_inner_radius">@dimen/spacer_2x</dimen> + <dimen name="widget_inner_padding_vertical">@dimen/widget_inner_radius</dimen> + <dimen name="widget_inner_padding_horizontal">@dimen/spacer_1x</dimen> <dimen name="widget_stack_card_padding">@dimen/spacer_1hx</dimen> <dimen name="widget_font_size_header">16sp</dimen> |