Merge "Add tooltip for taskbar overflow button" into main

This commit is contained in:
Treehugger Robot
2025-06-05 09:02:43 -07:00
committed by Android (Google) Code Review
5 changed files with 30 additions and 1 deletions

View File

@@ -134,6 +134,8 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener {
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;
}

View File

@@ -39,6 +39,7 @@ import androidx.annotation.VisibleForTesting;
import androidx.core.graphics.ColorUtils;
import com.android.app.animation.Interpolators;
import com.android.launcher3.R;
import com.android.launcher3.Reorderable;
import com.android.launcher3.Utilities;
import com.android.launcher3.icons.IconNormalizer;
@@ -339,6 +340,17 @@ public class TaskbarOverflowView extends FrameLayout implements Reorderable {
}
}
/**
* @return Tooltip to be used for the taskbar overflow view - returns null if the view should
* not have a tooltip.
*/
public String getTextForTooltipPopup() {
if (mIsActive) {
return null;
}
return getResources().getString(R.string.taskbar_overflow_a11y_title);
}
/**
* Returns the view's state (whether it shows a set of app icons or a leave-behind circle).
*/

View File

@@ -363,6 +363,9 @@ public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconPar
mControllerCallbacks.getOverflowOnClickListener());
mTaskbarOverflowView.setOnLongClickListener(
mControllerCallbacks.getOverflowOnLongClickListener());
if (enableCursorHoverStates()) {
setHoverListenerForIcon(mTaskbarOverflowView);
}
}
if (ENABLE_TASKBAR_OVERFLOW.isTrue()) {