Refactored section names to only draw when there is space.
- This CL removes all space for section names in both phones and tablets. And when there are no section names, the layout will automatically fully merge the sections. Bug: 20222023 Change-Id: Ic7c751d86f095e5cbd690bfd4f94bb5b00ff8ae4
This commit is contained in:
1 parent
c332934e27
commit
fbc5b18626
6 files changed
+134
-108
No files matched your search
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.launcher3;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorListenerAdapter;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
@@ -315,12 +317,37 @@ public class BaseRecyclerView extends RecyclerView
|
||||
/**
|
||||
* Animates the visibility of the fast scroller popup.
|
||||
*/
|
||||
private void animateFastScrollerVisibility(boolean visible) {
|
||||
private void animateFastScrollerVisibility(final boolean visible) {
|
||||
ObjectAnimator anim = ObjectAnimator.ofFloat(this, "fastScrollerAlpha", visible ? 1f : 0f);
|
||||
anim.setDuration(visible ? 200 : 150);
|
||||
anim.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
if (visible) {
|
||||
onFastScrollingStart();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
if (!visible) {
|
||||
onFastScrollingEnd();
|
||||
}
|
||||
}
|
||||
});
|
||||
anim.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* To be overridden by subclasses.
|
||||
*/
|
||||
protected void onFastScrollingStart() {}
|
||||
|
||||
/**
|
||||
* To be overridden by subclasses.
|
||||
*/
|
||||
protected void onFastScrollingEnd() {}
|
||||
|
||||
/**
|
||||
* Invalidates the fast scroller popup.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user