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

Commit dad52e15 authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Better screen size adaptation for ResolverActivity" into jb-dev

parents 8fb62329 589e6f96
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -70,8 +70,7 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte
    private Button mOnceButton;
    private int mIconDpi;
    private int mIconSize;

    private static final int MAX_COLUMNS = 4;
    private int mMaxColumns;

    private boolean mRegistered;
    private final PackageMonitor mPackageMonitor = new PackageMonitor() {
@@ -105,6 +104,7 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte
        super.onCreate(savedInstanceState);
        mPm = getPackageManager();
        mAlwaysUseOption = alwaysUseOption;
        mMaxColumns = getResources().getInteger(R.integer.config_maxResolverActivityColumns);
        intent.setComponent(null);

        AlertController.AlertParams ap = mAlertParams;
@@ -154,7 +154,7 @@ public class ResolverActivity extends AlertActivity implements AdapterView.OnIte

    void resizeGrid() {
        final int itemCount = mAdapter.getCount();
        mGrid.setNumColumns(Math.min(itemCount, MAX_COLUMNS));
        mGrid.setNumColumns(Math.min(itemCount, mMaxColumns));
    }

    Drawable getIcon(Resources res, int resId) {
+4 −4
Original line number Diff line number Diff line
@@ -33,8 +33,8 @@
              android:gravity="center"
              android:minLines="2"
              android:maxLines="2"
              android:paddingLeft="8dip"
              android:paddingRight="8dip" />
              android:paddingLeft="4dip"
              android:paddingRight="4dip" />

    <!-- Activity icon when presenting dialog
         Size will be filled in by ResolverActivity -->
@@ -51,7 +51,7 @@
              android:gravity="center"
              android:minLines="2"
              android:maxLines="2"
              android:paddingLeft="8dip"
              android:paddingRight="8dip" />
              android:paddingLeft="4dip"
              android:paddingRight="4dip" />
</LinearLayout>
+5 −0
Original line number Diff line number Diff line
@@ -35,5 +35,10 @@
    <!-- If true, the screen can be rotated via the accelerometer in all 4
         rotations as the default behavior. -->
    <bool name="config_allowAllRotations">true</bool>

    <!-- Maximum number of grid columns permitted in the ResolverActivity
         used for picking activities to handle an intent. -->
    <integer name="config_maxResolverActivityColumns">3</integer>

</resources>
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 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>

    <!-- Maximum number of grid columns permitted in the ResolverActivity
         used for picking activities to handle an intent. -->
    <integer name="config_maxResolverActivityColumns">4</integer>

</resources>
+4 −0
Original line number Diff line number Diff line
@@ -846,6 +846,10 @@
         movement threshold where scrolling should begin. -->
    <dimen name="config_viewConfigurationTouchSlop">8dp</dimen>

    <!-- Maximum number of grid columns permitted in the ResolverActivity
         used for picking activities to handle an intent. -->
    <integer name="config_maxResolverActivityColumns">2</integer>

    <!-- Array of OEM specific USB mode override config.
         OEM can override a certain USB mode depending on ro.bootmode.
         Specify an array of below items to set override rule.
Loading