diff options
author | Adam Powell <adamp@google.com> | 2012-05-22 17:33:27 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-05-22 17:33:27 -0700 |
commit | 3f892a2071dd7befcea2a218a6479d54e64b73e1 (patch) | |
tree | 7d06350620b34c31411cde908b7f571ceb036538 | |
parent | 650907bb3306ba8aa95058a40c083ba36dd735c7 (diff) | |
parent | 019c976364314aa16e53e8af31616ab902711288 (diff) | |
download | packages_apps_packageinstaller-3f892a2071dd7befcea2a218a6479d54e64b73e1.zip packages_apps_packageinstaller-3f892a2071dd7befcea2a218a6479d54e64b73e1.tar.gz packages_apps_packageinstaller-3f892a2071dd7befcea2a218a6479d54e64b73e1.tar.bz2 |
am 019c9763: Make permissions pages awaken their scrollbars when the page is focused
* commit '019c976364314aa16e53e8af31616ab902711288':
Make permissions pages awaken their scrollbars when the page is focused
-rw-r--r-- | src/com/android/packageinstaller/PackageInstallerActivity.java | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/com/android/packageinstaller/PackageInstallerActivity.java b/src/com/android/packageinstaller/PackageInstallerActivity.java index da0df53..c07ed4a 100644 --- a/src/com/android/packageinstaller/PackageInstallerActivity.java +++ b/src/com/android/packageinstaller/PackageInstallerActivity.java @@ -199,6 +199,12 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen View tab = widget.getChildTabViewAt(position); mTempRect.set(tab.getLeft(), tab.getTop(), tab.getRight(), tab.getBottom()); widget.requestRectangleOnScreen(mTempRect, false); + + // Make sure the scrollbars are visible for a moment after selection + final View contentView = mTabs.get(position).view; + if (contentView instanceof CaffeinatedScrollView) { + ((CaffeinatedScrollView) contentView).awakenScrollBars(); + } } @Override @@ -221,7 +227,7 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen msg = (mAppInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0 ? R.string.install_confirm_question_update_system : R.string.install_confirm_question_update; - ScrollView scrollView = new ScrollView(this); + ScrollView scrollView = new CaffeinatedScrollView(this); scrollView.setFillViewport(true); if (perms.getPermissionCount(AppSecurityPermissions.WHICH_NEW) > 0) { scrollView.addView(perms.getPermissionsView(AppSecurityPermissions.WHICH_NEW)); @@ -237,7 +243,7 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen } if (perms.getPermissionCount(AppSecurityPermissions.WHICH_PERSONAL) > 0) { permVisible = true; - ScrollView scrollView = new ScrollView(this); + ScrollView scrollView = new CaffeinatedScrollView(this); scrollView.setFillViewport(true); scrollView.addView(perms.getPermissionsView(AppSecurityPermissions.WHICH_PERSONAL)); adapter.addTab(tabHost.newTabSpec("personal").setIndicator( @@ -245,7 +251,7 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen } if (perms.getPermissionCount(AppSecurityPermissions.WHICH_DEVICE) > 0) { permVisible = true; - ScrollView scrollView = new ScrollView(this); + ScrollView scrollView = new CaffeinatedScrollView(this); scrollView.setFillViewport(true); scrollView.addView(perms.getPermissionsView(AppSecurityPermissions.WHICH_DEVICE)); adapter.addTab(tabHost.newTabSpec("device").setIndicator( @@ -513,4 +519,21 @@ public class PackageInstallerActivity extends Activity implements OnCancelListen finish(); } } + + /** + * It's a ScrollView that knows how to stay awake. + */ + static class CaffeinatedScrollView extends ScrollView { + public CaffeinatedScrollView(Context context) { + super(context); + } + + /** + * Make this visible so we can call it + */ + @Override + public boolean awakenScrollBars() { + return super.awakenScrollBars(); + } + } } |