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

Commit fe4f03cd authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Set number of columns of photo picker dynamically

We use magic number 135dp to get the number of columns.
Here's the number of columns on Nexus devices:
https://goto.google.com/devicecolumns

Bug 27181878

Change-Id: I346caf488423586655cdd2a650c0502f7ff1bb9b
parent c423ee61
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="135dp"
    android:layout_height="135dp"
    android:layout_width="@dimen/photo_picker_item_ideal_width"
    android:layout_height="@dimen/photo_picker_item_ideal_width"
    android:background="@color/google_grey_600"
    android:orientation="vertical">

+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
      android:numColumns="auto_fit"
      android:verticalSpacing="3dp"
      android:horizontalSpacing="3dp"
      android:stretchMode="none"
      android:stretchMode="columnWidth"
      android:gravity="center"
      android:paddingTop="3dp"
      android:drawSelectorOnTop="true"/>
+2 −2
Original line number Diff line number Diff line
@@ -21,8 +21,8 @@

    <ImageView
            android:id="@+id/image"
            android:layout_width="135dp"
            android:layout_height="135dp"
            android:layout_width="match_parent"
            android:layout_height="@dimen/photo_picker_item_ideal_width"
            android:adjustViewBounds="true"
            android:layout_centerInParent="true"
            android:scaleType="centerCrop" />
+2 −2
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="135dp"
    android:layout_height="135dp"
    android:layout_width="@dimen/photo_picker_item_ideal_width"
    android:layout_height="@dimen/photo_picker_item_ideal_width"
    android:background="@color/google_grey_600"
    android:orientation="vertical">

+2 −2
Original line number Diff line number Diff line
@@ -280,8 +280,8 @@
      of ListView's will not match the padding inside list items -->
    <dimen name="contact_browser_list_item_padding_top_or_bottom">12dp</dimen>

    <!-- Width of padding between columns of photos in photo picker -->
    <dimen name="photo_picker_column_padding_width">1dp</dimen>
    <!-- Ideal item width in photo picker -->
    <dimen name="photo_picker_item_ideal_width">135dp</dimen>

    <!-- Margin between name field and whatever fields are above it. -->
    <dimen name="compact_editor_name_top_margin">8dp</dimen>
Loading