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

Commit 1ec5701a authored by skxu's avatar skxu
Browse files

Modify icon size for fill and save dialogs

Bug: 274942082
Test: Tested on phone, foldable, tablet
Change-Id: I40da6b0b67dae523b6afb903f65bc4842630c308
parent ff9f7271
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -35,10 +35,10 @@

        <ImageView
            android:id="@+id/autofill_service_icon"
            android:scaleType="fitStart"
            android:scaleType="fitCenter"
            android:visibility="gone"
            android:layout_width="@dimen/autofill_dialog_icon_size"
            android:layout_height="@dimen/autofill_dialog_icon_size"/>
            android:layout_height="@dimen/autofill_dialog_icon_max_height"
            android:layout_width="fill_parent"/>

        <LinearLayout
            android:id="@+id/autofill_dialog_header"
+3 −4
Original line number Diff line number Diff line
@@ -40,10 +40,10 @@

            <ImageView
                android:id="@+id/autofill_save_icon"
                android:scaleType="fitStart"
                android:scaleType="fitCenter"
                android:layout_gravity="center"
                android:layout_width="@dimen/autofill_save_icon_size"
                android:layout_height="@dimen/autofill_save_icon_size"/>
                android:layout_height="@dimen/autofill_save_icon_max_height"
                android:layout_width="fill_parent"/>

            <TextView
                android:id="@+id/autofill_save_title"
@@ -60,7 +60,6 @@
                android:id="@+id/autofill_save_custom_subtitle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/autofill_save_scroll_view_top_margin"
                android:visibility="gone"/>

        </LinearLayout>
+5 −8
Original line number Diff line number Diff line
@@ -874,6 +874,7 @@
    <dimen name="autofill_elevation">32dp</dimen>
    <dimen name="autofill_save_inner_padding">16dp</dimen>
    <dimen name="autofill_save_icon_size">32dp</dimen>
    <dimen name="autofill_save_icon_max_height">56dp</dimen>
    <dimen name="autofill_save_title_start_padding">8dp</dimen>
    <dimen name="autofill_save_scroll_view_top_margin">16dp</dimen>
    <dimen name="autofill_save_button_bar_padding">16dp</dimen>
@@ -882,19 +883,15 @@
    <!-- Max height of the the autofill save custom subtitle as a fraction of the screen width/height -->
    <dimen name="autofill_save_custom_subtitle_max_height">20%</dimen>

    <!-- Max (absolute) dimensions (both width and height) of autofill service icon on autofill save affordance.
      NOTE: the actual displayed size might is actually smaller than this and is hardcoded in the
      autofill_save.xml layout; this dimension is just used to avoid a crash in the UI (if the icon provided
      by the autofill service metadata is bigger than these dimentionsit will not be displayed).
    -->
    <dimen name="autofill_save_icon_max_size">300dp</dimen>

    <!-- Maximum number of datasets that are visible in the UX picker without scrolling -->
    <integer name="autofill_max_visible_datasets">3</integer>

    <!-- Size of an icon in the Autolfill fill dialog -->
    <!-- Size of an icon in the Autofill fill dialog -->
    <dimen name="autofill_dialog_icon_size">32dp</dimen>

    <!-- The max height of an icon in the Autofill fill dialog. -->
    <dimen name="autofill_dialog_icon_max_height">56dp</dimen>

    <!-- Size of a slice shortcut view -->
    <dimen name="slice_shortcut_size">56dp</dimen>
    <!-- Size of action icons in a slice -->
+1 −2
Original line number Diff line number Diff line
@@ -3654,7 +3654,6 @@
  <java-symbol type="dimen" name="autofill_dataset_picker_max_width"/>
  <java-symbol type="dimen" name="autofill_dataset_picker_max_height"/>
  <java-symbol type="dimen" name="autofill_save_custom_subtitle_max_height"/>
  <java-symbol type="dimen" name="autofill_save_icon_max_size"/>
  <java-symbol type="integer" name="autofill_max_visible_datasets" />

  <java-symbol type="style" name="Theme.DeviceDefault.Autofill" />
+1 −19
Original line number Diff line number Diff line
@@ -563,25 +563,7 @@ final class SaveUi {
    private void setServiceIcon(Context context, View view, Drawable serviceIcon) {
        final ImageView iconView = view.findViewById(R.id.autofill_save_icon);
        final Resources res = context.getResources();

        final int maxWidth = res.getDimensionPixelSize(R.dimen.autofill_save_icon_max_size);
        final int maxHeight = maxWidth;
        final int actualWidth = serviceIcon.getMinimumWidth();
        final int actualHeight = serviceIcon.getMinimumHeight();

        if (actualWidth <= maxWidth && actualHeight <= maxHeight) {
            if (sDebug) {
                Slog.d(TAG, "Adding service icon "
                        + "(" + actualWidth + "x" + actualHeight + ") as it's less than maximum "
                        + "(" + maxWidth + "x" + maxHeight + ").");
            }
        iconView.setImageDrawable(serviceIcon);
        } else {
            Slog.w(TAG, "Not adding service icon of size "
                    + "(" + actualWidth + "x" + actualHeight + ") because maximum is "
                    + "(" + maxWidth + "x" + maxHeight + ").");
            ((ViewGroup)iconView.getParent()).removeView(iconView);
        }
    }

    private static boolean isValidLink(PendingIntent pendingIntent, Intent intent) {