diff options
author | Adam Powell <adamp@google.com> | 2012-05-13 18:25:29 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2012-05-13 18:27:12 -0700 |
commit | ee21cab0e684710a77df85577ff16d1f00edaf4d (patch) | |
tree | b12e3aaa012f453a78249263d92f5b429076190a /src/com/android/packageinstaller/PackageInstallerActivity.java | |
parent | 9822c2e38ef710936ea13e14d9c993e12797240f (diff) | |
download | packages_apps_packageinstaller-ee21cab0e684710a77df85577ff16d1f00edaf4d.zip packages_apps_packageinstaller-ee21cab0e684710a77df85577ff16d1f00edaf4d.tar.gz packages_apps_packageinstaller-ee21cab0e684710a77df85577ff16d1f00edaf4d.tar.bz2 |
Fix up tabs in the permissions display
Make tab bar scrollable if tabs don't all fit.
Scroll the currently selected tab into view when it becomes selected.
Bug 6481646
Change-Id: Ic492526ce06fae759b23127f74cfcb8e2fd8f030
Diffstat (limited to 'src/com/android/packageinstaller/PackageInstallerActivity.java')
-rw-r--r-- | src/com/android/packageinstaller/PackageInstallerActivity.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/packageinstaller/PackageInstallerActivity.java b/src/com/android/packageinstaller/PackageInstallerActivity.java index 7051bdd..da0df53 100644 --- a/src/com/android/packageinstaller/PackageInstallerActivity.java +++ b/src/com/android/packageinstaller/PackageInstallerActivity.java @@ -28,17 +28,17 @@ import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageParser; +import android.graphics.Rect; import android.net.Uri; import android.os.Bundle; import android.provider.Settings; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; -import android.util.AttributeSet; import android.util.Log; import android.view.LayoutInflater; import android.view.View; -import android.view.ViewGroup; import android.view.View.OnClickListener; +import android.view.ViewGroup; import android.widget.AppSecurityPermissions; import android.widget.Button; import android.widget.ScrollView; @@ -103,6 +103,7 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen private final TabHost mTabHost; private final ViewPager mViewPager; private final ArrayList<TabInfo> mTabs = new ArrayList<TabInfo>(); + private final Rect mTempRect = new Rect(); static final class TabInfo { private final String tag; @@ -193,6 +194,11 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen widget.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS); mTabHost.setCurrentTab(position); widget.setDescendantFocusability(oldFocusability); + + // Scroll the current tab into visibility if needed. + View tab = widget.getChildTabViewAt(position); + mTempRect.set(tab.getLeft(), tab.getTop(), tab.getRight(), tab.getBottom()); + widget.requestRectangleOnScreen(mTempRect, false); } @Override |