Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8bdadb03 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fixes A11yMenu Settings title bar cutoff for largest font sizes." into main

parents f67fbac1 1c29cb5b
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -19,3 +19,13 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "action_bar_wrap_content"
    namespace: "accessibility"
    description: "Applies WRAP_CONTENT to the action bar in A11yMenu settings to better fit large fonts"
    bug: "347911378"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
+14 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.os.Bundle;
import android.provider.Browser;
import android.provider.Settings;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.window.OnBackInvokedCallback;

@@ -35,6 +36,7 @@ import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceManager;

import com.android.systemui.accessibility.accessibilitymenu.Flags;
import com.android.systemui.accessibility.accessibilitymenu.R;

/**
@@ -60,6 +62,18 @@ public class A11yMenuSettingsActivity extends FragmentActivity {
        ((TextView) findViewById(R.id.action_bar_title)).setText(
                getResources().getString(R.string.accessibility_menu_settings_name)
        );
        if (Flags.actionBarWrapContent()) {
            setHeightWrapContent(findViewById(com.android.internal.R.id.action_bar));
            setHeightWrapContent(findViewById(com.android.internal.R.id.action_bar_container));
        }
    }

    private void setHeightWrapContent(View view) {
        if (view != null) {
            ViewGroup.LayoutParams params = view.getLayoutParams();
            params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
            view.setLayoutParams(params);
        }
    }

    @Override