Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e126d72f authored by Jon Miranda's avatar Jon Miranda
Browse files

More grid changes, closer to final specs.

* Added isScalable, minCellWidth, minCellHeight, and borderSpacing attrs

When isScalable is true, we use set workspace cell values to
minCellWidth/minCellHeight and then scale the cell values to
fit the available space. This allows us to have consistent
aspect ratios when two devices match the display/grid options.

This is different from the dynamic grid, which calculates
cell values based on iconSize/textSize/etc and then allows
the cell width to be as wide as space allows.

I adjusted some variables so that they will auto adjust
based on another value, indepenent from whether the
grid isScalable or not. An example of this is the folder
label text, where it's always set to be 1.14x of whatever
the workspace icon text size is. This is so we don't need
to add a bunch of more variables to DisplayOption/GridOption.

Bug: 175329686
Test: - switching between device profiles,
      - testing folder open/close
      - testing in multiwindow
      - testing in landscape
Change-Id: Ia469ae0d65b518469ef264b726db46f4a3210056
parent 036b5854
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -21,4 +21,5 @@
    android:textColor="?attr/folderTextColor"
    android:includeFontPadding="false"
    android:hapticFeedbackEnabled="false"
    launcher:iconDisplay="folder" />
    launcher:iconDisplay="folder"
    launcher:centerVertically="true" />
+2 −8
Original line number Diff line number Diff line
@@ -27,15 +27,12 @@
        android:clipToPadding="false"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingLeft="16dp"
        android:paddingRight="16dp"
        android:paddingTop="16dp"
        launcher:pageIndicator="@+id/folder_page_indicator" />

    <LinearLayout
        android:id="@+id/folder_footer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_height="48dp"
        android:clipChildren="false"
        android:orientation="horizontal"
        android:paddingLeft="12dp"
@@ -53,13 +50,10 @@
            android:gravity="center_horizontal"
            android:hint="@string/folder_hint_text"
            android:imeOptions="flagNoExtractUi"
            android:paddingBottom="@dimen/folder_label_padding_bottom"
            android:paddingTop="@dimen/folder_label_padding_top"
            android:singleLine="true"
            android:textColor="?attr/folderTextColor"
            android:textColorHighlight="?android:attr/colorControlHighlight"
            android:textColorHint="?attr/folderHintColor"
            android:textSize="@dimen/folder_label_text_size" />
            android:textColorHint="?attr/folderHintColor"/>

        <com.android.launcher3.pageindicators.PageIndicatorDots
            android:id="@+id/folder_page_indicator"
+8 −0
Original line number Diff line number Diff line
@@ -133,6 +133,8 @@
        <attr name="numAllAppsColumns" format="integer" />
        <attr name="defaultLayoutId" format="reference" />
        <attr name="demoModeLayoutId" format="reference" />
        <attr name="isScalable" format="boolean" />

    </declare-styleable>

    <declare-styleable name="DevicePadding">
@@ -150,6 +152,12 @@
        <attr name="minWidthDps" format="float" />
        <attr name="minHeightDps" format="float" />

        <!-- These min cell values are only used if GridDisplayOption#isScalable is true-->
        <attr name="minCellHeightDps" format="float" />
        <attr name="minCellWidthDps" format="float" />

        <attr name="borderSpacingDps" format="float" />

        <attr name="iconImageSize" format="float" />
        <!-- landscapeIconSize defaults to iconSize, if not specified -->
        <attr name="landscapeIconSize" format="float" />
+1 −1
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@

    <!-- AllApps & Launcher transitions -->
    <!-- Out of 100, the percent to shrink the workspace during spring loaded mode. -->
    <integer name="config_workspaceSpringLoadShrinkPercentage">90</integer>
    <integer name="config_workspaceSpringLoadShrinkPercentage">85</integer>

    <!-- The duration of the animation from search hint to text entry -->
    <integer name="config_searchHintAnimationDuration">50</integer>
+10 −6
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@

    <!-- Dynamic Grid -->
    <dimen name="dynamic_grid_edge_margin">8dp</dimen>
    <dimen name="dynamic_grid_left_right_margin">8dp</dimen>
    <dimen name="dynamic_grid_icon_drawable_padding">7dp</dimen>
    <!-- Minimum space between workspace and hotseat in spring loaded mode -->
    <dimen name="dynamic_grid_min_spring_loaded_space">8dp</dimen>
@@ -27,7 +28,6 @@
    <dimen name="dynamic_grid_cell_border_spacing">16dp</dimen>
    <dimen name="dynamic_grid_cell_layout_padding">5.5dp</dimen>
    <dimen name="dynamic_grid_cell_padding_x">8dp</dimen>
    <dimen name="dynamic_grid_cell_padding_y">7dp</dimen>

    <!-- Hotseat -->
    <dimen name="dynamic_grid_hotseat_top_padding">8dp</dimen>
@@ -37,6 +37,9 @@
    <dimen name="dynamic_grid_hotseat_extra_vertical_size">34dp</dimen>
    <dimen name="dynamic_grid_hotseat_side_padding">0dp</dimen>

    <!-- Scalable Grid -->
    <dimen name="scalable_grid_left_right_margin">22dp</dimen>

    <!-- Workspace page indicator -->
    <dimen name="workspace_page_indicator_height">24dp</dimen>
    <dimen name="workspace_page_indicator_line_height">1dp</dimen>
@@ -90,7 +93,6 @@
    <!-- The size of corner radius of the arrow in the arrow toast. -->
    <dimen name="arrow_toast_corner_radius">2dp</dimen>


<!-- Search bar in All Apps -->
    <dimen name="all_apps_header_max_elevation">3dp</dimen>
    <dimen name="all_apps_header_scroll_to_elevation">16dp</dimen>
@@ -148,10 +150,12 @@

    <dimen name="folder_cell_x_padding">9dp</dimen>
    <dimen name="folder_cell_y_padding">6dp</dimen>
    <dimen name="folder_child_text_size">13sp</dimen>
    <dimen name="folder_label_padding_top">12dp</dimen>
    <dimen name="folder_label_padding_bottom">12dp</dimen>
    <dimen name="folder_label_text_size">16sp</dimen>
    <!-- label text size = workspace text size multiplied by this scale -->
    <dimen name="folder_label_text_scale">1.14</dimen>
    <dimen name="folder_label_height">48dp</dimen>

    <dimen name="folder_content_padding_left_right">8dp</dimen>
    <dimen name="folder_content_padding_top">16dp</dimen>

<!-- Sizes for managed profile badges -->
    <dimen name="profile_badge_size">24dp</dimen>
Loading