summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BaseContainerView.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-09-14 21:40:15 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-14 21:40:15 +0000
commit5fcaab43e603ceabd1d71ec355c8a0b59aac8cf0 (patch)
treefcf23a25aadc660bd2dbb8b5178da454e8a00f08 /src/com/android/launcher3/BaseContainerView.java
parente40f5ce4af3c743bd4dbc3abeba938559c31732c (diff)
parentea9ad5cead9ad894fb670476bb5381198cdcf2de (diff)
downloadandroid_packages_apps_Trebuchet-5fcaab43e603ceabd1d71ec355c8a0b59aac8cf0.tar.gz
android_packages_apps_Trebuchet-5fcaab43e603ceabd1d71ec355c8a0b59aac8cf0.tar.bz2
android_packages_apps_Trebuchet-5fcaab43e603ceabd1d71ec355c8a0b59aac8cf0.zip
am ea9ad5ce: Merge remote-tracking branch \'origin/ub-launcher3-burnaby\' into mnc-dev
* commit 'ea9ad5cead9ad894fb670476bb5381198cdcf2de': (76 commits) Restoring provider behavior for reloading app on old devices > For older devices, launcher will only reload in case of inserts with specific query parameters > For older devices, launcehr will notify content observers of any internal inserts > Chaning TAG for Launcher provider as max logging tag is only 23 characters Removing items which are on invalid screen Preventing null pointer crash when opening a folder Revert workaround for move to default screen on home intent. Fixing NPE in recycler view scroll bar. Adding workaround for regression caused by ag/752175 Adding gradle script for Android Studio Override the overscroll color for the widget rows. Adding graphic for all apps empty search screen. Using GET_UNINSTALLED_PACKAGES flag when getting packageInfo for a managed profile app Revert "Adding viewId for the QSB" Adding viewId for the QSB Fixing issue with missing scroll bar after fast-scrolling and searching. Fixing an issue where you would inadvertently start fastscrolling. Pending bind callbacks should be cleared before starting the loader, similar to startBinding Fixing widgets container inactive scroll bar color. Making the detached scrollbar catch up faster to the actual scroll position. Updating theme to use the light theme by default, instead of wallpaper theme > This allows us to use all the goodness of material theme > Cursor in folder edit text is no longer 1px wide Updating the target sdk to launcher Using the usermanager api to get creation time ...
Diffstat (limited to 'src/com/android/launcher3/BaseContainerView.java')
-rw-r--r--src/com/android/launcher3/BaseContainerView.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/com/android/launcher3/BaseContainerView.java b/src/com/android/launcher3/BaseContainerView.java
index c8de9df10..c11824054 100644
--- a/src/com/android/launcher3/BaseContainerView.java
+++ b/src/com/android/launcher3/BaseContainerView.java
@@ -34,10 +34,12 @@ public abstract class BaseContainerView extends LinearLayout implements Insettab
// The bounds of the search bar. Only the left, top, right are used to inset the
// search bar and the height is determined by the measurement of the layout
private Rect mFixedSearchBarBounds = new Rect();
- // The bounds of the container
+ // The computed bounds of the search bar
+ private Rect mSearchBarBounds = new Rect();
+ // The computed bounds of the container
protected Rect mContentBounds = new Rect();
- // The padding to apply to the container to achieve the bounds
- protected Rect mContentPadding = new Rect();
+ // The computed padding to apply to the container to achieve the container bounds
+ private Rect mContentPadding = new Rect();
// The inset to apply to the edges and between the search bar and the container
private int mContainerBoundsInset;
private boolean mHasSearchBar;
@@ -90,7 +92,7 @@ public abstract class BaseContainerView extends LinearLayout implements Insettab
*/
protected void updateBackgroundAndPaddings() {
Rect padding;
- Rect searchBarBounds = new Rect(mFixedSearchBarBounds);
+ Rect searchBarBounds = new Rect();
if (!isValidSearchBarBounds(mFixedSearchBarBounds)) {
// Use the default bounds
padding = new Rect(mInsets.left + mContainerBoundsInset,
@@ -110,14 +112,20 @@ public abstract class BaseContainerView extends LinearLayout implements Insettab
(mHasSearchBar ? 0 : (mInsets.top + mContainerBoundsInset)),
getMeasuredWidth() - mFixedSearchBarBounds.right,
mInsets.bottom + mContainerBoundsInset);
+
+ // Use the search bounds
+ searchBarBounds.set(mFixedSearchBarBounds);
}
- if (!padding.equals(mContentPadding) || !searchBarBounds.equals(mFixedSearchBarBounds)) {
+
+ // If either the computed container padding has changed, or the computed search bar bounds
+ // has changed, then notify the container
+ if (!padding.equals(mContentPadding) || !searchBarBounds.equals(mSearchBarBounds)) {
mContentPadding.set(padding);
mContentBounds.set(padding.left, padding.top,
getMeasuredWidth() - padding.right,
getMeasuredHeight() - padding.bottom);
- mFixedSearchBarBounds.set(searchBarBounds);
- onUpdateBackgroundAndPaddings(mFixedSearchBarBounds, padding);
+ mSearchBarBounds.set(searchBarBounds);
+ onUpdateBackgroundAndPaddings(mSearchBarBounds, padding);
}
}