Don't show dictionary debug info on toolbar (#1644)

This commit is contained in:
Eran Leshem 2025-05-31 09:00:00 +03:00 committed by GitHub
parent 4d441e5bdf
commit 82bea7facf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 4 deletions

View file

@ -373,7 +373,7 @@ final class SuggestionStripLayoutHelper {
x += wordView.getMeasuredWidth();
if (SuggestionStripView.DEBUG_SUGGESTIONS) {
layoutDebugInfo(positionInStrip, placerView, x);
layoutDebugInfo(positionInStrip, placerView, (int) stripView.getX() + x);
}
}
return startIndexOfMoreSuggestions;
@ -436,8 +436,7 @@ final class SuggestionStripLayoutHelper {
placerView.addView(debugInfoView);
debugInfoView.measure(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
final int infoWidth = debugInfoView.getMeasuredWidth();
final int y = debugInfoView.getMeasuredHeight();
ViewLayoutUtils.placeViewAt(debugInfoView, x - infoWidth, y, infoWidth, debugInfoView.getMeasuredHeight());
ViewLayoutUtils.placeViewAt(debugInfoView, x - infoWidth, 0, infoWidth, debugInfoView.getMeasuredHeight());
}
private int getSuggestionWidth(final int positionInStrip, final int maxWidth) {

View file

@ -486,7 +486,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
mSuggestedWords.mIsObsoleteSuggestions, mSuggestedWords.mInputStyle,
mSuggestedWords.mSequenceNumber);
mStartIndexOfMoreSuggestions = mLayoutHelper.layoutAndReturnStartIndexOfMoreSuggestions(
getContext(), mSuggestedWords, mSuggestionsStrip, SuggestionStripView.this);
getContext(), mSuggestedWords, mSuggestionsStrip, this);
mStripVisibilityGroup.showSuggestionsStrip();
// Show the toolbar if no suggestions are left and the "Auto show toolbar" setting is enabled
if (mSuggestedWords.isEmpty() && Settings.getValues().mAutoShowToolbar){
@ -705,6 +705,13 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick
mSuggestionsStrip.setVisibility(VISIBLE);
mPinnedKeys.setVisibility(VISIBLE);
}
if (DEBUG_SUGGESTIONS) {
for (var view : mDebugInfoViews) {
view.setVisibility(mSuggestionsStrip.getVisibility());
}
}
mToolbarExpandKey.setScaleX((visible && !locked ? -1f : 1f) * mRtl);
}