chore: Cleanup, and hidden feature logged
Signed-off-by: Pun Butrach <pun.butrach@gmail.com>
This commit is contained in:
1 parent
5180c3d4c4
commit
11f7abcb66
1818 files changed
+104945
-147848
No files matched your search
@@ -26,7 +26,6 @@ import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLA
|
||||
import android.animation.AnimatorSet;
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.graphics.Rect;
|
||||
import android.text.TextUtils;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -51,6 +50,7 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener {
|
||||
private final TaskbarView mTaskbarView;
|
||||
private final View mHoverView;
|
||||
private final ArrowTipView mHoverToolTipView;
|
||||
private final String mToolTipText;
|
||||
private final int mYOffset;
|
||||
|
||||
public TaskbarHoverToolTipController(TaskbarActivityContext activity, TaskbarView taskbarView,
|
||||
@@ -59,6 +59,17 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener {
|
||||
mTaskbarView = taskbarView;
|
||||
mHoverView = hoverView;
|
||||
|
||||
if (mHoverView instanceof BubbleTextView) {
|
||||
mToolTipText = ((BubbleTextView) mHoverView).getText().toString();
|
||||
} else if (mHoverView instanceof FolderIcon
|
||||
&& ((FolderIcon) mHoverView).mInfo.title != null) {
|
||||
mToolTipText = ((FolderIcon) mHoverView).mInfo.title.toString();
|
||||
} else if (mHoverView instanceof AppPairIcon) {
|
||||
mToolTipText = ((AppPairIcon) mHoverView).getTitleTextView().getText().toString();
|
||||
} else {
|
||||
mToolTipText = null;
|
||||
}
|
||||
|
||||
ContextThemeWrapper arrowContextWrapper = new ContextThemeWrapper(mActivity,
|
||||
R.style.ArrowTipTaskbarStyle);
|
||||
mHoverToolTipView = new ArrowTipView(arrowContextWrapper, /* isPointingUp = */ false,
|
||||
@@ -100,15 +111,9 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener {
|
||||
}
|
||||
|
||||
private void maybeRevealHoverToolTip() {
|
||||
if (mHoverView == null) {
|
||||
if (mHoverView == null || mToolTipText == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final String toolTipText = getToolTipText();
|
||||
if (TextUtils.isEmpty(toolTipText)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Do not show tooltip if taskbar icons are transitioning to hotseat.
|
||||
if (mActivity.isIconAlignedWithHotseat()) {
|
||||
return;
|
||||
@@ -123,21 +128,7 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener {
|
||||
}
|
||||
|
||||
Rect iconViewBounds = Utilities.getViewBounds(mHoverView);
|
||||
mHoverToolTipView.showAtLocation(toolTipText, iconViewBounds.centerX(),
|
||||
mHoverToolTipView.showAtLocation(mToolTipText, iconViewBounds.centerX(),
|
||||
mTaskbarView.getTop() - mYOffset, /* shouldAutoClose= */ false);
|
||||
}
|
||||
|
||||
private String getToolTipText() {
|
||||
if (mHoverView instanceof BubbleTextView btv) {
|
||||
return btv.getText().toString();
|
||||
} else if (mHoverView instanceof FolderIcon icon && icon.mInfo.title != null) {
|
||||
return icon.mInfo.title.toString();
|
||||
} else if (mHoverView instanceof AppPairIcon icon) {
|
||||
return icon.getTitleTextView().getText().toString();
|
||||
} else if (mHoverView instanceof TaskbarOverflowView icon) {
|
||||
return icon.getTextForTooltipPopup();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user