summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/AppsContainerView.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2015-05-11 16:30:13 -0700
committerWinson Chung <winsonc@google.com>2015-05-11 17:53:47 -0700
commit13eb527b5ae7f564e3ace6137a8d466636d87188 (patch)
treea74b3aaaed2dee277e1efea6461fbc9414fbcb41 /src/com/android/launcher3/AppsContainerView.java
parent57ebefb5891255a23472473d5ec90b5247a334fc (diff)
downloadandroid_packages_apps_Trebuchet-13eb527b5ae7f564e3ace6137a8d466636d87188.tar.gz
android_packages_apps_Trebuchet-13eb527b5ae7f564e3ace6137a8d466636d87188.tar.bz2
android_packages_apps_Trebuchet-13eb527b5ae7f564e3ace6137a8d466636d87188.zip
Exploring dense all apps layout.
- Disabling section headers in all apps on tablet layouts - Fixing issue with predictions not showing on rotation - Fixing issue with over-aggressive dismissing of keyboard & filtered app state - Fixing issue where the container bounds were running straight up to the nav bar Change-Id: I5a5a56afa75b50be96af4894bf785ffbb1b15fb3
Diffstat (limited to 'src/com/android/launcher3/AppsContainerView.java')
-rw-r--r--src/com/android/launcher3/AppsContainerView.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/com/android/launcher3/AppsContainerView.java b/src/com/android/launcher3/AppsContainerView.java
index b8d30d081..8a5c6605e 100644
--- a/src/com/android/launcher3/AppsContainerView.java
+++ b/src/com/android/launcher3/AppsContainerView.java
@@ -213,7 +213,13 @@ public class AppsContainerView extends BaseContainerView implements DragSource,
new AppsContainerSearchEditTextView.OnBackKeyListener() {
@Override
public void onBackKey() {
- hideSearchField(true, true);
+ // Only hide the search field if there is no query, or if there
+ // are no filtered results
+ String query = Utilities.trim(
+ mSearchBarEditView.getEditableText().toString());
+ if (query.isEmpty() || mApps.hasNoFilteredResults()) {
+ hideSearchField(true, true);
+ }
}
});
}
@@ -277,15 +283,17 @@ public class AppsContainerView extends BaseContainerView implements DragSource,
} else {
// If there are fixed bounds, then we update the padding to reflect the fixed bounds.
setPadding(mFixedBounds.left, mFixedBounds.top, getMeasuredWidth() - mFixedBounds.right,
- mInsets.bottom);
+ mFixedBounds.bottom);
}
// Update the apps recycler view, inset it by the container inset as well
+ DeviceProfile grid = LauncherAppState.getInstance().getDynamicGrid().getDeviceProfile();
+ int startMargin = grid.isPhone() ? mContentMarginStart : 0;
int inset = mFixedBounds.isEmpty() ? mContainerInset : mFixedBoundsContainerInset;
if (isRtl) {
- mAppsRecyclerView.setPadding(inset, inset, inset + mContentMarginStart, inset);
+ mAppsRecyclerView.setPadding(inset, inset, inset + startMargin, inset);
} else {
- mAppsRecyclerView.setPadding(inset + mContentMarginStart, inset, inset, inset);
+ mAppsRecyclerView.setPadding(inset + startMargin, inset, inset, inset);
}
// Update the header bar