mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Merge "Add tooltip for taskbar overflow button" into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
ca739ac8ae
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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).
|
||||
*/
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user