mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-27 15:26:58 +00:00
Update font settings to match POR
Updates font color, size, weight, and line height for text in the widget picker to match POR and pass a11y test. Bug: 317948371 Flag: NONE Test: Accessibility Scanner contrast test Change-Id: I3c7676c507b81a616876206681972ebb9fefd0c3
This commit is contained in:
@@ -46,20 +46,22 @@
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@+id/widget_text_container"
|
||||
android:orientation="vertical">
|
||||
<!-- The name of the widget. -->
|
||||
<TextView
|
||||
android:id="@+id/widget_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:fadingEdge="horizontal"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_horizontal|center_vertical"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:drawablePadding="@dimen/widget_cell_app_icon_padding"
|
||||
android:textSize="@dimen/widget_cell_font_size" />
|
||||
<!-- The name of the widget. -->
|
||||
<TextView
|
||||
android:id="@+id/widget_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:fadingEdge="horizontal"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_horizontal|center_vertical"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:textColor="?attr/widgetCellTitleColor"
|
||||
android:textSize="@dimen/widget_cell_title_font_size"
|
||||
android:textFontWeight="@integer/widget_cell_title_font_weight"
|
||||
android:lineHeight="@dimen/widget_cell_title_line_height"
|
||||
android:drawablePadding="@dimen/widget_cell_app_icon_padding" />
|
||||
|
||||
<!-- The original dimensions of the widget -->
|
||||
<TextView
|
||||
@@ -67,21 +69,23 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textSize="@dimen/widget_cell_font_size"
|
||||
android:alpha="0.7" />
|
||||
android:textColor="?attr/widgetCellSubtitleColor"
|
||||
android:textSize="@dimen/widget_cell_dims_font_size"
|
||||
android:textFontWeight="@integer/widget_cell_dims_font_weight"
|
||||
android:lineHeight="@dimen/widget_cell_dims_line_height" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/widget_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:textSize="@dimen/widget_cell_font_size"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textColor="?attr/widgetCellSubtitleColor"
|
||||
android:textSize="@dimen/widget_cell_description_font_size"
|
||||
android:textFontWeight="@integer/widget_cell_description_font_weight"
|
||||
android:lineHeight="@dimen/widget_cell_description_line_height"
|
||||
android:maxLines="3"
|
||||
android:ellipsize="end"
|
||||
android:fadingEdge="horizontal"
|
||||
android:alpha="0.7" />
|
||||
android:fadingEdge="horizontal" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
@@ -94,7 +98,9 @@
|
||||
android:paddingEnd="@dimen/widget_cell_add_button_end_padding"
|
||||
android:text="@string/widget_add_button_label"
|
||||
android:textColor="?attr/widgetPickerAddButtonTextColor"
|
||||
android:textSize="@dimen/widget_cell_font_size"
|
||||
android:textSize="@dimen/widget_cell_add_button_font_size"
|
||||
android:fontWeight="@integer/widget_cell_add_button_font_weight"
|
||||
android:lineHeight="@dimen/widget_cell_add_button_line_height"
|
||||
android:gravity="center"
|
||||
android:visibility="gone"
|
||||
android:drawableStart="@drawable/ic_plus"
|
||||
|
||||
@@ -48,8 +48,10 @@
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?attr/widgetPickerHeaderAppTitleColor"
|
||||
android:textSize="@dimen/widget_picker_header_app_title_font_size"
|
||||
android:textFontWeight="@integer/widget_picker_header_app_title_font_weight"
|
||||
android:lineHeight="@dimen/widget_picker_header_app_title_line_height"
|
||||
tools:text="App name" />
|
||||
|
||||
<TextView
|
||||
@@ -58,8 +60,10 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:alpha="0.7"
|
||||
android:textColor="?attr/widgetPickerHeaderAppSubtitleColor"
|
||||
android:textSize="@dimen/widget_picker_header_app_subtitle_font_size"
|
||||
android:textFontWeight="@integer/widget_picker_header_app_subtitle_font_weight"
|
||||
android:lineHeight="@dimen/widget_picker_header_app_subtitle_line_height"
|
||||
tools:text="m widgets, n shortcuts" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -51,7 +51,9 @@
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?attr/widgetPickerHeaderAppTitleColor"
|
||||
android:textSize="16sp"
|
||||
android:textSize="@dimen/widget_picker_header_app_title_font_size"
|
||||
android:textFontWeight="@integer/widget_picker_header_app_title_font_weight"
|
||||
android:lineHeight="@dimen/widget_picker_header_app_title_line_height"
|
||||
android:duplicateParentState="true"
|
||||
tools:text="App name" />
|
||||
|
||||
@@ -62,7 +64,9 @@
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textColor="?attr/widgetPickerHeaderAppSubtitleColor"
|
||||
android:alpha="0.7"
|
||||
android:textSize="@dimen/widget_picker_header_app_subtitle_font_size"
|
||||
android:textFontWeight="@integer/widget_picker_header_app_subtitle_font_weight"
|
||||
android:lineHeight="@dimen/widget_picker_header_app_subtitle_line_height"
|
||||
android:duplicateParentState="true"
|
||||
tools:text="m widgets, n shortcuts" />
|
||||
|
||||
|
||||
30
res/values-night-v34/colors.xml
Normal file
30
res/values-night-v34/colors.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
**
|
||||
** Copyright 2024, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<color name="widget_picker_secondary_surface_color_dark">
|
||||
@android:color/system_surface_bright_dark</color>
|
||||
<color name="widget_picker_header_app_title_color_dark">
|
||||
@android:color/system_on_surface_dark</color>
|
||||
<color name="widget_picker_header_app_subtitle_color_dark">
|
||||
@android:color/system_on_surface_variant_dark</color>
|
||||
<color name="widget_cell_title_color_dark">
|
||||
@android:color/system_on_surface_dark</color>
|
||||
<color name="widget_cell_subtitle_color_dark">
|
||||
@android:color/system_on_surface_variant_dark</color>
|
||||
</resources>
|
||||
30
res/values-v34/colors.xml
Normal file
30
res/values-v34/colors.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
**
|
||||
** Copyright 2024, The Android Open Source Project
|
||||
**
|
||||
** Licensed under the Apache License, Version 2.0 (the "License");
|
||||
** you may not use this file except in compliance with the License.
|
||||
** You may obtain a copy of the License at
|
||||
**
|
||||
** http://www.apache.org/licenses/LICENSE-2.0
|
||||
**
|
||||
** Unless required by applicable law or agreed to in writing, software
|
||||
** distributed under the License is distributed on an "AS IS" BASIS,
|
||||
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
** See the License for the specific language governing permissions and
|
||||
** limitations under the License.
|
||||
*/
|
||||
-->
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<color name="widget_picker_secondary_surface_color_light">
|
||||
@android:color/system_surface_bright_light</color>
|
||||
<color name="widget_picker_header_app_title_color_light">
|
||||
@android:color/system_on_surface_light</color>
|
||||
<color name="widget_picker_header_app_subtitle_color_light">
|
||||
@android:color/system_on_surface_variant_light</color>
|
||||
<color name="widget_cell_title_color_light">
|
||||
@android:color/system_on_surface_light</color>
|
||||
<color name="widget_cell_subtitle_color_light">
|
||||
@android:color/system_on_surface_variant_light</color>
|
||||
</resources>
|
||||
@@ -76,6 +76,8 @@
|
||||
<attr name="widgetPickerCollapseHandleColor" format="color"/>
|
||||
<attr name="widgetPickerAddButtonBackgroundColor" format="color"/>
|
||||
<attr name="widgetPickerAddButtonTextColor" format="color"/>
|
||||
<attr name="widgetCellTitleColor" format="color" />
|
||||
<attr name="widgetCellSubtitleColor" format="color" />
|
||||
|
||||
<!-- BubbleTextView specific attributes. -->
|
||||
<declare-styleable name="BubbleTextView">
|
||||
|
||||
@@ -117,6 +117,8 @@
|
||||
<color name="widget_picker_collapse_handle_color_light">#C4C7C5</color>
|
||||
<color name="widget_picker_add_button_background_color_light">#0B57D0</color>
|
||||
<color name="widget_picker_add_button_text_color_light">#0B57D0</color>
|
||||
<color name="widget_cell_title_color_light">@color/material_color_on_surface</color>
|
||||
<color name="widget_cell_subtitle_color_light">@color/material_color_on_surface_variant</color>
|
||||
|
||||
<color name="widget_picker_primary_surface_color_dark">#1F2020</color>
|
||||
<color name="widget_picker_secondary_surface_color_dark">#393939</color>
|
||||
@@ -134,6 +136,8 @@
|
||||
<color name="widget_picker_collapse_handle_color_dark">#444746</color>
|
||||
<color name="widget_picker_add_button_background_color_dark">#062E6F</color>
|
||||
<color name="widget_picker_add_button_text_color_dark">#FFFFFF</color>
|
||||
<color name="widget_cell_title_color_dark">@color/material_color_on_surface</color>
|
||||
<color name="widget_cell_subtitle_color_dark">@color/material_color_on_surface_variant</color>
|
||||
|
||||
<color name="material_color_on_secondary_fixed_variant">#3F4759</color>
|
||||
<color name="material_color_on_tertiary_fixed_variant">#583E5B</color>
|
||||
|
||||
@@ -179,19 +179,36 @@
|
||||
<!-- Widget tray -->
|
||||
<dimen name="widget_cell_vertical_padding">8dp</dimen>
|
||||
<dimen name="widget_cell_horizontal_padding">8dp</dimen>
|
||||
<dimen name="widget_cell_font_size">14sp</dimen>
|
||||
<dimen name="widget_cell_title_font_size">14sp</dimen>
|
||||
<integer name="widget_cell_title_font_weight">500</integer>
|
||||
<dimen name="widget_cell_title_line_height">20sp</dimen>
|
||||
<dimen name="widget_cell_dims_font_size">14sp</dimen>
|
||||
<integer name="widget_cell_dims_font_weight">400</integer>
|
||||
<dimen name="widget_cell_dims_line_height">20sp</dimen>
|
||||
<dimen name="widget_cell_description_font_size">12sp</dimen>
|
||||
<integer name="widget_cell_description_font_weight">400</integer>
|
||||
<dimen name="widget_cell_description_line_height">16sp</dimen>
|
||||
<dimen name="widget_cell_app_icon_size">24dp</dimen>
|
||||
<dimen name="widget_cell_app_icon_padding">8dp</dimen>
|
||||
<dimen name="widget_cell_add_button_height">48dp</dimen>
|
||||
<dimen name="widget_cell_add_button_start_padding">8dp</dimen>
|
||||
<dimen name="widget_cell_add_button_end_padding">16dp</dimen>
|
||||
<dimen name="widget_cell_add_button_scroll_padding">24dp</dimen>
|
||||
<dimen name="widget_cell_add_button_font_size">14sp</dimen>
|
||||
<integer name="widget_cell_add_button_font_weight">500</integer>
|
||||
<dimen name="widget_cell_add_button_line_height">20sp</dimen>
|
||||
|
||||
<dimen name="widget_tabs_button_horizontal_padding">4dp</dimen>
|
||||
<dimen name="widget_tabs_horizontal_padding">16dp</dimen>
|
||||
<dimen name="widget_apps_tabs_vertical_padding">6dp</dimen>
|
||||
<dimen name="widget_picker_landscape_tablet_left_right_margin">117dp</dimen>
|
||||
<dimen name="widget_picker_two_panels_left_right_margin">0dp</dimen>
|
||||
<dimen name="widget_picker_header_app_title_font_size">16sp</dimen>
|
||||
<integer name="widget_picker_header_app_title_font_weight">500</integer>
|
||||
<dimen name="widget_picker_header_app_title_line_height">24sp</dimen>
|
||||
<dimen name="widget_picker_header_app_subtitle_font_size">14sp</dimen>
|
||||
<integer name="widget_picker_header_app_subtitle_font_weight">400</integer>
|
||||
<dimen name="widget_picker_header_app_subtitle_line_height">20sp</dimen>
|
||||
<dimen name="widget_recommendations_table_vertical_padding">8dp</dimen>
|
||||
<!-- Bottom margin for the search and recommended widgets container without work profile -->
|
||||
<dimen name="search_and_recommended_widgets_container_bottom_margin">16dp</dimen>
|
||||
|
||||
@@ -268,6 +268,10 @@
|
||||
@color/widget_picker_add_button_background_color_light</item>
|
||||
<item name="widgetPickerAddButtonTextColor">
|
||||
@color/widget_picker_add_button_text_color_light</item>
|
||||
<item name="widgetCellTitleColor">
|
||||
@color/widget_cell_title_color_light</item>
|
||||
<item name="widgetCellSubtitleColor">
|
||||
@color/widget_cell_subtitle_color_light</item>
|
||||
</style>
|
||||
<style name="WidgetContainerTheme.Dark" parent="AppTheme.Dark">
|
||||
<item name="android:colorEdgeEffect">?android:attr/textColorSecondary</item>
|
||||
@@ -303,6 +307,10 @@
|
||||
@color/widget_picker_add_button_background_color_dark</item>
|
||||
<item name="widgetPickerAddButtonTextColor">
|
||||
@color/widget_picker_add_button_text_color_dark</item>
|
||||
<item name="widgetCellTitleColor">
|
||||
@color/widget_cell_title_color_dark</item>
|
||||
<item name="widgetCellSubtitleColor">
|
||||
@color/widget_cell_subtitle_color_dark</item>
|
||||
</style>
|
||||
|
||||
<style name="FastScrollerPopup" parent="@android:style/TextAppearance.DeviceDefault.DialogWindowTitle">
|
||||
|
||||
@@ -58,12 +58,13 @@ public final class WidgetsRecommendationTableLayout extends TableLayout {
|
||||
|
||||
public WidgetsRecommendationTableLayout(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
// There are 1 row for title, 1 row for dimension and 2 rows for description.
|
||||
// There are 1 row for title, 1 row for dimension and max 3 rows for description.
|
||||
mWidgetsRecommendationTableVerticalPadding = 2 * getResources()
|
||||
.getDimensionPixelSize(R.dimen.widget_recommendations_table_vertical_padding);
|
||||
mWidgetCellVerticalPadding = 2 * getResources()
|
||||
.getDimensionPixelSize(R.dimen.widget_cell_vertical_padding);
|
||||
mWidgetCellTextViewsHeight = 4 * getResources().getDimension(R.dimen.widget_cell_font_size);
|
||||
mWidgetCellTextViewsHeight =
|
||||
getResources().getDimension(R.dimen.widget_cell_title_line_height);
|
||||
}
|
||||
|
||||
/** Sets a {@link android.view.View.OnLongClickListener} for all widget cells in this table. */
|
||||
|
||||
@@ -31,6 +31,7 @@ import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.UserHandle;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.LayoutInflater;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -79,7 +80,8 @@ public final class WidgetsListHeaderViewHolderBinderTest {
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
|
||||
mContext = new ActivityContextWrapper(getApplicationContext());
|
||||
mContext = new ActivityContextWrapper(new ContextThemeWrapper(getApplicationContext(),
|
||||
R.style.WidgetContainerTheme));
|
||||
mTestProfile = new InvariantDeviceProfile();
|
||||
mTestProfile.numRows = 5;
|
||||
mTestProfile.numColumns = 5;
|
||||
|
||||
Reference in New Issue
Block a user